54 "Reads Nektar++ xml file.");
71 vector<string> filename;
72 filename.push_back(
m_config[
"infile"].as<string>());
79 m_mesh->m_expDim = graph->GetMeshDimension();
80 m_mesh->m_spaceDim = graph->GetSpaceDimension();
83 map<int, NodeSharedPtr> vIdMap;
85 SpatialDomains::PointGeomMap::const_iterator vit;
87 for (vit = vertset.begin(); vit != vertset.end(); ++vit)
91 new Node(vert->GetVid(), (*vert)(0), (*vert)(1), (*vert)(2)));
92 m_mesh->m_vertexSet.insert(n);
93 vIdMap[vert->GetVid()] = n;
96 map<int, EdgeSharedPtr> eIdMap;
98 map<int, FaceSharedPtr> fIdMap;
106 pair<EdgeSet::iterator, bool> testIns;
109 for (it = tmp.begin(); it != tmp.end(); ++it)
111 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
113 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
117 vector<NodeSharedPtr> curve;
118 int id0 = it->second->GetVid(0);
119 int id1 = it->second->GetVid(1);
121 it->second->GetPointsKeys()[0].GetPointsType();
125 testIns =
m_mesh->m_edgeSet.insert(ed);
126 (*(testIns.first))->m_id = it->second->GetEid();
127 eIdMap[it->second->GetEid()] = ed;
136 pair<FaceSet::iterator, bool> testIns;
139 for (it = tmp.begin(); it != tmp.end(); ++it)
141 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
143 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
146 vector<NodeSharedPtr> faceVertices;
147 vector<EdgeSharedPtr> faceEdges;
148 vector<NodeSharedPtr> faceNodes;
150 for (
int i = 0; i < 3; ++i)
152 faceVertices.push_back(vIdMap[it->second->GetVid(i)]);
153 faceEdges.push_back(eIdMap[it->second->GetEid(i)]);
161 testIns =
m_mesh->m_faceSet.insert(fac);
162 (*(testIns.first))->m_id = it->second->GetFid();
163 fIdMap[it->second->GetFid()] = fac;
169 for (it2 = tmp3.begin(); it2 != tmp3.end(); ++it2)
171 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
173 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
176 vector<NodeSharedPtr> faceVertices;
177 vector<EdgeSharedPtr> faceEdges;
178 vector<NodeSharedPtr> faceNodes;
180 for (
int i = 0; i < 4; ++i)
182 faceVertices.push_back(vIdMap[it2->second->GetVid(i)]);
183 faceEdges.push_back(eIdMap[it2->second->GetEid(i)]);
191 testIns =
m_mesh->m_faceSet.insert(fac);
192 (*(testIns.first))->m_id = it2->second->GetFid();
193 fIdMap[it2->second->GetFid()] = fac;
203 for (it = curvedEdges.begin(); it != curvedEdges.end(); ++it)
206 int id = curve->m_curveID;
207 ASSERTL1(eIdMap.find(
id) != eIdMap.end(),
"Failed to find curved edge");
209 edg->m_curveType = curve->m_ptype;
210 for (
int j = 0; j < curve->m_points.size() - 2; ++j)
213 (*curve->m_points[j + 1])(0),
214 (*curve->m_points[j + 1])(1),
215 (*curve->m_points[j + 1])(2)));
216 edg->m_edgeNodes.push_back(n);
222 for (it = curvedFaces.begin(); it != curvedFaces.end(); ++it)
225 int id = curve->m_curveID;
226 ASSERTL1(fIdMap.find(
id) != fIdMap.end(),
"Failed to find curved edge");
228 fac->m_curveType = curve->m_ptype;
229 int Ntot = curve->m_points.size();
235 int N = ((int)sqrt(8.0 * Ntot + 1.0) - 1) / 2;
236 for (
int j = 3 + 3 * (N - 2); j < Ntot; ++j)
239 (*curve->m_points[j])(0),
240 (*curve->m_points[j])(1),
241 (*curve->m_points[j])(2)));
242 fac->m_faceNodes.push_back(n);
247 int N = (int)sqrt((
double)Ntot);
249 for (
int j = 1; j < N - 1; ++j)
251 for (
int k = 1; k < N - 1; ++k)
254 (*curve->m_points[j * N + k])(0),
255 (*curve->m_points[j * N + k])(1),
256 (*curve->m_points[j * N + k])(2)));
257 fac->m_faceNodes.push_back(n);
270 for (compIt = GraphComps.begin(); compIt != GraphComps.end(); ++compIt)
273 int dim = (*compIt->second)[0]->GetShapeDim();
276 for (geomIt = (*compIt->second).begin();
277 geomIt != (*compIt->second).end();
280 ElmtConfig conf((*geomIt)->GetShapeType(), 1,
true,
true,
false);
283 vector<NodeSharedPtr> nodeList;
284 for (
int i = 0; i < (*geomIt)->GetNumVerts(); ++i)
286 nodeList.push_back(vIdMap[(*geomIt)->GetVid(i)]);
290 tags.push_back(compIt->first);
293 (*geomIt)->GetShapeType(), conf, nodeList, tags);
295 E->SetId((*geomIt)->GetGlobalID());
296 m_mesh->m_element[dim].push_back(E);
301 E->SetVolumeNodes(edg->m_edgeNodes);
307 for (
int i = 0; i < (*geomIt)->GetNumEdges(); ++i)
312 edg->m_elLink.push_back(pair<ElementSharedPtr, int>(E, i));
318 E->SetVolumeNodes(fac->m_faceNodes);
325 for (
int i = 0; i < (*geomIt)->GetNumFaces(); ++i)
330 fac->m_elLink.push_back(pair<ElementSharedPtr, int>(E, i));
337 m_mesh->m_faceLabels = graph->GetCompositesLabels();
Basic information about an element.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Represents an edge which joins two points.
static boost::shared_ptr< MeshGraph > Read(const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
Represents a face comprised of three or more edges.
pair< ModuleType, string > ModuleKey
MeshSharedPtr m_mesh
Mesh object.
ElementFactory & GetElementFactory()
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
boost::shared_ptr< Curve > CurveSharedPtr
std::vector< GeometrySharedPtr >::iterator GeometryVectorIter
std::map< int, TriGeomSharedPtr > TriGeomMap
1D Evenly-spaced points using Lagrange polynomial
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
std::map< int, PointGeomSharedPtr > PointGeomMap
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
std::map< int, SegGeomSharedPtr > SegGeomMap
std::map< int, Composite >::iterator CompositeMapIter
boost::shared_ptr< Node > NodeSharedPtr
std::map< std::string, ConfigOption > m_config
List of configuration values.
std::map< int, Composite > CompositeMap
2D Nodal Fekete Points on a Triangle
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
std::map< int, QuadGeomSharedPtr > QuadGeomMap
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
boost::unordered_map< int, CurveSharedPtr > CurveMap
2D Evenly-spaced points on a Triangle
boost::shared_ptr< Element > ElementSharedPtr
boost::shared_ptr< Face > FaceSharedPtr
std::pair< ModuleType, std::string > ModuleKey
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
boost::shared_ptr< PointGeom > PointGeomSharedPtr
2D Nodal Electrostatic Points on a Triangle
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.