ensightSurfaceReader.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "ensightSurfaceReader.H"
29 #include "stringOps.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(ensightSurfaceReader, 0);
36  addToRunTimeSelectionTable(surfaceReader, ensightSurfaceReader, fileName);
37 }
38 
39 
40 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Read and discard specified number of elements
46 template<class Type>
47 static inline void discard(label n, ensightReadFile& is)
48 {
49  Type val;
50 
51  while (n > 0)
52  {
53  is.read(val);
54  --n;
55  }
56 }
57 
58 } // End namespace Foam
59 
60 
61 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
62 
63 void Foam::ensightSurfaceReader::skip(const label n, Istream& is) const
64 {
65  label i = 0;
66  token tok;
67  while (is.good() && (i < n))
68  {
69  is >> tok;
70  ++i;
71 
72  DebugInfo
73  << "Skipping token " << tok << nl;
74  }
75 
76  if (i != n)
77  {
79  << "Requested to skip " << n << " tokens, but stream exited after "
80  << i << " tokens. Last token read: " << tok
81  << nl;
82  }
83 }
84 
85 
87 {
88  do
89  {
90  is.getLine(line);
91 
92  // Trim out any '#' comments
93  const auto pos = line.find('#');
94  if (pos != std::string::npos)
95  {
96  line.erase(pos);
97  }
99  }
100  while (line.empty() && is.good());
101 }
102 
103 
105 (
106  const word& expected,
107  IFstream& is
108 ) const
109 {
110  string actual;
111  readLine(is, actual);
112 
113  if (expected != actual)
114  {
116  << "Expected section header '" << expected
117  << "' but read " << actual << nl
118  << exit(FatalIOError);
119  }
120 
121  DebugInfo
122  << "Read section header: " << expected << nl;
123 }
124 
125 
127 (
128  const fileName& fName,
129  const label timeIndex
130 )
131 {
132  fileName result(fName);
133 
134  const auto nMask = stringOps::count(fName, '*');
135 
136  // If there are any '*' chars, they are assumed to be contiguous
137  // Eg, data/******/geometry
138 
139  if (nMask)
140  {
141  std::ostringstream oss;
142  oss << std::setfill('0') << std::setw(nMask) << timeIndex;
143 
144  const std::string maskStr(nMask, '*');
145  const std::string indexStr = oss.str();
146  result.replace(maskStr, indexStr);
147  }
148 
149  return result;
150 }
151 
152 
155 {
156  // Binary flag string if applicable
157  is.readBinaryHeader();
158 
159  string buffer;
160 
161  Pair<idTypes> idHandling(idTypes::NONE, idTypes::NONE);
162 
163  // Ensight Geometry File
164  is.read(buffer);
165  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
166 
167  // Description - 1
168  is.read(buffer);
169  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
170 
171  // "node id (off|assign|given|ignore)" - "given" is not actually supported
172  is.read(buffer);
173  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
174 
175  if (buffer.find("ignore") != std::string::npos)
176  {
177  idHandling.first() = idTypes::IGNORE;
178  }
179  else if (buffer.find("given") != std::string::npos)
180  {
181  idHandling.first() = idTypes::GIVEN;
182  }
183 
184  // "element id (off|assign|given|ignore)"
185  is.read(buffer);
186  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
187 
188  if (buffer.find("ignore") != std::string::npos)
189  {
190  idHandling.second() = idTypes::IGNORE;
191  }
192  else if (buffer.find("given") != std::string::npos)
193  {
194  idHandling.second() = idTypes::GIVEN;
195  }
196 
197 
198  // "part" - but could also be an optional "extents"
199  is.read(buffer);
200  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
201 
202  if (buffer.find("extents") != std::string::npos)
203  {
204  // Optional extents - read and discard 6 floats
205  // (xmin, xmax, ymin, ymax, zmin, zmax)
206 
207  discard<scalar>(6, is);
208 
209  // Part
210  is.read(buffer);
211  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
212  }
213 
214  // The part number
215  label ivalue;
216  is.read(ivalue);
217  DebugInfo<< "ivalue: " << ivalue << nl;
218 
219  // Part description / name
220  is.read(buffer);
221  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
222 
223  // "coordinates"
224  is.read(buffer);
225  DebugInfo<< "buffer [" << buffer.length() << "] " << buffer << nl;
226 
227  return idHandling;
228 }
229 
230 
232 {
234 
235  if (!is.good())
236  {
238  << "Cannot read file " << is.name()
239  << exit(FatalError);
240  }
241 
242  string buffer;
243 
244  // Read the file
245 
246  debugSection("FORMAT", is);
247  readLine(is, buffer); // type: ensight gold
248 
249  debugSection("GEOMETRY", is);
250  readLine(is, buffer);
251 
252  // GEOMETRY with any of these
253  // model: 1 xxx.0000.mesh
254  // model: xxx.0000.mesh
255  // model: data/directory/geometry
256  //
257  // - use the last entry
258  meshFileName_ = stringOps::splitSpace(buffer).last().str();
259 
260  DebugInfo << "mesh file:" << meshFileName_ << endl;
261 
262  debugSection("VARIABLE", is);
263 
264  // Read the field description
265  DynamicList<word> fieldNames(16);
266  DynamicList<string> fieldFileNames(16);
267 
268  while (is.good())
269  {
270  readLine(is, buffer);
271 
272  if (buffer == "TIME")
273  {
274  break;
275  }
276 
277  // Read the field name and associated file name. Eg,
278  // scalar per element: 1 p data/********/p
279 
280  const auto parsed = stringOps::splitSpace(buffer);
281 
282  if (buffer.find(':') == string::npos || parsed.size() < 4)
283  {
285  << "Error reading field file name. Current buffer: "
286  << buffer << endl;
287  continue;
288  }
289  else if (debug)
290  {
291  Info<< "variable line: " << parsed.size();
292  for (const auto& s : parsed)
293  {
294  Info<< " " << s.str();
295  }
296  Info<< nl;
297  }
298 
299  fieldNames.append(parsed[parsed.size()-2].str());
300  fieldFileNames.append(parsed.last().str());
301  }
302  fieldNames_.transfer(fieldNames);
303  fieldFileNames_.transfer(fieldFileNames);
304 
305  DebugInfo
306  << "fieldNames: " << fieldNames_ << nl
307  << "fieldFileNames: " << fieldFileNames_ << nl;
308 
309  // Start reading time information
310  readLine(is, buffer); // time set: <int>
311 
312  readLine(is, buffer);
313  readFromLine(3, buffer, nTimeSteps_); // number of steps: <int>
314  readLine(is, buffer);
315  readFromLine(3, buffer, timeStartIndex_); // filename start number: <int>
316  readLine(is, buffer);
317  readFromLine(2, buffer, timeIncrement_); // filename increment: <int>
318 
319  DebugInfo
320  << "nTimeSteps: " << nTimeSteps_ << nl
321  << "timeStartIndex: " << timeStartIndex_ << nl
322  << "timeIncrement: " << timeIncrement_ << nl;
323 
324  // Read the time values
325  readLine(is, buffer); // time values:
326  timeValues_.setSize(nTimeSteps_);
327  for (label i = 0; i < nTimeSteps_; ++i)
328  {
329  scalar t(readScalar(is));
330 
331  timeValues_[i].value() = t;
332  // TODO: use character representation of t directly instead of
333  // regenerating from scalar value
334  timeValues_[i].name() = Foam::name(t);
335  }
336 }
337 
338 
339 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
340 
342 :
343  surfaceReader(fName),
344  streamFormat_(IOstream::ASCII),
345  baseDir_(fName.path()),
346  meshFileName_(),
347  fieldNames_(),
348  fieldFileNames_(),
349  nTimeSteps_(0),
350  timeStartIndex_(0),
351  timeIncrement_(1),
352  timeValues_(),
353  surfPtr_(nullptr)
354 {
355  IFstream is(fName);
356  readCase(is);
357 }
358 
359 
360 // * * * * * * * * * * * * * Public Member Functions * * * * * * * * * * * //
361 
363 (
364  const label timeIndex
365 )
366 {
368 
369  if (!surfPtr_)
370  {
371  fileName meshInstance(replaceMask(meshFileName_, timeIndex));
372  IFstream isBinary(baseDir_/meshInstance, IOstream::BINARY);
373 
374  if (!isBinary.good())
375  {
377  << "Cannot read file " << isBinary.name()
378  << exit(FatalError);
379  }
380 
381  streamFormat_ = IOstream::BINARY;
382  {
383  istream& iss = isBinary.stdStream();
384 
385  // Binary string is *exactly* 80 characters
386  string buf(size_t(80), '\0');
387  iss.read(&buf[0], 80);
388 
389  if (!iss)
390  {
391  // Truncated?
392  buf.erase(iss.gcount());
393  }
394 
395  // Truncate at the first embedded '\0'
396  const auto endp = buf.find('\0');
397  if (endp != std::string::npos)
398  {
399  buf.erase(endp);
400  }
401 
402  // Contains "C Binary" ?
403  if
404  (
405  (buf.find("binary") == std::string::npos)
406  && (buf.find("Binary") == std::string::npos)
407  )
408  {
409  streamFormat_ = IOstream::ASCII;
410  }
411  }
412 
413  if (debug)
414  {
415  Info<< "stream format: ";
416  if (streamFormat_ == IOstream::ASCII)
417  {
418  Info<< "ascii" << endl;
419  }
420  else
421  {
422  Info<< "binary" << endl;
423  }
424  }
425 
426 
427  ensightReadFile is(baseDir_/meshInstance, streamFormat_);
428 
429  DebugInfo
430  << "File: " << is.name() << nl;
431 
432  Pair<idTypes> idHandling = readGeometryHeader(is);
433 
434  label nPoints;
435  is.read(nPoints);
436 
437  DebugInfo
438  << "nPoints: " << nPoints << nl;
439 
440  if (idHandling.first() == idTypes::GIVEN)
441  {
443  << "Treating node id 'given' as being 'ignore'" << nl
444  << "If something fails, this could be the reason" << nl
445  << endl;
446 
447  idHandling.first() = idTypes::IGNORE;
448  }
449 
450  if (idHandling.first() == idTypes::IGNORE)
451  {
452  DebugInfo
453  << "Ignore " << nPoints << " node ids" << nl;
454 
455  // Read and discard labels
456  discard<label>(nPoints, is);
457  }
458 
460  for (direction cmpt = 0; cmpt < vector::nComponents; ++cmpt)
461  {
462  for (point& pt : points)
463  {
464  is.read(pt[cmpt]);
465  }
466  }
467 
468 
469  // Read faces - may be a mix of tris, quads and polys
470  DynamicList<face> faces(ceil(nPoints/3));
471  DynamicList<Tuple2<string, label>> schema(faces.size());
472  string faceType;
473  while (is.good()) // (is.peek() != EOF)
474  {
475  is.read(faceType);
476 
477  if (!is.good())
478  {
479  break;
480  }
481 
482  label nFace = 0;
483 
484  if (faceType == "tria3")
485  {
486  is.read(nFace);
487 
488  DebugInfo
489  << "faceType <" << faceType.c_str() << "> count: "
490  << nFace << nl;
491 
492  if
493  (
494  idHandling.second() == idTypes::IGNORE
495  || idHandling.second() == idTypes::GIVEN
496  )
497  {
498  DebugInfo
499  << "Ignore " << nFace << " element ids" << nl;
500 
501  // Read and discard labels
502  discard<label>(nFace, is);
503  }
504 
505  face f(3);
506  for (label facei = 0; facei < nFace; ++facei)
507  {
508  for (label& fp : f)
509  {
510  is.read(fp);
511  }
512 
513  faces.append(f);
514  }
515  }
516  else if (faceType == "quad4")
517  {
518  is.read(nFace);
519 
520  DebugInfo
521  << "faceType <" << faceType.c_str() << "> count: "
522  << nFace << nl;
523 
524  if
525  (
526  idHandling.second() == idTypes::IGNORE
527  || idHandling.second() == idTypes::GIVEN
528  )
529  {
530  DebugInfo
531  << "Ignore " << nFace << " element ids" << nl;
532 
533  // Read and discard labels
534  discard<label>(nFace, is);
535  }
536 
537  face f(4);
538  for (label facei = 0; facei < nFace; ++facei)
539  {
540  for (label& fp : f)
541  {
542  is.read(fp);
543  }
544 
545  faces.append(f);
546  }
547  }
548  else if (faceType == "nsided")
549  {
550  is.read(nFace);
551 
552  DebugInfo
553  << "faceType <" << faceType.c_str() << "> count: "
554  << nFace << nl;
555 
556  if
557  (
558  idHandling.second() == idTypes::IGNORE
559  || idHandling.second() == idTypes::GIVEN
560  )
561  {
562  DebugInfo
563  << "Ignore " << nFace << " element ids" << nl;
564 
565  // Read and discard labels
566  discard<label>(nFace, is);
567  }
568 
569  labelList np(nFace);
570  for (label facei = 0; facei < nFace; ++facei)
571  {
572  is.read(np[facei]);
573  }
574  for (label facei = 0; facei < nFace; ++facei)
575  {
576  face f(np[facei]);
577  for (label& fp : f)
578  {
579  is.read(fp);
580  }
581 
582  faces.append(f);
583  }
584  }
585  else
586  {
587  if (debug)
588  {
590  << "Unknown face type: <" << faceType.c_str()
591  << ">. Stopping read and continuing with current "
592  << "elements only" << endl;
593  }
594  break;
595  }
596  schema.append(Tuple2<string, label>(faceType, nFace));
597  }
598 
599  schema_.transfer(schema);
600 
601  DebugInfo
602  << "read nFaces: " << faces.size() << nl
603  << "file schema: " << schema_ << nl;
604 
605  // Convert from 1-based Ensight addressing to 0-based OF addressing
606  for (face& f : faces)
607  {
608  for (label& pointi : f)
609  {
610  --pointi;
611  }
612  }
613 
614  surfPtr_.reset(new meshedSurface(std::move(points), std::move(faces)));
615  }
616 
617  return *surfPtr_;
618 }
619 
620 
622 {
623  return timeValues_;
624 }
625 
626 
628 (
629  const label timeIndex
630 ) const
631 {
632  return fieldNames_;
633 }
634 
635 
637 (
638  const label timeIndex,
639  const label fieldIndex,
640  const scalar& refValue
641 ) const
642 {
643  return readField<scalar>(timeIndex, fieldIndex);
644 }
645 
646 
648 (
649  const label timeIndex,
650  const label fieldIndex,
651  const vector& refValue
652 ) const
653 {
654  return readField<vector>(timeIndex, fieldIndex);
655 }
656 
657 
660 (
661  const label timeIndex,
662  const label fieldIndex,
663  const sphericalTensor& refValue
664 ) const
665 {
666  return readField<sphericalTensor>(timeIndex, fieldIndex);
667 }
668 
669 
671 (
672  const label timeIndex,
673  const label fieldIndex,
674  const symmTensor& refValue
675 ) const
676 {
677  return readField<symmTensor>(timeIndex, fieldIndex);
678 }
679 
680 
682 (
683  const label timeIndex,
684  const label fieldIndex,
685  const tensor& refValue
686 ) const
687 {
688  return readField<tensor>(timeIndex, fieldIndex);
689 }
690 
691 
692 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::string::replace
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
Definition: string.C:121
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::Pair::second
const T & second() const noexcept
Return second element, which is also the last element.
Definition: PairI.H:122
Foam::Tensor< scalar >
Foam::SymmTensor< scalar >
Foam::surfaceReader
Base class for surface readers.
Definition: surfaceReader.H:53
Foam::stringOps::inplaceTrimRight
void inplaceTrimRight(std::string &s)
Trim trailing whitespace inplace.
Definition: stringOps.C:994
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::ISstream::getLine
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
Definition: ISstreamI.H:76
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::ensightSurfaceReader::replaceMask
static fileName replaceMask(const fileName &fName, const label timeIndex)
Replace the '*' mask chars with a 0 padded string.
Definition: ensightSurfaceReader.C:127
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::IFstream
Input from file stream, using an ISstream.
Definition: IFstream.H:53
Foam::DynamicList< word >
Foam::IFstream::name
virtual const fileName & name() const
Read/write access to the name of the stream.
Definition: ISstream.H:124
Foam::ensightSurfaceReader::skip
void skip(const label n, Istream &is) const
Helper function to skip forward n steps in stream.
Definition: ensightSurfaceReader.C:63
Foam::ensightSurfaceReader::readLine
void readLine(IFstream &is, string &buffer) const
Helper function to read an ascii line from file.
Definition: ensightSurfaceReader.C:86
Foam::IOstream
An IOstream is an abstract base class for all input/output systems; be they streams,...
Definition: IOstream.H:75
Foam::ensightSurfaceReader::readCase
void readCase(IFstream &is)
Read the case file.
Definition: ensightSurfaceReader.C:231
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::token
A token holds an item read from Istream.
Definition: token.H:68
Foam::stringOps::splitSpace
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
Definition: stringOpsTemplates.C:180
Foam::ensightSurfaceReader::fieldNames
virtual wordList fieldNames(const label timeIndex) const
Return a list of the available fields at a given time.
Definition: ensightSurfaceReader.C:628
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
n
label n
Definition: TABSMDCalcMethod2.H:31
ensightSurfaceReader.H
Foam::ensightSurfaceReader::ensightSurfaceReader
ensightSurfaceReader(const fileName &fName)
Construct from fileName.
Definition: ensightSurfaceReader.C:341
Foam::ensightSurfaceReader::times
virtual instantList times() const
Return a list of the available times.
Definition: ensightSurfaceReader.C:621
Foam::ensightReadFile
Ensight output with specialized read() for strings, integers and floats. Correctly handles binary rea...
Definition: ensightReadFile.H:49
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:365
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::DynamicList::append
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Definition: DynamicListI.H:474
Foam::ensightSurfaceReader::geometry
virtual const meshedSurface & geometry(const label timeIndex)
Return a reference to the surface geometry.
Definition: ensightSurfaceReader.C:363
Foam::ensightSurfaceReader::readGeometryHeader
Pair< idTypes > readGeometryHeader(ensightReadFile &is) const
Read (and discard) geometry file header.
Definition: ensightSurfaceReader.C:154
Foam::ensightSurfaceReader::debugSection
void debugSection(const word &expected, IFstream &is) const
Read and check a section header.
Definition: ensightSurfaceReader.C:105
Foam::FatalError
error FatalError
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::setw
Omanip< int > setw(const int i)
Definition: IOmanip.H:199
Foam::SphericalTensor< scalar >
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::ensightReadFile::readBinaryHeader
Istream & readBinaryHeader()
Read "C Binary" for binary files (eg, geometry/measured)
Definition: ensightReadFile.C:152
Foam::IFstream::stdStream
virtual std::istream & stdStream()
Access to underlying std::istream.
Definition: IFstream.C:94
Foam::discard
static void discard(label n, ensightReadFile &is)
Definition: ensightSurfaceReader.C:47
Foam::IOstreamOption::BINARY
"binary"
Definition: IOstreamOption.H:73
Foam::IOstreamOption::ASCII
"ascii" (normal default)
Definition: IOstreamOption.H:72
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:359
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:54
Foam::meshedSurface
MeshedSurface< face > meshedSurface
Definition: MeshedSurfacesFwd.H:41
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::List< label >
Foam::setfill
Omanip< char > setfill(char fillch)
Definition: IOmanip.H:175
points
const pointField & points
Definition: gmvOutputHeader.H:1
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::line
A line primitive.
Definition: line.H:59
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:401
Foam::stringOps::count
std::string::size_type count(const std::string &s, const char c)
Count the number of occurrences of the specified character.
Definition: stringOps.C:699
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:57
Foam::ensightSurfaceReader::field
virtual tmp< Field< scalar > > field(const label timeIndex, const label fieldIndex, const scalar &refValue=pTraits< scalar >::zero) const
Return a scalar field at a given time.
Definition: ensightSurfaceReader.C:637
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:224
Foam::MeshedSurface< face >
stringOps.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:303
Foam::ensightReadFile::read
virtual Istream & read(char *buf, std::streamsize count)
Binary read.
Definition: ensightReadFile.C:45
Foam::VectorSpace< Vector< Cmpt >, Cmpt, 3 >::nComponents
static constexpr direction nComponents
Number of components in this vector space.
Definition: VectorSpace.H:101
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177