Go to the documentation of this file.
41 namespace surfaceWriters
57 for (
direction cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
86 IOstream::compressionEnum(
"compression", options)
88 fieldScale_(options.subOrEmptyDict(
"fieldScale"))
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;
142 const meshedSurf& surf = surface();
151 const labelUList& origFaceIds = surf.faceIds();
161 MeshedSurfaceProxy<face>
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;
234 tmp<Field<Type>> tfield = mergeField(localValues) * varScale;
236 const meshedSurf& surf = surface();
240 const auto&
values = tfield();
247 OFstream
os(outputFile, streamOpt_);
252 const bool useOrigFaceIds =
254 elemIds.size() ==
values.size()
261 for (
const Type& val :
values)
264 (useOrigFaceIds ? elemIds[faceIndex] : faceIndex);
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)
A class for managing temporary objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
virtual const faceList & faces() const =0
An IOstream is an abstract base class for all input/output systems; be they streams,...
Abstract definition of a meshed surface defined by faces and points.
static bool master(const label communicator=worldComm)
Ostream & endl(Ostream &os)
Convenience macros for instantiating surfaceWriter methods.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
Generic templated field type.
virtual const pointField & points() const =0
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
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.
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
Output to file stream, using an OSstream.
virtual const labelList & faceIds() const
@ ASCII
"ascii" (normal default)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A surfaceWriter for STARCD files.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const UList< T > & null()
defineSurfaceWriterWriteFields(Foam::surfaceWriters::starcdWriter)
UList< label > labelUList
A UList of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
bool equal(const T &s1, const T &s2)
bool isDir(const fileName &name, const bool followLink=true)