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::convertVolFields
87 vtkMultiBlockDataSet* output
90 const fvMesh& mesh = *meshPtr_;
94 reader_->GetVolFieldSelection()
97 if (selectedFields.empty())
121 Info<<
"<beg> Foam::vtkPVFoam::convertVolFields" << nl
122 <<
"converting OpenFOAM volume fields" <<
endl;
125 Info<<
" " << iter()->name()
126 <<
" == " << iter()->objectPath() <<
nl;
132 PtrList<PrimitivePatchInterpolation<primitivePatch>>
133 ppInterpList(mesh.boundaryMesh().size());
140 new PrimitivePatchInterpolation<primitivePatch>
142 mesh.boundaryMesh()[i]
148 bool interpFields = reader_->GetInterpolateVolFields();
150 convertVolFields<scalar>
154 convertVolFields<vector>
158 convertVolFields<sphericalTensor>
162 convertVolFields<symmTensor>
166 convertVolFields<tensor>
173 Info<<
"<end> Foam::vtkPVFoam::convertVolFields" <<
endl;
179 void Foam::vtkPVFoam::convertPointFields
181 vtkMultiBlockDataSet* output
184 const fvMesh& mesh = *meshPtr_;
188 reader_->GetPointFieldSelection()
191 if (selectedFields.empty())
195 Info<<
"no point fields selected" <<
endl;
219 Info<<
"<beg> Foam::vtkPVFoam::convertPointFields" << nl
220 <<
"converting OpenFOAM volume fields -> point fields" <<
endl;
223 Info<<
" " << iter()->name()
224 <<
" == " << iter()->objectPath() <<
nl;
233 convertPointFields<scalar>
237 convertPointFields<vector>
241 convertPointFields<sphericalTensor>
245 convertPointFields<symmTensor>
249 convertPointFields<tensor>
256 Info<<
"<end> Foam::vtkPVFoam::convertPointFields" <<
endl;
262 void Foam::vtkPVFoam::convertLagrangianFields
264 vtkMultiBlockDataSet* output
267 arrayRange& range = arrayRangeLagrangian_;
268 const fvMesh& mesh = *meshPtr_;
272 reader_->GetLagrangianFieldSelection()
275 if (selectedFields.empty())
282 Info<<
"<beg> Foam::vtkPVFoam::convertLagrangianFields" <<
endl;
286 for (
int partId = range.start(); partId < range.end(); ++partId)
288 const word cloudName = getPartName(partId);
289 const label datasetNo = partDataset_[partId];
291 if (!partStatus_[partId] || datasetNo < 0)
318 Info<<
"converting OpenFOAM lagrangian fields" <<
nl;
321 Info<<
" " << iter()->name()
322 <<
" == " << iter()->objectPath() <<
nl;
326 convertLagrangianFields<label>
330 convertLagrangianFields<scalar>
334 convertLagrangianFields<vector>
338 convertLagrangianFields<sphericalTensor>
342 convertLagrangianFields<symmTensor>
346 convertLagrangianFields<tensor>
354 Info<<
"<end> Foam::vtkPVFoam::convertLagrangianFields" <<
endl;
#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 void printMemory()
Simple memory used debugging information.
List of IOobjects with searching and retrieving facilities.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const pointMesh & New(const polyMesh &mesh)
HashSet wordHashSet
A HashSet with word keys.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static const word prefix
The prefix to local: lagrangian.
word name(const complex &)
Return a string representation of a complex.