Panzer  Version of the Day
Panzer_L2Projection.hpp
Go to the documentation of this file.
1 // @HEADER
2 // @HEADER
3 
4 #ifndef PANZER_L2_PROJECTION_HPP
5 #define PANZER_L2_PROJECTION_HPP
6 
7 #include "Teuchos_RCP.hpp"
8 #include "Phalanx_KokkosDeviceTypes.hpp"
11 #include "Tpetra_Map.hpp" // for KokkosDeviceWrapperNode
12 #include "Tpetra_CrsMatrix_fwd.hpp"
13 #include "Tpetra_MultiVector_fwd.hpp"
14 #include <vector>
15 #include <string>
16 
17 namespace Teuchos {
18  template<typename T> class MpiComm;
19 }
20 
21 namespace panzer {
22 
23  class BasisDescriptor;
24  class IntegrationDescriptor;
25  template<typename LO,typename GO> class ConnManager;
26  template<typename LO,typename GO> class DOFManager;
27  template<typename LO,typename GO> class UniqueGlobalIndexer;
28  class WorksetContainer;
29 
35  template<typename LO, typename GO>
36  class L2Projection {
37 
42  std::vector<std::string> elementBlockNames_;
45 
47 
48  public:
49 
51  L2Projection() : setupCalled_(false) {}
52 
62  void setup(const panzer::BasisDescriptor& targetBasis,
63  const panzer::IntegrationDescriptor& integrationDescriptor,
64  const Teuchos::RCP<const Teuchos::MpiComm<int>>& comm,
65  const Teuchos::RCP<const panzer::ConnManager<LO,GO>>& connManager,
66  const std::vector<std::string>& elementBlockNames,
67  const Teuchos::RCP<panzer::WorksetContainer> worksetContainer = Teuchos::null);
68 
71 
79 
92 
111  buildRHSMatrix(const panzer::UniqueGlobalIndexer<LO,GO>& sourceDOFManager,
112  const Teuchos::RCP<const Tpetra::Map<LO,GO,Kokkos::Compat::KokkosDeviceWrapperNode<PHX::Device>>>& ownedSourceMap,
113  const std::string& sourceFieldName,
114  const panzer::BasisDescriptor& sourceBasisDescriptor,
115  const int vectorOrGradientDirectionIndex = -1);
116  };
117 
118 }
119 
120 #endif
panzer::L2Projection::worksetContainer_
Teuchos::RCP< panzer::WorksetContainer > worksetContainer_
Definition: Panzer_L2Projection.hpp:43
Panzer_IntegrationDescriptor.hpp
panzer::L2Projection::targetBasisDescriptor_
panzer::BasisDescriptor targetBasisDescriptor_
Definition: Panzer_L2Projection.hpp:38
Teuchos_RCP.hpp
Teuchos::MpiComm
Definition: Panzer_L2Projection.hpp:18
panzer::L2Projection::L2Projection
L2Projection()
Constructor.
Definition: Panzer_L2Projection.hpp:51
panzer::L2Projection::comm_
Teuchos::RCP< const Teuchos::MpiComm< int > > comm_
Definition: Panzer_L2Projection.hpp:40
panzer::L2Projection::getTargetGlobalIndexer
Teuchos::RCP< panzer::UniqueGlobalIndexer< LO, GO > > getTargetGlobalIndexer() const
Returns the target global indexer. Will be null if setup() has not been called.
Definition: Panzer_L2Projection_impl.hpp:71
panzer::IntegrationDescriptor
Definition: Panzer_IntegrationDescriptor.hpp:51
panzer::UniqueGlobalIndexer
Definition: Panzer_GatherOrientation_decl.hpp:61
panzer::L2Projection::setup
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 supp...
Definition: Panzer_L2Projection_impl.hpp:26
panzer::L2Projection::buildRHSMatrix
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,...
Definition: Panzer_L2Projection_impl.hpp:244
panzer::L2Projection::targetGlobalIndexer_
Teuchos::RCP< panzer::DOFManager< LO, GO > > targetGlobalIndexer_
Definition: Panzer_L2Projection.hpp:46
panzer::L2Projection::buildMassMatrix
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.
Definition: Panzer_L2Projection_impl.hpp:76
Teuchos::RCP
panzer::L2Projection::setupCalled_
bool setupCalled_
Definition: Panzer_L2Projection.hpp:44
panzer::BasisDescriptor
Definition: Panzer_BasisDescriptor.hpp:53
panzer::L2Projection::buildInverseLumpedMassMatrix
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....
Definition: Panzer_L2Projection_impl.hpp:230
panzer::L2Projection::elementBlockNames_
std::vector< std::string > elementBlockNames_
Definition: Panzer_L2Projection.hpp:42
panzer::L2Projection::integrationDescriptor_
panzer::IntegrationDescriptor integrationDescriptor_
Definition: Panzer_L2Projection.hpp:39
panzer::ConnManager
Definition: Panzer_L2Projection.hpp:25
panzer::L2Projection::connManager_
Teuchos::RCP< const panzer::ConnManager< LO, GO > > connManager_
Definition: Panzer_L2Projection.hpp:41
Panzer_BasisDescriptor.hpp
panzer::L2Projection
Unified set of tools for building objects for lumped and consistent L2 projects between bases....
Definition: Panzer_L2Projection.hpp:36
panzer
Definition: Panzer_BasisValues_Evaluator_decl.hpp:54
panzer::DOFManager
Definition: Panzer_L2Projection.hpp:26
Teuchos
panzer::WorksetContainer
Class that provides access to worksets on each element block and side set.
Definition: Panzer_WorksetContainer.hpp:73