42 void Foam::foamSurfaceWriter::Write
44 const fileName& outputDir,
45 const fileName& surfaceName,
48 const word& fieldName,
49 const Field<Type>& values,
50 const bool isNodeValues
53 const fileName surfaceDir(outputDir/surfaceName);
55 if (!
isDir(surfaceDir))
62 Info<<
"Writing field " << fieldName <<
" to " << surfaceDir <<
endl;
68 const fileName foamName(pTraits<Type>::typeName);
71 if (!
isDir(valuesDir))
76 OFstream(valuesDir/fieldName, writeFormat_)() << values;
107 const fileName surfaceDir(outputDir/surfaceName);
109 if (!
isDir(surfaceDir))
116 Info<<
"Writing geometry to " << surfaceDir <<
endl;
120 OFstream(surfaceDir/
"points", writeFormat_)() << points;
123 OFstream(surfaceDir/
"faces", writeFormat_)() << faces;
131 faceCentres[facei] = faces[facei].centre(points);
134 OFstream(surfaceDir/
"faceCentres", writeFormat_)() << faceCentres;
virtual ~foamSurfaceWriter()
Destructor.
foamSurfaceWriter(const IOstream::streamFormat writeFormat)
Construct given write format.
#define forAll(list, i)
Loop across all elements in list.
A class for handling file names.
static const char *const typeName
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A surfaceWriter for native OpenFOAM format with support for writing ASCII or binary.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
Convenience macros for instantiating writer methods for surfaceWriter classes.
streamFormat
Enumeration for the format of data in the stream.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
makeSurfaceWriterType(ensightSurfaceWriter)
Base class for surface writers.
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces) const
Write single surface geometry to file.