51 "Reads Nektar++ xml file.");
69 vector<string> filename;
70 filename.push_back(
m_config[
"infile"].as<string>());
77 m_mesh->m_expDim = graph->GetMeshDimension();
78 m_mesh->m_spaceDim = graph->GetSpaceDimension();
81 map<int, NodeSharedPtr> vIdMap;
83 SpatialDomains::PointGeomMap::const_iterator vit;
85 for (vit = vertset.begin(); vit != vertset.end(); ++vit)
89 new Node(vert->GetVid(), (*vert)(0), (*vert)(1), (*vert)(2)));
90 m_mesh->m_vertexSet.insert(n);
91 vIdMap[vert->GetVid()] = n;
94 map<int, EdgeSharedPtr> eIdMap;
96 map<int, FaceSharedPtr> fIdMap;
104 pair<EdgeSet::iterator, bool> testIns;
107 for (it = tmp.begin(); it != tmp.end(); ++it)
109 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
111 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
115 vector<NodeSharedPtr>
curve;
116 int id0 = it->second->GetVid(0);
117 int id1 = it->second->GetVid(1);
119 it->second->GetPointsKeys()[0].GetPointsType();
123 testIns =
m_mesh->m_edgeSet.insert(ed);
124 (*(testIns.first))->m_id = it->second->GetEid();
125 eIdMap[it->second->GetEid()] = ed;
134 pair<FaceSet::iterator, bool> testIns;
137 for (it = tmp.begin(); it != tmp.end(); ++it)
139 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
141 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
144 vector<NodeSharedPtr> faceVertices;
145 vector<EdgeSharedPtr> faceEdges;
146 vector<NodeSharedPtr> faceNodes;
148 for (
int i = 0; i < 3; ++i)
150 faceVertices.push_back(vIdMap[it->second->GetVid(i)]);
151 faceEdges.push_back(eIdMap[it->second->GetEid(i)]);
159 testIns =
m_mesh->m_faceSet.insert(fac);
160 (*(testIns.first))->m_id = it->second->GetFid();
161 fIdMap[it->second->GetFid()] = fac;
167 for (it2 = tmp3.begin(); it2 != tmp3.end(); ++it2)
169 pair<int, SpatialDomains::GeometrySharedPtr> tmp2(
171 boost::dynamic_pointer_cast<SpatialDomains::Geometry>(
174 vector<NodeSharedPtr> faceVertices;
175 vector<EdgeSharedPtr> faceEdges;
176 vector<NodeSharedPtr> faceNodes;
178 for (
int i = 0; i < 4; ++i)
180 faceVertices.push_back(vIdMap[it2->second->GetVid(i)]);
181 faceEdges.push_back(eIdMap[it2->second->GetEid(i)]);
189 testIns =
m_mesh->m_faceSet.insert(fac);
190 (*(testIns.first))->m_id = it2->second->GetFid();
191 fIdMap[it2->second->GetFid()] = fac;
201 for (it = curvedEdges.begin(); it != curvedEdges.end(); ++it)
204 int id = curve->m_curveID;
205 ASSERTL1(eIdMap.find(
id) != eIdMap.end(),
"Failed to find curved edge");
207 edg->m_curveType = curve->m_ptype;
208 for (
int j = 0; j < curve->m_points.size() - 2; ++j)
211 (*curve->m_points[j + 1])(0),
212 (*curve->m_points[j + 1])(1),
213 (*curve->m_points[j + 1])(2)));
214 edg->m_edgeNodes.push_back(n);
220 for (it = curvedFaces.begin(); it != curvedFaces.end(); ++it)
223 int id = curve->m_curveID;
224 ASSERTL1(fIdMap.find(
id) != fIdMap.end(),
"Failed to find curved edge");
226 fac->m_curveType = curve->m_ptype;
227 int Ntot = curve->m_points.size();
233 int N = ((int)sqrt(8.0 * Ntot + 1.0) - 1) / 2;
234 for (
int j = 3 + 3 * (N - 2); j < Ntot; ++j)
237 (*curve->m_points[j])(0),
238 (*curve->m_points[j])(1),
239 (*curve->m_points[j])(2)));
240 fac->m_faceNodes.push_back(n);
245 int N = (int)sqrt((
double)Ntot);
247 for (
int j = 1; j < N - 1; ++j)
249 for (
int k = 1; k < N - 1; ++k)
252 (*curve->m_points[j * N + k])(0),
253 (*curve->m_points[j * N + k])(1),
254 (*curve->m_points[j * N + k])(2)));
255 fac->m_faceNodes.push_back(n);
268 for (compIt = GraphComps.begin(); compIt != GraphComps.end(); ++compIt)
271 int dim = (*compIt->second)[0]->GetShapeDim();
274 for (geomIt = (*compIt->second).begin();
275 geomIt != (*compIt->second).end();
278 ElmtConfig conf((*geomIt)->GetShapeType(), 1,
true,
true,
false);
281 vector<NodeSharedPtr> nodeList;
282 for (
int i = 0; i < (*geomIt)->GetNumVerts(); ++i)
284 nodeList.push_back(vIdMap[(*geomIt)->GetVid(i)]);
288 tags.push_back(compIt->first);
291 (*geomIt)->GetShapeType(), conf, nodeList, tags);
293 E->SetId((*geomIt)->GetGlobalID());
294 m_mesh->m_element[dim].push_back(E);
299 E->SetVolumeNodes(edg->m_edgeNodes);
305 for (
int i = 0; i < (*geomIt)->GetNumEdges(); ++i)
310 edg->m_elLink.push_back(pair<ElementSharedPtr, int>(E, i));
316 E->SetVolumeNodes(fac->m_faceNodes);
323 for (
int i = 0; i < (*geomIt)->GetNumFaces(); ++i)
328 fac->m_elLink.push_back(pair<ElementSharedPtr, int>(E, i));
335 m_mesh->m_faceLabels = graph->GetCompositesLabels();
Basic information about an element.
pair< ModuleType, string > ModuleKey
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.
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
ElementFactory & GetElementFactory()
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Represents a point in the domain.
boost::shared_ptr< Curve > CurveSharedPtr
virtual void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
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
std::map< int, SegGeomSharedPtr > SegGeomMap
std::map< int, Composite >::iterator CompositeMapIter
boost::shared_ptr< Node > NodeSharedPtr
virtual void ProcessComposites()
Generate composites.
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 void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
boost::unordered_map< int, CurveSharedPtr > CurveMap
2D Evenly-spaced points on a Triangle
boost::shared_ptr< Element > ElementSharedPtr
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
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.