41 namespace surfaceWriters
100 open(surf, outputPath, parallel);
115 open(
points, faces, outputPath, parallel);
128 if (useTimeDir() && !
timeName().empty())
131 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
133 outputFile.
ext(
"inp");
137 Info<<
"Writing geometry to " << outputFile <<
endl;
141 const meshedSurfRef& surf = adjustSurface();
150 const labelUList& origFaceIds = surf.faceIds();
160 MeshedSurfaceProxy<face>
185 const word& fieldName,
200 if (useTimeDir() && !
timeName().empty())
207 outputFile /= fieldName +
'_' + outputPath_.name();
208 outputFile.
ext(
"usr");
211 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
215 Info<<
" to " << outputFile <<
endl;
220 const meshedSurfRef& surf = adjustSurface();
224 const auto&
values = tfield();
231 OFstream
os(outputFile, streamOpt_);
236 const bool useOrigFaceIds =
238 elemIds.size() ==
values.size()
245 for (
const Type& val :
values)
248 (useOrigFaceIds ? elemIds[faceIndex] : faceIndex);
A class for handling file names.
static void writeData(Ostream &os, const Type &val)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A surfaceWriter for STARCD files.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
A simple container for options an IOstream can normally have.
static std::string path(const std::string &str)
Return directory path name (part before last /)
word ext() const
Return file name extension (part after last .)
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
Abstract definition of a meshed surface defined by faces and points.
Various functions to operate on Lists.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
A class for handling words, derived from Foam::string.
starcdWriter()
Default construct.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual fileName write()
Write surface geometry to file.
Convenience macros for instantiating surfaceWriter methods.
defineTypeName(abaqusWriter)
defineSurfaceWriterWriteFields(Foam::surfaceWriters::starcdWriter)
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static const UList< label > & null() noexcept
Return a null UList (reference to a nullObject). Behaves like an empty UList.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Base class for surface writers.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)