35#ifndef NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
36#define NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
38#include <unordered_map>
60namespace SpatialDomains
62typedef std::map<int, std::pair<LibUtilities::ShapeType, std::vector<int>>>
167typedef std::shared_ptr<std::vector<std::pair<GeometrySharedPtr, int>>>
191 bool fillGraph =
true,
195 std::string &outfilename,
bool defaultExp =
false,
251 "Composite not found.");
259 const std::string &compositeStr,
CompositeMap &compositeVector)
const;
271 std::map<int, std::map<int, CompositeSharedPtr>> &
GetDomain()
276 std::map<int, CompositeSharedPtr> &
GetDomain(
int domain)
279 "Request for domain which does not exist");
284 const std::string variable =
"DefaultVar");
291 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
295 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
296 std::vector<std::vector<LibUtilities::PointsType>> &pointstype);
328 std::string var =
"DefaultVar");
335 const std::string var2);
350 ExpansionType type_z,
const int nummodes_x,
const int nummodes_y,
351 const int nummodes_z);
475 std::string &outfilename,
bool defaultExp =
false,
543 std::string &outfilename,
bool defaultExp,
577 (std::string(
"ExpansionInfo field is already set for variable ") +
591 const std::string var2)
596 if (expVec1.get() == expVec2.get())
#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
Provides a generic Factory class.
Base class for a spectral/hp element mesh.
void SetDomainRange(NekDouble xmin, NekDouble xmax, NekDouble ymin=NekConstants::kNekUnsetDouble, NekDouble ymax=NekConstants::kNekUnsetDouble, NekDouble zmin=NekConstants::kNekUnsetDouble, NekDouble zmax=NekConstants::kNekUnsetDouble)
std::map< int, SegGeomSharedPtr > & GetAllSegGeoms()
bool CheckRange(Geometry2D &geom)
Check if goemetry is in range definition if activated.
void FillBoundingBoxTree()
std::map< int, RefRegion * > m_refRegion
Link the refinement id with the surface region data.
void SetCompositeOrdering(CompositeOrdering p_compOrder)
HexGeomMap & GetAllHexGeoms()
int GetMeshDimension()
Dimension of the mesh (can be a 1D curve in 3D space).
PrismGeomMap m_prismGeoms
const std::string GetGeomInfo(std::string parameter)
void ReadGeometry(LibUtilities::DomainRangeShPtr rng, bool fillGraph)
void PopulateFaceToElMap(Geometry3DSharedPtr element, int kNfaces)
Given a 3D geometry object #element, populate the face to element map m_faceToElMap which maps faces ...
void SetRefinementInfo(ExpansionInfoMapShPtr &expansionMap)
This function sets the expansion #exp in map with entry #variable.
Geometry2DSharedPtr GetGeometry2D(int gID)
std::map< int, std::map< int, CompositeSharedPtr > > & GetDomain()
void SetExpansionInfoToEvenlySpacedPoints(int npoints=0)
Sets expansions to have equispaced points.
std::map< int, CompositeSharedPtr > & GetComposites()
std::unordered_map< int, GeometryLinkSharedPtr > & GetAllFaceToElMap()
LibUtilities::SessionReaderSharedPtr m_session
std::map< int, CompositeMap > m_domain
void SetPartition(SpatialDomains::MeshGraphSharedPtr graph)
std::unique_ptr< GeomRTree > m_boundingBoxTree
ExpansionInfoMapShPtr SetUpExpansionInfoMap()
std::map< int, CompositeSharedPtr > & GetDomain(int domain)
void SetExpansionInfoToPointOrder(int npts)
Reset expansion to have specified point order npts.
bool SameExpansionInfo(const std::string var1, const std::string var2)
CompositeOrdering m_compOrder
std::map< int, CompositeMap > m_refComposite
Link the refinement id with the composites.
virtual void v_WriteGeometry(std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)=0
bool ExpansionInfoDefined(const std::string var)
void GetCompositeList(const std::string &compositeStr, CompositeMap &compositeVector) const
virtual void v_PartitionMesh(LibUtilities::SessionReaderSharedPtr session)=0
CompositeMap m_meshComposites
TetGeomMap & GetAllTetGeoms()
void Empty(int dim, int space)
const ExpansionInfoMap & GetExpansionInfo(const std::string variable="DefaultVar")
void WriteGeometry(std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)
GeometryLinkSharedPtr GetElementsFromEdge(Geometry1DSharedPtr edge)
GeometrySharedPtr GetCompositeItem(int whichComposite, int whichItem)
ExpansionInfoMapShPtrMap m_expansionMapShPtrMap
void PRefinementElmts(ExpansionInfoMapShPtr &expansionMap, RefRegion *®ion, GeometrySharedPtr geomVecIter)
Perform the p-refinement in the selected elements.
int GetSpaceDimension()
Dimension of the space (can be a 1D curve in 3D space).
MovementSharedPtr m_movement
BndRegionOrdering & GetBndRegionOrdering()
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::unordered_map< int, GeometryLinkSharedPtr > m_faceToElMap
MovementSharedPtr & GetMovement()
CompositeSharedPtr GetComposite(int whichComposite)
virtual void v_ReadGeometry(LibUtilities::DomainRangeShPtr rng, bool fillGraph)=0
void SetExpansionInfo(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Sets expansions given field definitions.
void SetBndRegionOrdering(BndRegionOrdering p_bndRegOrder)
CompositeOrdering & GetCompositeOrdering()
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
CurveMap & GetCurvedFaces()
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)
std::map< int, PointGeomSharedPtr > & GetAllPointGeoms()
QuadGeomMap & GetAllQuadGeoms()
bool CheckForGeomInfo(std::string parameter)
SegGeomSharedPtr GetSegGeom(int id)
CompositeDescriptor CreateCompositeDescriptor()
CurveMap & GetCurvedEdges()
GeometryLinkSharedPtr GetElementsFromFace(Geometry2DSharedPtr face)
void ReadRefinementInfo()
Read refinement info.
TriGeomMap & GetAllTriGeoms()
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)
PrismGeomMap & GetAllPrismGeoms()
PyrGeomMap & GetAllPyrGeoms()
std::map< int, std::string > & GetCompositesLabels()
void PartitionMesh(LibUtilities::SessionReaderSharedPtr session)
static LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionType(GeometrySharedPtr in, ExpansionType type, const int order)
void SetSession(LibUtilities::SessionReaderSharedPtr pSession)
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
LibUtilities::DomainRangeShPtr m_domainRange
BndRegionOrdering m_bndRegOrder
Abstract base class for the refinement surface region.
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
std::map< std::string, std::string > FieldMetaDataMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
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< Composite > CompositeSharedPtr
std::shared_ptr< ExpansionInfoMap > ExpansionInfoMapShPtr
std::map< int, SegGeomSharedPtr > SegGeomMap
std::shared_ptr< Movement > MovementSharedPtr
std::unordered_map< int, CurveSharedPtr > CurveMap
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< 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
std::map< int, CompositeSharedPtr > CompositeMap
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)