Go to the documentation of this file.
21 #ifndef ensight_writeVolFields_H
22 #define ensight_writeVolFields_H
36 const ensightMesh& ensMesh,
37 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield,
38 const bool nearCellValue =
false
45 else if (nearCellValue)
47 auto tzgrad = makeZeroGradientField<Type>(tfield);
59 const auto&
field = tfield();
62 const bool nodeValues = ensCase.nodeValues();
64 autoPtr<ensightFile>
os =
65 ensCase.newData<Type>(
field.name(), nodeValues);
67 bool wrote = ensightOutput::writeVolField<Type>
84 const ensightMesh& ensMesh,
85 const IOobjectList& objects,
86 const bool nearCellValue =
false
89 typedef GeometricField<Type, fvPatchField, volMesh> GeoField;
91 const fvMesh&
mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
95 for (
const word& fieldName : objects.sortedNames<GeoField>())
103 getField<GeoField>(objects.findObject(fieldName),
mesh),
108 Info<<
' ' << fieldName;
119 ensightCase& ensCase,
120 const ensightMesh& ensMesh,
121 const IOobjectList& objects,
122 const bool nearCellValue =
false
125 #undef ensight_WRITE_FIELD
126 #define ensight_WRITE_FIELD(PrimitiveType) \
127 writeVolFields<PrimitiveType> \
142 #undef ensight_WRITE_FIELD
autoPtr< ensightFile > newData(const word &varName, const bool isPointData=false) const
Open stream for new data file (on master), with current index.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones,...
Helper routines for reading a field or fields, for foamToEnsight.
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
#define ensight_WRITE_FIELD(PrimitiveType)
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
wordList sortedNames() const
The sorted names of the IOobjects.
const polyMesh & mesh() const noexcept
Reference to the underlying polyMesh.
bool writeVolField(ensightCase &ensCase, const ensightMesh &ensMesh, const tmp< GeometricField< Type, fvPatchField, volMesh >> &tfield, const bool nearCellValue=false)
messageStream Info
Information stream (stdout output on master, null elsewhere)
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
OBJstream os(runTime.globalPath()/outputName)
Mesh data needed to do the Finite Volume discretisation.
List of IOobjects with searching and retrieving facilities.
label writeVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
Supports writing of ensight cases as well as providing common factory methods to open new files.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
bool nodeValues() const
Force use of values per node instead of per element.