56 const bool writePointValues
63 const fileName surfaceDir(outputDir/surfaceName);
65 if (!
isDir(surfaceDir))
72 Info<<
"Writing geometry to " << surfaceDir <<
endl;
88 stream(surfaceDir/
"points")() <<
points;
91 stream(surfaceDir/
"faces")() << faces;
98 faceCentres[facei] = faces[facei].centre(
points);
100 stream(surfaceDir/
"faceCentres")() << faceCentres;
108 << surfaceDir <<
endl;
111 #define WriteFieldType(Type, nullArg) \
112 if (field##Type##Values.set(fieldi)) \
114 const fileName valuesDir \
118 word(pTraits<Type>::typeName) \
119 + word(Field<Type>::typeName) \
123 if (!isDir(valuesDir)) \
128 stream(valuesDir/fieldNames[fieldi])() \
129 << field##Type##Values[fieldi]; \
132 #undef WriteFieldType
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
static const versionNumber currentVersion
Current version number.
void size(const label)
Override size to be inconsistent with allocated storage.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A class for handling file names.
A surfaceWriter for native OpenFOAM format with support for writing ASCII or binary.
virtual ~foamSurfaceWriter()
Destructor.
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const wordList &fieldNames, const bool writePointValues #define FieldTypeValuesConstArg(Type, nullArg)) const=0
Inherit base class templated write.
Base class for surface writers.
A class for handling words, derived from string.
#define FieldTypeValuesConstArg(Type, nullArg)
#define WriteFieldType(Type, nullArg)
static List< word > fieldNames
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
defineTypeNameAndDebug(combustionModel, 0)
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)