|
Panzer
Version of the Day
|
Go to the documentation of this file.
43 #ifndef __Panzer_BlockedTpetraLinearObjFactory_hpp__
44 #define __Panzer_BlockedTpetraLinearObjFactory_hpp__
49 #include "Tpetra_Map.hpp"
50 #include "Tpetra_CrsGraph.hpp"
51 #include "Tpetra_Import.hpp"
52 #include "Tpetra_Export.hpp"
54 #include "PanzerDiscFE_config.hpp"
64 #include "Panzer_GatherOrientation.hpp"
71 #include "Thyra_BlockedLinearOpBase.hpp"
72 #include "Thyra_ProductVectorBase.hpp"
76 #include "Teuchos_OpaqueWrapper.hpp"
80 template <
typename Traits,
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT=panzer::TpetraNodeType>
85 typedef Tpetra::Vector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
VectorType;
86 typedef Tpetra::CrsMatrix<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
CrsMatrixType;
87 typedef Tpetra::Operator<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
OperatorType;
88 typedef Tpetra::CrsGraph<LocalOrdinalT,GlobalOrdinalT,NodeT>
CrsGraphType;
89 typedef Tpetra::Map<LocalOrdinalT,GlobalOrdinalT,NodeT>
MapType;
90 typedef Tpetra::Import<LocalOrdinalT,GlobalOrdinalT,NodeT>
ImportType;
91 typedef Tpetra::Export<LocalOrdinalT,GlobalOrdinalT,NodeT>
ExportType;
93 typedef Thyra::TpetraVector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
ThyraVector;
94 typedef Thyra::TpetraLinearOp<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>
ThyraLinearOp;
141 bool zeroVectorRows=
false,
bool adjustX =
false)
const;
164 template <
typename EvalT>
169 template <
typename EvalT>
174 template <
typename EvalT>
179 template <
typename EvalT>
184 template <
typename EvalT>
189 template <
typename EvalT>
329 std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LocalOrdinalT,GlobalOrdinalT> > >
gidProviders_;
354 bool zeroVectorRows)
const;
370 mutable std::vector<Teuchos::RCP<const MapType> >
maps_;
375 mutable std::vector<Teuchos::RCP<const ImportType> >
importers_;
376 mutable std::vector<Teuchos::RCP<const ExportType> >
exporters_;
Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > VectorType
Teuchos::RCP< const BlockedDOFManager< LocalOrdinalT, GlobalOrdinalT > > blockedDOFManager_
Tpetra::Export< LocalOrdinalT, GlobalOrdinalT, NodeT > ExportType
Teuchos::MpiComm< int > getComm() const
Tpetra::Operator< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > OperatorType
std::unordered_map< std::pair< int, int >, Teuchos::RCP< const CrsGraphType >, panzer::pair_hash > ghostedGraphs_
Pushes residual values into the residual vector for a Newton-based solve.
Teuchos::RCP< const panzer::BlockedDOFManager< int, GlobalOrdinalT > > getGlobalIndexer() const
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherDomain() const
Use preconstructed gather evaluators.
virtual void ghostToGlobalContainer(const LinearObjContainer &ghostContainer, LinearObjContainer &container, int) const
void initializeContainer(int, LinearObjContainer &loc) const
Teuchos::RCP< Thyra::VectorBase< ScalarT > > getThyraRangeVector() const
Get a range vector.
Thyra::TpetraVector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > ThyraVector
int getBlockRowCount() const
how many block rows
Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getGhostedThyraDomainSpace() const
Get the domain vector space (x and dxdt)
std::unordered_map< std::pair< int, int >, Teuchos::RCP< const CrsGraphType >, panzer::pair_hash > graphs_
void globalToGhostTpetraVector(int i, const VectorType &in, VectorType &out) const
virtual Teuchos::RCP< const ExportType > getGhostedExport(int j) const
get exporter for converting an overalapped object to a "normal" object
Teuchos::RCP< Thyra::ProductVectorSpaceBase< ScalarT > > ghostedRangeSpace_
void ghostToGlobalTpetraVector(int i, const VectorType &in, VectorType &out) const
void initializeGhostedContainer(int, LinearObjContainer &loc) const
Thyra::TpetraLinearOp< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > ThyraLinearOp
virtual Teuchos::RCP< const CrsGraphType > buildTpetraGraph(int i, int j) const
Teuchos::RCP< const Teuchos::MpiComm< int > > comm_
void ghostToGlobalThyraMatrix(const Thyra::LinearOpBase< ScalarT > &in, Thyra::LinearOpBase< ScalarT > &out) const
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveGhostedLinearObjContainer() const
Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getThyraRangeSpace() const
Get the range vector space (f)
#define TEUCHOS_ASSERT(assertion_test)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual Teuchos::RCP< WriteVector_GlobalEvaluationData > buildWriteDomainContainer() const
BlockedTpetraLinearObjContainer< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > BTLOC
void globalToGhostThyraVector(const Teuchos::RCP< const Thyra::VectorBase< ScalarT > > &in, const Teuchos::RCP< Thyra::VectorBase< ScalarT > > &out) const
virtual void beginFill(LinearObjContainer &loc) const
virtual Teuchos::RCP< LinearObjContainer > buildLinearObjContainer() const
std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > nc2c_vector(const std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > &ugis)
Tpetra::CrsGraph< LocalOrdinalT, GlobalOrdinalT, NodeT > CrsGraphType
Teuchos::RCP< Thyra::ProductVectorSpaceBase< ScalarT > > domainSpace_
virtual Teuchos::RCP< const ImportType > getGhostedImport(int i) const
get importer for converting an overalapped object to a "normal" object
Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > getDomainGlobalIndexer() const
Get the domain unique global indexer this factory was created with.
virtual Teuchos::RCP< LinearObjContainer > buildGhostedLinearObjContainer() const
virtual void globalToGhostContainer(const LinearObjContainer &container, LinearObjContainer &ghostContainer, int) const
Teuchos::RCP< Thyra::VectorBase< ScalarT > > getGhostedThyraRangeVector() const
Get a range vector.
virtual ~BlockedTpetraLinearObjFactory()
Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getThyraDomainSpace() const
Get the domain vector space (x and dxdt)
Gathers tangent vectors dx/dp for computing df/dx*dx/dp + df/dp into the nodal fields of the field ma...
int getBlockColCount() const
how many block columns
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveLinearObjContainer() const
std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > gidProviders_
virtual Teuchos::RCP< const MapType > getMap(int i) const
get the map from the matrix
Gathers solution values from the Newton solution vector into the nodal fields of the field manager.
virtual Teuchos::RCP< const MapType > buildTpetraGhostedMap(int i) const
std::vector< Teuchos::RCP< const ImportType > > importers_
void addExcludedPair(int rowBlock, int colBlock)
exclude a block pair from the matrix
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.
virtual void readVector(const std::string &, LinearObjContainer &, int) const
virtual void endFill(LinearObjContainer &loc) const
Teuchos::RCP< VectorType > getTpetraDomainVector(int i) const
Teuchos::RCP< panzer::CloneableEvaluator > buildScatterDirichlet() const
Use preconstructed dirichlet scatter evaluators.
Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, NodeT > MapType
virtual Teuchos::RCP< const CrsGraphType > buildTpetraGhostedGraph(int i, int j) const
void makeRoomForBlocks(std::size_t blockCnt)
Allocate the space in the std::vector objects so we can fill with appropriate Tpetra data.
virtual Teuchos::RCP< const CrsGraphType > getGhostedGraph(int i, int j) const
get the ghosted graph of the crs matrix
Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > getRangeGlobalIndexer() const
Get the range unique global indexer this factory was created with.
void ghostToGlobalTpetraMatrix(int blockRow, const CrsMatrixType &in, CrsMatrixType &out) const
virtual Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > buildReadOnlyDomainContainer() const
Teuchos::RCP< Thyra::VectorBase< ScalarT > > getGhostedThyraDomainVector() const
Get a domain vector.
Teuchos::RCP< panzer::CloneableEvaluator > buildScatter() const
Use preconstructed scatter evaluators.
BlockedTpetraLinearObjFactory(const Teuchos::RCP< const Teuchos::MpiComm< int > > &comm, const Teuchos::RCP< const BlockedDOFManager< LocalOrdinalT, GlobalOrdinalT > > &gidProvider)
Teuchos::RCP< const UniqueGlobalIndexer< LocalOrdinalT, std::pair< int, GlobalOrdinalT > > > blockProvider_
std::vector< Teuchos::RCP< const ExportType > > exporters_
Teuchos::RCP< Thyra::ProductVectorSpaceBase< ScalarT > > rangeSpace_
Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > getGhostedThyraRangeSpace() const
Get the range vector space (f)
Teuchos::RCP< Thyra::ProductVectorSpaceBase< ScalarT > > ghostedDomainSpace_
virtual Teuchos::RCP< const MapType > buildTpetraMap(int i) const
Tpetra::Import< LocalOrdinalT, GlobalOrdinalT, NodeT > ImportType
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherTangent() const
Use preconstructed gather evaluators.
Teuchos::RCP< Thyra::BlockedLinearOpBase< ScalarT > > getGhostedThyraMatrix() const
Get a Thyra operator.
Pushes residual values into the residual vector for a Newton-based solve.
Gathers orientations per field from the global indexer and stores them in the field manager.
std::vector< Teuchos::RCP< const MapType > > ghostedMaps_
Teuchos::RCP< CrsMatrixType > getGhostedTpetraMatrix(int i, int j) const
std::vector< Teuchos::RCP< const MapType > > maps_
Teuchos::RCP< panzer::CloneableEvaluator > buildGather() const
Use preconstructed gather evaluators.
Teuchos::RCP< CrsMatrixType > getTpetraMatrix(int i, int j) const
Teuchos::RCP< VectorType > getGhostedTpetraRangeVector(int i) const
Teuchos::RCP< VectorType > getGhostedTpetraDomainVector(int i) const
Teuchos::RCP< Thyra::VectorBase< ScalarT > > getThyraDomainVector() const
Get a domain vector.
virtual void adjustForDirichletConditions(const LinearObjContainer &localBCRows, const LinearObjContainer &globalBCRows, LinearObjContainer &ghostedObjs, bool zeroVectorRows=false, bool adjustX=false) const
Tpetra::CrsMatrix< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > CrsMatrixType
Teuchos::RCP< VectorType > getTpetraRangeVector(int i) const
Teuchos::RCP< Thyra::LinearOpBase< ScalarT > > getThyraMatrix() const
Get a Thyra operator.
void addExcludedPairs(const std::vector< std::pair< int, int > > &exPairs)
exclude a vector of pairs from the matrix
void ghostToGlobalThyraVector(const Teuchos::RCP< const Thyra::VectorBase< ScalarT > > &in, const Teuchos::RCP< Thyra::VectorBase< ScalarT > > &out) const
std::unordered_set< std::pair< int, int >, panzer::pair_hash > excludedPairs_
virtual Teuchos::RCP< const MapType > getGhostedMap(int i) const
get the ghosted map from the matrix
virtual void applyDirichletBCs(const LinearObjContainer &counter, LinearObjContainer &result) const
Teuchos::RCP< panzer::CloneableEvaluator > buildGatherOrientation() const
Use preconstructed gather evaluators.
virtual Teuchos::RCP< const CrsGraphType > getGraph(int i, int j) const
get the graph of the crs matrix
virtual void writeVector(const std::string &, const LinearObjContainer &, int) const