|
Panzer Version of the Day
|
#include <Panzer_LinearObjFactory.hpp>

Classes | |
| struct | Gather_Builder |
| struct | GatherDomain_Builder |
| struct | GatherOrientation_Builder |
| struct | GatherTangent_Builder |
| struct | Scatter_Builder |
| struct | ScatterDirichlet_Builder |
Public Member Functions | |
| virtual | ~LinearObjFactory () |
| template<typename BuilderT > | |
| void | buildGatherScatterEvaluators (const BuilderT &builder) |
| virtual void | readVector (const std::string &identifier, LinearObjContainer &loc, int id) const =0 |
| virtual void | writeVector (const std::string &identifier, const LinearObjContainer &loc, int id) const =0 |
| virtual Teuchos::RCP< LinearObjContainer > | buildLinearObjContainer () const =0 |
| virtual Teuchos::RCP< LinearObjContainer > | buildPrimitiveLinearObjContainer () const =0 |
| virtual Teuchos::RCP< LinearObjContainer > | buildGhostedLinearObjContainer () const =0 |
| virtual Teuchos::RCP< LinearObjContainer > | buildPrimitiveGhostedLinearObjContainer () const =0 |
| virtual Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > | buildReadOnlyDomainContainer () const =0 |
| virtual void | globalToGhostContainer (const LinearObjContainer &container, LinearObjContainer &ghostContainer, int) const =0 |
| virtual void | ghostToGlobalContainer (const LinearObjContainer &ghostContainer, LinearObjContainer &container, int) const =0 |
| virtual void | initializeContainer (int, LinearObjContainer &loc) const =0 |
| virtual void | initializeGhostedContainer (int, LinearObjContainer &loc) const =0 |
| virtual void | adjustForDirichletConditions (const LinearObjContainer &localBCRows, const LinearObjContainer &globalBCRows, LinearObjContainer &ghostedObjs, bool zeroVectorRows=false, bool adjustX=false) const =0 |
| virtual void | applyDirichletBCs (const LinearObjContainer &counter, LinearObjContainer &result) const =0 |
| virtual Teuchos::MpiComm< int > | getComm () const =0 |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildScatter (const Teuchos::ParameterList &pl) const |
| Use preconstructed scatter evaluators. | |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildGather (const Teuchos::ParameterList &pl) const |
| Use preconstructed gather evaluators. | |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildGatherTangent (const Teuchos::ParameterList &pl) const |
| Use preconstructed gather evaluators. | |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildGatherDomain (const Teuchos::ParameterList &pl) const |
| Use preconstructed gather evaluators. | |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildGatherOrientation (const Teuchos::ParameterList &pl) const |
| Use preconstructed gather evaluators. | |
| template<typename EvalT > | |
| Teuchos::RCP< PHX::Evaluator< Traits > > | buildScatterDirichlet (const Teuchos::ParameterList &pl) const |
| Use preconstructed dirichlet scatter evaluators. | |
| virtual Teuchos::RCP< const panzer::GlobalIndexer > | getDomainGlobalIndexer () const =0 |
| Get the domain global indexer object associated with this factory. | |
| virtual Teuchos::RCP< const panzer::GlobalIndexer > | getRangeGlobalIndexer () const =0 |
| Get the range global indexer object associated with this factory. | |
| virtual void | beginFill (LinearObjContainer &) const |
| Open a container for filling. Takes either a ghosted or an owned container. | |
| virtual void | beginFill (LinearObjContainer &ghostContainer, const LinearObjContainer &) const |
| Open a ghosted container for filling, naming the owned container it feeds. | |
| virtual void | endFill (LinearObjContainer &) const |
| Close a container after filling. Takes either a ghosted or an owned container. | |
| virtual void | endFill (LinearObjContainer &ghostContainer, const LinearObjContainer &) const |
| Close a ghosted container after filling, naming the owned container it fed. | |
Private Types | |
| typedef PHX::TemplateManager< typename Traits::EvalTypes, panzer::CloneableEvaluator, PHX::EvaluatorDerived< _, Traits > > | Evaluator_TemplateManager |
Private Attributes | |
| Teuchos::RCP< Evaluator_TemplateManager > | scatterManager_ |
| Teuchos::RCP< Evaluator_TemplateManager > | scatterDirichletManager_ |
| Teuchos::RCP< Evaluator_TemplateManager > | gatherManager_ |
| Teuchos::RCP< Evaluator_TemplateManager > | gatherTangentManager_ |
| Teuchos::RCP< Evaluator_TemplateManager > | gatherDomainManager_ |
| Teuchos::RCP< Evaluator_TemplateManager > | gatherOrientManager_ |
Abstract factory that builds the linear algebra objects required for the assembly including the gather/scatter evaluator objects.
The interface for construction of the gather scatter is externally very simple, but in fact under the hood it is quite complex. The user of this factory object simply calls buildGather(const Teuchos::ParameterList & pl) const, buildScatter(const Teuchos::ParameterList & pl) const, or buildScatterDirichlet(const Teuchos::ParameterList & pl) const.
To implement a version of this class an author must overide all the linear algebra construction functions. The new version should also call the base class version of buildGatherScatterEvaluators in the constructor with a reference to itself passed in as an argument. This requires the new version of the class to implement the following functions
This builds the correct scatter/gather/scatter-dirichlet evaluator objects and returns them as a CloneableEvaluator (These evaluators must overide the CloneableEvaluator::clone function which takes a parameter list). The cloned evaluators will be the ones actually returned from the buildGather(const Teuchos::ParameterList & pl) const, buildGatherDomain(const Teuchos::ParameterList & pl) const, buildGatherOrientation(const Teuchos::ParameterList & pl) const, buildScatter(const Teuchos::ParameterList & pl) const, or buildScatterDirichlet(const Teuchos::ParameterList & pl) const functions.
Definition at line 72 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 292 of file Panzer_LinearObjFactory.hpp.
|
inlinevirtual |
Definition at line 74 of file Panzer_LinearObjFactory.hpp.
|
inline |
This builds all the required evaluators. It is required to be called before the build[Gather,Scatter,ScatterDirichlet] functions are called. This would typically be called by the inheriting class.
| [in] | builder | Template class to build all required evaluators. The class has the following interface. |
Definition at line 371 of file Panzer_LinearObjFactory.hpp.
|
pure virtual |
Read in a vector from a file. Fill a particular vector in the linear object container.
| [in] | identifier | Key for specifying which file(s) to read |
| [in] | loc | Linear object container to fill with the vector |
| [in] | id | Id for the field to be filled |
Implemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >.
|
pure virtual |
Write in a vector from a file. Fill a particular vector in the linear object container.
| [in] | identifier | Key for specifying which file(s) to read |
| [in] | loc | Linear object container to fill with the vector |
| [in] | id | Id for the field to be filled |
Implemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >.
|
pure virtual |
Build a container with all the neccessary linear algebra objects. This is the non-ghosted version.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Build a container with all the neccessary linear algebra objects, purely on the single physics. This gives linear algebra objects that are relevant for a single physics solve. In many cases this is simply a call to buildLinearObjContainer however, in a few important cases (for instance in stochastic galerkin methods) this will return a container for a single instantiation of the physics. This is the non-ghosted version.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Build a container with all the neccessary linear algebra objects. This is the ghosted version.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Build a container with all the neccessary linear algebra objects, purely on the single physics. This gives linear algebra objects that are relevant for a single physics solve. In many cases this is simply a call to buildGhostedLinearObjContainer however, in a few important cases (for instance in stochastic galerkin methods) this will return a container for a single instantiation of the physics. This is the ghosted version.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Build a GlobalEvaluationDataContainer that handles all domain communication. This is used primarily for gather operations and hides the allocation and usage of the ghosted vector from the user.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Initialize container with a specific set of member values.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Initialize container with a specific set of member values.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Adjust the residual vector and Jacobian matrix (if they exist) for applied dirichlet conditions. The adjustment considers if a boundary condition was set globally and locally and based on that result adjust the ghosted matrix and residual vector so that when they are summed across processors they resulting Dirichlet condition is correct.
| [in] | localBCRows | Linear object container uses the X vector to indicate locally set dirichlet conditions. The format is if an entry of the vector is nonzero then it was set as a dirichlet condition. |
| [in] | globalBCRows | Linear object container uses the X vector to indicate globally set dirichlet conditions. The format is if an entry of the vector is nonzero then it was set as a dirichlet condition. |
| [in,out] | ghostedObjs | Ghosted linear object container storing the residual and jacobian matrix for any boundary conditions set. The matrix will be modified by zeroing any rows that are set as nonzero in globalBCRows but zero in localBCRows (similarly for the vector). If a row is nonzero in both localBCRows and globalBCRows then those rows in both the matrix and the residual vector are devided by the corresponding entry in the globalBCRows. |
| [in] | zeroVectorRows | Instead of preserving (and scaling) the vector rows, setting this to true will zero them instead. |
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Adjust a vector by replacing selected rows with the value of the evaluated dirichlet conditions. This is handled through the standard container mechanism.
| [in] | counter | Contains a counter vector (the "x" vector) indicating which rows contain dirichlet conditions by having a non zero entry. The dirichlet condition values are specified in the "f" vector. |
| [in,out] | result | The vector to be modifed is the "f" vector. |
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Acess to the MPI Comm used in constructing this LOF.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
inline |
Use preconstructed scatter evaluators.
Definition at line 219 of file Panzer_LinearObjFactory.hpp.
|
inline |
Use preconstructed gather evaluators.
Definition at line 224 of file Panzer_LinearObjFactory.hpp.
|
inline |
Use preconstructed gather evaluators.
Definition at line 229 of file Panzer_LinearObjFactory.hpp.
|
inline |
Use preconstructed gather evaluators.
Definition at line 234 of file Panzer_LinearObjFactory.hpp.
|
inline |
Use preconstructed gather evaluators.
Definition at line 239 of file Panzer_LinearObjFactory.hpp.
|
inline |
Use preconstructed dirichlet scatter evaluators.
Definition at line 244 of file Panzer_LinearObjFactory.hpp.
|
pure virtual |
Get the domain global indexer object associated with this factory.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
pure virtual |
Get the range global indexer object associated with this factory.
Implemented in panzer::BlockedEpetraLinearObjFactory< Traits, LocalOrdinalT >, panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
|
inlinevirtual |
Open a container for filling. Takes either a ghosted or an owned container.
AssemblyEngine calls this on both, so nothing here may assume which it was handed. Use the two-argument overload for the ghosted container when the owned one it will be migrated into is known.
Reimplemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
Definition at line 259 of file Panzer_LinearObjFactory.hpp.
|
inlinevirtual |
Open a ghosted container for filling, naming the owned container it feeds.
Factories whose ghosted and owned containers share storage (Tpetra FE assembly, where both hold one Tpetra::FECrsMatrix) use this to connect the two: the owned container does not learn its matrix until the caller sets it, so the link cannot be made when the containers are built. The default ignores container and is right for every factory that keeps the two sets of objects separate.
Reimplemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
Definition at line 269 of file Panzer_LinearObjFactory.hpp.
|
inlinevirtual |
Close a container after filling. Takes either a ghosted or an owned container.
As with beginFill, AssemblyEngine calls this on both.
Reimplemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
Definition at line 277 of file Panzer_LinearObjFactory.hpp.
|
inlinevirtual |
Close a ghosted container after filling, naming the owned container it fed.
The counterpart of beginFill(ghostContainer,container): a factory that lent ghostContainer storage there takes it back here. The default ignores container.
Reimplemented in panzer::BlockedTpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >, and panzer::TpetraLinearObjFactory< Traits, ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT >.
Definition at line 284 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 295 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 296 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 297 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 298 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 299 of file Panzer_LinearObjFactory.hpp.
|
private |
Definition at line 300 of file Panzer_LinearObjFactory.hpp.