26 #include "writeFuns.H" 35 const List<Type>& source,
36 DynamicList<floatScalar>& dest
67 const GeometricField<Type, fvPatchField, volMesh>& vvf,
71 const fvMesh& mesh = vMesh.mesh();
73 const labelList& superCells = vMesh.topo().superCells();
75 label nValues = mesh.nCells() + superCells.size();
77 os << vvf.name() <<
' ' << pTraits<Type>::nComponents <<
' ' 80 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nValues);
82 insert(vvf.primitiveField(), fField);
84 forAll(superCells, superCelli)
86 label origCelli = superCells[superCelli];
88 insert(vvf[origCelli], fField);
90 write(os, binary, fField);
99 const GeometricField<Type, pointPatchField, pointMesh>& pvf,
103 const fvMesh& mesh = vMesh.mesh();
104 const vtkTopo& topo = vMesh.topo();
106 const labelList& addPointCellLabels = topo.addPointCellLabels();
107 const label nTotPoints = mesh.nPoints() + addPointCellLabels.size();
109 os << pvf.name() <<
' ' << pTraits<Type>::nComponents <<
' ' 112 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nTotPoints);
116 forAll(addPointCellLabels, api)
118 label origCelli = addPointCellLabels[api];
122 write(os, binary, fField);
131 const GeometricField<Type, fvPatchField, volMesh>& vvf,
132 const GeometricField<Type, pointPatchField, pointMesh>& pvf,
136 const fvMesh& mesh = vMesh.mesh();
137 const vtkTopo& topo = vMesh.topo();
139 const labelList& addPointCellLabels = topo.addPointCellLabels();
140 const label nTotPoints = mesh.nPoints() + addPointCellLabels.size();
142 os << vvf.name() <<
' ' << pTraits<Type>::nComponents <<
' ' 145 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nTotPoints);
149 forAll(addPointCellLabels, api)
151 label origCelli = addPointCellLabels[api];
153 insert(vvf[origCelli], fField);
155 write(os, binary, fField);
159 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
164 const PtrList<GeometricField<Type, PatchField, GeoMesh>>& flds,
170 write(os, binary, flds[i], vMesh);
180 const volPointInterpolation& pInterp,
181 const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds,
187 write(os, binary, flds[i], pInterp.interpolate(flds[i])(), vMesh);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void insert(const point &, DynamicList< floatScalar > &dest)
Append point to given DynamicList.
List< label > labelList
A List of labels.
static void write(std::ostream &, const bool, DynamicList< floatScalar > &)
Write floats ascii or binary.
Type interpolatePointToCell(const GeometricField< Type, pointPatchField, pointMesh > &ptf, const label celli)
Interpolates (averages) the vertex values to the cell center.