Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_GatherTangent_BlockedTpetra.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
11#ifndef PANZER_EVALUATOR_GATHER_TANGENT_BLOCKEDTPETRA_DECL_HPP
12#define PANZER_EVALUATOR_GATHER_TANGENT_BLOCKEDTPETRA_DECL_HPP
13
14#include "Phalanx_config.hpp"
15#include "Phalanx_Evaluator_Macros.hpp"
16#include "Phalanx_MDField.hpp"
17
18#include "Teuchos_ParameterList.hpp"
19
20#include "PanzerDiscFE_config.hpp"
21#include "Panzer_Dimension.hpp"
22#include "Panzer_Traits.hpp"
24
27
28namespace panzer {
29
30template <typename ScalarT,typename LocalOrdinalT,typename GlobalOrdinalT,typename NodeT>
31class BlockedTpetraLinearObjContainer;
32
33class GlobalIndexer;
34class BlockedDOFManager;
35
47template <typename EvalT,typename TRAITS,typename S,typename LO,typename GO,typename NodeT=panzer::TpetraNodeType>
49 : public panzer::EvaluatorWithBaseImpl<TRAITS>,
50 public PHX::EvaluatorDerived<EvalT, TRAITS>,
52public:
53
54 GatherTangent_BlockedTpetra(const Teuchos::RCP<const BlockedDOFManager> & indexer)
55 : globalIndexer_(indexer) {}
56
57 GatherTangent_BlockedTpetra(const Teuchos::RCP<const BlockedDOFManager> & indexer,
58 const Teuchos::ParameterList& p);
59
60 void postRegistrationSetup(typename TRAITS::SetupData d,
62
63 void preEvaluate(typename TRAITS::PreEvalData d);
64
65 void evaluateFields(typename TRAITS::EvalData d);
66
67 virtual Teuchos::RCP<CloneableEvaluator> clone(const Teuchos::ParameterList & pl) const
69
70private:
71
72 // We always use RealType for gathering as we never compute derivatives for this evaluator
74 //typedef typename EvalT::ScalarT ScalarT;
75
77 typedef Tpetra::Vector<S,LO,GO,NodeT> VectorType;
78 typedef Tpetra::CrsMatrix<S,LO,GO,NodeT> CrsMatrixType;
79 typedef Tpetra::CrsGraph<LO,GO,NodeT> CrsGraphType;
80 typedef Tpetra::Map<LO,GO,NodeT> MapType;
81 typedef Tpetra::Import<LO,GO,NodeT> ImportType;
82 typedef Tpetra::Export<LO,GO,NodeT> ExportType;
83
84 // maps the local (field,element,basis) triplet to a global ID
85 // for scattering
86 Teuchos::RCP<const BlockedDOFManager> globalIndexer_;
87
88 std::vector<int> fieldIds_; // field IDs needing mapping
89
91 std::vector<Teuchos::RCP<const panzer::GlobalIndexer>> fieldGlobalIndexers_;
92
95 std::vector<int> productVectorBlockIndex_;
96
97 std::vector< PHX::MDField<ScalarT,Cell,NODE> > gatherFields_;
98
99 Teuchos::RCP<std::vector<std::string> > indexerNames_;
101 std::string globalDataKey_; // what global data does this fill?
102
103 // The tangent gather source, resolved in preEvaluate(). Exactly one of these
104 // is set: a linear object container, or the blocked read-only ghosted vector
105 // the model evaluator hands out for tangent gather containers.
106 Teuchos::RCP<const BlockedTpetraLinearObjContainer<S,LO,GO,NodeT> > blockedContainer_;
107 Teuchos::RCP<panzer::BlockedVector_ReadOnly_GlobalEvaluationData> xBvRoGed_;
108
110 PHX::View<LO**> worksetLIDs_;
111
113 std::vector<PHX::View<int*>> fieldOffsets_;
114
116};
117
118}
119
121
122// **************************************************************
123#endif
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Gathers tangent vectors dx/dp for computing df/dx*dx/dp + df/dp into the nodal fields of the field ma...
Tpetra::CrsMatrix< S, LO, GO, NodeT > CrsMatrixType
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > fieldGlobalIndexers_
Vector of global indexers, one for each field to gather, respectively.
Teuchos::RCP< const BlockedDOFManager > globalIndexer_
Teuchos::RCP< panzer::BlockedVector_ReadOnly_GlobalEvaluationData > xBvRoGed_
Teuchos::RCP< std::vector< std::string > > indexerNames_
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &vm)
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field.
GatherTangent_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Teuchos::RCP< const BlockedTpetraLinearObjContainer< S, LO, GO, NodeT > > blockedContainer_
BlockedTpetraLinearObjContainer< S, LO, GO, NodeT > ContainerType
double RealType
Scalar type used for the Residual evaluation type (plain double).