Nektar++
|
#include <MeshGraph3D.h>
Public Member Functions | |
MeshGraph3D () | |
MeshGraph3D (const LibUtilities::SessionReaderSharedPtr &pSession, const DomainRangeShPtr &rng=NullDomainRangeShPtr) | |
virtual | ~MeshGraph3D () |
void | ReadGeometry (const std::string &infilename) |
Read will read the meshgraph vertices given a filename. More... | |
void | ReadGeometry (TiXmlDocument &doc) |
Read will read the meshgraph vertices given a TiXmlDocument. More... | |
SegGeomSharedPtr | GetSegGeom (int eID) |
Geometry2DSharedPtr | GetGeometry2D (int gID) |
int | GetCoordim (void) |
const TriGeomMap & | GetTrigeoms (void) const |
const QuadGeomMap & | GetQuadgeoms (void) const |
void | GenXGeoFac () |
int | GetNseggeoms () const |
int | GetVidFromElmt (LibUtilities::ShapeType shape, const int vert, const int elmt) const |
int | GetEidFromElmt (LibUtilities::ShapeType shape, const int edge, const int elmt) const |
StdRegions::Orientation | GetEorientFromElmt (LibUtilities::ShapeType shape, const int edge, const int elmt) const |
StdRegions::Orientation | GetCartesianEorientFromElmt (LibUtilities::ShapeType shape, const int edge, const int elmt) const |
int | GetNumComposites (void) |
int | GetNumCompositeItems (int whichComposite) |
ElementFaceVectorSharedPtr | GetElementsFromFace (Geometry2DSharedPtr face) |
Return the elements (shared ptrs) that have this face. More... | |
LibUtilities::BasisKey | GetFaceBasisKey (Geometry2DSharedPtr face, const int flag, const std::string variable="DefaultVar") |
Return the BasisKey corresponding to a face of an element. More... | |
Public Member Functions inherited from Nektar::SpatialDomains::MeshGraph | |
MeshGraph () | |
MeshGraph (unsigned int meshDimension, unsigned int spaceDimension) | |
MeshGraph (const LibUtilities::SessionReaderSharedPtr &pSession, const DomainRangeShPtr &rng=NullDomainRangeShPtr) | |
virtual | ~MeshGraph () |
void | ReadGeometryInfo (const std::string &infilename) |
Read geometric information from a file. More... | |
void | ReadGeometryInfo (TiXmlDocument &doc) |
Read geometric information from an XML document. More... | |
void | ReadExpansions (const std::string &infilename) |
Read the expansions given the XML file path. More... | |
void | ReadExpansions (TiXmlDocument &doc) |
Read the expansions given the XML document reference. More... | |
void | ReadDomain (TiXmlDocument &doc) |
void | ReadCurves (TiXmlDocument &doc) |
void | ReadCurves (std::string &infilename) |
void | WriteGeometry (std::string &outfilename) |
Write out an XML file containing the GEOMETRY block representing this MeshGraph instance inside a NEKTAR tag. More... | |
void | WriteGeometry (TiXmlDocument &doc) |
Populate a TinyXML document with a GEOMETRY tag inside the NEKTAR tag. More... | |
int | GetMeshDimension () const |
Dimension of the mesh (can be a 1D curve in 3D space). More... | |
int | GetSpaceDimension () const |
Dimension of the space (can be a 1D curve in 3D space). More... | |
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. More... | |
bool | CheckRange (Geometry3D &geom) |
Check if goemetry is in range definition if activated. More... | |
Composite | GetComposite (int whichComposite) const |
GeometrySharedPtr | GetCompositeItem (int whichComposite, int whichItem) |
void | GetCompositeList (const std::string &compositeStr, CompositeMap &compositeVector) const |
const CompositeMap & | GetComposites () const |
const map< int, string > & | GetCompositesLabels () const |
Return a map of integers and strings containing the labels of each composite. More... | |
const std::vector< CompositeMap > & | GetDomain (void) const |
const CompositeMap & | GetDomain (int domain) const |
const ExpansionMap & | GetExpansions () |
const ExpansionMap & | GetExpansions (const std::string variable) |
ExpansionShPtr | GetExpansion (GeometrySharedPtr geom, const std::string variable="DefaultVar") |
void | SetExpansions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef) |
Sets expansions given field definitions. More... | |
void | SetExpansions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, std::vector< std::vector< LibUtilities::PointsType > > &pointstype) |
Sets expansions given field definition, quadrature points. More... | |
void | SetExpansionsToEvenlySpacedPoints (int npoints=0) |
Sets expansions to have equispaced points. More... | |
void | SetExpansionsToPolyOrder (int nmodes) |
Reset expansion to have specified polynomial order nmodes. More... | |
void | SetExpansionsToPointOrder (int npts) |
Reset expansion to have specified point order npts. More... | |
void | SetExpansions (const std::string variable, ExpansionMapShPtr &exp) |
This function sets the expansion #exp in map with entry #variable. More... | |
void | SetBasisKey (LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys, std::string var="DefaultVar") |
Sets the basis key for all expansions of the given shape. More... | |
bool | SameExpansions (const std::string var1, const std::string var2) |
bool | CheckForGeomInfo (std::string parameter) |
const std::string | GetGeomInfo (std::string parameter) |
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) |
int | GetNvertices () const |
PointGeomSharedPtr | GetVertex (int id) |
PointGeomSharedPtr | AddVertex (NekDouble x, NekDouble y, NekDouble z) |
Adds a vertex to the with the next available ID. More... | |
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. More... | |
SegGeomSharedPtr | GetEdge (unsigned int id) |
TriGeomSharedPtr | AddTriangle (SegGeomSharedPtr edges[], StdRegions::Orientation orient[]) |
QuadGeomSharedPtr | AddQuadrilateral (SegGeomSharedPtr edges[], StdRegions::Orientation orient[]) |
TetGeomSharedPtr | AddTetrahedron (TriGeomSharedPtr tfaces[TetGeom::kNtfaces]) |
PyrGeomSharedPtr | AddPyramid (TriGeomSharedPtr tfaces[PyrGeom::kNtfaces], QuadGeomSharedPtr qfaces[PyrGeom::kNqfaces]) |
PrismGeomSharedPtr | AddPrism (TriGeomSharedPtr tfaces[PrismGeom::kNtfaces], QuadGeomSharedPtr qfaces[PrismGeom::kNqfaces]) |
HexGeomSharedPtr | AddHexahedron (QuadGeomSharedPtr qfaces[HexGeom::kNqfaces]) |
const PointGeomMap & | GetVertSet () const |
CurveMap & | GetCurvedEdges () |
CurveMap & | GetCurvedFaces () |
const PointGeomMap & | GetAllPointGeoms () const |
const SegGeomMap & | GetAllSegGeoms () const |
const TriGeomMap & | GetAllTriGeoms () const |
const QuadGeomMap & | GetAllQuadGeoms () const |
const TetGeomMap & | GetAllTetGeoms () const |
const PyrGeomMap & | GetAllPyrGeoms () const |
const PrismGeomMap & | GetAllPrismGeoms () const |
const HexGeomMap & | GetAllHexGeoms () const |
template<typename ElementType > | |
const std::map< int, boost::shared_ptr< ElementType > > & | GetAllElementsOfType () const |
Convenience method for ElVis. More... | |
template<> | |
const std::map< int, boost::shared_ptr< SegGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< TriGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< QuadGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< HexGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< PrismGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< TetGeom > > & | GetAllElementsOfType () const |
template<> | |
const std::map< int, boost::shared_ptr< PyrGeom > > & | GetAllElementsOfType () const |
Protected Member Functions | |
void | ReadEdges (TiXmlDocument &doc) |
void | ReadFaces (TiXmlDocument &doc) |
void | ReadElements (TiXmlDocument &doc) |
void | ReadComposites (TiXmlDocument &doc) |
void | ResolveGeomRef (const std::string &prevToken, const std::string &token, Composite &composite) |
Protected Member Functions inherited from Nektar::SpatialDomains::MeshGraph | |
ExpansionMapShPtr | SetUpExpansionMap (void) |
Private Member Functions | |
void | PopulateFaceToElMap (Geometry3DSharedPtr element, int kNfaces) |
Given a 3D geometry object #element, populate the face to element map m_faceToElMap which maps faces to their corresponding element(s). More... | |
Private Attributes | |
boost::unordered_map< int, ElementFaceVectorSharedPtr > | m_faceToElMap |
Definition at line 55 of file MeshGraph3D.h.
Nektar::SpatialDomains::MeshGraph3D::MeshGraph3D | ( | ) |
Definition at line 46 of file MeshGraph3D.cpp.
Nektar::SpatialDomains::MeshGraph3D::MeshGraph3D | ( | const LibUtilities::SessionReaderSharedPtr & | pSession, |
const DomainRangeShPtr & | rng = NullDomainRangeShPtr |
||
) |
Definition at line 50 of file MeshGraph3D.cpp.
References Nektar::SpatialDomains::MeshGraph::ReadExpansions(), and ReadGeometry().
|
virtual |
Definition at line 58 of file MeshGraph3D.cpp.
void Nektar::SpatialDomains::MeshGraph3D::GenXGeoFac | ( | ) |
|
inline |
Definition at line 147 of file MeshGraph3D.h.
References ASSERTL2, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::LibUtilities::eTriangle, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, and Nektar::SpatialDomains::MeshGraph::m_triGeoms.
|
inline |
Definition at line 69 of file MeshGraph3D.h.
References Nektar::SpatialDomains::MeshGraph::GetSpaceDimension().
|
inline |
Definition at line 109 of file MeshGraph3D.h.
References ASSERTL2, Nektar::LibUtilities::eTriangle, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, and Nektar::SpatialDomains::MeshGraph::m_triGeoms.
ElementFaceVectorSharedPtr Nektar::SpatialDomains::MeshGraph3D::GetElementsFromFace | ( | Geometry2DSharedPtr | face | ) |
Return the elements (shared ptrs) that have this face.
Definition at line 1339 of file MeshGraph3D.cpp.
References ASSERTL0, Nektar::iterator, and m_faceToElMap.
Referenced by GetFaceBasisKey().
|
inline |
Definition at line 128 of file MeshGraph3D.h.
References ASSERTL2, Nektar::LibUtilities::eTriangle, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, and Nektar::SpatialDomains::MeshGraph::m_triGeoms.
LibUtilities::BasisKey Nektar::SpatialDomains::MeshGraph3D::GetFaceBasisKey | ( | Geometry2DSharedPtr | face, |
const int | facedir, | ||
const std::string | variable = "DefaultVar" |
||
) |
Return the BasisKey corresponding to a face of an element.
Retrieve the basis key for a given face direction.
Definition at line 1353 of file MeshGraph3D.cpp.
References ASSERTL0, Nektar::StdRegions::EvaluateQuadFaceBasisKey(), Nektar::StdRegions::EvaluateTriFaceBasisKey(), Nektar::SpatialDomains::Geometry3D::GetDir(), GetElementsFromFace(), Nektar::SpatialDomains::MeshGraph::GetExpansion(), and Nektar::LibUtilities::NullBasisKey().
Geometry2DSharedPtr Nektar::SpatialDomains::MeshGraph3D::GetGeometry2D | ( | int | gID | ) |
Definition at line 1086 of file MeshGraph3D.cpp.
References Nektar::SpatialDomains::MeshGraph::m_quadGeoms, and Nektar::SpatialDomains::MeshGraph::m_triGeoms.
Referenced by ReadElements(), and ResolveGeomRef().
|
inline |
Definition at line 85 of file MeshGraph3D.h.
References Nektar::SpatialDomains::MeshGraph::m_segGeoms.
|
inline |
Definition at line 186 of file MeshGraph3D.h.
References ErrorUtil::efatal, Nektar::SpatialDomains::MeshGraph::m_meshComposites, and NEKERROR.
|
inline |
Definition at line 181 of file MeshGraph3D.h.
References Nektar::SpatialDomains::MeshGraph::m_meshComposites.
|
inline |
Definition at line 78 of file MeshGraph3D.h.
References Nektar::SpatialDomains::MeshGraph::m_quadGeoms.
SegGeomSharedPtr Nektar::SpatialDomains::MeshGraph3D::GetSegGeom | ( | int | eID | ) |
Definition at line 1077 of file MeshGraph3D.cpp.
References ASSERTL0, Nektar::iterator, and Nektar::SpatialDomains::MeshGraph::m_segGeoms.
Referenced by ReadFaces().
|
inline |
Definition at line 73 of file MeshGraph3D.h.
References Nektar::SpatialDomains::MeshGraph::m_triGeoms.
|
inline |
Definition at line 90 of file MeshGraph3D.h.
References ASSERTL2, Nektar::LibUtilities::eTriangle, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, and Nektar::SpatialDomains::MeshGraph::m_triGeoms.
|
private |
Given a 3D geometry object #element, populate the face to element map m_faceToElMap which maps faces to their corresponding element(s).
element | Element to process. |
kNfaces | Number of faces of #element. Should be removed and put into Geometry3D as a virtual member function. |
Definition at line 1417 of file MeshGraph3D.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::iterator, and m_faceToElMap.
Referenced by ReadElements().
|
protected |
We know we have it since we made it this far.
Look for elements in ELEMENT block.
All elements are of the form: "<C ID = "N"> ... </C>".
Read the ID field first.
Parse out the element components corresponding to type of element.
Keep looking
Definition at line 982 of file MeshGraph3D.cpp.
References ASSERTL0, ErrorUtil::efatal, Nektar::SpatialDomains::MeshGraph::m_compositesLabels, Nektar::SpatialDomains::MeshGraph::m_meshComposites, NEKERROR, and ResolveGeomRef().
Referenced by ReadGeometry().
|
protected |
We know we have it since we made it this far.
Look for elements in ELEMENT block.
All elements are of the form: "<E ID="#"> ... </E>", with ? being the element type. Read the ID field first.
Since all edge data is one big text block, we need to accumulate all TINYXML_TEXT data and then parse it. This approach effectively skips all comments or other node types since we only care about the edge list. We cannot handle missing edge numbers as we could with missing element numbers due to the text block format.
Now parse out the edges, three fields at a time.
Definition at line 98 of file MeshGraph3D.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ErrorUtil::efatal, Nektar::LibUtilities::CompressData::GetCompressString(), Nektar::SpatialDomains::MeshGraph::GetVertex(), Nektar::iterator, Nektar::SpatialDomains::MeshGraph::m_curvedEdges, Nektar::SpatialDomains::MeshGraph::m_segGeoms, Nektar::SpatialDomains::MeshGraph::m_spaceDimension, NEKERROR, and Nektar::LibUtilities::CompressData::ZlibDecodeFromBase64Str().
Referenced by ReadGeometry().
|
protected |
We know we have it since we made it this far.
Look for elements in ELEMENT block.
All elements are of the form: "<? ID="#"> ... </?>", with ? being the element type.
Read id attribute.
Read text element description.
Parse out the element components corresponding to type of element.
Create arrays for the tri and quad faces.
Fill the arrays and make sure there aren't too many faces.
Make sure all of the face indicies could be read, and that there weren't too few.
Create arrays for the tri and quad faces.
Fill the arrays and make sure there aren't too many faces.
Make sure all of the face indicies could be read, and that there weren't too few.
Create arrays for the tri and quad faces.
Fill the arrays and make sure there aren't too many faces.
Make sure all of the face indicies could be read, and that there weren't too few.
Create arrays for the tri and quad faces.
Fill the arrays and make sure there aren't too many faces.
Make sure all of the face indicies could be read, and that there weren't too few.
Keep looking
Definition at line 507 of file MeshGraph3D.cpp.
References ASSERTL0, ErrorUtil::efatal, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTriangle, Nektar::LibUtilities::CompressData::GetCompressString(), GetGeometry2D(), Nektar::SpatialDomains::PyrGeom::kNfaces, Nektar::SpatialDomains::TetGeom::kNfaces, Nektar::SpatialDomains::PrismGeom::kNfaces, Nektar::SpatialDomains::HexGeom::kNfaces, Nektar::SpatialDomains::PyrGeom::kNqfaces, Nektar::SpatialDomains::TetGeom::kNqfaces, Nektar::SpatialDomains::PrismGeom::kNqfaces, Nektar::SpatialDomains::HexGeom::kNqfaces, Nektar::SpatialDomains::PyrGeom::kNtfaces, Nektar::SpatialDomains::TetGeom::kNtfaces, Nektar::SpatialDomains::PrismGeom::kNtfaces, Nektar::SpatialDomains::HexGeom::kNtfaces, Nektar::SpatialDomains::MeshGraph::m_hexGeoms, Nektar::SpatialDomains::MeshGraph::m_prismGeoms, Nektar::SpatialDomains::MeshGraph::m_pyrGeoms, Nektar::SpatialDomains::MeshGraph::m_tetGeoms, NEKERROR, PopulateFaceToElMap(), and Nektar::LibUtilities::CompressData::ZlibDecodeFromBase64Str().
Referenced by ReadGeometry().
|
protected |
We know we have it since we made it this far.
Look for elements in FACE block.
All faces are of the form: "<? ID="#"> ... </?>", with ? being an element type (either Q or T). They might be in compressed format and so then need upacking.
See if this face has curves.
Create a TriGeom to hold the new definition.
See if this face has curves.
Create a QuadGeom to hold the new definition.
Read id attribute.
See if this face has curves.
Read text element description.
Parse out the element components corresponding to type of element.
Create a TriGeom to hold the new definition.
Create a QuadGeom to hold the new definition.
Keep looking
Definition at line 234 of file MeshGraph3D.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ErrorUtil::efatal, Nektar::LibUtilities::CompressData::GetCompressString(), Nektar::SpatialDomains::SegGeom::GetEdgeOrientation(), GetSegGeom(), Nektar::iterator, Nektar::SpatialDomains::TriGeom::kNedges, Nektar::SpatialDomains::QuadGeom::kNedges, Nektar::SpatialDomains::MeshGraph::m_curvedEdges, Nektar::SpatialDomains::MeshGraph::m_curvedFaces, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, Nektar::SpatialDomains::MeshGraph::m_triGeoms, NEKERROR, and Nektar::LibUtilities::CompressData::ZlibDecodeFromBase64Str().
Referenced by ReadGeometry().
|
virtual |
Read will read the meshgraph vertices given a filename.
Reimplemented from Nektar::SpatialDomains::MeshGraph.
Definition at line 62 of file MeshGraph3D.cpp.
References ASSERTL0.
Referenced by MeshGraph3D().
|
virtual |
Read will read the meshgraph vertices given a TiXmlDocument.
Look for all geometry related data in GEOMETRY block.
Error value returned by TinyXML.
Reimplemented from Nektar::SpatialDomains::MeshGraph.
Definition at line 77 of file MeshGraph3D.cpp.
References ASSERTL0, ReadComposites(), Nektar::SpatialDomains::MeshGraph::ReadCurves(), Nektar::SpatialDomains::MeshGraph::ReadDomain(), ReadEdges(), ReadElements(), ReadFaces(), and Nektar::SpatialDomains::MeshGraph::ReadGeometry().
|
protected |
Definition at line 1108 of file MeshGraph3D.cpp.
References ASSERTL0, Nektar::SpatialDomains::MeshGraph::CheckRange(), ErrorUtil::efatal, ErrorUtil::ewarning, Nektar::ParseUtils::GenerateSeqVector(), GetGeometry2D(), Nektar::iterator, Nektar::SpatialDomains::MeshGraph::m_hexGeoms, Nektar::SpatialDomains::MeshGraph::m_prismGeoms, Nektar::SpatialDomains::MeshGraph::m_pyrGeoms, Nektar::SpatialDomains::MeshGraph::m_quadGeoms, Nektar::SpatialDomains::MeshGraph::m_segGeoms, Nektar::SpatialDomains::MeshGraph::m_tetGeoms, Nektar::SpatialDomains::MeshGraph::m_triGeoms, Nektar::SpatialDomains::MeshGraph::m_vertSet, and NEKERROR.
Referenced by ReadComposites().
|
private |
Definition at line 220 of file MeshGraph3D.h.
Referenced by GetElementsFromFace(), and PopulateFaceToElMap().