35 #ifndef NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
36 #define NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
38 #include <unordered_map>
60 namespace SpatialDomains
62 typedef std::map<int, std::pair<LibUtilities::ShapeType, std::vector<int>>>
169 typedef std::shared_ptr<std::vector<std::pair<GeometrySharedPtr, int>>>
187 bool fillGraph =
true);
190 std::string &outfilename,
191 bool defaultExp =
false,
244 "Composite not found.");
249 int whichComposite,
int whichItem);
252 const std::string &compositeStr,
265 std::vector<std::map<int, CompositeSharedPtr>> &
GetDomain()
270 std::map<int, CompositeSharedPtr> &
GetDomain(
int domain)
273 "Request for domain which does not exist");
278 const std::string variable =
"DefaultVar");
285 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
289 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
290 std::vector<std::vector<LibUtilities::PointsType>> &pointstype);
313 std::string var =
"DefaultVar");
321 const std::string var2);
325 inline const std::string
GetGeomInfo(std::string parameter);
334 ExpansionType type_z,
const int nummodes_x,
const int nummodes_y,
335 const int nummodes_z);
421 const std::string variable =
"DefaultVar");
503 (std::string(
"ExpansionInfo field is already set for variable ") +
517 const std::string var2)
522 if (expVec1.get() == expVec2.get())
544 "Parameter " + parameter +
" does not exist.");
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define SPATIAL_DOMAINS_EXPORT
Describes the specification for a Basis.
Provides a generic Factory class.
Base class for a spectral/hp element mesh.
std::map< int, PointGeomSharedPtr > & GetAllPointGeoms()
std::map< int, std::string > & GetCompositesLabels()
void SetDomainRange(NekDouble xmin, NekDouble xmax, NekDouble ymin=NekConstants::kNekUnsetDouble, NekDouble ymax=NekConstants::kNekUnsetDouble, NekDouble zmin=NekConstants::kNekUnsetDouble, NekDouble zmax=NekConstants::kNekUnsetDouble)
PrismGeomMap & GetAllPrismGeoms()
bool CheckRange(Geometry2D &geom)
Check if goemetry is in range definition if activated.
void FillBoundingBoxTree()
int GetMeshDimension()
Dimension of the mesh (can be a 1D curve in 3D space).
PrismGeomMap m_prismGeoms
QuadGeomMap & GetAllQuadGeoms()
const std::string GetGeomInfo(std::string parameter)
void PopulateFaceToElMap(Geometry3DSharedPtr element, int kNfaces)
Given a 3D geometry object #element, populate the face to element map m_faceToElMap which maps faces ...
BndRegionOrdering & GetBndRegionOrdering()
HexGeomMap & GetAllHexGeoms()
Geometry2DSharedPtr GetGeometry2D(int gID)
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true)
void SetExpansionInfoToEvenlySpacedPoints(int npoints=0)
Sets expansions to have equispaced points.
virtual void ReadGeometry(LibUtilities::DomainRangeShPtr rng, bool fillGraph)=0
LibUtilities::SessionReaderSharedPtr m_session
std::vector< CompositeMap > m_domain
CurveMap & GetCurvedEdges()
std::unique_ptr< GeomRTree > m_boundingBoxTree
TetGeomMap & GetAllTetGeoms()
ExpansionInfoMapShPtr SetUpExpansionInfoMap()
void SetExpansionInfoToPointOrder(int npts)
Reset expansion to have specified point order npts.
bool SameExpansionInfo(const std::string var1, const std::string var2)
CurveMap & GetCurvedFaces()
PyrGeomMap & GetAllPyrGeoms()
CompositeOrdering m_compOrder
void GetCompositeList(const std::string &compositeStr, CompositeMap &compositeVector) const
CompositeMap m_meshComposites
void Empty(int dim, int space)
virtual void PartitionMesh(LibUtilities::SessionReaderSharedPtr session)=0
const ExpansionInfoMap & GetExpansionInfo(const std::string variable="DefaultVar")
std::map< int, SegGeomSharedPtr > & GetAllSegGeoms()
GeometryLinkSharedPtr GetElementsFromEdge(Geometry1DSharedPtr edge)
GeometrySharedPtr GetCompositeItem(int whichComposite, int whichItem)
ExpansionInfoMapShPtrMap m_expansionMapShPtrMap
int GetSpaceDimension()
Dimension of the space (can be a 1D curve in 3D space).
std::string GetCompositeString(CompositeSharedPtr comp)
Returns a string representation of a composite.
void ResetExpansionInfoToBasisKey(ExpansionInfoMapShPtr &expansionMap, LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys)
void SetExpansionInfoToNumModes(int nmodes)
Reset expansion to have specified polynomial order nmodes.
std::map< int, CompositeSharedPtr > & GetComposites()
std::unordered_map< int, GeometryLinkSharedPtr > m_faceToElMap
CompositeSharedPtr GetComposite(int whichComposite)
void SetExpansionInfo(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Sets expansions given field definitions.
TriGeomMap & GetAllTriGeoms()
CompositeOrdering & GetCompositeOrdering()
LibUtilities::BasisKey GetEdgeBasisKey(SegGeomSharedPtr edge, const std::string variable="DefaultVar")
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionTypeHomo(GeometrySharedPtr in, ExpansionType type_x, ExpansionType type_y, ExpansionType type_z, const int nummodes_x, const int nummodes_y, const int nummodes_z)
bool CheckForGeomInfo(std::string parameter)
LibUtilities::BasisKey GetFaceBasisKey(Geometry2DSharedPtr face, const int facedir, const std::string variable="DefaultVar")
3D functions
SegGeomSharedPtr GetSegGeom(int id)
CompositeDescriptor CreateCompositeDescriptor()
GeometryLinkSharedPtr GetElementsFromFace(Geometry2DSharedPtr face)
std::map< int, CompositeSharedPtr > & GetDomain(int domain)
void SetBasisKey(LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys, std::string var="DefaultVar")
Sets the basis key for all expansions of the given shape.
std::map< int, std::string > m_compositesLabels
std::vector< int > GetElementsContainingPoint(PointGeomSharedPtr p)
PointGeomSharedPtr GetVertex(int id)
virtual void WriteGeometry(std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)=0
static LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionType(GeometrySharedPtr in, ExpansionType type, const int order)
void SetSession(LibUtilities::SessionReaderSharedPtr pSession)
std::vector< std::map< int, CompositeSharedPtr > > & GetDomain()
LibUtilities::DomainRangeShPtr m_domainRange
BndRegionOrdering m_bndRegOrder
std::map< std::string, std::string > FieldMetaDataMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
std::shared_ptr< DomainRange > DomainRangeShPtr
static DomainRangeShPtr NullDomainRangeShPtr
static const NekDouble kNekUnsetDouble
std::map< int, TriGeomSharedPtr > TriGeomMap
std::map< std::string, std::string > GeomInfoMap
std::map< int, std::vector< unsigned int > > CompositeOrdering
std::map< int, PyrGeomSharedPtr > PyrGeomMap
std::map< int, QuadGeomSharedPtr > QuadGeomMap
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
std::shared_ptr< std::vector< std::pair< GeometrySharedPtr, int > > > GeometryLinkSharedPtr
std::map< int, std::vector< unsigned int > > BndRegionOrdering
std::shared_ptr< ExpansionInfoMap > ExpansionInfoMapShPtr
std::map< int, SegGeomSharedPtr > SegGeomMap
std::unordered_map< int, CurveSharedPtr > CurveMap
std::map< int, CompositeSharedPtr > CompositeMap
LibUtilities::NekFactory< std::string, MeshGraph > MeshGraphFactory
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::map< int, TetGeomSharedPtr > TetGeomMap
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
const std::string kExpansionTypeStr[]
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< std::string, std::string > MeshMetaDataMap
std::map< int, PrismGeomSharedPtr > PrismGeomMap
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< Geometry > GeometrySharedPtr
MeshGraphFactory & GetMeshGraphFactory()
std::shared_ptr< Composite > CompositeSharedPtr
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
std::map< std::string, ExpansionInfoMapShPtr > ExpansionInfoMapShPtrMap
std::map< int, HexGeomSharedPtr > HexGeomMap
std::map< int, PointGeomSharedPtr > PointGeomMap
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
The above copyright notice and this permission notice shall be included.
std::vector< std::shared_ptr< Geometry > > m_geomVec
GeometrySharedPtr m_geomShPtr
ExpansionInfo(GeometrySharedPtr geomShPtr, const LibUtilities::BasisKeyVector basiskeyvec)
LibUtilities::BasisKeyVector m_basisKeyVector
ExpansionInfo(ExpansionInfoShPtr ExpInfo)