Advanced Multi-Physics (AMP)
On-Line Documentation
simpleDOF_Manager.h
Go to the documentation of this file.
1#ifndef included_AMP_simpleDOF_Manager
2#define included_AMP_simpleDOF_Manager
3
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/mesh/Mesh.h"
6#include "AMP/mesh/MeshElement.h"
7#include <memory>
8
9
10namespace AMP::Discretization {
11
12
22{
23public:
25
26
37 static std::shared_ptr<DOFManager> create( std::shared_ptr<const AMP::Mesh::Mesh> mesh,
39 int gcw,
40 int DOFsPerElement,
41 bool split = true );
42
52 simpleDOFManager( std::shared_ptr<const AMP::Mesh::Mesh> mesh,
53 const AMP::Mesh::MeshIterator &local,
54 const AMP::Mesh::MeshIterator &ghost,
56 int DOFsPerElement );
57
58
67 static std::shared_ptr<DOFManager> create( std::shared_ptr<const AMP::Mesh::Mesh> mesh,
68 const AMP::Mesh::MeshIterator &ghost,
69 const AMP::Mesh::MeshIterator &local,
70 int DOFsPerElement );
71
72
80 static std::shared_ptr<DOFManager> create( const AMP::Mesh::MeshIterator &it,
81 int DOFsPerElement );
82
83
86
87
89 std::string className() const override { return "simpleDOFManager"; }
90
91
97 AMP::Mesh::MeshElementID getElementID( size_t dof ) const override;
98
99
105 std::unique_ptr<AMP::Mesh::MeshElement> getElement( size_t dof ) const override;
106
107
111 std::shared_ptr<const AMP::Mesh::Mesh> getMesh() const override;
112
113
122
123
125 std::vector<size_t> getRemoteDOFs() const override;
126
127
136 std::shared_ptr<DOFManager> subset( const std::shared_ptr<const AMP::Mesh::Mesh> mesh,
137 bool useMeshComm = true ) override;
138
144 int getDOFsPerPoint() const override;
145
146public: // Advanced interfaces
149 size_t *dofs,
150 size_t N_alloc,
151 bool sort = true ) const override;
153
154 // Append DOFs to the list
156 size_t *dofs,
157 size_t index,
158 size_t capacity ) const override;
159
160
161public: // Write/read restart data
162 void registerChildObjects( AMP::IO::RestartManager *manager ) const override;
163 void writeRestart( int64_t ) const override;
165
166protected:
167 // Private constructor
169
170 // Function to find the remote DOF given a set of mesh element IDs
171 std::vector<size_t> getRemoteDOF( const std::vector<AMP::Mesh::MeshElementID> &ids ) const;
172
173 // Function to initialize the data
175
176
177protected: // Data members
178 bool d_isBaseMesh = false; // Is the mesh a base mesh
180 uint8_t d_DOFsPerElement = 0; // # Of DOFs per type
181 std::shared_ptr<const AMP::Mesh::Mesh> d_mesh; // Mesh
183 std::vector<AMP::Mesh::MeshID> d_baseMeshIDs; // Must be global list
186 std::vector<AMP::Mesh::MeshElementID> d_local_id; // List of local ids
187 std::vector<AMP::Mesh::MeshElementID> d_remote_id; // List of remote ids
188 std::vector<size_t> d_remote_dof; // remote dofs
189};
190} // namespace AMP::Discretization
191
192#endif
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 derived class to create a simple DOF_Manager.
static std::shared_ptr< DOFManager > create(std::shared_ptr< const AMP::Mesh::Mesh > mesh, AMP::Mesh::GeomType type, int gcw, int DOFsPerElement, bool split=true)
Create a new DOF manager object.
simpleDOFManager(int64_t, AMP::IO::RestartManager *)
AMP::Mesh::MeshIterator getIterator() const override
Get an entry over the mesh elements associated with the DOFs.
std::vector< size_t > getRemoteDOFs() const override
Get the remote DOFs for a vector.
std::vector< AMP::Mesh::MeshElementID > d_local_id
std::unique_ptr< AMP::Mesh::MeshElement > getElement(size_t dof) const override
Get the mesh element for a DOF.
int getDOFsPerPoint() const override
Get the number of DOFs per element.
std::shared_ptr< const AMP::Mesh::Mesh > getMesh() const override
Get the underlying mesh.
simpleDOFManager(std::shared_ptr< const AMP::Mesh::Mesh > mesh, const AMP::Mesh::MeshIterator &local, const AMP::Mesh::MeshIterator &ghost, AMP::Mesh::GeomType type, int DOFsPerElement)
Create a new DOF manager object.
std::string className() const override
Return a string with the mesh class name.
std::vector< AMP::Mesh::MeshElementID > d_remote_id
static std::shared_ptr< DOFManager > create(const AMP::Mesh::MeshIterator &it, int DOFsPerElement)
Create a new DOF manager object.
std::vector< size_t > getRemoteDOF(const std::vector< AMP::Mesh::MeshElementID > &ids) const
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
std::vector< AMP::Mesh::MeshID > d_baseMeshIDs
std::shared_ptr< const AMP::Mesh::Mesh > d_mesh
AMP::Mesh::MeshElementID getElementID(size_t dof) const override
Get the mesh element ID for a DOF.
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.
void writeRestart(int64_t) const override
Write restart data to file.
virtual ~simpleDOFManager()
Destructor.
size_t appendDOFs(const AMP::Mesh::MeshElementID &id, size_t *dofs, size_t index, size_t capacity) const override
static std::shared_ptr< DOFManager > create(std::shared_ptr< const AMP::Mesh::Mesh > mesh, const AMP::Mesh::MeshIterator &ghost, const AMP::Mesh::MeshIterator &local, int DOFsPerElement)
Create a new DOF manager object.
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.
Class to manage reading/writing restart data.
A class used to iterate over elements in a Mesh.
GeomType
Enumeration for basic mesh-based quantities.
Definition MeshID.h:12
A structure used to identify the mesh element.
Definition MeshID.h:156
A structure used to identify the mesh.
Definition MeshID.h:31



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page