29 #ifndef vtkPVFoamPointFields_H
30 #define vtkPVFoamPointFields_H
40 void Foam::vtkPVFoam::convertPointFields
43 const pointMesh& pMesh,
45 vtkMultiBlockDataSet* output
48 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
52 const word& fieldName = iter()->name();
56 iter()->headerClassName()
65 Info<<
"Foam::vtkPVFoam::convertPointFields : "
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];
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().findIndex(zoneName);
147 if (!partStatus_[partId] || datasetNo < 0 || zoneId < 0)
155 ptf.primitiveField(),
156 mesh.faceZones()[zoneId].patch().meshPoints()
159 convertPatchPointField
164 arrayRangeFaceZones_,
173 void Foam::vtkPVFoam::convertPointFieldBlock
175 const PointField<Type>& 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 PointField<Type>& ptf,
205 const VolField<Type>&
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();
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: "
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.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static const char *const typeName
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Interpolates (averages) the vertex values to the cell center.
const fvPatchList & patches
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
List< label > labelList
A List of labels.
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.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Type interpolatePointToCell(const PointField< Type > &ptf, const label celli)