44 void Foam::foamSurfaceWriter::writeTemplate
46 const fileName& outputDir,
47 const fileName& surfaceName,
50 const word& fieldName,
51 const Field<Type>& values,
52 const bool isNodeValues,
56 fileName surfaceDir(outputDir/surfaceName);
58 if (!
isDir(surfaceDir))
65 Info<<
"Writing field " << fieldName <<
" to " << surfaceDir <<
endl;
71 fileName foamName(pTraits<Type>::typeName);
74 if (!
isDir(valuesDir))
80 OFstream(valuesDir/fieldName)() << values;
109 fileName surfaceDir(outputDir/surfaceName);
111 if (!
isDir(surfaceDir))
118 Info<<
"Writing geometry to " << surfaceDir <<
endl;
123 OFstream(surfaceDir/
"points")() << points;
126 OFstream(surfaceDir/
"faces")() << faces;
134 faceCentres[facei] = faces[facei].centre(points);
137 OFstream(surfaceDir/
"faceCentres")() << faceCentres;
virtual ~foamSurfaceWriter()
Destructor.
#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 foams.
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const bool verbose=false) const
Write single surface geometry to file.
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.
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
foamSurfaceWriter()
Construct null.
Base class for surface writers.
static const Vector< scalar > zero
makeSurfaceWriterType(dxSurfaceWriter)