39 namespace surfaceWriters
81 open(surf, outputPath, parallel);
96 open(
points, faces, outputPath, parallel);
110 if (useTimeDir() && !
timeName().empty())
113 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
118 Info<<
"Writing geometry to " << surfaceDir <<
endl;
123 const meshedSurfRef& surf = adjustSurface();
128 const faceList& faces = surf.faces();
130 if (!
isDir(surfaceDir))
136 OFstream(surfaceDir/
"points", streamOpt_)() <<
points;
139 OFstream(surfaceDir/
"faces", streamOpt_)() << faces;
148 faceCentres[facei] = faces[facei].centre(
points);
151 OFstream(surfaceDir/
"faceCentres", streamOpt_)() << faceCentres;
164 const word& fieldName,
183 if (useTimeDir() && !
timeName().empty())
186 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
189 const fileName outputFile
198 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
202 Info<<
" to " << surfaceDir <<
endl;
208 if (!
isDir(outputFile.path()))
210 mkDir(outputFile.path());
214 OFstream(outputFile, streamOpt_)() << tfield();
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Ostream & endl(Ostream &os)
Add newline and flush stream.
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 /)
Macros for easy insertion into run-time selection tables.
Abstract definition of a meshed surface defined by faces and points.
#define forAll(list, i)
Loop across all elements in list.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
static const char *const typeName
Typename for Field.
List< face > faceList
List of faces.
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)
vectorField pointField
pointField is a vectorField.
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.
virtual fileName write()
Write surface geometry to file.
foamWriter()
Default construct.
Convenience macros for instantiating surfaceWriter methods.
A surfaceWriter for OpenFOAM surfaces.
defineTypeName(abaqusWriter)
defineSurfaceWriterWriteFields(Foam::surfaceWriters::foamWriter)
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Base class for surface writers.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
static constexpr const zero Zero
Global zero (0)