diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C index 351e52c7ac..c9d21f86a0 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) "cvMeshDict", runTime.system(), runTime, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 1357d8a9a6..faa7b863d0 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -33,7 +33,7 @@ License Foam::conformalVoronoiMesh::conformalVoronoiMesh ( const Time& runTime, - const IOdictionary& cvMeshDict + const dictionary& cvMeshDict ) : HTriangulation(), @@ -519,7 +519,28 @@ void Foam::conformalVoronoiMesh::insertFlatEdgePointGroup const pointIndexHit& edHit ) { - Info<< "NOT INSERTING FLAT EDGE POINT GROUP, NOT IMPLEMENTED" << endl; + const point& edgePt = edHit.hitPoint(); + + scalar ppDist = pointPairDistance(edgePt); + + const vectorField& feNormals = feMesh.normals(); + const labelList& edNormalIs = feMesh.edgeNormals()[edHit.index()]; + + // As this is a flat edge, there are two normals by definition + const vector& nA = feNormals[edNormalIs[0]]; + const vector& nB = feNormals[edNormalIs[1]]; + + // Average normal to remove any bias to one side, although as this + // is a flat edge, the normals should be essentially the same + vector n = 0.5*(nA + nB); + + // Direction along the surface to the control point, sense of edge + // direction not important, as +s and -s can be used because this + // is a flat edge + vector s = 2.0*ppDist*(feMesh.edgeDirections()[edHit.index()] ^ n); + + insertPointPair(ppDist, edgePt + s, n); + insertPointPair(ppDist, edgePt - s, n); } diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 873fd10267..3208845d27 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -657,7 +657,7 @@ public: conformalVoronoiMesh ( const Time& runTime, - const IOdictionary& cvMeshDict + const dictionary& cvMeshDict ); diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C index ae53f4214a..516fe688dc 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.C @@ -31,7 +31,7 @@ License Foam::cvControls::cvControls ( const conformalVoronoiMesh& cvMesh, - const IOdictionary& cvMeshDict + const dictionary& cvMeshDict ) : cvMesh_(cvMesh), diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H index 1b194fd5ba..5f28f8a92f 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControls.H @@ -35,7 +35,7 @@ SourceFiles #ifndef cvControls_H #define cvControls_H -#include "IOdictionary.H" +#include "dictionary.H" #include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ class cvControls const conformalVoronoiMesh& cvMesh_; //- Reference to the cvMeshDict - const IOdictionary& cvMeshDict_; + const dictionary& cvMeshDict_; // General parameters @@ -282,11 +282,11 @@ public: // Constructors - //- Construct from references to conformalVoronoiMesh and IOdictionary + //- Construct from references to conformalVoronoiMesh and dictionary cvControls ( const conformalVoronoiMesh& cvMesh, - const IOdictionary& cvMeshDict + const dictionary& cvMeshDict ); @@ -299,7 +299,7 @@ public: // Access //- Return the cvMeshDict - inline const IOdictionary& cvMeshDict() const; + inline const dictionary& cvMeshDict() const; //- Return the span inline scalar span() const; diff --git a/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H b/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H index 4184e17df3..4734f1398b 100644 --- a/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H +++ b/src/mesh/conformalVoronoiMesh/cvControls/cvControlsI.H @@ -25,7 +25,7 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::IOdictionary& Foam::cvControls::cvMeshDict() const +inline const Foam::dictionary& Foam::cvControls::cvMeshDict() const { return cvMeshDict_; }