11 #ifndef __Panzer_TpetraLinearObjFactory_decl_hpp__
12 #define __Panzer_TpetraLinearObjFactory_decl_hpp__
17 #include "Tpetra_Map.hpp"
18 #include "Tpetra_CrsGraph.hpp"
19 #include "Tpetra_CrsMatrix.hpp"
20 #include "Tpetra_Import.hpp"
21 #include "Tpetra_Export.hpp"
23 #include "PanzerDiscFE_config.hpp"
27 #include "Panzer_ScatterResidual_Tpetra.hpp"
28 #include "Panzer_ScatterDirichletResidual_Tpetra.hpp"
29 #include "Panzer_GatherSolution_Tpetra.hpp"
30 #include "Panzer_GatherTangent_Tpetra.hpp"
31 #include "Panzer_GatherOrientation.hpp"
42 template <
typename Traits,
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT=panzer::TpetraNodeType>
47 typedef Tpetra::Vector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
VectorType;
48 typedef Tpetra::CrsMatrix<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
CrsMatrixType;
49 typedef Tpetra::CrsGraph<LocalOrdinalT,GlobalOrdinalT,NodeT>
CrsGraphType;
50 typedef Tpetra::Map<LocalOrdinalT,GlobalOrdinalT,NodeT>
MapType;
51 typedef Tpetra::Import<LocalOrdinalT,GlobalOrdinalT,NodeT>
ImportType;
52 typedef Tpetra::Export<LocalOrdinalT,GlobalOrdinalT,NodeT>
ExportType;
95 bool zeroVectorRows=
false,
bool adjustX=
false)
const;
109 #ifdef PANZER_HAVE_EPETRA_STACK
122 template <
typename EvalT>
127 template <
typename EvalT>
132 template <
typename EvalT>
137 template <
typename EvalT>
142 template <
typename EvalT>
147 template <
typename EvalT>
242 Tpetra::Vector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT> & out,
bool col)
const;
244 Tpetra::CrsMatrix<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT> & out)
const;
246 Tpetra::Vector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT> & out,
bool col)
const;
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherOrientation() const
Use preconstructed gather evaluators.
virtual const Teuchos::RCP< Tpetra::Export< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedExport() const
get exporter for converting an overalapped object to a "normal" object
virtual void globalToGhostContainer(const LinearObjContainer &container, LinearObjContainer &ghostContainer, int) const
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > domainSpace_
Teuchos::RCP< Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getTpetraVector() const
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedColMap() const
Teuchos::RCP< const GlobalIndexer > gidProvider_
virtual Teuchos::MpiComm< int > getComm() const
Teuchos::RCP< ExportType > ghostedExporter_
Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > cGhostedMap_
Teuchos::RCP< ExportType > ghostedColExporter_
virtual Teuchos::RCP< LinearObjContainer > buildGhostedLinearObjContainer() const
void initializeGhostedContainer(int, LinearObjContainer &loc) const
virtual Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > buildReadOnlyDomainContainer() const
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherDomain() const
Use preconstructed gather evaluators.
Teuchos::RCP< Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedTpetraVector() const
virtual const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildGhostedGraph() const
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getThyraDomainSpace() const
Get the domain space.
Teuchos::RCP< Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getTpetraMatrix() const
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherTangent() const
Use preconstructed gather evaluators.
virtual const Teuchos::RCP< Tpetra::Import< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedImport() const
get importer for converting an overalapped object to a "normal" object
Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > cMap_
void initializeContainer(int, LinearObjContainer &loc) const
Teuchos::RCP< Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getTpetraColVector() const
Teuchos::RCP< const panzer::GlobalIndexer > getDomainGlobalIndexer() const
Get the domain global indexer this factory was created with.
virtual void endFill(LinearObjContainer &loc) const
Gathers tangent vectors dx/dp for computing df/dx*dx/dp + df/dp into the nodal fields of the field ma...
virtual const Teuchos::RCP< Tpetra::Import< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedColImport() const
virtual void beginFill(LinearObjContainer &loc) const
Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > MapType
virtual const Teuchos::RCP< const Teuchos::Comm< int > > getTeuchosComm() const
get exporter for converting an overalapped object to a "normal" object
Tpetra::Import< LocalOrdinalT, GlobalOrdinalT, NodeT > ImportType
virtual const Teuchos::RCP< Tpetra::Export< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedColExport() const
Teuchos::RCP< Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedTpetraMatrix() const
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > getColMap() const
virtual void adjustForDirichletConditions(const LinearObjContainer &localBCRows, const LinearObjContainer &globalBCRows, LinearObjContainer &ghostedObjs, bool zeroVectorRows=false, bool adjustX=false) const
void globalToGhostTpetraVector(const Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &in, Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &out, bool col) const
PHX::MDField< ScalarT, panzer::Cell, panzer::IP > result
A field that will be used to build up the result of the integral we're performing.
void ghostToGlobalTpetraMatrix(const Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &in, Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &out) const
Teuchos::RCP< panzer::CloneableEvaluator > buildGather() const
Use preconstructed gather evaluators.
Tpetra::Export< LocalOrdinalT, GlobalOrdinalT, NodeT > ExportType
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > CrsMatrixType
virtual Teuchos::RCP< LinearObjContainer > buildLinearObjContainer() const
Teuchos::RCP< panzer::CloneableEvaluator > buildScatterDirichlet() const
Use preconstructed dirichlet scatter evaluators.
TpetraLinearObjContainer< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > ContainerType
Gathers solution values from the Newton solution vector into the nodal fields of the field manager...
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedMap() const
get the ghosted map from the matrix
Pushes residual values into the residual vector for a Newton-based solve.
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildColMap() const
virtual const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildGraph() const
Teuchos::RCP< Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedTpetraColVector() const
virtual ~TpetraLinearObjFactory()
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > getMap() const
get the map from the matrix
Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > ghostedMap_
Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > graph_
virtual const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGraph() const
get the graph of the crs matrix
Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > ghostedGraph_
Pushes residual values into the residual vector for a Newton-based solve.
TpetraLinearObjFactory(const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< const GlobalIndexer > &gidProvider)
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildMap() const
Teuchos::RCP< const GlobalIndexer > colGidProvider_
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveGhostedLinearObjContainer() const
Teuchos::RCP< ImportType > ghostedColImporter_
Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > map_
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getThyraRangeSpace() const
Get the range space.
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildGhostedColMap() const
virtual void ghostToGlobalContainer(const LinearObjContainer &ghostContainer, LinearObjContainer &container, int) const
Gathers orientations per field from the global indexer and stores them in the field manager...
virtual void readVector(const std::string &, LinearObjContainer &, int) const
virtual Teuchos::RCP< Thyra::LinearOpBase< ScalarT > > getThyraMatrix() const
Get a matrix operator.
Teuchos::RCP< const Teuchos::Comm< int > > comm_
#define TEUCHOS_ASSERT(assertion_test)
void ghostToGlobalTpetraVector(const Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &in, Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > &out, bool col) const
Teuchos::RCP< panzer::CloneableEvaluator > buildScatter() const
Use preconstructed scatter evaluators.
virtual void writeVector(const std::string &, const LinearObjContainer &, int) const
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveLinearObjContainer() const
Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > CrsGraphType
Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > VectorType
Teuchos::RCP< const panzer::GlobalIndexer > getRangeGlobalIndexer() const
Get the domain global indexer this factory was created with.
virtual const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > > getGhostedGraph() const
get the ghosted graph of the crs matrix
virtual const Teuchos::RCP< Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > > buildGhostedMap() const
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > rangeSpace_
virtual void applyDirichletBCs(const LinearObjContainer &counter, LinearObjContainer &result) const
Teuchos::RCP< ImportType > ghostedImporter_