29 #ifndef vtkPVFoamPointFields_H 30 #define vtkPVFoamPointFields_H 40 void Foam::vtkPVFoam::convertPointFields
43 const pointMesh& pMesh,
44 const IOobjectList& objects,
45 vtkMultiBlockDataSet* output
48 const polyBoundaryMesh& patches = mesh.boundaryMesh();
52 const word& fieldName = iter()->name();
56 iter()->headerClassName()
65 Info<<
"Foam::vtkPVFoam::convertPointFields : " 69 GeometricField<Type, pointPatchField, pointMesh> ptf
77 convertPointFieldBlock
86 convertPointFieldBlock
95 convertPointFieldBlock
109 int partId = arrayRangePatches_.start();
110 partId < arrayRangePatches_.end();
114 const word patchName = getPartName(partId);
115 const label datasetNo = partDataset_[partId];
116 const label patchId = patches.findPatchID(patchName);
118 if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
123 convertPatchPointField
126 ptf.boundaryField()[
patchId].patchInternalField()(),
138 int partId = arrayRangeFaceZones_.start();
139 partId < arrayRangeFaceZones_.end();
143 const word zoneName = getPartName(partId);
144 const label datasetNo = partDataset_[partId];
145 const label zoneId = mesh.faceZones().findZoneID(zoneName);
147 if (!partStatus_[partId] || datasetNo < 0 || zoneId < 0)
155 ptf.primitiveField(),
156 mesh.faceZones()[zoneId]().meshPoints()
159 convertPatchPointField
164 arrayRangeFaceZones_,
173 void Foam::vtkPVFoam::convertPointFieldBlock
175 const GeometricField<Type, pointPatchField, pointMesh>& ptf,
176 vtkMultiBlockDataSet* output,
177 const arrayRange& range,
178 const List<polyDecomp>& decompLst
181 for (
int partId = range.start(); partId < range.end(); ++partId)
183 const label datasetNo = partDataset_[partId];
185 if (datasetNo >= 0 && partStatus_[partId])
202 void Foam::vtkPVFoam::convertPointField
204 const GeometricField<Type, pointPatchField, pointMesh>& ptf,
205 const GeometricField<Type, fvPatchField, volMesh>& tf,
206 vtkMultiBlockDataSet* output,
207 const arrayRange& range,
208 const label datasetNo,
209 const polyDecomp& decomp
212 const label nComp = pTraits<Type>::nComponents;
213 const labelList& addPointCellLabels = decomp.addPointCellLabels();
214 const labelList& pointMap = decomp.pointMap();
220 nPoints = pointMap.size();
224 nPoints = ptf.size();
228 pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
229 pointData->SetNumberOfComponents(nComp);
230 pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));
237 pointData->SetName(tf.name().c_str());
241 pointData->SetName(ptf.name().c_str());
246 Info<<
"convert convertPointField: " 248 <<
" size = " << nPoints
249 <<
" nComp=" << nComp
250 <<
" nTuples = " << (nPoints + addPointCellLabels.size())
260 const Type& t = ptf[pointMap[i]];
265 vtkOpenFOAMTupleRemap<Type>(vec);
267 pointData->InsertTuple(i, vec);
274 const Type& t = ptf[i];
279 vtkOpenFOAMTupleRemap<Type>(vec);
281 pointData->InsertTuple(i, vec);
290 forAll(addPointCellLabels, apI)
292 const Type& t = tf[addPointCellLabels[apI]];
297 vtkOpenFOAMTupleRemap<Type>(vec);
299 pointData->InsertTuple(i++, vec);
304 forAll(addPointCellLabels, apI)
311 vtkOpenFOAMTupleRemap<Type>(vec);
313 pointData->InsertTuple(i++, vec);
317 vtkUnstructuredGrid::SafeDownCast
319 GetDataSetFromBlock(output, range, datasetNo)
321 ->AddArray(pointData);
#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.
static const char *const typeName
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< label > labelList
A List of labels.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
Type interpolatePointToCell(const GeometricField< Type, pointPatchField, pointMesh > &ptf, const label celli)
Interpolates (averages) the vertex values to the cell center.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)