21#ifndef ensight_writeVolFields_H
22#define ensight_writeVolFields_H
36 const ensightMesh& ensMesh,
37 const tmp<VolumeField<Type>>& 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
91 const fvMesh&
mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
95 for (
const word& fieldName : objects.sortedNames<FieldType>())
103 getField<FieldType>(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
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Supports writing of ensight cases as well as providing common factory methods to open new files.
autoPtr< ensightFile > newData(const word &varName, const bool isPointData=false) const
Open stream for new data file (on master), with current index.
bool nodeValues() const
Force use of values per node instead of per element.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones,...
const polyMesh & mesh() const noexcept
Reference to the underlying polyMesh.
Mesh data needed to do the Finite Volume discretisation.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define ensight_WRITE_FIELD(PrimitiveType)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
label writeVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool writeVolField(ensightCase &ensCase, const ensightMesh &ensMesh, const tmp< VolumeField< Type > > &tfield, const bool nearCellValue=false)