54 for (
const auto& tok : tokens)
63 const string vrtSpec(tok);
64 const auto slash = vrtSpec.find(
'/');
104 <<
"Cannot read file " << filename
115 string line = this->getLineNoComment(is);
118 while (
line.removeEnd(
'\\'))
120 line += this->getLineNoComment(is);
126 if (tokens.size() < 2)
142 readScalar(tokens[1]),
143 readScalar(tokens[2]),
144 readScalar(tokens[3])
159 for (label i = 1; i < dynVerts.
size(); i++)
161 const edge
e(dynVerts[i-1], dynVerts[i]);
164 dynUsedPoints[
e[0]] =
e[0];
165 dynUsedPoints[
e[1]] =
e[1];
178 for (label i = 1; i < dynVerts.
size(); i++)
180 const edge
e(dynVerts[i-1], dynVerts[i]);
183 dynUsedPoints[
e[0]] =
e[0];
184 dynUsedPoints[
e[1]] =
e[1];
194 if (dynUsedPoints[pointi] >= 0)
198 dynPoints[nUsed] = std::move(dynPoints[pointi]);
199 dynUsedPoints[pointi] = nUsed;
208 storedPoints().transfer(dynPoints);
211 if (nUsed != dynUsedPoints.
size())
213 for (edge&
e : dynEdges)
215 e[0] = dynUsedPoints[
e[0]];
216 e[1] = dynUsedPoints[
e[1]];
243 <<
"Cannot write file " << filename <<
nl 249 <<
"o " <<
os.name().stem() <<
nl 251 <<
"# points : " << pointLst.
size() <<
nl 252 <<
"# lines : " << edgeLst.
size() <<
nl;
255 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
nl;
258 for (
const point&
p : pointLst)
260 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
263 os <<
"# </points>" <<
nl 265 <<
"# <edges count=\"" << edgeLst.
size() <<
"\">" <<
endl;
268 for (
const edge&
e : edgeLst)
270 os <<
"l " << (
e[0] + 1) <<
" " << (
e[1] + 1) <<
nl;
272 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)
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)
Same as 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.
static label readObjVertices(const SubStrings< string > &tokens, DynamicList< label > &verts)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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.
vector point
Point is a vector.
void transfer(List< T > &list)
Transfer contents of the argument List into this.
Foam::SubStrings< StringType > splitSpace(const StringType &str, std::string::size_type pos=0)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
streamFormat format() const noexcept
Get the current stream format.