29 #ifndef vtkPVFoamSurfaceField_H 30 #define vtkPVFoamSurfaceField_H 36 #include "vtkCellData.h" 37 #include "vtkFloatArray.h" 38 #include "vtkMultiBlockDataSet.h" 39 #include "vtkPolyData.h" 46 void Foam::vtkPVFoam::convertSurfaceField
48 const GeometricField<Type, fvPatchField, volMesh>& tf,
49 vtkMultiBlockDataSet* output,
50 const arrayRange& range,
51 const label datasetNo,
56 const label nComp = pTraits<Type>::nComponents;
57 const label nInternalFaces = mesh.nInternalFaces();
58 const labelList& faceOwner = mesh.faceOwner();
59 const labelList& faceNeigh = mesh.faceNeighbour();
62 cellData->SetNumberOfTuples(faceLabels.size());
63 cellData->SetNumberOfComponents(nComp);
64 cellData->Allocate(nComp*faceLabels.size());
65 cellData->SetName(tf.name().c_str());
69 Info<<
"convert convertSurfaceField: " 71 <<
" size = " << tf.size()
73 <<
" nTuples = " << faceLabels.size() <<
endl;
82 const label faceNo = faceLabels[facei];
83 if (faceNo < nInternalFaces)
85 Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
94 const Type& t = tf[faceOwner[faceNo]];
100 vtkOpenFOAMTupleRemap<Type>(vec);
102 cellData->InsertTuple(facei, vec);
106 vtkPolyData::SafeDownCast
108 GetDataSetFromBlock(output, range, datasetNo)
110 ->AddArray(cellData);
117 void Foam::vtkPVFoam::convertSurfaceField
119 const GeometricField<Type, fvsPatchField, surfaceMesh>& tf,
120 vtkMultiBlockDataSet* output,
121 const arrayRange& range,
122 const label datasetNo,
127 const label nComp = pTraits<Type>::nComponents;
128 const label nInternalFaces = mesh.nInternalFaces();
131 cellData->SetNumberOfTuples(faceLabels.size());
132 cellData->SetNumberOfComponents(nComp);
133 cellData->Allocate(nComp*faceLabels.size());
134 cellData->SetName(tf.name().c_str());
138 Info<<
"convert convertSurfaceField: " 140 <<
" size = " << tf.size()
141 <<
" nComp=" << nComp
142 <<
" nTuples = " << faceLabels.size() <<
endl;
146 Field<Type> flatFld(mesh.nFaces(),
Zero);
147 SubField<Type>(flatFld, nInternalFaces) = tf.internalField();
150 const fvsPatchField<Type>& fvs = tf.boundaryField()[
patchi];
165 const label faceNo = faceLabels[facei];
172 vtkOpenFOAMTupleRemap<Type>(vec);
174 cellData->InsertTuple(facei, vec);
177 vtkPolyData::SafeDownCast
179 GetDataSetFromBlock(output, range, datasetNo)
181 ->AddArray(cellData);
188 void Foam::vtkPVFoam::convertSurfaceFields
191 const IOobjectList& objects,
192 vtkMultiBlockDataSet* output
200 iter()->headerClassName()
208 const GeometricField<Type, fvsPatchField, surfaceMesh>
tf 217 int partId = arrayRangePatches_.start();
218 partId < arrayRangePatches_.end();
222 const word patchName = getPartName(partId);
223 const label datasetNo = partDataset_[partId];
224 const label patchId = mesh.boundaryMesh().findPatchID(patchName);
226 if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
231 const fvsPatchField<Type>& ptf = tf.boundaryField()[
patchId];
233 if (!
isType<emptyFvsPatchField<Type>>(ptf))
250 int partId = arrayRangeFaceZones_.start();
251 partId < arrayRangeFaceZones_.end();
255 const word zoneName = getPartName(partId);
256 const label datasetNo = partDataset_[partId];
258 if (!partStatus_[partId] || datasetNo < 0)
264 const label zoneId = zMesh.findZoneID(zoneName);
275 arrayRangeFaceZones_,
285 int partId = arrayRangeFaceSets_.start();
286 partId < arrayRangeFaceSets_.end();
290 const word selectName = getPartName(partId);
291 const label datasetNo = partDataset_[partId];
293 if (!partStatus_[partId] || datasetNo < 0)
298 const faceSet fSet(mesh, selectName);
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static const char *const typeName
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool isType(const Type &t)
Check the typeid.
List< label > labelList
A List of labels.
MeshZones< faceZone, polyMesh > meshFaceZones
A MeshZones with the type faceZone.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)