27 #include "vtkDataArraySelection.h"
28 #include "vtkPolyData.h"
29 #include "vtkUnstructuredGrid.h"
34 #include "vtkPVFoamReader.h"
46 const fileName& instance,
53 return IOobjectList(0);
57 IOobjectList
objects(mesh, instance, local);
60 IOobjectList objectsConstant(mesh, dbPtr_().constant(), local);
61 forAllIter(IOobjectList, objectsConstant, iter)
67 *objectsConstant.HashPtrTable<IOobject>::remove(iter)
75 if (!selected.found(iter()->
name()))
85 void Foam::vtkPVFoam::convertFields(vtkMultiBlockDataSet* output)
87 const fvMesh& mesh = *meshPtr_;
91 reader_->GetFieldSelection()
94 if (selectedFields.empty())
119 <<
" converting OpenFOAM volume fields" <<
endl;
122 Info<<
" " << iter()->name()
123 <<
" == " << iter()->objectPath(
false) <<
nl;
129 PtrList<PrimitivePatchInterpolation<primitivePatch>>
130 ppInterpList(mesh.boundaryMesh().size());
137 new PrimitivePatchInterpolation<primitivePatch>
139 mesh.boundaryMesh()[i]
145 bool interpFields = reader_->GetInterpolateVolFields();
147 convertVolFields<scalar>
149 mesh, ppInterpList,
objects, interpFields, output
151 convertVolFields<vector>
153 mesh, ppInterpList,
objects, interpFields, output
155 convertVolFields<sphericalTensor>
157 mesh, ppInterpList,
objects, interpFields, output
159 convertVolFields<symmTensor>
161 mesh, ppInterpList,
objects, interpFields, output
163 convertVolFields<tensor>
165 mesh, ppInterpList,
objects, interpFields, output
168 convertVolInternalFields<scalar>
172 convertVolInternalFields<vector>
176 convertVolInternalFields<sphericalTensor>
180 convertVolInternalFields<symmTensor>
184 convertVolInternalFields<tensor>
189 convertSurfaceFields<scalar>(mesh,
objects, output);
190 convertSurfaceFields<vector>(mesh,
objects, output);
191 convertSurfaceFields<sphericalTensor>(mesh,
objects, output);
192 convertSurfaceFields<symmTensor>(mesh,
objects, output);
193 convertSurfaceFields<tensor>(mesh,
objects, output);
198 convertPointFields<scalar>(mesh, pMesh,
objects, output);
199 convertPointFields<vector>(mesh, pMesh,
objects, output);
200 convertPointFields<sphericalTensor>(mesh, pMesh,
objects, output);
201 convertPointFields<symmTensor>(mesh, pMesh,
objects, output);
202 convertPointFields<tensor>(mesh, pMesh,
objects, output);
211 void Foam::vtkPVFoam::convertLagrangianFields(vtkMultiBlockDataSet* output)
213 arrayRange&
range = arrayRangeLagrangian_;
214 const fvMesh& mesh = *meshPtr_;
218 reader_->GetLagrangianFieldSelection()
221 if (selectedFields.empty())
232 for (
int partId =
range.start(); partId <
range.end(); ++partId)
234 const word
cloudName = getPartName(partId);
235 const label datasetNo = partDataset_[partId];
237 if (!partStatus_[partId] || datasetNo < 0)
265 <<
"converting OpenFOAM lagrangian fields" <<
nl <<
" ";
268 Info<<
" " << iter()->name()
269 <<
" == " << iter()->objectPath(
false) <<
nl;
273 convertLagrangianFields<label>
277 convertLagrangianFields<scalar>
281 convertLagrangianFields<vector>
285 convertLagrangianFields<sphericalTensor>
289 convertLagrangianFields<symmTensor>
293 convertLagrangianFields<tensor>
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static pointMesh & New(const polyMesh &mesh)
List of IOobjects with searching and retrieving facilities.
static const word prefix
The prefix to local: lagrangian.
#define InfoInFunction
Report an information message using Foam::Info.
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.
word name(const bool)
Return a word representation of a bool.
HashSet wordHashSet
A HashSet with word keys.
const word cloudName(propsDict.lookup("cloudName"))