1#ifndef included_AMP_MultiMesh
2#define included_AMP_MultiMesh
4#include "AMP/mesh/Mesh.h"
5#include "AMP/mesh/loadBalance/loadBalanceSimulator.h"
37 explicit MultiMesh( std::shared_ptr<const MeshParameters> params );
51 const std::vector<std::shared_ptr<Mesh>> &meshes,
52 bool checkComm =
true );
64 std::unique_ptr<Mesh>
clone()
const override;
82 static size_t maxProcs( std::shared_ptr<const MeshParameters> params );
125 bool isGlobal =
true )
const override;
139 std::shared_ptr<Mesh>
Subset( std::string name )
const override;
158 const int gcw = 0 )
const override;
238 const GeomType type )
const override;
287 virtual std::vector<std::shared_ptr<AMP::Mesh::Mesh>>
getMeshes();
293 virtual std::vector<std::shared_ptr<const AMP::Mesh::Mesh>>
getMeshes()
const;
336 void displaceMesh( std::shared_ptr<const AMP::LinearAlgebra::Vector> x )
override;
358 const std::vector<std::vector<int>> &groups );
363 static std::vector<std::shared_ptr<AMP::Database>>
Provides C++ wrapper around MPI routines.
Class to manage reading/writing restart data.
A pointer class to wrap a MeshElementVector.
A class used to iterate over elements in a Mesh.
A class used to abstract away mesh from an application.
std::unique_ptr< MeshElement > MeshElementPtr
Pointer to MeshElement and MeshElementVector.
MeshID meshID() const
Get the mesh ID.
Movable
Enumeration for basic mesh-based quantities.
virtual std::shared_ptr< Mesh > Subset(MeshID meshID) const
Subset a mesh given a MeshID.
A concrete mesh class for a multi-mesh.
MeshIterator isMember(const MeshIterator &it) const override
Check if elements are in the mesh.
std::vector< int > getBoundaryIDs() const override
Return the list of all boundary ID sets in the mesh.
MeshElementPtr getElement(const MeshElementID &id) const override
Return a mesh element given it's id.
virtual std::shared_ptr< Mesh > Subset(const MeshIterator &iterator, bool isGlobal=true) const override
Subset a mesh given a MeshIterator.
static size_t estimateMeshSize(std::shared_ptr< const MeshParameters > params)
Estimate the number of elements in the mesh.
MultiMesh(int64_t, AMP::IO::RestartManager *)
std::vector< MeshID > getAllMeshIDs() const override
std::string meshClass() const override
Return a string with the mesh class name.
Mesh::Movable isMeshMovable() const override
Is the mesh movable.
void displaceMesh(std::shared_ptr< const AMP::LinearAlgebra::Vector > x) override
Displace the entire mesh.
virtual MeshIterator getSurfaceIterator(const GeomType type, const int gcw=0) const override
Return an MeshIterator over the given geometric objects on the surface.
static std::vector< AMP_MPI > createComms(const AMP_MPI &comm, const std::vector< std::vector< int > > &groups)
A function to compute the AMP_MPI comms for each mesh.
std::shared_ptr< Mesh > Subset(MeshID meshID) const override
Subset a mesh given a MeshID.
uint64_t positionHash() const override
Identify if the position has moved.
static std::vector< std::shared_ptr< AMP::Database > > createDatabases(std::shared_ptr< const AMP::Database > database)
Function to create the databases for the meshes within the multimesh.
std::unique_ptr< Mesh > clone() const override
Function to clone the mesh (allows use to properly copy the derived class)
void writeRestart(int64_t) const override
Write restart data to file.
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register child objects.
bool operator==(const Mesh &mesh) const override
Check if two meshes are equal.
std::vector< std::shared_ptr< Mesh > > d_meshes
A list of all meshes in the multimesh.
MultiMesh(std::shared_ptr< const MeshParameters > params)
Default constructor.
MultiMesh & operator=(MultiMesh &&rhs)=delete
MultiMesh(const std::string &name, const AMP_MPI &comm, const std::vector< std::shared_ptr< Mesh > > &meshes, bool checkComm=true)
Constructor to create a MultiMesh from existing meshes.
virtual std::vector< std::shared_ptr< AMP::Mesh::Mesh > > getMeshes()
bool containsElement(const MeshElementID &id) const override
Mesh::Movable d_isMovable
Are all meshes movable.
MeshIterator getIterator(const GeomType type, const int gcw=0) const override
Return an MeshIterator over the given geometric objects.
bool isMember(const MeshElementID &id) const override
Check if an element is in the mesh.
MultiMesh(const MultiMesh &rhs)
static size_t maxProcs(std::shared_ptr< const MeshParameters > params)
Return the maximum number of processors that can be used with the mesh.
MultiMesh(MultiMesh &&rhs)=default
virtual MeshIterator getBlockIDIterator(const GeomType type, const int id, const int gcw=0) const override
Return an MeshIterator over the given geometric objects on the given block ID set.
virtual std::vector< std::shared_ptr< const AMP::Mesh::Mesh > > getMeshes() const
std::vector< int > getBlockIDs() const override
Return the list of all boundary ID sets in the mesh.
virtual MeshIterator getBoundaryIDIterator(const GeomType type, const int id, const int gcw=0) const override
Return an MeshIterator over the given geometric objects on the given boundary ID set.
virtual ~MultiMesh()
Deconstructor.
size_t numLocalElements(const GeomType type) const override
std::shared_ptr< Mesh > Subset(std::string name) const override
Subset a mesh given a mesh name.
size_t numGhostElements(const GeomType type, const int gcw) const override
std::vector< MeshID > getBaseMeshIDs() const override
virtual ElementListPtr getElementParents(const MeshElement &elem, const GeomType type) const override
Return the parent elements of the given mesh element.
MultiMesh & operator=(const MultiMesh &rhs)=delete
void displaceMesh(const std::vector< double > &x) override
Displace the entire mesh.
size_t numGlobalElements(const GeomType type) const override
std::vector< MeshID > getLocalBaseMeshIDs() const override
std::vector< MeshID > getLocalMeshIDs() const override
bool isBaseMesh() const override
Is the current mesh a base mesh.
GeomType
Enumeration for basic mesh-based quantities.
A structure used to identify the mesh element.
A structure used to identify the mesh.