35 #ifndef NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
36 #define NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
38 #include <boost/unordered_map.hpp>
59 namespace SpatialDomains
192 unsigned int meshDimension,
193 unsigned int spaceDimension);
197 const DomainRangeShPtr &rng = NullDomainRangeShPtr);
206 DomainRangeShPtr &rng = NullDomainRangeShPtr);
210 const std::string& infilename,
211 bool pReadExpansions =
true);
216 const std::string& infilename);
224 const std::string &infilename);
232 const std::string &infilename);
245 std::string &infilename);
248 std::string &outfilename);
276 inline Composite
GetComposite(
int whichComposite)
const;
283 const std::string &compositeStr,
284 CompositeMap &compositeVector)
const;
289 inline const std::vector<CompositeMap> &
GetDomain(
void)
const;
291 inline const CompositeMap &
GetDomain(
int domain)
const;
298 const std::string variable);
305 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
310 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
312 std::vector< std::vector<LibUtilities::PointsType> >
329 const std::string variable,
330 ExpansionMapShPtr &exp);
336 std::string var =
"DefaultVar");
339 const std::string var1,
340 const std::string var2);
344 inline const std::string
GetGeomInfo(std::string parameter);
358 const int nummodes_x,
359 const int nummodes_y,
360 const int nummodes_z);
405 template<
typename ElementType>
470 "Composite not found.");
507 ASSERTL1(domain <
m_domain.size(),
"Request for domain which does not exist");
517 std::string defstr =
"DefaultVar";
529 ASSERTL0(
false,(std::string(
"Expansion field is already set for variable ") + variable).c_str());
546 if(expVec1.get() == expVec2.get())
570 "Parameter " + parameter +
" does not exist.");
592 "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
const map< int, string > & GetCompositesLabels() const
Return a map of integers and strings containing the labels of each composite.
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
void SetExpansionsToPointOrder(int npts)
Reset expansion to have specified point order npts.
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
const PointGeomMap & GetAllPointGeoms() const
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
map< int, string > m_compositesLabels
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