1#ifndef included_AMP_DOF_Manager
2#define included_AMP_DOF_Manager
4#include "AMP/discretization/DOF_ManagerParameters.h"
5#include "AMP/mesh/Mesh.h"
6#include "AMP/mesh/MeshElement.h"
7#include "AMP/mesh/MeshID.h"
8#include "AMP/utils/AMP_MPI.h"
77 virtual std::unique_ptr<AMP::Mesh::MeshElement>
getElement(
size_t dof )
const;
103 void getDOFs(
const std::vector<AMP::Mesh::MeshElementID> &ids,
104 std::vector<size_t> &dofs )
const;
120 virtual std::shared_ptr<const AMP::Mesh::Mesh>
getMesh()
const;
196 virtual std::shared_ptr<DOFManager>
subset(
const std::shared_ptr<const AMP::Mesh::Mesh> mesh,
197 bool useMeshComm =
true );
219 bool sort =
true )
const;
225 size_t capacity )
const;
257 std::shared_ptr<DOFManagerParameters>
params;
Provides C++ wrapper around MPI routines.
void getDOFs(const std::vector< AMP::Mesh::MeshElementID > &ids, std::vector< size_t > &dofs) const
Get the entry indices of DOFs given a mesh element ID.
const AMP_MPI & getComm() const
Get the comm for the DOFManger.
std::shared_ptr< DOFManagerParameters > params
The DOF manager parameters.
virtual std::vector< size_t > getRemoteDOFs() const
Get the remote DOFs for a vector.
virtual size_t beginDOF() const
The first D.O.F. on this core.
virtual void writeRestart(int64_t fid) const
Write restart data to file.
virtual std::shared_ptr< const AMP::Mesh::Mesh > getMesh() const
Get the underlying mesh.
virtual ~DOFManager()
Deconstructor.
virtual bool operator==(const DOFManager &rhs) const
Compares two DOFManager for equality.
virtual size_t endDOF() const
One past the last D.O.F. on this core.
std::vector< size_t > d_remoteDOFs
The remote dofs (if cached)
DOFManager(int64_t fid, AMP::IO::RestartManager *manager)
Write restart data to file.
virtual int getDOFsPerPoint() const
Get the number of DOFs per element.
virtual size_t appendDOFs(const AMP::Mesh::MeshElementID &id, size_t *dofs, size_t index, size_t capacity) const
size_t d_begin
The begining DOF, ending DOF and number of local DOFs for this processor.
DOFManager()
Empty constructor for a DOF manager object.
virtual size_t getRowDOFs(const AMP::Mesh::MeshElementID &id, size_t *dofs, size_t N_alloc, bool sort=true) const
Get the row DOFs given a mesh element.
virtual size_t numLocalDOF() const
The local number of D.O.F.
void getDOFs(const AMP::Mesh::MeshElementID &id, std::vector< size_t > &dofs) const
Get the entry indices of DOFs given a mesh element ID.
virtual std::unique_ptr< AMP::Mesh::MeshElement > getElement(size_t dof) const
Get the mesh element for a DOF.
virtual AMP::Mesh::MeshIterator getIterator() const
Get an entry over the mesh elements associated with the DOFs.
DOFManager(size_t N_local, const AMP_MPI &comm, std::vector< size_t > remoteDOFs={})
Basic constructor for DOFManager.
void getDOFs(int N_ids, const AMP::Mesh::MeshElementID *ids, std::vector< size_t > &dofs) const
Get the entry indices of DOFs given a mesh element ID.
virtual std::vector< size_t > getLocalSizes() const
The local number of D.O.F on each rank.
virtual void replaceRemoteDOFs(std::vector< size_t > &newRemote)
virtual std::string className() const
Return a string with the mesh class name.
virtual void registerChildObjects(AMP::IO::RestartManager *manager) const
Register any child objects.
virtual std::shared_ptr< DOFManager > subset(const std::shared_ptr< const AMP::Mesh::Mesh > mesh, bool useMeshComm=true)
Subset the DOF Manager for a mesh.
AMP_MPI d_comm
The comm for this DOFManager.
virtual std::shared_ptr< DOFManager > subset(const AMP::Mesh::MeshIterator &iterator, const AMP_MPI &comm)
Subset the DOF Manager for a mesh element iterator.
virtual size_t numGlobalDOF() const
The global number of D.O.F.
bool operator!=(const DOFManager &rhs) const
Inverse of ==.
std::vector< size_t > getRowDOFs(const AMP::Mesh::MeshElementID &id) const
Get the row DOFs given a mesh element.
virtual AMP::Mesh::MeshElementID getElementID(size_t dof) const
Get the mesh element for a DOF.
virtual std::shared_ptr< DOFManager > subset(const AMP_MPI &comm)
Subset the DOF Manager for a AMP_MPI communicator.
std::vector< size_t > d_localSize
uint64_t getID() const
Get a unique id hash.
Class to manage reading/writing restart data.
A class used to iterate over elements in a Mesh.
Enhancement of std::enable_shared_from_this.
A structure used to identify the mesh element.