1#ifndef included_AMP_MultiDOF_Manager
2#define included_AMP_MultiDOF_Manager
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/discretization/MultiDOFHelper.h"
6#include "AMP/mesh/Mesh.h"
7#include "AMP/mesh/MeshElement.h"
36 std::vector<std::shared_ptr<DOFManager>> managers,
37 std::shared_ptr<const AMP::Mesh::Mesh> mesh = {} );
63 std::unique_ptr<AMP::Mesh::MeshElement>
getElement(
size_t dof )
const override;
69 std::shared_ptr<const AMP::Mesh::Mesh>
getMesh()
const override;
98 std::shared_ptr<DOFManager>
subset(
const std::shared_ptr<const AMP::Mesh::Mesh> mesh,
99 bool useMeshComm =
true )
override;
109 const AMP_MPI &comm )
override;
115 void reset( std::vector<std::shared_ptr<DOFManager>> managers,
116 std::shared_ptr<const AMP::Mesh::Mesh> mesh = {} );
143 const std::vector<size_t> &localDOF )
const;
162 const std::vector<size_t> &globalDOF )
const;
170 bool sort =
true )
const override;
177 size_t capacity )
const override;
202 std::shared_ptr<const AMP::Mesh::Mesh>
d_mesh;
Provides C++ wrapper around MPI routines.
std::vector< size_t > getRowDOFs(const AMP::Mesh::MeshElementID &id) const
Get the row DOFs given a mesh element.
virtual std::shared_ptr< DOFManager > subset(const AMP_MPI &comm)
Subset the DOF Manager for a AMP_MPI communicator.
A class to manage mapping multiple DOFs to global indicies.
std::pair< size_t, int > globalToSub(size_t dof) const
Convert the global to local dof.
size_t subToGlobal(int manager, size_t dof) const
Convert the local to global dof.
A derived class to combine multiple DOFManagers.
std::vector< size_t > getRemoteDOFs() const override
Get the remote DOFs for a vector.
multiDOFManager(std::shared_ptr< DOFManager > manager)
Create a new DOF manager object.
void reset(std::vector< std::shared_ptr< DOFManager > > managers, std::shared_ptr< const AMP::Mesh::Mesh > mesh={})
std::pair< size_t, int > globalToSub(size_t dof) const
std::vector< size_t > getSubDOF(const int DOFManager, const std::vector< size_t > &globalDOF) const
Function to convert DOFs from the global DOF to a sub-manager DOF.
virtual ~multiDOFManager() override
Deconstructor.
std::vector< size_t > getGlobalDOF(const int DOFManager, const std::vector< size_t > &localDOF) const
Function to convert DOFs from a sub-manager DOF to the global DOF.
const auto & getDOFManagers() const
Get the DOFManagers that compose the multiDOFManager.
std::vector< size_t > d_globalSize
multiDOFManager(const AMP_MPI &comm, std::vector< std::shared_ptr< DOFManager > > managers, std::shared_ptr< const AMP::Mesh::Mesh > mesh={})
Create a new DOF manager object.
std::vector< size_t > getLocalSizes() const override
Get the local sizes on each rank.
size_t appendDOFs(const AMP::Mesh::MeshElementID &id, size_t *dofs, size_t index, size_t capacity) const override
std::shared_ptr< const AMP::Mesh::Mesh > getMesh() const override
Get the underlying mesh.
AMP::Mesh::MeshIterator getIterator() const override
Get an entry over the mesh elements associated with the DOFs.
int getDOFsPerPoint() const override
Get the number of DOFs per element.
AMP::Mesh::MeshElementID getElementID(size_t dof) const override
Get the mesh element ID for a DOF.
const multiDOFHelper & getMap() const
std::shared_ptr< DOFManager > subset(const AMP_MPI &comm) override
Subset the DOF Manager for a AMP_MPI communicator.
std::vector< std::shared_ptr< DOFManager > > d_managers
std::shared_ptr< DOFManager > subset(const AMP::Mesh::MeshIterator &iterator, const AMP_MPI &comm) override
Subset the DOF Manager for a mesh element iterator.
size_t getRowDOFs(const AMP::Mesh::MeshElementID &id, size_t *dofs, size_t N_alloc, bool sort=true) const override
Get the row DOFs given a mesh element.
size_t subToGlobal(int manager, size_t dof) const
std::shared_ptr< const AMP::Mesh::Mesh > d_mesh
const auto & getDOFManager(const size_t i) const
get the i-th dof manager
std::shared_ptr< DOFManager > subset(const std::shared_ptr< const AMP::Mesh::Mesh > mesh, bool useMeshComm=true) override
Subset the DOF Manager for a mesh.
std::unique_ptr< AMP::Mesh::MeshElement > getElement(size_t dof) const override
Get the mesh element for a DOF.
A class used to iterate over elements in a Mesh.
A structure used to identify the mesh element.