54 for (
const auto& tok : tokens)
63 std::string vrtSpec(tok.str());
67 const auto slash = vrtSpec.find(
'/');
68 slash != std::string::npos
107 <<
"Cannot read file " << filename
118 string line = this->getLineNoComment(is);
121 while (
line.removeEnd(
'\\'))
123 line += this->getLineNoComment(is);
129 if (tokens.size() < 2)
145 readScalar(tokens[1]),
146 readScalar(tokens[2]),
147 readScalar(tokens[3])
162 for (label i = 1; i < dynVerts.
size(); i++)
164 const edge
e(dynVerts[i-1], dynVerts[i]);
167 dynUsedPoints[
e[0]] =
e[0];
168 dynUsedPoints[
e[1]] =
e[1];
181 for (label i = 1; i < dynVerts.
size(); i++)
183 const edge
e(dynVerts[i-1], dynVerts[i]);
186 dynUsedPoints[
e[0]] =
e[0];
187 dynUsedPoints[
e[1]] =
e[1];
197 if (dynUsedPoints[pointi] >= 0)
201 dynPoints[nUsed] = std::move(dynPoints[pointi]);
202 dynUsedPoints[pointi] = nUsed;
211 storedPoints().transfer(dynPoints);
214 if (nUsed != dynUsedPoints.
size())
216 for (edge&
e : dynEdges)
218 e = edge(dynUsedPoints,
e);
221 storedEdges().transfer(dynEdges);
245 <<
"Cannot write file " << filename <<
nl 251 <<
"o " <<
os.name().stem() <<
nl 253 <<
"# points : " << pointLst.
size() <<
nl 254 <<
"# lines : " << edgeLst.
size() <<
nl;
257 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
nl;
260 for (
const point&
p : pointLst)
262 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
265 os <<
"# </points>" <<
nl 267 <<
"# <edges count=\"" << edgeLst.
size() <<
"\">" <<
endl;
270 for (
const edge&
e : edgeLst)
272 os <<
"l " << (
e[0] + 1) <<
" " << (
e[1] + 1) <<
nl;
274 os <<
"# </edges>" <<
endl;
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Foam::SubStrings splitSpace(const std::string &str, std::string::size_type pos=0)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
A simple container for options an IOstream can normally have.
void setSize(const label n)
Alias for resize()
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar e
Elementary charge.
static std::string dateTime()
The current wall-clock date/time (in local time) as a string in ISO-8601 format (yyyy-mm-ddThh:mm:ss)...
void append(const T &val)
Copy append an element to the end of this list.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static label readObjVertices(const SubStrings &tokens, DynamicList< label > &verts)
OBJstream os(runTime.globalPath()/outputName)
Mesh data needed to do the Finite Area discretisation.
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void push_back(const T &val)
Copy append an element to the end of this list.
vector point
Point is a vector.
streamFormat format() const noexcept
Get the current stream format.