Go to the documentation of this file.
41 namespace surfaceWriters
57 for (
direction cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
102 open(surf, outputPath, parallel);
117 open(
points, faces, outputPath, parallel);
130 if (useTimeDir() && !
timeName().empty())
133 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
135 outputFile.
ext(
"inp");
139 Info<<
"Writing geometry to " << outputFile <<
endl;
186 const word& fieldName,
201 if (useTimeDir() && !
timeName().empty())
208 outputFile /= fieldName +
'_' + outputPath_.name();
209 outputFile.
ext(
"usr");
215 const scalar varScale =
217 std::is_integral<Type>::value
219 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
224 Info<<
"Writing field " << fieldName;
225 if (!
equal(varScale, 1))
227 Info<<
" (scaling " << varScale <<
')';
229 Info<<
" to " << outputFile <<
endl;
240 const auto&
values = tfield();
252 const bool useOrigFaceIds =
261 for (
const Type& val :
values)
264 (useOrigFaceIds ? elemIds[faceIndex] : faceIndex);
virtual fileName write()
Write surface geometry to file.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
Base class for surface writers.
A class for handling file names.
defineTypeName(abaqusWriter)
static std::string path(const std::string &str)
Return directory path name (part before last /)
A class for managing temporary objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
static bool master(const label communicator=worldComm)
Am I the master process.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Convenience macros for instantiating surfaceWriter methods.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual const pointField & points() const =0
The points used for the surface.
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
static void writeData(Ostream &os, const Type &val)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
word ext() const
Return file name extension (part after last .)
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
starcdWriter()
Default construct.
Output to file stream, using an OSstream.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
A surfaceWriter for STARCD files.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
True if there is a value in the list that satisfies the predicate.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Various functions to operate on Lists.
void size(const label n)
Older name for setAddressableSize.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const UList< T > & null()
Return a UList reference to a nullObject.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::starcdWriter)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?