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().nameLessExt() <<
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;
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void transfer(List< T > &list)
Transfer contents of the argument List into this.
void setSize(const label n)
Same as resize()
void append(const T &val)
Copy append an element to the end of this list.
Input from file stream, using an ISstream.
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
bool good() const noexcept
True if next operation might succeed.
Output to file stream, using an OSstream.
virtual bool read()
Re-read model coefficients if they have changed.
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
void size(const label n)
Older name for setAddressableSize.
static std::string dateTime()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Area discretisation.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
virtual bool write()
Write the output fields.
virtual void validate()
Validate the turbulence fields after construction.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
static label readObjVertices(const SubStrings< string > &tokens, DynamicList< label > &verts)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.