27 #include "vtkPVblockMeshReader.h" 33 #include "vtkOpenFOAMPoints.H" 36 #include "vtkCellArray.h" 37 #include "vtkDataArraySelection.h" 38 #include "vtkMultiBlockDataSet.h" 39 #include "vtkPoints.h" 40 #include "vtkPolyData.h" 41 #include "vtkUnstructuredGrid.h" 46 void Foam::vtkPVblockMesh::convertMeshBlocks
48 vtkMultiBlockDataSet* output,
52 vtkDataArraySelection* selection = reader_->GetBlockSelection();
53 arrayRange& range = arrayRangeBlocks_;
57 const blockMesh& blkMesh = *meshPtr_;
66 const scalar scaleFactor = blkMesh.scaleFactor();
70 int partId = range.start();
75 if (!blockStatus_[partId])
80 const blockDescriptor& blockDef = blkMesh[blockI];
86 vtkpoints->Allocate( blockDef.nPoints() );
87 const labelList& blockLabels = blockDef.blockShape();
97 blockPoints[blockLabels[ptI]],
104 vtkmesh->InsertNextCell
111 vtkmesh->SetPoints(vtkpoints);
116 output, vtkmesh, range, datasetNo,
117 selection->GetArrayName(partId)
133 void Foam::vtkPVblockMesh::convertMeshEdges
135 vtkMultiBlockDataSet* output,
139 vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
140 arrayRange& range = arrayRangeEdges_;
142 range.block(blockNo);
145 const blockMesh& blkMesh = *meshPtr_;
149 const scalar scaleFactor = blkMesh.scaleFactor();
153 int partId = range.start();
154 partId < range.end();
158 if (!edgeStatus_[partId])
166 const blockDescriptor& blockDef = blkMesh[blockI];
168 edgeList blkEdges = blockDef.blockShape().edges();
173 blockDef.edgesPointsWeights(edgesPoints, edgesWeights);
176 label foundEdgeI = -1;
177 forAll(blkEdges, blkEdgeI)
179 if (edges[edgeI].compare(blkEdges[blkEdgeI]))
181 foundEdgeI = blkEdgeI;
186 if (foundEdgeI != -1)
188 const List<point>& edgePoints = edgesPoints[foundEdgeI];
193 vtkpoints->Allocate( edgePoints.size() );
194 vtkmesh->Allocate(1);
196 vtkIdType pointIds[edgePoints.size()];
208 vtkmesh->InsertNextCell
215 vtkmesh->SetPoints(vtkpoints);
220 output, vtkmesh, range, datasetNo,
221 selection->GetArrayName(partId)
241 void Foam::vtkPVblockMesh::convertMeshCorners
243 vtkMultiBlockDataSet* output,
247 arrayRange& range = arrayRangeCorners_;
248 range.block(blockNo);
252 const scalar& scaleFactor = meshPtr_->
scaleFactor();
265 vtkpoints->Allocate( blockPoints.size() );
266 vtkcells->Allocate( blockPoints.size() );
268 vtkIdType pointId = 0;
278 vtkcells->InsertNextCell(1, &pointId);
282 vtkmesh->SetPoints(vtkpoints);
285 vtkmesh->SetVerts(vtkcells);
290 output, vtkmesh, range, datasetNo,
291 arrayRangeCorners_.name()
#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)
void vtkInsertNextOpenFOAMPoint(vtkPoints *points, const Foam::point &p)
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar scaleFactor() const
The scaling factor used to convert to meters.
const pointField & vertices() const
Reference to point field defining the blockMesh.
vectorField pointField
pointField is a vectorField.
Pre-declare SubField and related Field type.
List< scalar > scalarList
A List of scalars.
List< label > labelList
A List of labels.
PtrList< blockEdge > blockEdgeList
A PtrList of blockEdges.
#define InfoInFunction
Report an information message using Foam::Info.