Unified set of tools for building objects for lumped and consistent L2 projects between bases. Currently only supports projections onto HGrad bases from any type of source basis. It is design to be extensible to all cases.
More...
#include <Panzer_L2Projection.hpp>
|
| L2Projection () |
| Constructor. More...
|
|
void | setup (const panzer::BasisDescriptor &targetBasis, const panzer::IntegrationDescriptor &integrationDescriptor, const Teuchos::RCP< const Teuchos::MpiComm< int >> &comm, const Teuchos::RCP< const panzer::ConnManager< LO, GO >> &connManager, const std::vector< std::string > &elementBlockNames, const Teuchos::RCP< panzer::WorksetContainer > worksetContainer=Teuchos::null) |
| Setup base objects for L2 Projections - requires target scalar basis and creates worksets if not supplied by user. More...
|
|
Teuchos::RCP< panzer::UniqueGlobalIndexer< LO, GO > > | getTargetGlobalIndexer () const |
| Returns the target global indexer. Will be null if setup() has not been called. More...
|
|
Teuchos::RCP< Tpetra::CrsMatrix< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > | buildMassMatrix () |
| Allocates, fills and returns a mass matrix for L2 projection onto a target basis. More...
|
|
Teuchos::RCP< Tpetra::MultiVector< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > | buildInverseLumpedMassMatrix () |
| Allocates, fills and returns a Tpetra::MultiVector containing the inverse lumped mass matrix values. This is currently inefficient in that it uses the consistent mass matrix to generate the row sums. This saves significant code duplication at the temporary runtime cost of allocating the mass matrix. The temporary matrix is deallocated on exit from this function so it should not be an issue. More...
|
|
Teuchos::RCP< Tpetra::CrsMatrix< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > | buildRHSMatrix (const panzer::UniqueGlobalIndexer< LO, GO > &sourceDOFManager, const Teuchos::RCP< const Tpetra::Map< LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device >>> &ownedSourceMap, const std::string &sourceFieldName, const panzer::BasisDescriptor &sourceBasisDescriptor, const int vectorOrGradientDirectionIndex=-1) |
| Allocates, fills and returns a rectangular matrix for L2 projection of a scalar field, one dimension of gradient (for hgrad basis), or one dimension of a vector field onto the target scalar basis. If you wish to project all values of a vector field or all the gradients of a scalar field, then you will need three separate RHS matrices to form the RHS for each independently. The vectors must be independent Tpetra vectors to solve multiple right hand sides with the linear solver. More...
|
|
template<typename LO, typename GO>
class panzer::L2Projection< LO, GO >
Unified set of tools for building objects for lumped and consistent L2 projects between bases. Currently only supports projections onto HGrad bases from any type of source basis. It is design to be extensible to all cases.
Definition at line 36 of file Panzer_L2Projection.hpp.
◆ L2Projection()
template<typename LO , typename GO >
◆ setup()
template<typename LO , typename GO >
Setup base objects for L2 Projections - requires target scalar basis and creates worksets if not supplied by user.
- Parameters
-
[in] | basis | (required) Basis that field values will be projected to. |
[in] | integrationDescriptor | (required) Integration order used for the projection. |
[in] | comm | (required) Teuchos MPI communicator used all processes involved in the project. |
[in] | connManger | (required) Connection manager to describe the mesh. |
[in] | elementBlockNames | (required) Names of element blocks in mesh that are involved in the projection. |
[in] | worksetContainer | (optional) If the user has already allocated worksets for the corresponding mesh/element blocks, we can used those instead of reallocating for projection. |
Definition at line 26 of file Panzer_L2Projection_impl.hpp.
◆ getTargetGlobalIndexer()
template<typename LO , typename GO >
◆ buildMassMatrix()
template<typename LO , typename GO >
Teuchos::RCP< Tpetra::CrsMatrix< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > panzer::L2Projection< LO, GO >::buildMassMatrix |
( |
| ) |
|
Allocates, fills and returns a mass matrix for L2 projection onto a target basis.
- Returns
- Filled mass matrix in a Tpetra::CrsMatrix
Definition at line 76 of file Panzer_L2Projection_impl.hpp.
◆ buildInverseLumpedMassMatrix()
template<typename LO , typename GO >
Teuchos::RCP< Tpetra::MultiVector< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > panzer::L2Projection< LO, GO >::buildInverseLumpedMassMatrix |
( |
| ) |
|
Allocates, fills and returns a Tpetra::MultiVector containing the inverse lumped mass matrix values. This is currently inefficient in that it uses the consistent mass matrix to generate the row sums. This saves significant code duplication at the temporary runtime cost of allocating the mass matrix. The temporary matrix is deallocated on exit from this function so it should not be an issue.
- Returns
- Filled inverse lumped mass matrix in a Tpetra::MultiVector (diagonal entries mass matrix)
Definition at line 230 of file Panzer_L2Projection_impl.hpp.
◆ buildRHSMatrix()
template<typename LO , typename GO >
Teuchos::RCP< Tpetra::CrsMatrix< double, LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device > > > panzer::L2Projection< LO, GO >::buildRHSMatrix |
( |
const panzer::UniqueGlobalIndexer< LO, GO > & |
sourceDOFManager, |
|
|
const Teuchos::RCP< const Tpetra::Map< LO, GO, Kokkos::Compat::KokkosDeviceWrapperNode< PHX::Device >>> & |
ownedSourceMap, |
|
|
const std::string & |
sourceFieldName, |
|
|
const panzer::BasisDescriptor & |
sourceBasisDescriptor, |
|
|
const int |
vectorOrGradientDirectionIndex = -1 |
|
) |
| |
Allocates, fills and returns a rectangular matrix for L2 projection of a scalar field, one dimension of gradient (for hgrad basis), or one dimension of a vector field onto the target scalar basis. If you wish to project all values of a vector field or all the gradients of a scalar field, then you will need three separate RHS matrices to form the RHS for each independently. The vectors must be independent Tpetra vectors to solve multiple right hand sides with the linear solver.
- Parameters
-
[in] | (required) | sourceDOFManager The source dof manger object |
[in] | (required) | ownedSourceMap The Tpetra Map for the owned source vector |
[in] | (required) | sourceFieldName The string name of the source field to project |
[in] | (required) | sourceBasisDescriptor The type of the basis for the source field |
[in] | (optional) | vectorOrGradientDirectionIndex For vector fields, this is the vector index to project (x,y, or z component). For scalar fields, the default value of -1 results in a projection of the scalar field value. If set to 0 or greater, it is assumed that the gradient of the HGrad field is projected and that this value is the dimension index for the particular gradient (x, y, or z component). |
- Returns
- Alocated and filled Tpetra::CrsMatrix
Definition at line 244 of file Panzer_L2Projection_impl.hpp.
◆ targetBasisDescriptor_
template<typename LO , typename GO >
◆ integrationDescriptor_
template<typename LO , typename GO >
◆ comm_
template<typename LO , typename GO >
◆ connManager_
template<typename LO , typename GO >
◆ elementBlockNames_
template<typename LO , typename GO >
◆ worksetContainer_
template<typename LO , typename GO >
◆ setupCalled_
template<typename LO , typename GO >
◆ targetGlobalIndexer_
template<typename LO , typename GO >
The documentation for this class was generated from the following files: