35 #ifndef NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
36 #define NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
38 #include <boost/unordered_map.hpp>
58 namespace SpatialDomains
189 unsigned int meshDimension,
190 unsigned int spaceDimension);
194 const DomainRangeShPtr &rng = NullDomainRangeShPtr);
203 DomainRangeShPtr &rng = NullDomainRangeShPtr);
207 const std::string& infilename,
208 bool pReadExpansions =
true);
213 const std::string& infilename);
221 const std::string &infilename);
229 const std::string &infilename);
242 std::string &infilename);
245 std::string &outfilename);
273 inline Composite
GetComposite(
int whichComposite)
const;
280 const std::string &compositeStr,
281 CompositeMap &compositeVector)
const;
285 inline const std::vector<CompositeMap> &
GetDomain(
void)
const;
287 inline const CompositeMap &
GetDomain(
int domain)
const;
294 const std::string variable);
301 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
306 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
308 std::vector< std::vector<LibUtilities::PointsType> >
321 const std::string variable,
322 ExpansionMapShPtr &exp);
328 std::string var =
"DefaultVar");
331 const std::string var1,
332 const std::string var2);
336 inline const std::string
GetGeomInfo(std::string parameter);
350 const int nummodes_x,
351 const int nummodes_y,
352 const int nummodes_z);
396 template<
typename ElementType>
460 "Composite not found.");
487 ASSERTL1(domain <
m_domain.size(),
"Request for domain which does not exist");
497 std::string defstr =
"DefaultVar";
509 ASSERTL0(
false,(std::string(
"Expansion field is already set for variable ") + variable).c_str());
526 if(expVec1.get() == expVec2.get())
550 "Parameter " + parameter +
" does not exist.");
572 "Vertex " + boost::lexical_cast<
string>(id)
const std::map< int, boost::shared_ptr< ElementType > > & GetAllElementsOfType() const
Convenience method for ElVis.
std::map< std::string, std::string > GeomInfoMap
void SetExpansions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Sets expansions given field definitions.
boost::shared_ptr< PyrGeom > PyrGeomSharedPtr
#define ASSERTL0(condition, msg)
const std::vector< CompositeMap > & GetDomain(void) const
LibUtilities::ShapeType m_shapeType
LibUtilities::SessionReaderSharedPtr m_session
int GetSpaceDimension() const
Dimension of the space (can be a 1D curve in 3D space).
boost::shared_ptr< ElementFaceVector > ElementFaceVectorSharedPtr
CurveMap & GetCurvedFaces()
std::map< int, ExpansionShPtr >::const_iterator ExpansionMapConstIter
const PrismGeomMap & GetAllPrismGeoms() const
void SetExpansionsToPolyOrder(int nmodes)
Reset expansion to have specified polynomial order nmodes.
PrismGeomMap m_prismGeoms
static boost::shared_ptr< MeshGraph > Read(const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
void ReadCurves(TiXmlDocument &doc)
std::vector< PointGeomSharedPtr > PointGeomVector
PrismGeomSharedPtr AddPrism(TriGeomSharedPtr tfaces[PrismGeom::kNtfaces], QuadGeomSharedPtr qfaces[PrismGeom::kNqfaces])
CompositeMap m_meshComposites
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
int GetMeshDimension() const
Dimension of the mesh (can be a 1D curve in 3D space).
PointGeomSharedPtr GetVertex(int id)
boost::shared_ptr< InterfaceComponent > SharedInterfaceCompPtr
std::map< int, PrismGeomSharedPtr > PrismGeomMap
std::vector< ElementFaceSharedPtr > ElementFaceVector
bool SameExpansions(const std::string var1, const std::string var2)
const SegGeomMap & GetAllSegGeoms() const
static const int kNtfaces
boost::shared_ptr< HexGeom > HexGeomSharedPtr
PointGeomSharedPtr AddVertex(NekDouble x, NekDouble y, NekDouble z)
Adds a vertex to the with the next available ID.
std::map< int, PyrGeomSharedPtr > PyrGeomMap
Expansion(GeometrySharedPtr geomShPtr, const LibUtilities::BasisKeyVector basiskeyvec)
QuadGeomSharedPtr AddQuadrilateral(SegGeomSharedPtr edges[], StdRegions::Orientation orient[])
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual void ReadGeometry(const std::string &infilename)
Read will read the meshgraph vertices given a filename.
boost::shared_ptr< Curve > CurveSharedPtr
const ExpansionMap & GetExpansions()
static LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionType(GeometrySharedPtr in, ExpansionType type, const int order)
std::map< int, TetGeomSharedPtr > TetGeomMap
bool CheckForGeomInfo(std::string parameter)
std::map< int, TriGeomSharedPtr > TriGeomMap
const PyrGeomMap & GetAllPyrGeoms() const
TriGeomSharedPtr AddTriangle(SegGeomSharedPtr edges[], StdRegions::Orientation orient[])
DomainRangeShPtr m_domainRange
boost::shared_ptr< ElementEdge > ElementEdgeSharedPtr
void WriteGeometry(std::string &outfilename)
Write out an XML file containing the GEOMETRY block representing this MeshGraph instance inside a NEK...
std::map< int, PointGeomSharedPtr > PointGeomMap
GeometrySharedPtr m_Element
GeometrySharedPtr GetCompositeItem(int whichComposite, int whichItem)
boost::shared_ptr< ExpansionMap > ExpansionMapShPtr
SegGeomSharedPtr AddEdge(PointGeomSharedPtr v0, PointGeomSharedPtr v1, CurveSharedPtr curveDefinition=CurveSharedPtr())
Adds an edge between two points. If curveDefinition is null, then the edge is straight, otherwise it is curved according to the curveDefinition.
static const int kNqfaces
Composite GetComposite(int whichComposite) const
boost::shared_ptr< SegGeom > SegGeomSharedPtr
std::map< std::string, ExpansionMapShPtr >::iterator ExpansionMapShPtrMapIter
const HexGeomMap & GetAllHexGeoms() const
CurveMap & GetCurvedEdges()
std::map< int, Composite >::const_iterator CompositeMapConstIter
std::map< int, SegGeomSharedPtr > SegGeomMap
boost::shared_ptr< DomainRange > DomainRangeShPtr
PyrGeomSharedPtr AddPyramid(TriGeomSharedPtr tfaces[PyrGeom::kNtfaces], QuadGeomSharedPtr qfaces[PyrGeom::kNqfaces])
std::map< int, Composite >::iterator CompositeMapIter
GeometrySharedPtr m_geomShPtr
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::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
std::map< std::string, ExpansionMapShPtr > ExpansionMapShPtrMap
boost::shared_ptr< GeometryVector > Composite
static const NekDouble kNekUnsetDouble
boost::shared_ptr< ElementFace > ElementFaceSharedPtr
std::map< int, Composite > CompositeMap
const std::string GetGeomInfo(std::string parameter)
const PointGeomMap & GetVertSet() const
static const int kNtfaces
SegGeomSharedPtr GetEdge(unsigned int id)
const QuadGeomMap & GetAllQuadGeoms() const
boost::shared_ptr< ElementEdgeVector > ElementEdgeVectorSharedPtr
void ReadGeometryInfo(const std::string &infilename)
Read geometric information from a file.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
std::map< int, QuadGeomSharedPtr > QuadGeomMap
static const int kNqfaces
std::vector< CompositeMap > m_domain
void GetCompositeList(const std::string &compositeStr, CompositeMap &compositeVector) const
static DomainRangeShPtr NullDomainRangeShPtr
boost::shared_ptr< Expansion > ExpansionShPtr
ExpansionMapShPtrMap m_expansionMapShPtrMap
Base class for a spectral/hp element mesh.
std::list< SharedInterfaceCompPtr > InterfaceCompList
void ReadDomain(TiXmlDocument &doc)
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
void SetDomainRange(NekDouble xmin, NekDouble xmax, NekDouble ymin=NekConstants::kNekUnsetDouble, NekDouble ymax=NekConstants::kNekUnsetDouble, NekDouble zmin=NekConstants::kNekUnsetDouble, NekDouble zmax=NekConstants::kNekUnsetDouble)
bool CheckRange(Geometry2D &geom)
Check if goemetry is in range definition if activated.
void SetBasisKey(LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys, std::string var="DefaultVar")
Sets the basis key for all expansions of the given shape.
ExpansionShPtr GetExpansion(GeometrySharedPtr geom, const std::string variable="DefaultVar")
boost::shared_ptr< TetGeom > TetGeomSharedPtr
boost::shared_ptr< TriGeom > TriGeomSharedPtr
HexGeomSharedPtr AddHexahedron(QuadGeomSharedPtr qfaces[HexGeom::kNqfaces])
ExpansionMapShPtr SetUpExpansionMap(void)
void ReadExpansions(const std::string &infilename)
Read the expansions given the XML file path.
boost::unordered_map< int, CurveSharedPtr > CurveMap
static const int kNqfaces
const CompositeMap & GetComposites() const
const std::string kExpansionTypeStr[]
static const int kNtfaces
const TetGeomMap & GetAllTetGeoms() const
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< int, HexGeomSharedPtr > HexGeomMap
boost::shared_ptr< Geometry > GeometrySharedPtr
void SetExpansionsToEvenlySpacedPoints(int npoints=0)
Sets expansions to have equispaced points.
GeometrySharedPtr m_Element
boost::shared_ptr< PointGeom > PointGeomSharedPtr
#define SPATIAL_DOMAINS_EXPORT
LibUtilities::BasisKeyVector m_basisKeyVector
std::map< int, ExpansionShPtr > ExpansionMap
TetGeomSharedPtr AddTetrahedron(TriGeomSharedPtr tfaces[TetGeom::kNtfaces])
InterfaceCompList m_iComps
std::map< int, ExpansionShPtr >::iterator ExpansionMapIter
std::vector< ElementEdgeSharedPtr > ElementEdgeVector
const TriGeomMap & GetAllTriGeoms() const