diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/Make/options b/applications/utilities/mesh/conversion/foamToStarMesh/Make/options index 1567290170..e3af2fe661 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/Make/options +++ b/applications/utilities/mesh/conversion/foamToStarMesh/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/conversion/lnInclude + -I$(LIB_SRC)/conversion/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude EXE_LIBS = \ -lconversion diff --git a/applications/utilities/mesh/conversion/star4ToFoam/Make/options b/applications/utilities/mesh/conversion/star4ToFoam/Make/options index 1567290170..e3af2fe661 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/Make/options +++ b/applications/utilities/mesh/conversion/star4ToFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/conversion/lnInclude + -I$(LIB_SRC)/conversion/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude EXE_LIBS = \ -lconversion diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml index 18bccb0398..41aa21e674 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml @@ -82,6 +82,19 @@ + + + + + Use vtkPolyhedron instead of decomposing polyhedra + + + GetUseVTKPolyhedron()) { - const cellModel& model = cellShapes[cellI].model(); - - if - ( - model != hex - && model != wedge - && model != prism - && model != pyr - && model != tet - && model != tetWedge - ) + forAll(cellShapes, cellI) { - const cell& cFaces = mesh.cells()[cellI]; + const cellModel& model = cellShapes[cellI].model(); - forAll(cFaces, cFaceI) + if + ( + model != hex + && model != wedge + && model != prism + && model != pyr + && model != tet + && model != tetWedge + ) { - const face& f = mesh.faces()[cFaces[cFaceI]]; + const cell& cFaces = mesh.cells()[cellI]; - label nFacePoints = f.size(); + forAll(cFaces, cFaceI) + { + const face& f = mesh.faces()[cFaces[cFaceI]]; - label nQuads = (nFacePoints - 2)/2; - label nTris = (nFacePoints - 2)%2; - nAddCells += nQuads + nTris; + label nFacePoints = f.size(); + + label nQuads = (nFacePoints - 2)/2; + label nTris = (nFacePoints - 2)%2; + nAddCells += nQuads + nTris; + } + + nAddCells--; + nAddPoints++; } - - nAddCells--; - nAddPoints++; } } @@ -155,7 +162,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh // Set counters for additional points and additional cells label addPointI = 0, addCellI = 0; - // Create storage for points - needed for mapping from Foam to VTK + // Create storage for points - needed for mapping from OpenFOAM to VTK // data types - max 'order' = hex = 8 points vtkIdType nodeIds[8]; @@ -256,6 +263,80 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh nodeIds ); } + else if (reader_->GetUseVTKPolyhedron()) + { + // Polyhedral cell - use VTK_POLYHEDRON + const labelList& cFaces = mesh.cells()[cellI]; + + vtkIdType nFaces = cFaces.size(); + vtkIdType nodeCount = 0; + vtkIdType nLabels = nFaces; + + // count size for face stream + forAll(cFaces, cFaceI) + { + const face& f = mesh.faces()[cFaces[cFaceI]]; + nLabels += f.size(); + } + + // unique node ids - approximately equal to the number of point ids + DynamicList uniqueNodeIds(nLabels-nFaces); + + // zero-based index into uniqueNodeIds + DynamicList faceLabels(nLabels); + + // localized point id within the cell + Map