Nektar++
MeshGraphXml.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: MeshGraphXml.h
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: This file contains the base class specification for the
32 // MeshGraphXml class.
33 //
34 //
35 ////////////////////////////////////////////////////////////////////////////////
36 #ifndef NEKTAR_SPATIALDOMAINS_MGXML_H
37 #define NEKTAR_SPATIALDOMAINS_MGXML_H
38 
41 
42 namespace Nektar
43 {
44 namespace SpatialDomains
45 {
46 
47 class MeshGraphXml : public MeshGraph
48 {
49 public:
51  {
52  }
53 
54  virtual ~MeshGraphXml()
55  {
56  }
57 
59  std::string outname, std::vector<std::set<unsigned int>> elements,
60  std::vector<unsigned int> partitions);
61 
63  {
65  }
66 
67  static std::string className;
68 
69 protected:
70  // some of these functions are going to be virtual because they will be
71  // inherited by the XmlCompressed version
72 
74  std::string &outfilename, bool defaultExp = false,
75  const LibUtilities::FieldMetaDataMap &metadata =
78  LibUtilities::DomainRangeShPtr rng, bool fillGraph) override;
80  LibUtilities::SessionReaderSharedPtr session) override;
81 
82  virtual void v_ReadVertices();
83  virtual void v_ReadCurves();
84  void ReadDomain();
85 
86  virtual void v_ReadEdges();
87  virtual void v_ReadFaces();
88 
89  void ReadElements();
90  void ReadComposites();
91 
92  virtual void v_ReadElements1D();
93  virtual void v_ReadElements2D();
94  virtual void v_ReadElements3D();
95 
96  void ResolveGeomRef(const std::string &prevToken, const std::string &token,
97  CompositeSharedPtr &composite);
98  void ResolveGeomRef1D(const std::string &prevToken,
99  const std::string &token,
100  CompositeSharedPtr &composite);
101  void ResolveGeomRef2D(const std::string &prevToken,
102  const std::string &token,
103  CompositeSharedPtr &composite);
104  void ResolveGeomRef3D(const std::string &prevToken,
105  const std::string &token,
106  CompositeSharedPtr &composite);
107 
108  virtual void v_WriteVertices(TiXmlElement *geomTag, PointGeomMap &verts);
109  virtual void v_WriteEdges(TiXmlElement *geomTag, SegGeomMap &edges);
110  virtual void v_WriteTris(TiXmlElement *faceTag, TriGeomMap &tris);
111  virtual void v_WriteQuads(TiXmlElement *faceTag, QuadGeomMap &quads);
112  virtual void v_WriteHexs(TiXmlElement *elmtTag, HexGeomMap &hexs);
113  virtual void v_WritePrisms(TiXmlElement *elmtTag, PrismGeomMap &pris);
114  virtual void v_WritePyrs(TiXmlElement *elmtTag, PyrGeomMap &pyrs);
115  virtual void v_WriteTets(TiXmlElement *elmtTag, TetGeomMap &tets);
116  virtual void v_WriteCurves(TiXmlElement *geomTag, CurveMap &edges,
117  CurveMap &faces);
118  void WriteComposites(TiXmlElement *geomTag, CompositeMap &comps,
119  std::map<int, std::string> &compLabels);
120  void WriteDomain(TiXmlElement *geomTag,
121  std::map<int, CompositeMap> &domain);
122  void WriteDefaultExpansion(TiXmlElement *root);
123 
125 };
126 
127 } // namespace SpatialDomains
128 } // namespace Nektar
129 
130 #endif
#define SPATIAL_DOMAINS_EXPORT
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:180
void ResolveGeomRef1D(const std::string &prevToken, const std::string &token, CompositeSharedPtr &composite)
void WriteDefaultExpansion(TiXmlElement *root)
virtual void v_WriteQuads(TiXmlElement *faceTag, QuadGeomMap &quads)
virtual void v_WritePyrs(TiXmlElement *elmtTag, PyrGeomMap &pyrs)
virtual void v_WriteGeometry(std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap) override
Write out an XML file containing the GEOMETRY block representing this MeshGraph instance inside a NEK...
virtual void v_WriteTris(TiXmlElement *faceTag, TriGeomMap &tris)
virtual void v_WriteVertices(TiXmlElement *geomTag, PointGeomMap &verts)
static MeshGraphSharedPtr create()
Definition: MeshGraphXml.h:62
virtual void v_ReadGeometry(LibUtilities::DomainRangeShPtr rng, bool fillGraph) override
void ResolveGeomRef(const std::string &prevToken, const std::string &token, CompositeSharedPtr &composite)
void ResolveGeomRef3D(const std::string &prevToken, const std::string &token, CompositeSharedPtr &composite)
CompositeOrdering CreateCompositeOrdering()
virtual void v_WriteHexs(TiXmlElement *elmtTag, HexGeomMap &hexs)
virtual void v_WritePrisms(TiXmlElement *elmtTag, PrismGeomMap &pris)
virtual void v_WriteEdges(TiXmlElement *geomTag, SegGeomMap &edges)
void ResolveGeomRef2D(const std::string &prevToken, const std::string &token, CompositeSharedPtr &composite)
virtual void v_WriteTets(TiXmlElement *elmtTag, TetGeomMap &tets)
void WriteDomain(TiXmlElement *geomTag, std::map< int, CompositeMap > &domain)
virtual void v_PartitionMesh(LibUtilities::SessionReaderSharedPtr session) override
void WriteXMLGeometry(std::string outname, std::vector< std::set< unsigned int >> elements, std::vector< unsigned int > partitions)
void WriteComposites(TiXmlElement *geomTag, CompositeMap &comps, std::map< int, std::string > &compLabels)
virtual void v_WriteCurves(TiXmlElement *geomTag, CurveMap &edges, CurveMap &faces)
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:52
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:53
std::shared_ptr< DomainRange > DomainRangeShPtr
Definition: DomainRange.h:66
std::map< int, TriGeomSharedPtr > TriGeomMap
Definition: TriGeom.h:59
std::map< int, std::vector< unsigned int > > CompositeOrdering
Definition: MeshGraph.h:109
std::map< int, PyrGeomSharedPtr > PyrGeomMap
Definition: PyrGeom.h:78
std::map< int, QuadGeomSharedPtr > QuadGeomMap
Definition: QuadGeom.h:54
std::shared_ptr< Composite > CompositeSharedPtr
Definition: MeshGraph.h:137
std::map< int, SegGeomSharedPtr > SegGeomMap
Definition: SegGeom.h:52
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:61
std::map< int, TetGeomSharedPtr > TetGeomMap
Definition: TetGeom.h:87
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
std::map< int, PrismGeomSharedPtr > PrismGeomMap
Definition: PrismGeom.h:86
std::map< int, HexGeomSharedPtr > HexGeomMap
Definition: HexGeom.h:88
std::map< int, PointGeomSharedPtr > PointGeomMap
Definition: PointGeom.h:54
std::map< int, CompositeSharedPtr > CompositeMap
Definition: MeshGraph.h:138
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2