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)
63 if (!objects.found(iter.key()))
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() <<
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>
151 convertVolFields<vector>
155 convertVolFields<sphericalTensor>
159 convertVolFields<symmTensor>
163 convertVolFields<tensor>
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() <<
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List of IOobjects with searching and retrieving facilities.
static void printMemory()
Simple memory used debugging information.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashSet wordHashSet
A HashSet with word keys.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static const word prefix
The prefix to local: lagrangian.
static pointMesh & New(polyMesh &mesh)
word name(const complex &)
Return a string representation of a complex.
#define InfoInFunction
Report an information message using Foam::Info.