62 #undef TypeValueSetsConstArg
65 if (!
set.hasPointAxis())
68 <<
"Cannot write " << setName <<
" in " << typeName
69 <<
" format as it does not have a point axis" 73 if (!
isDir(outputDir))
79 const scalar timeValue = 0.0;
81 OFstream osCase(outputDir/setName +
".case");
84 outputDir/setName +
".000.mesh",
90 <<
"type: ensight gold" <<
nl 95 <<
"model: 1 " << osGeom.
name().
name() << nl
100 forAll(valueSetNames, fieldi)
102 #define WriteTypeCase(Type, nullArg) \ 103 if (Type##ValueSets.set(fieldi)) \ 106 << ensightPTraits<Type>::typeName << " per node:" \ 107 << setw(10) << 1 << " " << valueSetNames[fieldi] \ 108 << " " << setName.c_str() << ".***." \ 109 << valueSetNames[fieldi] << nl; \ 119 <<
"time set: 1" << nl
120 <<
"number of steps: 1" << nl
121 <<
"filename start number: 0" << nl
122 <<
"filename increment: 1" << nl
123 <<
"time values:" << nl
131 <<
setw(10) << 1 << nl
132 <<
"internalMesh" << nl
133 <<
"coordinates" << nl
134 <<
setw(10) <<
set.size() <<
nl;
145 osGeom <<
setw(12) << points[pointi][cmpt] <<
nl;
149 osGeom <<
setw(12) << scalar(0) <<
nl;
161 <<
setw(10) << vertices[vertexi] + 1 <<
nl;
172 <<
setw(10) << edges[edgei].second() + 1 <<
nl;
177 forAll(valueSetNames, fieldi)
183 + valueSetNames[fieldi],
187 #define WriteTypeValues(Type, nullArg) \ 188 if (Type##ValueSets.set(fieldi)) \ 191 << pTraits<Type>::typeName << nl \ 193 << setw(10) << 1 << nl \ 194 << "coordinates" << nl; \ 197 direction cmpt = 0; \ 198 cmpt < pTraits<Type>::nComponents; \ 202 const scalarField fld \ 204 Type##ValueSets[fieldi].component(cmpt) \ 208 if (mag(fld[i]) >= scalar(floatScalarVSmall)) \ 210 osField << setw(12) << fld[i] << nl; \ 214 osField << setw(12) << scalar(0) << nl; \ 220 #undef WriteTypeValues Ensight output with specialised write() for strings, integers and floats. Correctly handles binary wr...
#define forAll(list, i)
Loop across all elements in list.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
Specialised Ensight output with extra geometry file header.
static const floatScalar floatScalarVSmall
#define TypeValueSetsConstArg(Type, nullArg)
const fileName & name() const
Return the name of the stream.
T & first()
Return the first element of the list.
Macros for easy insertion into run-time selection tables.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
pointField vertices(const blockVertexList &bvl)
static const direction nComponents
Number of components in this vector space.
Holds list of sampling positions.
Pre-declare SubField and related Field type.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
word name() const
Return file name (part beyond last /)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
#define WriteTypeCase(Type, nullArg)
Istream and Ostream manipulators taking arguments.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
#define WriteTypeValues(Type, nullArg)
virtual ~ensightSetWriter()
Destructor.
virtual void write(const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const
Write a coordSet and associated data.
FOR_ALL_FIELD_TYPES(DefineFvWallInfoType)
dimensioned< scalar > mag(const dimensioned< Type > &)
Omanip< int > setw(const int i)
A class for managing temporary objects.