73 TiXmlElement *master =
75 TiXmlElement *domain = NULL;
76 TiXmlElement *boundary = NULL;
78 master = doc.FirstChildElement(
"NEKTAR");
79 ASSERTL0(master,
"Unable to find NEKTAR tag in file");
81 domain = master->FirstChildElement(
"DOMAIN");
83 ASSERTL0(domain,
"Unable to find DOMAIN tag in file.");
85 TiXmlNode *node = domain->FirstChild();
86 std::string components(node->ValueStr());
87 std::istringstream domainStrm(components);
99 "Only composites are allowed in a definition of a domain.");
103 std::string::size_type indxBeg = entry.find_first_of(
'[') + 1;
104 std::string::size_type indxEnd = entry.find_last_of(
']') - 1;
107 (std::string(
"Error reading DOMAIN definition:") + entry)
110 std::string indxStr = entry.substr(indxBeg, indxEnd - indxBeg + 1);
112 std::istringstream indexStrm(indxStr);
113 int indx1 = -1, indx2 = -1;
124 (std::string(
"Error reading collection range: ") + indxStr)
128 std::string::size_type dashLoc = indxStr.find(
'-');
129 if (dashLoc != std::string::npos)
134 indexStrm.seekg(dashLoc + 1);
137 ASSERTL0(indx1 < indx2 && indx2 >= 0,
138 (std::string(
"Error reading collection range: ") +
143 for (
int i = indx1; i <= indx2; ++i)
152 boundary = master->FirstChildElement(
"BOUNDARY");
153 ASSERTL0(boundary,
"Unable to find BOUNDARY tag in file.");
155 TiXmlElement *bc = boundary->FirstChildElement();
160 std::string bcType(bc->ValueStr());
162 TiXmlNode *node = bc->FirstChild();
163 std::string components(node->ValueStr());
164 std::istringstream boundaryStrm(components);
170 const char *endName =
172 const char *indx =
std::find(beginName, endName, bcType[0]);
176 (std::string(
"Unable to read boundary type tag: ") + bcType)
191 "Only composites are allowed in a definition of a "
192 "boundary condition.");
197 std::string::size_type indxBeg = entry.find_first_of(
'[') + 1;
198 std::string::size_type indxEnd = entry.find_last_of(
']') - 1;
202 (std::string(
"Error reading BOUNDARY definition:") + entry)
206 std::string indxStr =
207 entry.substr(indxBeg, indxEnd - indxBeg + 1);
209 std::istringstream indexStrm(indxStr);
210 int indx1 = -1, indx2 = -1;
220 (std::string(
"Error reading collection range: ") +
224 std::string::size_type dashLoc = indxStr.find(
'-');
225 if (dashLoc != std::string::npos)
230 while (indexStrm.get() !=
'-')
235 indx1 < indx2 && indx2 >= 0,
236 (std::string(
"Error reading collection range: ") +
241 for (
int i = indx1; i <= indx2; ++i)
244 boundary->m_BoundaryComposites.push_back(composite);
250 bc = bc->NextSiblingElement();
BoundaryVector m_boundaries
CompositeSharedPtr GetComposite(int whichComposite)
std::shared_ptr< BoundaryEntry > BoundarySharedPtr
@ eBoundaryTypeLastElement
const char BoundaryTypeNameMap[]
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)