Nektar++
Public Member Functions | List of all members
Nektar::SpatialDomains::MeshGraph1D Class Reference

#include <MeshGraph1D.h>

Inheritance diagram for Nektar::SpatialDomains::MeshGraph1D:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SpatialDomains::MeshGraph1D:
Collaboration graph
[legend]

Public Member Functions

 MeshGraph1D ()
 
 MeshGraph1D (const LibUtilities::SessionReaderSharedPtr &pSession, const DomainRangeShPtr &rng=NullDomainRangeShPtr)
 
virtual ~MeshGraph1D ()
 
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...
 
void ReadElements (TiXmlDocument &doc)
 
void ReadComposites (TiXmlDocument &doc)
 
void ResolveGeomRef (const std::string &prevToken, const std::string &token, Composite &composite)
 
int GetCoordim (void)
 
const SegGeomMapGetSeggeoms (void) const
 
int GetVidFromElmt (const int vert, const int elmt) const
 
- 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 CompositeMapGetComposites () const
 
const std::vector< CompositeMap > & GetDomain (void) const
 
const CompositeMapGetDomain (int domain) const
 
const ExpansionMapGetExpansions ()
 
const ExpansionMapGetExpansions (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 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 PointGeomMapGetVertSet () const
 
CurveMapGetCurvedEdges ()
 
CurveMapGetCurvedFaces ()
 
const SegGeomMapGetAllSegGeoms () const
 
const TriGeomMapGetAllTriGeoms () const
 
const QuadGeomMapGetAllQuadGeoms () const
 
const TetGeomMapGetAllTetGeoms () const
 
const PyrGeomMapGetAllPyrGeoms () const
 
const PrismGeomMapGetAllPrismGeoms () const
 
const HexGeomMapGetAllHexGeoms () 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< 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Nektar::SpatialDomains::MeshGraph
static boost::shared_ptr< MeshGraphRead (const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
 
static boost::shared_ptr< MeshGraphRead (const std::string &infilename, bool pReadExpansions=true)
 
static LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionType (GeometrySharedPtr in, ExpansionType type, const int order)
 
- Protected Member Functions inherited from Nektar::SpatialDomains::MeshGraph
ExpansionMapShPtr SetUpExpansionMap (void)
 
- Protected Attributes inherited from Nektar::SpatialDomains::MeshGraph
LibUtilities::SessionReaderSharedPtr m_session
 
PointGeomMap m_vertSet
 
InterfaceCompList m_iComps
 
CurveMap m_curvedEdges
 
CurveMap m_curvedFaces
 
SegGeomMap m_segGeoms
 
TriGeomMap m_triGeoms
 
QuadGeomMap m_quadGeoms
 
TetGeomMap m_tetGeoms
 
PyrGeomMap m_pyrGeoms
 
PrismGeomMap m_prismGeoms
 
HexGeomMap m_hexGeoms
 
int m_meshDimension
 
int m_spaceDimension
 
int m_partition
 
bool m_meshPartitioned
 
CompositeMap m_meshComposites
 
std::vector< CompositeMapm_domain
 
DomainRangeShPtr m_domainRange
 
ExpansionMapShPtrMap m_expansionMapShPtrMap
 
GeomInfoMap m_geomInfo
 

Detailed Description

Definition at line 47 of file MeshGraph1D.h.

Constructor & Destructor Documentation

Nektar::SpatialDomains::MeshGraph1D::MeshGraph1D ( )

Definition at line 46 of file MeshGraph1D.cpp.

47  {
48  }
Nektar::SpatialDomains::MeshGraph1D::MeshGraph1D ( const LibUtilities::SessionReaderSharedPtr pSession,
const DomainRangeShPtr rng = NullDomainRangeShPtr 
)

Definition at line 50 of file MeshGraph1D.cpp.

References Nektar::SpatialDomains::MeshGraph::ReadExpansions(), and ReadGeometry().

52  : MeshGraph(pSession,rng)
53  {
54  ReadGeometry (pSession->GetDocument());
55  ReadExpansions(pSession->GetDocument());
56  }
void ReadGeometry(const std::string &infilename)
Read will read the meshgraph vertices given a filename.
Definition: MeshGraph1D.cpp:63
void ReadExpansions(const std::string &infilename)
Read the expansions given the XML file path.
Definition: MeshGraph.cpp:525
Nektar::SpatialDomains::MeshGraph1D::~MeshGraph1D ( )
virtual

Definition at line 58 of file MeshGraph1D.cpp.

59  {
60  }

Member Function Documentation

int Nektar::SpatialDomains::MeshGraph1D::GetCoordim ( void  )
inline

Definition at line 62 of file MeshGraph1D.h.

References Nektar::SpatialDomains::MeshGraph::GetSpaceDimension().

63  {
64  return GetSpaceDimension();
65  }
int GetSpaceDimension() const
Dimension of the space (can be a 1D curve in 3D space).
Definition: MeshGraph.h:447
const SegGeomMap& Nektar::SpatialDomains::MeshGraph1D::GetSeggeoms ( void  ) const
inline

Definition at line 67 of file MeshGraph1D.h.

References Nektar::SpatialDomains::MeshGraph::m_segGeoms.

68  {
69  return m_segGeoms;
70  }
int Nektar::SpatialDomains::MeshGraph1D::GetVidFromElmt ( const int  vert,
const int  elmt 
) const
inline

Definition at line 72 of file MeshGraph1D.h.

References ASSERTL2, and Nektar::SpatialDomains::MeshGraph::m_segGeoms.

73  {
74  ASSERTL2((elmt >=0)&&(elmt < m_segGeoms.size()),
75  "eid is out of range");
76 
77  //return m_segGeoms[elmt]->GetVid(vert);
78  return m_segGeoms.find(elmt)->second->GetVid(vert);
79  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
void Nektar::SpatialDomains::MeshGraph1D::ReadComposites ( TiXmlDocument &  doc)

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.

Parse out the element components corresponding to type of element.

Keep looking for additional composite definitions.

Definition at line 170 of file MeshGraph1D.cpp.

References ASSERTL0, ErrorUtil::efatal, Nektar::SpatialDomains::MeshGraph::m_meshComposites, NEKERROR, and ResolveGeomRef().

Referenced by ReadGeometry().

171  {
172  TiXmlHandle docHandle(&doc);
173 
174  /// We know we have it since we made it this far.
175  TiXmlElement* mesh = docHandle.FirstChildElement("NEKTAR").FirstChildElement("GEOMETRY").Element();
176  TiXmlElement* field = NULL;
177 
178  ASSERTL0(mesh, "Unable to find GEOMETRY tag in file.");
179 
180  /// Look for elements in ELEMENT block.
181  field = mesh->FirstChildElement("COMPOSITE");
182 
183  ASSERTL0(field, "Unable to find COMPOSITE tag in file.");
184 
185  TiXmlElement *node = field->FirstChildElement("C");
186 
187  // Sequential counter for the composite numbers.
188  int nextCompositeNumber = -1;
189 
190  while (node)
191  {
192  /// All elements are of the form: "<? ID="#"> ... </?>", with
193  /// ? being the element type.
194 
195  nextCompositeNumber++;
196 
197  int indx;
198  int err = node->QueryIntAttribute("ID", &indx);
199  ASSERTL0(err == TIXML_SUCCESS, "Unable to read attribute ID.");
200  //ASSERTL0(indx == nextCompositeNumber, "Composite IDs must begin with zero and be sequential.");
201 
202  TiXmlNode* compositeChild = node->FirstChild();
203  // This is primarily to skip comments that may be present.
204  // Comments appear as nodes just like elements.
205  // We are specifically looking for text in the body
206  // of the definition.
207  while(compositeChild && compositeChild->Type() != TiXmlNode::TINYXML_TEXT)
208  {
209  compositeChild = compositeChild->NextSibling();
210  }
211 
212  ASSERTL0(compositeChild, "Unable to read composite definition body.");
213  std::string compositeStr = compositeChild->ToText()->ValueStr();
214 
215  /// Parse out the element components corresponding to type of element.
216 
217  std::istringstream compositeDataStrm(compositeStr.c_str());
218 
219  try
220  {
221  bool first = true;
222  std::string prevCompositeElementStr;
223 
224  while (!compositeDataStrm.fail())
225  {
226  std::string compositeElementStr;
227  compositeDataStrm >> compositeElementStr;
228 
229  if (!compositeDataStrm.fail())
230  {
231  if (first)
232  {
233  first = false;
234 
235  Composite curVector = MemoryManager<std::vector<GeometrySharedPtr> >::AllocateSharedPtr();
236  m_meshComposites[indx] = curVector;
237  }
238 
239  if (compositeElementStr.length() > 0)
240  {
241  ResolveGeomRef(prevCompositeElementStr, compositeElementStr, m_meshComposites[indx]);
242  }
243  prevCompositeElementStr = compositeElementStr;
244  }
245  }
246  }
247  catch(...)
248  {
250  (std::string("Unable to read COMPOSITE data for composite: ") + compositeStr).c_str());
251  }
252 
253  /// Keep looking for additional composite definitions.
254  node = node->NextSiblingElement("C");
255  }
256 
257  ASSERTL0(nextCompositeNumber >= 0, "At least one composite must be specified.");
258  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
void ResolveGeomRef(const std::string &prevToken, const std::string &token, Composite &composite)
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:111
void Nektar::SpatialDomains::MeshGraph1D::ReadElements ( TiXmlDocument &  doc)

We know we have it since we made it this far.

Look for elements in ELEMENT block.

All elements are of the form: "<S ID = n> ... </S>", with ? being the element type.

Parse out the element components corresponding to type of element. Read two vertex numbers

Keep looking for additional segments

Definition at line 97 of file MeshGraph1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ErrorUtil::efatal, Nektar::SpatialDomains::MeshGraph::GetVertex(), Nektar::iterator, Nektar::SpatialDomains::MeshGraph::m_curvedEdges, Nektar::SpatialDomains::MeshGraph::m_segGeoms, Nektar::SpatialDomains::MeshGraph::m_spaceDimension, and NEKERROR.

Referenced by ReadGeometry().

98  {
99  /// We know we have it since we made it this far.
100  TiXmlHandle docHandle(&doc);
101  TiXmlElement* mesh = docHandle.FirstChildElement("NEKTAR").FirstChildElement("GEOMETRY").Element();
102  TiXmlElement* field = NULL;
103 
104  /// Look for elements in ELEMENT block.
105  field = mesh->FirstChildElement("ELEMENT");
106 
107  ASSERTL0(field, "Unable to find ELEMENT tag in file.");
108 
109  /// All elements are of the form: "<S ID = n> ... </S>", with
110  /// ? being the element type.
111 
112  TiXmlElement *segment = field->FirstChildElement("S");
114 
115  while (segment)
116  {
117  int indx;
118  int err = segment->QueryIntAttribute("ID", &indx);
119  ASSERTL0(err == TIXML_SUCCESS, "Unable to read element attribute ID.");
120 
121  TiXmlNode* elementChild = segment->FirstChild();
122  while(elementChild && elementChild->Type() != TiXmlNode::TINYXML_TEXT)
123  {
124  elementChild = elementChild->NextSibling();
125  }
126 
127  ASSERTL0(elementChild, "Unable to read element description body.");
128  std::string elementStr = elementChild->ToText()->ValueStr();
129 
130  /// Parse out the element components corresponding to type of element.
131  /// Read two vertex numbers
132  int vertex1, vertex2;
133  std::istringstream elementDataStrm(elementStr.c_str());
134 
135  try
136  {
137  elementDataStrm >> vertex1;
138  elementDataStrm >> vertex2;
139 
140  ASSERTL0(!elementDataStrm.fail(), (std::string("Unable to read element data for SEGMENT: ") + elementStr).c_str());
141 
142  PointGeomSharedPtr vertices[2] = {GetVertex(vertex1), GetVertex(vertex2)};
143  SegGeomSharedPtr seg;
144  it = m_curvedEdges.find(indx);
145 
146  if (it == m_curvedEdges.end())
147  {
149  seg->SetGlobalID(indx); // Set global mesh id
150  }
151  else
152  {
153  seg = MemoryManager<SegGeom>::AllocateSharedPtr(indx, m_spaceDimension, vertices, it->second);
154  seg->SetGlobalID(indx); //Set global mesh id
155  }
156  seg->SetGlobalID(indx);
157  m_segGeoms[indx] = seg;
158  }
159  catch(...)
160  {
162  (std::string("Unable to read element data for segment: ") + elementStr).c_str());
163  }
164 
165  /// Keep looking for additional segments
166  segment = segment->NextSiblingElement("S");
167  }
168  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
PointGeomSharedPtr GetVertex(int id)
Definition: MeshGraph.h:567
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
void Nektar::SpatialDomains::MeshGraph1D::ReadGeometry ( const std::string &  infilename)
virtual

Read will read the meshgraph vertices given a filename.

Reimplemented from Nektar::SpatialDomains::MeshGraph.

Definition at line 63 of file MeshGraph1D.cpp.

References ASSERTL0.

Referenced by MeshGraph1D().

64  {
65  TiXmlDocument doc(infilename);
66 
67  bool loadOkay = doc.LoadFile();
68  std::stringstream errstr;
69  errstr << "Unable to load file: " << infilename << "\n";
70  errstr << doc.ErrorDesc() << " (Line " << doc.ErrorRow()
71  << ", Column " << doc.ErrorCol() << ")";
72  ASSERTL0(loadOkay, errstr.str());
73 
74  ReadGeometry(doc);
75  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
void ReadGeometry(const std::string &infilename)
Read will read the meshgraph vertices given a filename.
Definition: MeshGraph1D.cpp:63
void Nektar::SpatialDomains::MeshGraph1D::ReadGeometry ( TiXmlDocument &  doc)
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 78 of file MeshGraph1D.cpp.

References ASSERTL0, ReadComposites(), Nektar::SpatialDomains::MeshGraph::ReadCurves(), Nektar::SpatialDomains::MeshGraph::ReadDomain(), ReadElements(), and Nektar::SpatialDomains::MeshGraph::ReadGeometry().

79  {
80  // Read mesh first
82  TiXmlHandle docHandle(&doc);
83 
84  TiXmlElement* mesh = NULL;
85 
86  /// Look for all geometry related data in GEOMETRY block.
87  mesh = docHandle.FirstChildElement("NEKTAR").FirstChildElement("GEOMETRY").Element();
88 
89  ASSERTL0(mesh, "Unable to find GEOMETRY tag in file.");
90 
91  ReadCurves(doc);
92  ReadElements(doc);
93  ReadComposites(doc);
94  ReadDomain(doc);
95  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
void ReadCurves(TiXmlDocument &doc)
Definition: MeshGraph.cpp:1103
virtual void ReadGeometry(const std::string &infilename)
Read will read the meshgraph vertices given a filename.
Definition: MeshGraph.cpp:230
void ReadElements(TiXmlDocument &doc)
Definition: MeshGraph1D.cpp:97
void ReadDomain(TiXmlDocument &doc)
Definition: MeshGraph.cpp:1009
void ReadComposites(TiXmlDocument &doc)
void Nektar::SpatialDomains::MeshGraph1D::ResolveGeomRef ( const std::string &  prevToken,
const std::string &  token,
Composite composite 
)

Definition at line 265 of file MeshGraph1D.cpp.

References ASSERTL0, ErrorUtil::efatal, ErrorUtil::ewarning, Nektar::ParseUtils::GenerateSeqVector(), Nektar::iterator, Nektar::SpatialDomains::MeshGraph::m_segGeoms, Nektar::SpatialDomains::MeshGraph::m_vertSet, and NEKERROR.

Referenced by ReadComposites().

267  {
268  try
269  {
270  std::istringstream tokenStream(token);
271  std::istringstream prevTokenStream(prevToken);
272 
273  char type;
274  char prevType;
275 
276  tokenStream >> type;
277 
278  std::string::size_type indxBeg = token.find_first_of('[') + 1;
279  std::string::size_type indxEnd = token.find_last_of(']') - 1;
280 
281  ASSERTL0(indxBeg <= indxEnd, (std::string("Error reading index definition:") + token).c_str());
282 
283  std::string indxStr = token.substr(indxBeg, indxEnd - indxBeg + 1);
284 
285  typedef vector<unsigned int> SeqVectorType;
286  SeqVectorType seqVector;
287 
288  if (!ParseUtils::GenerateSeqVector(indxStr.c_str(), seqVector))
289  {
290  NEKERROR(ErrorUtil::efatal, (std::string("Ill-formed sequence definition: ") + indxStr).c_str());
291  }
292 
293  prevTokenStream >> prevType;
294 
295  // All composites must be of the same dimension.
296  bool validSequence = (prevToken.empty() || // No previous, then current is just fine.
297  (type == 'V' && prevType == 'V') ||
298  (type == 'S' && prevType == 'S'));
299 
300  ASSERTL0(validSequence, (std::string("Invalid combination of composite items: ")
301  + type + " and " + prevType + ".").c_str());
302 
303  switch(type)
304  {
305  case 'V': // Vertex
306  for (SeqVectorType::iterator iter=seqVector.begin(); iter!=seqVector.end(); ++iter)
307  {
308  if (m_vertSet.find(*iter) == m_vertSet.end())
309  {
310  char errStr[16] = "";
311  ::sprintf(errStr, "%d", *iter);
312  NEKERROR(ErrorUtil::ewarning, (std::string("Unknown vertex index: ") + errStr).c_str());
313  }
314  else
315  {
316  composite->push_back(m_vertSet[*iter]);
317  }
318  }
319  break;
320 
321  case 'S': // Segment
322  for (SeqVectorType::iterator iter=seqVector.begin(); iter!=seqVector.end(); ++iter)
323  {
324  if (m_segGeoms.find(*iter) == m_segGeoms.end())
325  {
326  char errStr[16] = "";
327  ::sprintf(errStr, "%d", *iter);
328  NEKERROR(ErrorUtil::ewarning, (std::string("Unknown segment index: ") + errStr).c_str());
329  }
330  else
331  {
332  composite->push_back(m_segGeoms[*iter]);
333  }
334  }
335  break;
336 
337  default:
338  NEKERROR(ErrorUtil::efatal, (std::string("Unrecognized composite token: ") + token).c_str());
339  }
340  }
341  catch(...)
342  {
343  NEKERROR(ErrorUtil::efatal, (std::string("Problem processing composite token: ") + token).c_str());
344  }
345 
346  return;
347  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
Definition: ParseUtils.hpp:78
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator