diff --git a/applications/utilities/mesh/generation/cvMesh/cvMeshDict b/applications/utilities/mesh/generation/cvMesh/cvMeshDict index aa269facff..8c65ed5140 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMeshDict +++ b/applications/utilities/mesh/generation/cvMesh/cvMeshDict @@ -397,7 +397,7 @@ motionControl polyMeshFiltering { // Write the underlying Delaunay tet mesh at output time - writeTetMesh true; + writeTetDualMesh false; //true; // Upper limit on the size of faces to be filtered. // fraction of the local target cell size diff --git a/applications/utilities/postProcessing/dataConversion/foamToTetDualMesh/foamToTetDualMesh.C b/applications/utilities/postProcessing/dataConversion/foamToTetDualMesh/foamToTetDualMesh.C index 716f419440..65552201aa 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTetDualMesh/foamToTetDualMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTetDualMesh/foamToTetDualMesh.C @@ -109,16 +109,22 @@ void ReadAndMapFields { label faceI = -index-1; label bFaceI = faceI - mesh.nInternalFaces(); - if (bFaceI < 0) + if (bFaceI >= 0) { - FatalErrorIn("ReadAndMapFields(..)") - << "Face " << faceI << " from index " << index - << " is not a boundary face." << abort(FatalError); + label patchI = mesh.boundaryMesh().patchID()[bFaceI]; + label localFaceI = mesh.boundaryMesh()[patchI].whichFace + ( + faceI + ); + fld[pointI] = readField.boundaryField()[patchI][localFaceI]; } + //else + //{ + // FatalErrorIn("ReadAndMapFields(..)") + // << "Face " << faceI << " from index " << index + // << " is not a boundary face." << abort(FatalError); + //} - label patchI = mesh.boundaryMesh().patchID()[bFaceI]; - label localFaceI = mesh.boundaryMesh()[patchI].whichFace(faceI); - fld[pointI] = readField.boundaryField()[patchI][localFaceI]; } //else //{ @@ -211,12 +217,12 @@ int main(int argc, char *argv[]) else { label faceI = -index-1; - if (faceI < tetDualMesh.nInternalFaces()) + if (faceI < mesh.nInternalFaces()) { FatalErrorIn(args.executable()) << "Face " << faceI << " from index " << index << " is not a boundary face." - << " nInternalFaces:" << tetDualMesh.nInternalFaces() + << " nInternalFaces:" << mesh.nInternalFaces() << exit(FatalError); } else diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index 2bd65d5771..4600237231 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -250,7 +250,7 @@ void Foam::conformalVoronoiMesh::writeMesh { writeInternalDelaunayVertices(instance); - if (cvMeshControls().writeTetMesh()) + if (cvMeshControls().writeTetDualMesh()) { pointField points; faceList faces; diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C index b1713eaa59..64beecdbdb 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C @@ -271,7 +271,7 @@ Foam::cvControls::cvControls const dictionary& filteringDict(cvMeshDict_.subDict("polyMeshFiltering")); - writeTetMesh_ = Switch(filteringDict.lookup("writeTetMesh")); + writeTetDualMesh_ = Switch(filteringDict.lookup("writeTetDualMesh")); filterSizeCoeff_ = readScalar ( diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H index 5fbda6cdef..4c50f2df31 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H @@ -219,7 +219,7 @@ class cvControls // polyMesh filtering controls //- Write tet mesh at output time (it always writes the Voronoi) - Switch writeTetMesh_; + Switch writeTetDualMesh_; //- Upper limit on the size of faces to be filtered from, // fraction of the local target cell size @@ -387,7 +387,7 @@ public: inline scalar removalDistCoeff() const; //- Write tetMesh at output time - inline Switch writeTetMesh() const; + inline Switch writeTetDualMesh() const; //- Return the filterSizeCoeff inline scalar filterSizeCoeff() const; diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H b/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H index bb67ce4593..7e0615082c 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H @@ -139,9 +139,9 @@ inline Foam::scalar Foam::cvControls::removalDistCoeff() const } -inline Foam::Switch Foam::cvControls::writeTetMesh() const +inline Foam::Switch Foam::cvControls::writeTetDualMesh() const { - return writeTetMesh_; + return writeTetDualMesh_; } diff --git a/tutorials/mesh/cvMesh/car/system/cvMeshDict b/tutorials/mesh/cvMesh/car/system/cvMeshDict index 096a775042..b6b63fd7ec 100644 --- a/tutorials/mesh/cvMesh/car/system/cvMeshDict +++ b/tutorials/mesh/cvMesh/car/system/cvMeshDict @@ -374,7 +374,7 @@ motionControl polyMeshFiltering { // Write the underlying Delaunay tet mesh at output time - writeTetMesh true; + writeTetDualMesh true; // Upper limit on the size of faces to be filtered. // fraction of the local target cell size diff --git a/tutorials/mesh/cvMesh/carWheel/system/cvMeshDict b/tutorials/mesh/cvMesh/carWheel/system/cvMeshDict index 4b21da566b..1353e1f2af 100644 --- a/tutorials/mesh/cvMesh/carWheel/system/cvMeshDict +++ b/tutorials/mesh/cvMesh/carWheel/system/cvMeshDict @@ -375,7 +375,7 @@ motionControl polyMeshFiltering { // Write the underlying Delaunay tet mesh at output time - writeTetMesh true; + writeTetDualMesh true; // Upper limit on the size of faces to be filtered. // fraction of the local target cell size diff --git a/tutorials/mesh/cvMesh/flange/system/cvMeshDict-generatePoints b/tutorials/mesh/cvMesh/flange/system/cvMeshDict-generatePoints index 2b89c0f82a..7698f99c65 100644 --- a/tutorials/mesh/cvMesh/flange/system/cvMeshDict-generatePoints +++ b/tutorials/mesh/cvMesh/flange/system/cvMeshDict-generatePoints @@ -196,6 +196,8 @@ motionControl polyMeshFiltering { + // Write the underlying Delaunay tet mesh at output time + writeTetDualMesh true; filterSizeCoeff 0.2; mergeClosenessCoeff 1e-4; continueFilteringOnBadInitialPolyMesh true; diff --git a/tutorials/mesh/cvMesh/flange/system/cvMeshDict-usePoints b/tutorials/mesh/cvMesh/flange/system/cvMeshDict-usePoints index f18afac701..966bf3815f 100644 --- a/tutorials/mesh/cvMesh/flange/system/cvMeshDict-usePoints +++ b/tutorials/mesh/cvMesh/flange/system/cvMeshDict-usePoints @@ -171,6 +171,9 @@ motionControl polyMeshFiltering { + // Write the underlying Delaunay tet mesh at output time + writeTetDualMesh true; + filterSizeCoeff 0.2; mergeClosenessCoeff 1e-4; continueFilteringOnBadInitialPolyMesh true;