diff --git a/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.C b/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.C index b5ea3d9ec72b8bfe8c83dfbdd7b5ffa306a47748..91ff5857713f46728eb898463f52f6dec16289b1 100644 --- a/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.C +++ b/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.C @@ -30,10 +30,8 @@ License namespace Foam { - -defineTypeNameAndDebug(closedTriSurfaceMesh, 0); -addToRunTimeSelectionTable(searchableSurface, closedTriSurfaceMesh, dict); - + defineTypeNameAndDebug(closedTriSurfaceMesh, 0); + addToRunTimeSelectionTable(searchableSurface, closedTriSurfaceMesh, dict); } @@ -65,10 +63,4 @@ Foam::closedTriSurfaceMesh::closedTriSurfaceMesh {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::closedTriSurfaceMesh::~closedTriSurfaceMesh() -{} - - // ************************************************************************* // diff --git a/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.H b/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.H index 3d53f3e4b65b6b246b5f95fff66c79ebc8e6ce18..7fba476649d825fffaaef08b629fa2eb97d678a4 100644 --- a/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.H +++ b/src/meshTools/searchableSurfaces/closedTriSurfaceMesh/closedTriSurfaceMesh.H @@ -52,7 +52,8 @@ class closedTriSurfaceMesh : public triSurfaceMesh { -private: + + // Private Member Functions //- No copy construct closedTriSurfaceMesh(const closedTriSurfaceMesh&) = delete; @@ -76,7 +77,7 @@ public: closedTriSurfaceMesh(const IOobject& io); //- Construct from IO and dictionary (used by searchableSurface). - // Dictionary may contain a 'scale' entry (eg, 0.001: mm -> m) + // Dictionary may contain a 'scale' entry (eg, 0.001: mm to m) closedTriSurfaceMesh ( const IOobject& io, @@ -84,9 +85,9 @@ public: ); - // Destructor + //- Destructor + virtual ~closedTriSurfaceMesh() = default; - virtual ~closedTriSurfaceMesh(); // Member Functions diff --git a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C index 244c931ddd72b7bbb87ed50f965123b7c174305d..d3daaa1852223b44944eb855bcd30c4eb1d49fbc 100644 --- a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C +++ b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,7 +32,19 @@ License namespace Foam { defineTypeNameAndDebug(searchableBox, 0); - addToRunTimeSelectionTable(searchableSurface, searchableBox, dict); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableBox, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableBox, + dict, + box + ); } @@ -47,6 +59,7 @@ void Foam::searchableBox::projectOntoCoordPlane { // Set point info.rawPoint()[dir] = planePt[dir]; + // Set face if (planePt[dir] == min()[dir]) { @@ -92,7 +105,7 @@ Foam::pointIndexHit Foam::searchableBox::findNearest // (for internal points) per direction what nearest cube side is point near; - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (info.rawPoint()[dir] < min()[dir]) { @@ -188,7 +201,7 @@ Foam::searchableBox::searchableBox ) : searchableSurface(io), - treeBoundBox(dict.lookup("min"), dict.lookup("max")) + treeBoundBox(dict.get<point>("min"), dict.get<point>("max")) { if (!contains(midpoint())) { @@ -201,12 +214,6 @@ Foam::searchableBox::searchableBox } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableBox::~searchableBox() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchableBox::regions() const @@ -222,8 +229,8 @@ const Foam::wordList& Foam::searchableBox::regions() const Foam::tmp<Foam::pointField> Foam::searchableBox::coordinates() const { - tmp<pointField> tCtrs(new pointField(6)); - pointField& ctrs = tCtrs.ref(); + auto tctrs = tmp<pointField>::New(6); + auto& ctrs = tctrs.ref(); const pointField pts(treeBoundBox::points()); const faceList& fcs = treeBoundBox::faces; @@ -233,7 +240,7 @@ Foam::tmp<Foam::pointField> Foam::searchableBox::coordinates() const ctrs[i] = fcs[i].centre(pts); } - return tCtrs; + return tctrs; } @@ -255,9 +262,9 @@ void Foam::searchableBox::boundingSpheres const face& f = fcs[i]; centres[i] = f.centre(pts); - forAll(f, fp) + for (const label pointi : f) { - const point& pt = pts[f[fp]]; + const point& pt = pts[pointi]; radiusSqr[i] = Foam::max ( @@ -303,7 +310,7 @@ Foam::pointIndexHit Foam::searchableBox::findNearestOnEdge // (for internal points) per direction what nearest cube side is point near; - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (info.rawPoint()[dir] < min()[dir]) { @@ -405,7 +412,7 @@ Foam::pointIndexHit Foam::searchableBox::findLine { info.setHit(); - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (info.rawPoint()[dir] == min()[dir]) { @@ -602,20 +609,23 @@ void Foam::searchableBox::getVolumeType ) const { volType.setSize(points.size()); - volType = volumeType::INSIDE; forAll(points, pointi) { const point& pt = points[pointi]; - for (direction dir = 0; dir < vector::nComponents; dir++) + volumeType vt = volumeType::INSIDE; + + for (direction dir=0; dir < vector::nComponents; ++dir) { if (pt[dir] < min()[dir] || pt[dir] > max()[dir]) { - volType[pointi] = volumeType::OUTSIDE; + vt = volumeType::OUTSIDE; break; } } + + volType[pointi] = vt; } } diff --git a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.H b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.H index be85f6bf7dc4993f12b7bad635f6b8c72d9c84cd..73a8b6c61e3aad310c843f46841ccc2265fb05eb 100644 --- a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.H +++ b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,14 @@ Class Description Searching on bounding box + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | box / searchableBox | selector | + min | minimum point for bounding box | yes | + max | maximum point for bounding box | yes | + \endtable + SourceFiles searchableBox.C @@ -43,8 +51,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ Class searchableBox Declaration \*---------------------------------------------------------------------------*/ @@ -54,8 +60,6 @@ class searchableBox public searchableSurface, public treeBoundBox { -private: - // Private Member Data mutable wordList regions_; @@ -109,14 +113,15 @@ public: ); //- Destructor - virtual ~searchableBox(); + virtual ~searchableBox() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below + //- Whether surface supports volume type (below) virtual bool hasVolumeType() const { return true; @@ -248,12 +253,11 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside) for points. virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.C b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.C index 4174a8abab0b8ce87254d1b88364df2d79755fa6..a28dc3600d857e2a6e207ff39d3b6a538641ef1b 100644 --- a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.C +++ b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,19 @@ License namespace Foam { defineTypeNameAndDebug(searchableCone, 0); - addToRunTimeSelectionTable(searchableSurface, searchableCone, dict); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableCone, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableCone, + dict, + cone + ); } @@ -39,9 +51,7 @@ namespace Foam Foam::tmp<Foam::pointField> Foam::searchableCone::coordinates() const { - tmp<pointField> tCtrs(new pointField(1, 0.5*(point1_ + point2_))); - - return tCtrs; + return tmp<pointField>::New(1, 0.5*(point1_ + point2_)); } @@ -71,13 +81,13 @@ void Foam::searchableCone::boundingSpheres Foam::tmp<Foam::pointField> Foam::searchableCone::points() const { - tmp<pointField> tPts(new pointField(2)); - pointField& pts = tPts.ref(); + auto tpts = tmp<pointField>::New(2); + auto& pts = tpts.ref(); pts[0] = point1_; pts[1] = point2_; - return tPts; + return tpts; } @@ -92,7 +102,7 @@ void Foam::searchableCone::findNearestAndNormal vector v(sample - point1_); // Decompose sample-point1 into normal and parallel component - scalar parallel = (v & unitDir_); + const scalar parallel = (v & unitDir_); // Remove the parallel component and normalise v -= parallel*unitDir_; @@ -338,8 +348,8 @@ void Foam::searchableCone::findLineAll vector point1End(end-cone.point1_); // Quick rejection of complete vector outside endcaps - scalar s1 = point1Start&(cone.unitDir_); - scalar s2 = point1End&(cone.unitDir_); + scalar s1 = point1Start & (cone.unitDir_); + scalar s2 = point1End & (cone.unitDir_); if ((s1 < 0.0 && s2 < 0.0) || (s1 > cone.magDir_ && s2 > cone.magDir_)) { @@ -735,12 +745,12 @@ Foam::searchableCone::searchableCone ) : searchableSurface(io), - point1_(dict.lookup("point1")), - radius1_(readScalar(dict.lookup("radius1"))), - innerRadius1_(dict.lookupOrDefault("innerRadius1", 0.0)), - point2_(dict.lookup("point2")), - radius2_(readScalar(dict.lookup("radius2"))), - innerRadius2_(dict.lookupOrDefault("innerRadius2", 0.0)), + point1_(dict.get<point>("point1")), + radius1_(dict.get<scalar>("radius1")), + innerRadius1_(dict.lookupOrDefault<scalar>("innerRadius1", 0)), + point2_(dict.get<point>("point2")), + radius2_(dict.get<scalar>("radius2")), + innerRadius2_(dict.lookupOrDefault<scalar>("innerRadius2", 0)), magDir_(mag(point2_-point1_)), unitDir_((point2_-point1_)/magDir_) { @@ -748,12 +758,6 @@ Foam::searchableCone::searchableCone } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableCone::~searchableCone() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchableCone::regions() const @@ -775,6 +779,7 @@ void Foam::searchableCone::findNearest ) const { info.setSize(samples.size()); + forAll(samples, i) { vector normal; @@ -1071,48 +1076,36 @@ void Foam::searchableCone::getVolumeType ) const { volType.setSize(points.size()); - volType = volumeType::INSIDE; - forAll(points, pointI) + forAll(points, pointi) { - const point& pt = points[pointI]; + const point& pt = points[pointi]; + + volType[pointi] = volumeType::OUTSIDE; vector v(pt - point1_); // Decompose sample-point1 into normal and parallel component - scalar parallel = v & unitDir_; - scalar comp = parallel; - scalar compInner = parallel; + const scalar parallel = (v & unitDir_); + // Quick rejection. Left of point1 endcap, or right of point2 endcap + if (parallel < 0 || parallel > magDir_) + { + continue; + } - scalar radius_sec = radius1_+comp*(radius2_-radius1_)/magDir_; + const scalar radius_sec = + radius1_ + parallel * (radius2_-radius1_)/magDir_; - scalar radius_sec_inner = - innerRadius1_ - +compInner*(innerRadius2_-innerRadius1_)/magDir_; + const scalar radius_sec_inner = + innerRadius1_ + parallel * (innerRadius2_-innerRadius1_)/magDir_; - if (parallel < 0) - { - // Left of point1 endcap - volType[pointI] = volumeType::OUTSIDE; - } - else if (parallel > magDir_) - { - // Right of point2 endcap - volType[pointI] = volumeType::OUTSIDE; - } - else + // Remove the parallel component + v -= parallel*unitDir_; + + if (mag(v) >= radius_sec_inner && mag(v) <= radius_sec) { - // Remove the parallel component - v -= parallel*unitDir_; - if (mag(v) >= radius_sec_inner && mag(v) <= radius_sec) - { - volType[pointI] = volumeType::INSIDE; - } - else - { - volType[pointI] = volumeType::OUTSIDE; - } + volType[pointi] = volumeType::INSIDE; } } } diff --git a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H index 25ad87f5c0c31fcb72c4bb60d96b7d85521bfb0b..9681ea3b383b59fe8a20558295868d244a6c8129 100644 --- a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H +++ b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,15 +27,16 @@ Class Description Searching on (optionally hollow) cone. - \heading Function object usage + \heading Dictionary parameters \table - Property | Description | Required | Default value - point1 | coordinate of endpoint | yes | - radius1 | radius at point1 | yes | yes - innerRadius1 | inner radius at point1 | no | - point2 | coordinate of endpoint | yes | - radius2 | radius at point2 | yes | yes - innerRadius2 | inner radius at point2 | no | + Property | Description | Required | Default + type | code / searchableCone | selector | + point1 | coordinate of endpoint | yes | + radius1 | radius at point1 | yes | + innerRadius1| inner radius at point1 | no | 0 + point2 | coordinate of endpoint | yes | + radius2 | radius at point2 | yes | + innerRadius2| inner radius at point2 | no | 0 \endtable Note @@ -145,22 +146,22 @@ class searchableCone public: //- Runtime type information - TypeName("searchableCone"); + TypeName("searchableCone"); // Constructors //- Construct from components - searchableCone - ( - const IOobject& io, - const point& point1, - const scalar radius1, - const scalar innerRadius1, - const point& point2, - const scalar radius2, - const scalar innerRadius2 - ); + searchableCone + ( + const IOobject& io, + const point& point1, + const scalar radius1, + const scalar innerRadius1, + const point& point2, + const scalar radius2, + const scalar innerRadius2 + ); //- Construct from dictionary (used by searchableSurface) searchableCone @@ -171,15 +172,15 @@ public: //- Destructor - - virtual ~searchableCone(); + virtual ~searchableCone() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below + //- Whether supports volume type (below) virtual bool hasVolumeType() const { return true; @@ -262,12 +263,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.C b/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.C index 6ffd74f8ca073c5d4939b95f65c22fb33a162d1c..7557567aaf2794141e33342d4e213ef528d2defd 100644 --- a/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.C +++ b/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,7 +31,19 @@ License namespace Foam { defineTypeNameAndDebug(searchableCylinder, 0); - addToRunTimeSelectionTable(searchableSurface, searchableCylinder, dict); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableCylinder, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableCylinder, + dict, + cylinder + ); } @@ -39,9 +51,7 @@ namespace Foam Foam::tmp<Foam::pointField> Foam::searchableCylinder::coordinates() const { - tmp<pointField> tCtrs(new pointField(1, 0.5*(point1_ + point2_))); - - return tCtrs; + return tmp<pointField>::New(1, 0.5*(point1_ + point2_)); } @@ -64,13 +74,13 @@ void Foam::searchableCylinder::boundingSpheres Foam::tmp<Foam::pointField> Foam::searchableCylinder::points() const { - tmp<pointField> tPts(new pointField(2)); - pointField& pts = tPts.ref(); + auto tpts = tmp<pointField>::New(2); + auto& pts = tpts.ref(); pts[0] = point1_; pts[1] = point2_; - return tPts; + return tpts; } @@ -180,7 +190,7 @@ Foam::pointIndexHit Foam::searchableCylinder::findNearest Foam::scalar Foam::searchableCylinder::radius2(const point& pt) const { const vector x = (pt-point1_) ^ unitDir_; - return x&x; + return (x & x); } @@ -500,22 +510,16 @@ Foam::searchableCylinder::searchableCylinder ) : searchableSurface(io), - point1_(dict.lookup("point1")), - point2_(dict.lookup("point2")), + point1_(dict.get<point>("point1")), + point2_(dict.get<point>("point2")), magDir_(mag(point2_-point1_)), unitDir_((point2_-point1_)/magDir_), - radius_(readScalar(dict.lookup("radius"))) + radius_(dict.get<scalar>("radius")) { bounds() = calcBounds(); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableCylinder::~searchableCylinder() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchableCylinder::regions() const @@ -660,7 +664,7 @@ void Foam::searchableCylinder::getNormal vector v(info[i].hitPoint() - point1_); // Decompose sample-point1 into normal and parallel component - scalar parallel = (v & unitDir_); + const scalar parallel = (v & unitDir_); // Remove the parallel component and normalise v -= parallel*unitDir_; @@ -728,25 +732,21 @@ void Foam::searchableCylinder::getVolumeType ) const { volType.setSize(points.size()); - volType = volumeType::INSIDE; forAll(points, pointi) { const point& pt = points[pointi]; + volType[pointi] = volumeType::OUTSIDE; + vector v(pt - point1_); // Decompose sample-point1 into normal and parallel component - scalar parallel = v & unitDir_; + const scalar parallel = (v & unitDir_); - if (parallel < 0) + // Quick rejection. Left of point1 endcap, or right of point2 endcap + if (parallel < 0 || parallel > magDir_) { - // left of point1 endcap - volType[pointi] = volumeType::OUTSIDE; - } - else if (parallel > magDir_) - { - // right of point2 endcap volType[pointi] = volumeType::OUTSIDE; } else @@ -754,14 +754,12 @@ void Foam::searchableCylinder::getVolumeType // Remove the parallel component v -= parallel*unitDir_; - if (mag(v) > radius_) - { - volType[pointi] = volumeType::OUTSIDE; - } - else - { - volType[pointi] = volumeType::INSIDE; - } + volType[pointi] = + ( + mag(v) <= radius_ + ? volumeType::INSIDE + : volumeType::OUTSIDE + ); } } } diff --git a/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.H b/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.H index 9c44b8bb78a3b6abb412f937967ab84688c5dbdc..69a5688ea7d6a69cb39e807a8df35e7d219d5fc0 100644 --- a/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.H +++ b/src/meshTools/searchableSurfaces/searchableCylinder/searchableCylinder.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,7 +25,16 @@ Class Foam::searchableCylinder Description - Searching on cylinder + Searching on a cylinder. + + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | cylinder / searchableCylinder | selector | + point1 | coordinate of endpoint | yes | + point2 | coordinate of endpoint | yes | + radius | cylinder radius | yes | + \endtable SourceFiles searchableCylinder.C @@ -55,10 +64,10 @@ private: // Private Member Data - //- 'left' point + //- The 'left' point const point point1_; - //- 'right' point + //- The 'right' point const point point2_; //- Length of vector point2-point1 @@ -67,7 +76,7 @@ private: //- Normalised vector point2-point1 const vector unitDir_; - //- Radius squared + //- The radius const scalar radius_; //- Names of regions @@ -119,8 +128,8 @@ public: searchableCylinder ( const IOobject& io, - const point&, - const point&, + const point& point1, + const point& point2, const scalar radius ); @@ -131,12 +140,14 @@ public: const dictionary& dict ); + //- Destructor - virtual ~searchableCylinder(); + virtual ~searchableCylinder() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; //- Whether supports volume type below @@ -170,7 +181,6 @@ public: virtual bool overlaps(const boundBox& bb) const { NotImplemented; - return false; } @@ -220,12 +230,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.C b/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.C index 0ed845d2e5dcb362b99cf70d558593ed9560d379..d75dff8ede7f168d2193b19bb71bf26b28f9b3ce 100644 --- a/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.C +++ b/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,10 +30,20 @@ License namespace Foam { - -defineTypeNameAndDebug(searchableDisk, 0); -addToRunTimeSelectionTable(searchableSurface, searchableDisk, dict); - + defineTypeNameAndDebug(searchableDisk, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableDisk, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableDisk, + dict, + disk + ); } @@ -50,7 +60,7 @@ Foam::pointIndexHit Foam::searchableDisk::findNearest vector v(sample - origin_); // Decompose sample-origin into normal and parallel component - scalar parallel = (v & normal_); + const scalar parallel = (v & normal_); // Remove the parallel component and normalise v -= parallel*normal_; @@ -90,7 +100,7 @@ void Foam::searchableDisk::findLine vector v(start - origin_); // Decompose sample-origin into normal and parallel component - scalar parallel = (v & normal_); + const scalar parallel = (v & normal_); if (sign(parallel) == sign((end - origin_) & normal_)) { @@ -160,9 +170,9 @@ Foam::searchableDisk::searchableDisk ) : searchableSurface(io), - origin_(dict.lookup("origin")), - normal_(dict.lookup("normal")), - radius_(readScalar(dict.lookup("radius"))) + origin_(dict.get<point>("origin")), + normal_(dict.get<vector>("normal")), + radius_(dict.get<scalar>("radius")) { normal_ /= mag(normal_); @@ -183,12 +193,6 @@ Foam::searchableDisk::searchableDisk } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableDisk::~searchableDisk() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchableDisk::regions() const diff --git a/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.H b/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.H index 1f66f47fa95a2071ec1ec28e473284d861677d49..dbe3f9d247489ac388c7467df80c1b1f710183ea 100644 --- a/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.H +++ b/src/meshTools/searchableSurfaces/searchableDisk/searchableDisk.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,6 +28,15 @@ Description Searching on circular disk given as origin, normal (gets normalised) and radius + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | disk / searchableDisk | selector | + origin | centre of disk | yes | + normal | normal vector | yes | + radius | disk radius | yes | + \endtable + SourceFiles searchableDisk.C @@ -45,7 +54,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class searchableDisk Declaration + Class searchableDisk Declaration \*---------------------------------------------------------------------------*/ class searchableDisk @@ -56,13 +65,13 @@ private: // Private Member Data - //- origin + //- Origin const point origin_; - //- normal + //- Normal vector normal_; - //- radius + //- Radius const scalar radius_; //- Names of regions @@ -120,14 +129,15 @@ public: ); //- Destructor - virtual ~searchableDisk(); + virtual ~searchableDisk() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below + //- Whether supports volume type (below) virtual bool hasVolumeType() const { return false; @@ -143,8 +153,7 @@ public: // Usually the element centres (should be of length size()). virtual tmp<pointField> coordinates() const { - tmp<pointField> tCtrs(new pointField(1, origin_)); - return tCtrs; + return tmp<pointField>::New(1, origin_); } //- Get bounding spheres (centre and radius squared), one per element. @@ -165,7 +174,6 @@ public: virtual bool overlaps(const boundBox& bb) const { NotImplemented; - return false; } @@ -215,12 +223,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.C b/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.C index 3d1b3f76c26459264dfbf586f01dca1430db255f..f531578355f402785ef4603e1d3ddc42555f383c 100644 --- a/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.C +++ b/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.C @@ -43,6 +43,13 @@ namespace Foam searchableExtrudedCircle, dict ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableExtrudedCircle, + dict, + extrudedCircle + ); } @@ -61,7 +68,7 @@ Foam::searchableExtrudedCircle::searchableExtrudedCircle ( IOobject ( - dict.lookup("file"), // name + dict.get<word>("file"), // name io.time().constant(), // instance "geometry", // local io.time(), // registry @@ -71,7 +78,7 @@ Foam::searchableExtrudedCircle::searchableExtrudedCircle ).objectPath() ) ), - radius_(readScalar(dict.lookup("radius"))) + radius_(dict.get<scalar>("radius")) { const edgeMesh& eMesh = eMeshPtr_(); diff --git a/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.H b/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.H index 83ac445ed401f96becd596b6780a54ed679a4ad9..482a8c5b3e5c24cbed1b5a3d6415058c667f8896 100644 --- a/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.H +++ b/src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.H @@ -25,7 +25,18 @@ Class Foam::searchableExtrudedCircle Description - Searching on edgemesh with constant radius + Searching on edgeMesh with constant radius + + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | extrudedCircle / searchableExtrudedCircle | selector | + file | The name of the edge mesh | yes | + radius | Search radius around the edges | yes | + \endtable + +Note + The edge mesh file is to be located in the constant/geometry directory. SourceFiles searchableExtrudedCircle.C @@ -43,10 +54,10 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward declarations class edgeMesh; class treeDataEdge; -template <class Type> class indexedOctree; +template<class Type> class indexedOctree; /*---------------------------------------------------------------------------*\ Class searchableExtrudedCircle Declaration @@ -102,6 +113,7 @@ public: // Member Functions + //- Names of regions virtual const wordList& regions() const; //- Whether supports volume type below @@ -206,8 +218,8 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( const pointField&, diff --git a/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.C b/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.C index a5e7b0430d1c2bc02000f66e4d714a4ba6b60fed..9a9577c7f91ea354276bcda091b39cb39f24f3d4 100644 --- a/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.C +++ b/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.C @@ -31,10 +31,20 @@ License namespace Foam { - -defineTypeNameAndDebug(searchablePlane, 0); -addToRunTimeSelectionTable(searchableSurface, searchablePlane, dict); - + defineTypeNameAndDebug(searchablePlane, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + searchablePlane, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchablePlane, + dict, + plane + ); } @@ -115,12 +125,6 @@ Foam::searchablePlane::searchablePlane } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchablePlane::~searchablePlane() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchablePlane::regions() const diff --git a/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.H b/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.H index 66e63c4de95555cb88d5cd4582b22696a65ed959..33518a4668b1c667d46605cfb053a44eaffaf586 100644 --- a/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.H +++ b/src/meshTools/searchableSurfaces/searchablePlane/searchablePlane.H @@ -25,7 +25,15 @@ Class Foam::searchablePlane Description - Searching on (infinite) plane. See plane.H + Searching on (infinite) plane. + The dictionary specifications are identical to the Foam::plane + requirements. + + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | plane / searchablePlane | selector | + \endtable SourceFiles searchablePlane.C @@ -43,8 +51,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ Class searchablePlane Declaration \*---------------------------------------------------------------------------*/ @@ -58,6 +64,7 @@ private: // Private Member Data + //- Names of regions mutable wordList regions_; @@ -103,11 +110,12 @@ public: ); //- Destructor - virtual ~searchablePlane(); + virtual ~searchablePlane() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; //- Whether supports volume type below @@ -126,8 +134,7 @@ public: // Usually the element centres (should be of length size()). virtual tmp<pointField> coordinates() const { - tmp<pointField> tCtrs(new pointField(1, refPoint())); - return tCtrs; + return tmp<pointField>::New(1, refPoint()); } //- Get bounding spheres (centre and radius squared), one per element. @@ -149,7 +156,6 @@ public: virtual bool overlaps(const boundBox& bb) const { NotImplemented; - return false; } @@ -199,8 +205,8 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( const pointField&, diff --git a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C index 5d168e6c0f7a128de22e46e6367b2e71b678dd01..865d13ebbf15980e78439055bc5df4a02356d5d8 100644 --- a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C +++ b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C @@ -32,7 +32,19 @@ License namespace Foam { defineTypeNameAndDebug(searchablePlate, 0); - addToRunTimeSelectionTable(searchableSurface, searchablePlate, dict); + addToRunTimeSelectionTable + ( + searchableSurface, + searchablePlate, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchablePlate, + dict, + plate + ); } @@ -42,7 +54,7 @@ Foam::direction Foam::searchablePlate::calcNormal(const point& span) { direction normalDir = 3; - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (span[dir] < 0) { @@ -96,7 +108,7 @@ Foam::pointIndexHit Foam::searchablePlate::findNearest info.rawPoint()[normalDir_] = origin_[normalDir_]; // Clip to edges if outside - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (dir != normalDir_) { @@ -158,7 +170,7 @@ Foam::pointIndexHit Foam::searchablePlate::findLine info.rawPoint()[normalDir_] = origin_[normalDir_]; // Clip to edges - for (direction dir = 0; dir < vector::nComponents; dir++) + for (direction dir = 0; dir < vector::nComponents; ++dir) { if (dir != normalDir_) { @@ -236,8 +248,8 @@ Foam::searchablePlate::searchablePlate ) : searchableSurface(io), - origin_(dict.lookup("origin")), - span_(dict.lookup("span")), + origin_(dict.get<point>("origin")), + span_(dict.get<vector>("span")), normalDir_(calcNormal(span_)) { if (debug) @@ -253,12 +265,6 @@ Foam::searchablePlate::searchablePlate } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchablePlate::~searchablePlate() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchablePlate::regions() const @@ -297,8 +303,8 @@ void Foam::searchablePlate::boundingSpheres Foam::tmp<Foam::pointField> Foam::searchablePlate::points() const { - tmp<pointField> tPts(new pointField(4)); - pointField& pts = tPts.ref(); + auto tpts = tmp<pointField>::New(4); + auto& pts = tpts.ref(); pts[0] = origin_; pts[2] = origin_ + span_; @@ -319,7 +325,7 @@ Foam::tmp<Foam::pointField> Foam::searchablePlate::points() const pts[3] = origin_ + point(0, span_.y(), 0); } - return tPts; + return tpts; } diff --git a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.H b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.H index 6d85baeb743beef31110187c383d37e91fb3180f..b3135410943a7c8d1cd1b6d001e7ea25a2cea9e3 100644 --- a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.H +++ b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,11 +30,21 @@ Description Plate defined as origin and span. One of the components of span has to be 0 which defines the normal direction. E.g. + \verbatim span = (Sx Sy 0) // plate in x-y plane origin = (Ox Oy Oz) + \endverbatim now plane is from (Ox Oy Oz) to (Ox+Sx Oy+Sy Oz) + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | plate / searchablePlate | selector | + origin | centre of the plate | yes | + span | The plate dimensions | yes | + \endtable + SourceFiles searchablePlate.C @@ -51,8 +61,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ Class searchablePlate Declaration \*---------------------------------------------------------------------------*/ @@ -72,6 +80,7 @@ private: //- Coordinate direction which is normal const direction normalDir_; + //- Names of regions mutable wordList regions_; @@ -127,11 +136,12 @@ public: //- Destructor - virtual ~searchablePlate(); + virtual ~searchablePlate() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; //- Whether supports volume type below diff --git a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C index ab2329e744a2c2a442fbd4965acc3ceb28927e89..13e85223e34d30a0b52e60f40fb937bf36e3889b 100644 --- a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C +++ b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,7 +32,19 @@ License namespace Foam { defineTypeNameAndDebug(searchableRotatedBox, 0); - addToRunTimeSelectionTable(searchableSurface, searchableRotatedBox, dict); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableRotatedBox, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableRotatedBox, + dict, + rotatedBox + ); } @@ -57,26 +69,20 @@ Foam::searchableRotatedBox::searchableRotatedBox io.writeOpt(), false //io.registerObject(), ), - treeBoundBox(Zero, dict.lookup("span")) + treeBoundBox(Zero, dict.get<vector>("span")) ), transform_ ( "rotation", - dict.lookup("origin"), - dict.lookup("e3"), - dict.lookup("e1") + dict.get<point>("origin"), + dict.get<vector>("e3"), + dict.get<vector>("e1") ) { points_ = transform_.globalPosition(box_.points()); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableRotatedBox::~searchableRotatedBox() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::wordList& Foam::searchableRotatedBox::regions() const @@ -135,10 +141,8 @@ bool Foam::searchableRotatedBox::overlaps(const boundBox& bb) const // 3a. my edges through bb faces const edgeList& edges = treeBoundBox::edges; - forAll(edges, edgeI) + for (const edge& e : edges) { - const edge& e = edges[edgeI]; - point inter; if (treeBb.intersects(points_[e[0]], points_[e[1]], inter)) { @@ -150,15 +154,12 @@ bool Foam::searchableRotatedBox::overlaps(const boundBox& bb) const const pointField bbPoints(bb.points()); - forAll(fcs, faceI) + for (const face& f : fcs) { - const face& f = fcs[faceI]; point fc = f.centre(points_); - forAll(edges, edgeI) + for (const edge& e : edges) { - const edge& e = edges[edgeI]; - pointHit inter = f.intersection ( bbPoints[e[0]], diff --git a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H index 9ac77123ba7a213b9d85bb4382f9d79280fc37c5..cb28c26c2912e52541cf848a3fd5e200a24c435c 100644 --- a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H +++ b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,12 +33,22 @@ Description E.g. box with sides 1 1 1 rotated 45 degrees around z-axis at origin (0.5 0.5 0.5) \verbatim - span (1 1 1); + span (1 1 1); origin (0.5 0.5 0.5); e1 (1 1 0); e3 (0 0 1); \endverbatim + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | rotatedBox / searchableRotatedBox | selector | + span | The box dimensions | yes | + origin | The box corner | yes | + e1 | Local x-axis of the box | yes | + e3 | Local z-axis of the box | yes | + \endtable + SourceFiles searchableRotatedBox.C @@ -68,13 +78,13 @@ private: // Private Member Data - //- box in local coordinate system + //- Box in local coordinate system searchableBox box_; - //- transformation from local to global coordinates + //- Transformation from local to global coordinates coordinateSystem transform_; - //- (global) corner points (in treeBoundBox order) + //- The (global) corner points (in treeBoundBox order) pointField points_; @@ -104,11 +114,12 @@ public: //- Destructor - virtual ~searchableRotatedBox(); + virtual ~searchableRotatedBox() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; //- Whether supports volume type below @@ -236,8 +247,8 @@ public: // cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C index 512edb074027c57220efae7a4b19f69e963ee6de..16b9430ad441c9a7c5104911453e7a2774bee89b 100644 --- a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C +++ b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,10 +30,20 @@ License namespace Foam { - -defineTypeNameAndDebug(searchableSphere, 0); -addToRunTimeSelectionTable(searchableSurface, searchableSphere, dict); - + defineTypeNameAndDebug(searchableSphere, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableSphere, + dict + ); + addNamedToRunTimeSelectionTable + ( + searchableSurface, + searchableSphere, + dict, + sphere + ); } @@ -148,8 +158,8 @@ Foam::searchableSphere::searchableSphere ) : searchableSurface(io), - centre_(dict.lookup("centre")), - radius_(readScalar(dict.lookup("radius"))) + centre_(dict.get<point>("centre")), + radius_(dict.get<scalar>("radius")) { bounds() = boundBox ( @@ -159,12 +169,6 @@ Foam::searchableSphere::searchableSphere } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableSphere::~searchableSphere() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::searchableSphere::overlaps(const boundBox& bb) const @@ -351,20 +355,18 @@ void Foam::searchableSphere::getVolumeType ) const { volType.setSize(points.size()); - volType = volumeType::INSIDE; + + const scalar rad2 = sqr(radius_); forAll(points, pointi) { const point& pt = points[pointi]; - if (magSqr(pt - centre_) <= sqr(radius_)) - { - volType[pointi] = volumeType::INSIDE; - } - else - { - volType[pointi] = volumeType::OUTSIDE; - } + volType[pointi] = + ( + (magSqr(pt - centre_) <= rad2) + ? volumeType::INSIDE : volumeType::OUTSIDE + ); } } diff --git a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H index 214343ea589986246cdec6417ea36444501b8b5a..69ee3ce22a26b1d37f1a84dc01f509b4a9ce3126 100644 --- a/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H +++ b/src/meshTools/searchableSurfaces/searchableSphere/searchableSphere.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,14 @@ Class Description Searching on sphere + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | sphere / searchableSphere | selector | + centre | The sphere centre | yes | + radius | The (outside) radius of sphere | yes | + \endtable + SourceFiles searchableSphere.C @@ -43,10 +51,8 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ - Class searchableSphere Declaration + Class searchableSphere Declaration \*---------------------------------------------------------------------------*/ class searchableSphere @@ -57,10 +63,10 @@ private: // Private Member Data - //- Centre point + //- Centre point of the sphere const point centre_; - //- Radius + //- The outer radius of the sphere const scalar radius_; //- Names of regions @@ -105,7 +111,12 @@ public: // Constructors //- Construct from components - searchableSphere(const IOobject& io, const point&, const scalar radius); + searchableSphere + ( + const IOobject& io, + const point& centre, + const scalar radius + ); //- Construct from dictionary (used by searchableSurface) searchableSphere @@ -114,15 +125,17 @@ public: const dictionary& dict ); + //- Destructor - virtual ~searchableSphere(); + virtual ~searchableSphere() = default; // Member Functions + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below + //- Whether supports volume type (below) virtual bool hasVolumeType() const { return true; @@ -138,8 +151,7 @@ public: // Usually the element centres (should be of length size()). virtual tmp<pointField> coordinates() const { - tmp<pointField> tCtrs(new pointField(1, centre_)); - return tCtrs; + return tmp<pointField>::New(1, centre_); } //- Get bounding spheres (centre and radius squared), one per element. @@ -205,12 +217,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C index 2b1a224a7585dd793be312c99cd0da658914e1c2..d7f2fab032b28840a31ed3ed16098b11efa20d14 100644 --- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,13 +67,13 @@ Foam::searchableSurface::searchableSurface(const IOobject& io) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableSurface::~searchableSurface() -{} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +bool Foam::searchableSurface::hasVolumeType() const +{ + return false; +} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::searchableSurface::findNearest ( diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H index 2a5579f221e9670081a3ec5b6de0e0c8e2018e28..b64a48d78c64306779b901bf1bc536044d83936e 100644 --- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H +++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,7 +55,7 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward declarations class objectRegistry; class mapDistribute; class treeBoundBox; @@ -155,7 +155,7 @@ public: //- Destructor - virtual ~searchableSurface(); + virtual ~searchableSurface() = default; // Member Functions @@ -188,8 +188,9 @@ public: //- Names of regions virtual const wordList& regions() const = 0; - //- Whether supports volume type below - virtual bool hasVolumeType() const = 0; + //- Whether supports volume type (below). + // This is false for the base class. + virtual bool hasVolumeType() const; //- Range of local indices that can be returned virtual label size() const = 0; @@ -335,8 +336,8 @@ public: vectorField& normal ) const = 0; - //- Determine type (inside/outside) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( const pointField&, diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C index 953d1538603a9f96e6f93ef54c070b9d9cc6e796..79603ea10b71388714b7205012084b54b5193b70 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C @@ -33,15 +33,13 @@ License namespace Foam { - -defineTypeNameAndDebug(searchableSurfaceCollection, 0); -addToRunTimeSelectionTable -( - searchableSurface, - searchableSurfaceCollection, - dict -); - + defineTypeNameAndDebug(searchableSurfaceCollection, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableSurfaceCollection, + dict + ); } @@ -182,7 +180,7 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection scale_(dict.size()), transform_(dict.size()), subGeom_(dict.size()), - mergeSubRegions_(dict.lookup("mergeSubRegions")), + mergeSubRegions_(dict.get<bool>("mergeSubRegions")), indexOffset_(dict.size()+1) { Info<< "SearchableCollection : " << name() << endl; @@ -197,7 +195,7 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection const dictionary& subDict = dict.subDict(instance_[surfI]); - scale_[surfI] = subDict.lookup("scale"); + subDict.read("scale", scale_[surfI]); transform_.set ( surfI, @@ -207,7 +205,7 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection ) ); - const word subGeomName(subDict.lookup("surface")); + const word subGeomName(subDict.get<word>("surface")); //Pout<< "Trying to find " << subGeomName << endl; const searchableSurface& s = @@ -223,7 +221,7 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection << exit(FatalError); } - subGeom_.set(surfI, &const_cast<searchableSurface&>(s)); + subGeom_.set(surfI, &(const_cast<searchableSurface&>(s))); indexOffset_[surfI] = startIndex; startIndex += subGeom_[surfI].size(); @@ -303,9 +301,9 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const { const wordList& subRegions = subGeom_[surfI].regions(); - forAll(subRegions, i) + for (const word& regionName : subRegions) { - allRegions.append(instance_[surfI] + "_" + subRegions[i]); + allRegions.append(instance_[surfI] + "_" + regionName); } } } @@ -324,8 +322,8 @@ Foam::label Foam::searchableSurfaceCollection::size() const Foam::tmp<Foam::pointField> Foam::searchableSurfaceCollection::coordinates() const { - tmp<pointField> tCtrs(new pointField(size())); - pointField& ctrs = tCtrs.ref(); + auto tctrs = tmp<pointField>::New(size()); + auto& ctrs = tctrs.ref(); // Append individual coordinates label coordI = 0; @@ -347,7 +345,7 @@ Foam::searchableSurfaceCollection::coordinates() const } } - return tCtrs; + return tctrs; } @@ -399,8 +397,8 @@ Foam::searchableSurfaceCollection::points() const nPoints += subGeom_[surfI].points()().size(); } - tmp<pointField> tPts(new pointField(nPoints)); - pointField& pts = tPts.ref(); + auto tpts = tmp<pointField>::New(nPoints); + auto& pts = tpts.ref(); // Append individual coordinates nPoints = 0; @@ -422,7 +420,7 @@ Foam::searchableSurfaceCollection::points() const } } - return tPts; + return tpts; } diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H index 222c1477e14ebe1019c9966392a9a4c2ae50776c..f35b64d3f742c99c3da2e5f8e915ff43dc3c58c8 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H +++ b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H @@ -28,6 +28,13 @@ Description Set of transformed searchableSurfaces. Does not do boolean operations so when meshing might find parts 'inside'. + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | searchableSurfaceCollection | selector | + mergeSubRegions | boolean | yes | + \endtable + SourceFiles searchableSurfaceCollection.C @@ -40,7 +47,6 @@ SourceFiles #include "treeBoundBox.H" #include "coordinateSystem.H" #include "UPtrList.H" -#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,13 +76,13 @@ class searchableSurfaceCollection UPtrList<searchableSurface> subGeom_; - Switch mergeSubRegions_; + bool mergeSubRegions_; //- Offsets for indices coming from different surfaces // (sized with size() of each surface) labelList indexOffset_; - //- Region names + //- Names of regions mutable wordList regions_; //- From individual regions to collection regions @@ -164,9 +170,10 @@ public: return transform_; } + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below + //- Whether supports volume type (below) virtual bool hasVolumeType() const { return false; @@ -194,7 +201,6 @@ public: virtual bool overlaps(const boundBox& bb) const { NotImplemented; - return false; } @@ -244,12 +250,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; // Other diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.C b/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.C index 7af6d6c8e8f47ccd915549b5b60a62906fd717bb..6721a4bb5a64711acab410c5e053dafe9d2461d6 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.C +++ b/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.C @@ -32,10 +32,13 @@ License namespace Foam { - -defineTypeNameAndDebug(searchableSurfaceWithGaps, 0); -addToRunTimeSelectionTable(searchableSurface, searchableSurfaceWithGaps, dict); - + defineTypeNameAndDebug(searchableSurfaceWithGaps, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + searchableSurfaceWithGaps, + dict + ); } @@ -178,26 +181,21 @@ Foam::searchableSurfaceWithGaps::searchableSurfaceWithGaps ) : searchableSurface(io), - gap_(readScalar(dict.lookup("gap"))), + gap_(dict.get<scalar>("gap")), subGeom_(1) { - const word subGeomName(dict.lookup("surface")); - - const searchableSurface& s = - io.db().lookupObject<searchableSurface>(subGeomName); + const word subGeomName(dict.get<word>("surface")); - subGeom_.set(0, &const_cast<searchableSurface&>(s)); + subGeom_.set + ( + 0, + io.db().lookupObjectRefPtr<searchableSurface>(subGeomName) + ); bounds() = subGeom_[0].bounds(); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::searchableSurfaceWithGaps::~searchableSurfaceWithGaps() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::searchableSurfaceWithGaps::findLine diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.H b/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.H index fd0ad48be218445861f2dc4a3789bbaaa1309d9f..936a020dfd4c8120778a2b0dc1ea22349e8c1a35 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.H +++ b/src/meshTools/searchableSurfaces/searchableSurfaceWithGaps/searchableSurfaceWithGaps.H @@ -42,14 +42,20 @@ Description sphere { - type searchableSurfaceWithGaps; - // Underlying surface - surface sphere.stl; - // Perturb distance - gap 1e-3; + type searchableSurfaceWithGaps; + surface sphere.stl; // Underlying surface + gap 1e-3; // Perturb distance } \endverbatim + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | searchableSurfaceWithGaps | selector | + surface | Name of the underlying surface | yes | + gap | Gap tolerance in meters | yes | + \endtable + SourceFiles searchableSurfaceWithGaps.C @@ -67,8 +73,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ Class searchableSurfaceWithGaps Declaration \*---------------------------------------------------------------------------*/ @@ -137,23 +141,24 @@ public: ); //- Destructor - virtual ~searchableSurfaceWithGaps(); + virtual ~searchableSurfaceWithGaps() = default; // Member Functions + //- The underlying searchableSurface const searchableSurface& surface() const { return subGeom_[0]; } - + //- Name of regions virtual const wordList& regions() const { return surface().regions(); } - //- Whether supports volume type below + //- Whether supports volume type (below) virtual bool hasVolumeType() const { return surface().hasVolumeType(); @@ -259,8 +264,8 @@ public: surface().getNormal(info, normal); } - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for points. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( const pointField& samples, diff --git a/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.C b/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.C index 6b2dc1470a9e8088486e5b0c6bfea11e79ccec66..b989f7b5039d7959b6a401def60eb23d463b70d2 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.C +++ b/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.C @@ -65,7 +65,6 @@ bool Foam::searchableSurfaces::connected // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct with length. Foam::searchableSurfaces::searchableSurfaces(const label size) : PtrList<searchableSurface>(size), @@ -90,7 +89,7 @@ Foam::searchableSurfaces::searchableSurfaces(const label size) // // // Make IOobject with correct name // autoPtr<IOobject> namedIO(io.clone()); -// namedIO().rename(dict.lookup("name")); +// namedIO().rename(dict.get<word>("name")); // // // Create and hook surface // set @@ -98,7 +97,7 @@ Foam::searchableSurfaces::searchableSurfaces(const label size) // surfI, // searchableSurface::New // ( -// dict.lookup("type"), +// dict.get<word>("type"), // namedIO(), // dict // ) @@ -140,7 +139,7 @@ Foam::searchableSurfaces::searchableSurfaces(const label size) // << exit(FatalError); // } // -// globalNames[index] = word(regionDict.lookup("name")); +// globalNames[index] = regionDict.get<word>("name"); // } // } // } @@ -193,8 +192,7 @@ Foam::searchableSurfaces::searchableSurfaces const dictionary& dict = topDict.subDict(key); - names_[surfI] = key; - dict.readIfPresent("name", names_[surfI]); + names_[surfI] = dict.lookupOrDefault<word>("name", key); // Make IOobject with correct name autoPtr<IOobject> namedIO(io.clone()); @@ -211,7 +209,7 @@ Foam::searchableSurfaces::searchableSurfaces surfI, searchableSurface::New ( - dict.lookup("type"), + dict.get<word>("type"), namedIO(), dict ) @@ -262,7 +260,7 @@ Foam::searchableSurfaces::searchableSurfaces << exit(FatalError); } - rNames[index] = word(regionDict.lookup("name")); + rNames[index] = regionDict.get<word>("name"); } } } diff --git a/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.H b/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.H index bcec55ed07aa921e37a6b2bc3d383c186cc3f0fa..7397eafc4fe91c6e568a2223eb2e84adf9dd4240 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.H +++ b/src/meshTools/searchableSurfaces/searchableSurfaces/searchableSurfaces.H @@ -26,6 +26,28 @@ Class Description Container for searchableSurfaces. + The collection is specified as a dictionary. For example, + + \verbatim + geometry + { + surface1 + { + type ...; + } + surface2 + { + type ...; + } + } + \endverbatim + + \heading The Sub-dictionary parameters + \table + Property | Description | Required | Default + name | alternative name for surface | no | dict name + regions | Region names sub-dictionary | no | + \endtable SourceFiles searchableSurfaces.C @@ -44,7 +66,7 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward declarations class triSurface; /*---------------------------------------------------------------------------*\ @@ -99,10 +121,11 @@ public: ////- Construct from list of dictionaries //searchableSurfaces(const IOobject&, const PtrList<dictionary>&); - //- Construct from dictionary and whether to construct names always - // as surfaceName "_" regionName (singleRegionName false) or - // for single region surfaces as surfaceName only (singleRegionName - // true) + //- Construct from dictionary. + // \param singleRegionName controls if names are constructed as + // surfaceName "_" regionName (singleRegionName false) or for + // single region surfaces as surfaceName only (singleRegionName + // true) searchableSurfaces ( const IOobject&, @@ -113,21 +136,25 @@ public: // Member Functions + //- Surface names, not region names const wordList& names() const { return names_; } + //- Surface names, not region names wordList& names() { return names_; } + //- Region names per surface const List<wordList>& regionNames() const { return regionNames_; } + //- Region names per surface List<wordList>& regionNames() { return regionNames_; diff --git a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C index cbf2b64764580f88e105f7a1ef1397e08d9365bd..4020fb3dc08cb9f2b14303e37bf9d1ea1cd63ca7 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C +++ b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C @@ -659,14 +659,14 @@ void Foam::searchableSurfacesQueries::signedDistance Foam::boundBox Foam::searchableSurfacesQueries::bounds ( const PtrList<searchableSurface>& allSurfaces, - const labelList& surfacesToTest + const labelUList& surfacesToTest ) { boundBox bb(boundBox::invertedBox); - forAll(surfacesToTest, testi) + for (const label surfi : surfacesToTest) { - bb.add(allSurfaces[surfacesToTest[testi]].bounds()); + bb.add(allSurfaces[surfi].bounds()); } return bb; diff --git a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.H b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.H index bf863e96cf471fec51db6aafee0c000247220d7f..7f3944df6ac20d75c720fbb94e64bfb9e3924d60 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.H +++ b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.H @@ -42,7 +42,7 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward declarations class plane; class pointConstraint; @@ -171,7 +171,7 @@ public: static boundBox bounds ( const PtrList<searchableSurface>& allSurfaces, - const labelList& surfacesToTest + const labelUList& surfacesToTest ); }; diff --git a/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.C b/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.C index 37378dc796e0f9a012ea910b79fd42274675c3e5..ff7a935112e3a02e17f3e52aad7c86a18b192b8e 100644 --- a/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.C +++ b/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.C @@ -30,22 +30,26 @@ License namespace Foam { - -defineTypeNameAndDebug(subTriSurfaceMesh, 0); -addToRunTimeSelectionTable(searchableSurface, subTriSurfaceMesh, dict); - + defineTypeNameAndDebug(subTriSurfaceMesh, 0); + addToRunTimeSelectionTable + ( + searchableSurface, + subTriSurfaceMesh, + dict + ); } + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::wordList Foam::subTriSurfaceMesh::patchNames(const triSurface& s) { - const geometricSurfacePatchList& patches = s.patches(); + const auto& patches = s.patches(); wordList names(patches.size()); - forAll(patches, patchI) + forAll(patches, patchi) { - names[patchI] = patches[patchI].name(); + names[patchi] = patches[patchi].name(); } return names; } @@ -54,30 +58,25 @@ Foam::wordList Foam::subTriSurfaceMesh::patchNames(const triSurface& s) Foam::labelList Foam::subTriSurfaceMesh::selectedRegions ( const triSurface& s, - const UList<wordRe>& regionNames + const wordRes& regionNameMatcher ) { const wordList names(patchNames(s)); - labelList regions(names.size()); + labelList regionIds(names.size()); - label compactI = 0; + label count = 0; - forAll(names, regionI) + forAll(names, regioni) { - const word& name = names[regionI]; - - forAll(regionNames, i) + if (regionNameMatcher.match(names[regioni])) { - if (regionNames[i].match(name)) - { - regions[compactI++] = regionI; - } + regionIds[count++] = regioni; } } - regions.setSize(compactI); + regionIds.setSize(count); - return regions; + return regionIds; } @@ -87,16 +86,16 @@ Foam::triSurface Foam::subTriSurfaceMesh::subset const dictionary& dict ) { - const word subGeomName(dict.lookup("surface")); + const word subGeomName(dict.get<word>("surface")); const triSurfaceMesh& s = io.db().lookupObject<triSurfaceMesh>(subGeomName); - const wordRes regionNames(dict.lookup("patches")); + const wordRes regionNames(dict.get<wordRes>("patches")); labelList regionMap(selectedRegions(s, regionNames)); - if (regionMap.size() == 0) + if (regionMap.empty()) { FatalIOErrorInFunction(dict) << "Found no regions in triSurface matching " << regionNames diff --git a/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.H b/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.H index 637f6a1025e1cadff32790827b713f68beed82b4..ec78b0cdd80a52ba1789be41c5b4f963941e18dc 100644 --- a/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.H +++ b/src/meshTools/searchableSurfaces/subTriSurfaceMesh/subTriSurfaceMesh.H @@ -43,6 +43,13 @@ Note } \endverbatim + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | subTriSurfaceMesh | selector | + surface | Name of the underlying surface | yes | + patches | List of surface region names or regexs | yes | + \endtable SourceFiles subTriSurfaceMesh.C @@ -76,7 +83,7 @@ class subTriSurfaceMesh static labelList selectedRegions ( const triSurface& s, - const UList<wordRe>& regionNames + const wordRes& regionNameMatcher ); //- Subset triSurface based on regions @@ -101,6 +108,7 @@ public: //- Destructor virtual ~subTriSurfaceMesh() = default; + }; diff --git a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C index 473fc1b9643aa8b58f7d76863a1ae100e7b58992..d65893028f4b7af5f5ee1c17ac510fd0a9d7c31a 100644 --- a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C +++ b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,9 +37,11 @@ namespace Foam { defineTypeNameAndDebug(triSurfaceMesh, 0); addToRunTimeSelectionTable(searchableSurface, triSurfaceMesh, dict); - word triSurfaceMesh::meshSubDir = "triSurface"; } +Foam::word Foam::triSurfaceMesh::meshSubDir = "triSurface"; + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::fileName Foam::triSurfaceMesh::checkFile @@ -136,19 +138,13 @@ bool Foam::triSurfaceMesh::addFaceToEdge EdgeMap<label>& facesPerEdge ) { - EdgeMap<label>::iterator eFnd = facesPerEdge.find(e); - if (eFnd != facesPerEdge.end()) + label& count = facesPerEdge(e, 0); // lookup or new entry + if (count == 2) { - if (eFnd() == 2) - { - return false; - } - eFnd()++; - } - else - { - facesPerEdge.insert(e, 1); + return false; } + + ++count; return true; } @@ -172,10 +168,10 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const const labelList& pFaces = pointFaces[pointi]; facesPerEdge.clear(); - forAll(pFaces, i) + for (const label facei : pFaces) { - const triSurface::FaceType& f = triSurface::operator[](pFaces[i]); - label fp = f.find(pointi); + const triSurface::FaceType& f = triSurface::operator[](facei); + const label fp = f.find(pointi); // Something weird: if I expand the code of addFaceToEdge in both // below instances it gives a segmentation violation on some @@ -183,7 +179,7 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const // Forward edge - label nextPointi = f[f.fcIndex(fp)]; + const label nextPointi = f[f.fcIndex(fp)]; if (nextPointi > pointi) { @@ -198,8 +194,9 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const return false; } } + // Reverse edge - label prevPointi = f[f.rcIndex(fp)]; + const label prevPointi = f[f.rcIndex(fp)]; if (prevPointi > pointi) { @@ -217,9 +214,9 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const } // Check for any edges used only once. - forAllConstIter(EdgeMap<label>, facesPerEdge, iter) + forAllConstIters(facesPerEdge, iter) { - if (iter() != 2) + if (iter.object() != 2) { return false; } @@ -477,17 +474,17 @@ void Foam::triSurfaceMesh::clearOut() Foam::tmp<Foam::pointField> Foam::triSurfaceMesh::coordinates() const { - tmp<pointField> tPts(new pointField(8)); - pointField& pt = tPts.ref(); + auto tpts = tmp<pointField>::New(8); + auto& pts = tpts.ref(); // Use copy to calculate face centres so they don't get stored - pt = PrimitivePatch<triSurface::FaceType, SubList, const pointField&> + pts = PrimitivePatch<triSurface::FaceType, SubList, const pointField&> ( SubList<triSurface::FaceType>(*this, triSurface::size()), triSurface::points() ).faceCentres(); - return tPts; + return tpts; } @@ -507,9 +504,9 @@ void Foam::triSurfaceMesh::boundingSpheres { const labelledTri& f = triSurface::operator[](facei); const point& fc = centres[facei]; - forAll(f, fp) + for (const label pointi : f) { - const point& pt = pts[f[fp]]; + const point& pt = pts[pointi]; radiusSqr[facei] = max(radiusSqr[facei], Foam::magSqr(fc-pt)); } } @@ -543,7 +540,7 @@ void Foam::triSurfaceMesh::movePoints(const pointField& newPoints) searchableSurface::instance() = objectRegistry::time().timeName(); objectRegistry::instance() = searchableSurface::instance(); - label event = getEvent(); + const label event = getEvent(); searchableSurface::eventNo() = event; objectRegistry::eventNo() = searchableSurface::eventNo(); @@ -623,9 +620,9 @@ const Foam::wordList& Foam::triSurfaceMesh::regions() const if (regions_.empty()) { regions_.setSize(patches().size()); - forAll(regions_, regionI) + forAll(regions_, regioni) { - regions_[regionI] = patches()[regionI].name(); + regions_[regioni] = patches()[regioni].name(); } } return regions_; @@ -765,14 +762,13 @@ void Foam::triSurfaceMesh::getNormal // Search neighbouring triangles const labelList& fFaces = faceFaces[facei]; - forAll(fFaces, j) + for (const label nbri : fFaces) { - label nbrI = fFaces[j]; - scalar nbrQual = s[nbrI].tri(pts).quality(); + scalar nbrQual = s[nbri].tri(pts).quality(); if (nbrQual > qual) { qual = nbrQual; - normal[i] = s[nbrI].normal(pts); + normal[i] = s[nbri].normal(pts); } } } @@ -792,7 +788,7 @@ void Foam::triSurfaceMesh::getNormal { if (info[i].hit()) { - label facei = info[i].index(); + const label facei = info[i].index(); // Cached: //normal[i] = faceNormals()[facei]; @@ -812,36 +808,27 @@ void Foam::triSurfaceMesh::getNormal void Foam::triSurfaceMesh::setField(const labelList& values) { + if (foundObject<triSurfaceLabelField>("values")) { - triSurfaceLabelField& fld = const_cast<triSurfaceLabelField&> - ( - lookupObject<triSurfaceLabelField> - ( - "values" - ) - ); - fld.field() = values; + lookupObjectRef<triSurfaceLabelField>("values").field() = values; } else { - autoPtr<triSurfaceLabelField> fldPtr + auto fldPtr = autoPtr<triSurfaceLabelField>::New ( - new triSurfaceLabelField + IOobject ( - IOobject - ( - "values", - objectRegistry::time().timeName(), // instance - meshSubDir, // local - *this, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), + "values", + objectRegistry::time().timeName(), // instance + meshSubDir, // local *this, - dimless, - labelField(values) - ) + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + *this, + dimless, + labelField(values) ); // Store field on triMesh @@ -858,12 +845,9 @@ void Foam::triSurfaceMesh::getField { if (foundObject<triSurfaceLabelField>("values")) { - values.setSize(info.size()); + const auto& fld = lookupObject<triSurfaceLabelField>("values"); - const triSurfaceLabelField& fld = lookupObject<triSurfaceLabelField> - ( - "values" - ); + values.setSize(info.size()); forAll(info, i) { @@ -882,36 +866,33 @@ void Foam::triSurfaceMesh::getVolumeType List<volumeType>& volType ) const { - volType.setSize(points.size()); - - scalar oldTol = indexedOctree<treeDataTriSurface>::perturbTol(); + const scalar oldTol = indexedOctree<treeDataTriSurface>::perturbTol(); indexedOctree<treeDataTriSurface>::perturbTol() = tolerance(); + volType.setSize(points.size()); + forAll(points, pointi) { const point& pt = points[pointi]; - if (!tree().bb().contains(pt)) + if (tree().bb().contains(pt)) { - if (hasVolumeType()) - { - // Precalculate and cache value for this outside point - if (outsideVolType_ == volumeType::UNKNOWN) - { - outsideVolType_ = tree().shapes().getVolumeType(tree(), pt); - } - volType[pointi] = outsideVolType_; - } - else + // Use cached volume type per each tree node + volType[pointi] = tree().getVolumeType(pt); + } + else if (hasVolumeType()) + { + // Precalculate and cache value for this outside point + if (outsideVolType_ == volumeType::UNKNOWN) { - // Have to calculate directly as outside the octree - volType[pointi] = tree().shapes().getVolumeType(tree(), pt); + outsideVolType_ = tree().shapes().getVolumeType(tree(), pt); } + volType[pointi] = outsideVolType_; } else { - // - use cached volume type per each tree node - volType[pointi] = tree().getVolumeType(pt); + // Have to calculate directly as outside the octree + volType[pointi] = tree().shapes().getVolumeType(tree(), pt); } } diff --git a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H index 7d5d2fcb2aba823a3bec8d549e7f49ab94c8a5b8..fea92bb84b650e09bfd1ebaa4986fe63ebf2ccb9 100644 --- a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H +++ b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,12 +27,21 @@ Class Description IOoject and searching on triSurface - Note: when constructing from dictionary has optional parameters: + Note: when constructing from dictionary has the following parameters: - scale : scaling factor. - tolerance : relative tolerance for doing intersections (see triangle::intersection) - minQuality: discard triangles with low quality when getting normal + \heading Dictionary parameters + \table + Property | Description | Required | Default + type | triSurfaceMesh | selector | + file | File name to locate the surface | no | + scale | Scaling factor | no | 0 + minQuality | Quality criterion | no | -1 + \endtable + SourceFiles triSurfaceMesh.C @@ -183,6 +192,7 @@ public: //- Destructor virtual ~triSurfaceMesh(); + //- Clear storage void clearOut(); @@ -198,9 +208,10 @@ public: // searchableSurface implementation + //- Names of regions virtual const wordList& regions() const; - //- Whether supports volume type below. I.e. whether is closed. + //- Whether supports volume type (below) - i.e. whether is closed. virtual bool hasVolumeType() const; //- Range of local indices that can be returned. @@ -278,12 +289,12 @@ public: vectorField& normal ) const; - //- Determine type (inside/outside/mixed) for point. unknown if - // cannot be determined (e.g. non-manifold surface) + //- Determine type (inside/outside/mixed) for point. + // Unknown if cannot be determined (e.g. non-manifold surface) virtual void getVolumeType ( - const pointField&, - List<volumeType>& + const pointField& points, + List<volumeType>& volType ) const; diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/snappyHexMeshDict b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/snappyHexMeshDict index 68edd21ed28584ad3028229af713ce8e70935a61..1522673795c4bae2bbc5db132e208dd2caa504bf 100644 --- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/snappyHexMeshDict +++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/snappyHexMeshDict @@ -59,8 +59,7 @@ geometry type triSurfaceMesh; name walls; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/snappyHexMeshDict b/tutorials/combustion/fireFoam/LES/compartmentFire/system/snappyHexMeshDict index 9c7d5313d512492d3883d26a964079e6966aead0..4ec493adf8dd33912a20c69e4fc2c48e8c4d5c8f 100644 --- a/tutorials/combustion/fireFoam/LES/compartmentFire/system/snappyHexMeshDict +++ b/tutorials/combustion/fireFoam/LES/compartmentFire/system/snappyHexMeshDict @@ -30,12 +30,11 @@ geometry { box1 //0.6x1x0.02 [cm] { - type searchableBox; - min (-0.1 -0.01 -0.1); - max (0.1 0.30 0.1); + type box; + min (-0.1 -0.01 -0.1); + max (0.1 0.30 0.1); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/combustion/reactingFoam/RAS/membrane/system/snappyHexMeshDict b/tutorials/combustion/reactingFoam/RAS/membrane/system/snappyHexMeshDict index 7bc2d15be2e29ef7aff75f2b9affd912551e8af2..df7b9d6091e1f205917e79c2f690cf6d5eb1f931 100644 --- a/tutorials/combustion/reactingFoam/RAS/membrane/system/snappyHexMeshDict +++ b/tutorials/combustion/reactingFoam/RAS/membrane/system/snappyHexMeshDict @@ -61,7 +61,7 @@ geometry type triSurfaceMesh; file "membrane-membrane.stl"; } -}; +} castellatedMeshControls { diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/blockMeshDict index 258cf019800c7098a0bb9c364edaab0402596136..fbb2d2b9a10d40fc48828e4e9e3574eb3cafdc8f 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/blockMeshDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/blockMeshDict @@ -55,7 +55,7 @@ geometry } cylinder { - type searchableCylinder; + type cylinder; point1 ($:aerofoil.xUpper -1e3 0); point2 ($:aerofoil.xUpper 1e3 0); radius $:domain.zMax; diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/snappyHexMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/snappyHexMeshDict index 735445f8b05e52cd5606e8501a092a759422faed..4567dce38bf8a133e6495847d04714cd6047480d 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/snappyHexMeshDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/snappyHexMeshDict @@ -73,7 +73,7 @@ geometry type triSurfaceMesh; name walls; } -}; +} castellatedMeshControls { diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict index 258cf019800c7098a0bb9c364edaab0402596136..fbb2d2b9a10d40fc48828e4e9e3574eb3cafdc8f 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict @@ -55,7 +55,7 @@ geometry } cylinder { - type searchableCylinder; + type cylinder; point1 ($:aerofoil.xUpper -1e3 0); point2 ($:aerofoil.xUpper 1e3 0); radius $:domain.zMax; diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/snappyHexMeshDict b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/snappyHexMeshDict index 1624e9ec610e757027bd951f6ccf7d0197d77b57..ee84068a5c1125d20618f71cfdecc4f5823e6381 100644 --- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/snappyHexMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/snappyHexMeshDict @@ -57,12 +57,11 @@ geometry refinementBox { - type searchableBox; - min (-0.5 -0.125 -0.25); - max (1.5 0.125 0.25); + type box; + min (-0.5 -0.125 -0.25); + max (1.5 0.125 0.25); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index 7be9a35b0d3bbade96d4a6466e055e0d42cf9af1..c75aa58ad7817330de576a564d9a1525ffeed24a 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -30,16 +30,16 @@ geometry { igloo { - type searchableSphere; - centre (3 3 0); - radius 4; + type sphere; + centre (3 3 0); + radius 4; } box1 { - type searchableBox; - min (0 0 0); - max (1 1 1); + type box; + min (0 0 0); + max (1 1 1); } twoFridgeFreezers @@ -51,7 +51,7 @@ geometry seal { surface box1; - scale (1.0 1.0 2.1); + scale (1.0 1.0 2.1); transform { coordinateSystem @@ -70,7 +70,7 @@ geometry herring { surface box1; - scale (1.0 1.0 2.1); + scale (1.0 1.0 2.1); transform { coordinateSystem @@ -87,8 +87,7 @@ geometry } } } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict index a3e27e3cac6221acae78e3c2fcc33296e7edb81a..4f4b54f0c4a8dc1a8e3cfb6ec89f3519b839d450 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict @@ -34,8 +34,7 @@ geometry type triSurfaceMesh; name geom; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/system/snappyHexMeshDict b/tutorials/incompressible/lumpedPointMotion/building/steady/system/snappyHexMeshDict index 5e7dcc36f6790562600a3ef39987e208ca4f897f..69338d2558cbe418d0f4d26d8cc2e8f446401c0b 100644 --- a/tutorials/incompressible/lumpedPointMotion/building/steady/system/snappyHexMeshDict +++ b/tutorials/incompressible/lumpedPointMotion/building/steady/system/snappyHexMeshDict @@ -33,7 +33,7 @@ geometry type triSurfaceMesh; name building; } -}; +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/snappyHexMeshDict index 7ee9298be505c567f0d83eae47cc52585700343e..c2401240803194e1b27c147512bbb06cbc368a84 100644 --- a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/snappyHexMeshDict @@ -35,11 +35,11 @@ geometry refinementBox { - type searchableBox; + type box; min (-1 -1 -1); max ( 5 1 1); } -}; +} // Settings for the castellatedMesh generation. castellatedMeshControls diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/snappyHexMeshDict index 6605378b3449870cb302c75e42683de6797b1289..4c6a78a1c1f2d7774ffed7b55d8ea121ade1d6c3 100644 --- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/snappyHexMeshDict @@ -30,11 +30,11 @@ geometry refinementBox { - type searchableBox; + type box; min (-5 -1 -1); max ( 5 1 1); } -}; +} // Settings for the castellatedMesh generation. castellatedMeshControls diff --git a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/createBafflesDict b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/createBafflesDict index 1455cd7b0e63d05b8f96ffa1781407735c2fd7e5..88fbb87ed9685689511d269c5f6d0350c031212b 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/createBafflesDict +++ b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/createBafflesDict @@ -79,7 +79,7 @@ baffles { //- Select faces and orientation through a searchableSurface type searchableSurface; - surface searchablePlate; + surface plate; origin (0.099 -0.006 0.004); span (0 0.012 0.012); diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/snappyHexMeshDict b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/snappyHexMeshDict index 790f81bf0a9e286ae659549debf649f184be9f32..1f6506e5b88fe4b0930be351b6bfa661674c50e7 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/snappyHexMeshDict @@ -36,7 +36,7 @@ geometry { ascii { - name innerCylinder; + name innerCylinder; } } } @@ -48,7 +48,7 @@ geometry { ascii { - name innerCylinderSmall; + name innerCylinderSmall; } } } @@ -60,7 +60,7 @@ geometry { ascii { - name outerCylinder; + name outerCylinder; } } } @@ -72,7 +72,7 @@ geometry { ascii { - name propellerTip; + name propellerTip; } } } @@ -84,7 +84,7 @@ geometry { ascii { - name propellerStem1; + name propellerStem1; } } } @@ -108,12 +108,11 @@ geometry { ascii { - name propellerStem3; + name propellerStem3; } } } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict index bd48bcf0649cc0a66aecca2e29f4a0c47cc557e4..d4d9f8dda024e0bbb66b431d99a2b9ec66441800 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict @@ -36,12 +36,11 @@ geometry refinementBox { - type searchableBox; + type box; min (-1 -1 -1); max ( 5 1 1); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 index 301c84d059ae9e6dacd216a0b1f3868535a5a2e2..c7b4d24594b03d3d80e8e7662ca1d3d0162611b9 100644 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 @@ -794,10 +794,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces @@ -821,10 +821,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/snappyHexMeshDict index 510c304c938224610fd8f924aa568df2fc8c954f..20d77742f9e03081a7bad6d658e1443608072f5d 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/snappyHexMeshDict @@ -37,12 +37,11 @@ geometry // Analytical shape; cylinder, sphere refinementBox { - type searchableBox; - min (-1.0 -0.7 0.0); - max ( 8.0 0.7 2.5); + type box; + min (-1.0 -0.7 0.0); + max ( 8.0 0.7 2.5); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict index fd5f279a3478f8d65a464b74aea57f8b90d13a70..3d210d69c2470a9e47f18a752cd9e41d3b52cf6a 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict @@ -36,12 +36,11 @@ geometry refinementBox { - type searchableBox; - min (-1.0 -0.7 0.0); - max ( 8.0 0.7 2.5); + type box; + min (-1.0 -0.7 0.0); + max ( 8.0 0.7 2.5); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/simpleFoam/rotorDisk/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/rotorDisk/system/snappyHexMeshDict index 53aa59aee4dc8815a40d465cb6797b6df274efd8..d3769f7fabbd7df80f74e8932cb06e89357dee58 100644 --- a/tutorials/incompressible/simpleFoam/rotorDisk/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/rotorDisk/system/snappyHexMeshDict @@ -38,7 +38,7 @@ geometry type triSurfaceMesh; name rotatingZone; } -}; +} castellatedMeshControls { diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict index 068955374bf660e139004d82c2975a23b65f54ce..50a584a8f47709c3b613e8bfdce6b82b3a5d75ab 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict @@ -31,16 +31,16 @@ geometry { windTurbine1 { - type searchableBox; - min (581845 4785805 1061); - max (581855 4785815 1071); + type box; + min (581845 4785805 1061); + max (581855 4785815 1071); } windTurbine2 { - type searchableBox; - min (581740 4785658 1065); - max (581771 4785671 1079); + type box; + min (581740 4785658 1065); + max (581771 4785671 1079); } terrain.stl @@ -48,8 +48,7 @@ geometry type triSurfaceMesh; name terrain; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict index 56998b69b119c75cd21baa3c5ba6a57bbf027eb4..2396673f7d7ad1e0067f8bdb064e4f6f0943e49b 100644 --- a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict @@ -30,11 +30,11 @@ geometry refinementBox { - type searchableBox; + type box; min ( 0 0 0); max (250 180 90); } -}; +} castellatedMeshControls { diff --git a/tutorials/lagrangian/MPPICFoam/cyclone/system/snappyHexMeshDict b/tutorials/lagrangian/MPPICFoam/cyclone/system/snappyHexMeshDict index e7d911def7e9f7fcc778e7af455c99965e558b60..59369679d0fefd32a6a4d3e9f19695ad5d0f2499 100644 --- a/tutorials/lagrangian/MPPICFoam/cyclone/system/snappyHexMeshDict +++ b/tutorials/lagrangian/MPPICFoam/cyclone/system/snappyHexMeshDict @@ -34,8 +34,7 @@ geometry type triSurfaceMesh; name walls; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 index 1b4b86f04a567f682b7bf2ea3d8a6745c365ecc4..00e0e245cf2813fa328187a64fb38ef03b83b6d9 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 @@ -810,10 +810,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces @@ -837,10 +837,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces diff --git a/tutorials/mesh/blockMesh/pipe/system/blockMeshDict b/tutorials/mesh/blockMesh/pipe/system/blockMeshDict index 3dc16c45dc7118e69e460a688fed160941e14614..22c35ebdc0a12405e6deabec7b1cf939ba765abd 100644 --- a/tutorials/mesh/blockMesh/pipe/system/blockMeshDict +++ b/tutorials/mesh/blockMesh/pipe/system/blockMeshDict @@ -18,20 +18,20 @@ geometry { cylinder { - type searchableCylinder; + type cylinder; point1 (0 -4 0); point2 (0 4 0); radius 0.7; } cylinder2 { - type searchableExtrudedCircle; + type extrudedCircle; file "curve2.vtk"; radius 0.5; } inletPlane { - type searchablePlate; + type plate; origin (-4 -50 -50); span (0 100 100); } diff --git a/tutorials/mesh/blockMesh/sphere/system/blockMeshDict b/tutorials/mesh/blockMesh/sphere/system/blockMeshDict index ae383f1140a3f43cbf6503a4dce41dd0bb7a0057..a3957ac87bb0800a9cb32dfb0ec68c21cb60b8c8 100644 --- a/tutorials/mesh/blockMesh/sphere/system/blockMeshDict +++ b/tutorials/mesh/blockMesh/sphere/system/blockMeshDict @@ -18,7 +18,7 @@ geometry { sphere { - type searchableSphere; + type sphere; centre (0 0 0); radius 1; } diff --git a/tutorials/mesh/blockMesh/sphere7/system/blockMeshDict b/tutorials/mesh/blockMesh/sphere7/system/blockMeshDict index d09a0c84f9c5d2696a62d792a686337a64ed93fc..82adcbfda08b9cd607f53e3e9a4c186ca16556b8 100644 --- a/tutorials/mesh/blockMesh/sphere7/system/blockMeshDict +++ b/tutorials/mesh/blockMesh/sphere7/system/blockMeshDict @@ -20,7 +20,7 @@ geometry { sphere { - type searchableSphere; + type sphere; centre (0 0 0); radius 1; } diff --git a/tutorials/mesh/blockMesh/sphere7ProjectedEdges/system/blockMeshDict b/tutorials/mesh/blockMesh/sphere7ProjectedEdges/system/blockMeshDict index 2b5c0e5925e8c5846842f070c3d156e608893ca5..ca2cf53ad2ecae42fa730f2bbbe9883d2b7d70ba 100644 --- a/tutorials/mesh/blockMesh/sphere7ProjectedEdges/system/blockMeshDict +++ b/tutorials/mesh/blockMesh/sphere7ProjectedEdges/system/blockMeshDict @@ -20,14 +20,14 @@ geometry { sphere { - type searchableSphere; + type sphere; centre (0 0 0); radius 1; } innerSphere { - type searchableSphere; + type sphere; centre (0 0 0); radius 0.5; } diff --git a/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict index 0d5ab9e34cae0fc41fb05cbd57883afc6c4ddd89..ca24dcf2d9bf5432a695b66f25f751893bd32d8b 100644 --- a/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict @@ -27,9 +27,9 @@ geometry refinementBox { - type searchableBox; - min (-0.2 -0.6 -0.2); - max ( 0.4 0.2 0.35); + type box; + min (-0.2 -0.6 -0.2); + max ( 0.4 0.2 0.35); } } diff --git a/tutorials/mesh/foamyHexMesh/blob/system/snappyHexMeshDict b/tutorials/mesh/foamyHexMesh/blob/system/snappyHexMeshDict index 82fdfd3648117e2f58d9afa355dc3eb4344bdaf7..6f11249aca896fd3ad3ddac4f3c719fe9556e8e8 100644 --- a/tutorials/mesh/foamyHexMesh/blob/system/snappyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/blob/system/snappyHexMeshDict @@ -36,11 +36,11 @@ geometry // // refinementBox // { -// type searchableBox; -// min (-1.0 -0.7 0.0); -// max ( 8.0 0.7 2.5); +// type box; +// min (-1.0 -0.7 0.0); +// max ( 8.0 0.7 2.5); // } -}; +} diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict index 78bcfc6c3d0137063142bfc597d56346fe451482..8212073591b91b447cfa5da3d43db2fc2d3eebb1 100644 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict @@ -34,11 +34,10 @@ geometry // Outside of domain domain { - type searchableBox; - min (-0.7 -0.9 -1); - max (1.3 1.1 1); + type box; + min (-0.7 -0.9 -1); + max (1.3 1.1 1); } - } diff --git a/tutorials/mesh/foamyQuadMesh/square/system/foamyQuadMeshDict b/tutorials/mesh/foamyQuadMesh/square/system/foamyQuadMeshDict index b63234f80941f7f25baa9a285530965a7cdd7a75..6214886878b0f1a34a2ceee8ee3a79d48c0c2efd 100644 --- a/tutorials/mesh/foamyQuadMesh/square/system/foamyQuadMeshDict +++ b/tutorials/mesh/foamyQuadMesh/square/system/foamyQuadMeshDict @@ -25,9 +25,9 @@ geometry refinementBox { - type searchableBox; - min (0.25 0.25 -1000); - max (0.75 0.75 1000); + type box; + min (0.25 0.25 -1000); + max (0.75 0.75 1000); } } diff --git a/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/snappyHexMeshDict b/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/snappyHexMeshDict index 0431041c25dc3c04dc41e7ce489fe4113451fec6..54b1d5eb0cae9edaf5891ca6b104b8ebda50b8c6 100644 --- a/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/snappyHexMeshDict @@ -30,37 +30,37 @@ geometry { v_dualWing { - type searchableCylinder; - name v_dualWing; - point1 (-0.43 0 -10); - point2 (-0.43 0 10); - radius 0.1; + type cylinder; + name v_dualWing; + point1 (-0.43 0 -10); + point2 (-0.43 0 10); + radius 0.1; } v_rotor { - type searchableCylinder; - name v_rotor; - point1 (0 0 -10); - point2 (0 0 10); - radius 0.75; + type cylinder; + name v_rotor; + point1 (0 0 -10); + point2 (0 0 10); + radius 0.75; } wing1 { - type searchableBox; - name wing1; - min (-0.5 -0.01 -10); - max (-0.44 0.01 10); + type box; + name wing1; + min (-0.5 -0.01 -10); + max (-0.44 0.01 10); } wing2 { - type searchableBox; - name wing2; - min (-0.42 -0.0025 -10); - max (-0.36 0.0025 10); + type box; + name wing2; + min (-0.42 -0.0025 -10); + max (-0.36 0.0025 10); } -}; +} diff --git a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/snappyHexMeshDict index 4e70b7683af0a1fb3f5e05aeffdbe36e37bd4a33..7add17fa327d4926d0caf5e9cf70b8cb3c5bc398 100644 --- a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/snappyHexMeshDict @@ -23,7 +23,7 @@ addLayers true; // Geometry. Definition of all surfaces. All surfaces are of class // searchableSurface. geometry -{}; +{} diff --git a/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/system/snappyHexMeshDict index 09d516c9976adb7171a1bc6c28bee98d2aabd230..bc6f62135e877c88cb41ce929fcf535d8e836bea 100644 --- a/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/system/snappyHexMeshDict @@ -35,12 +35,11 @@ geometry } wake { - type searchableBox; - min (0.8 -0.1 -0.1); - max (2.0 0.1 0.1); + type box; + min (0.8 -0.1 -0.1); + max (2.0 0.1 0.1); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict index 0049131b45232b596b0b192960ce0a3387fe6c2d..15b632ae687b57e825b5664b5d67929dd2ac3ad3 100644 --- a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict @@ -38,12 +38,11 @@ geometry //- Refine a bit extra around the small centre hole refineHole { - type searchableSphere; - centre (0 0 -0.012); - radius 0.003; + type sphere; + centre (0 0 -0.012); + radius 0.003; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/mesh/snappyHexMesh/gap_detection/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/gap_detection/system/snappyHexMeshDict index b1405f01129fb0e3c21184b469121890af568c5a..ff6216ee835560aed0e681d83e1bfaea8fd08f23 100644 --- a/tutorials/mesh/snappyHexMesh/gap_detection/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/gap_detection/system/snappyHexMeshDict @@ -34,13 +34,11 @@ geometry } all { - type searchableBox; - min (-1000 -1000 -1000); - max (1000 1000 1000); + type box; + min (-1000 -1000 -1000); + max (1000 1000 1000); } - -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/multiphase/interFoam/RAS/DTCHull/system/snappyHexMeshDict b/tutorials/multiphase/interFoam/RAS/DTCHull/system/snappyHexMeshDict index 7884be3674c10fe63a8f6b340d877e4a4ab17d82..54a6b77baf587e522790096e0308c7d2c3d99703 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHull/system/snappyHexMeshDict +++ b/tutorials/multiphase/interFoam/RAS/DTCHull/system/snappyHexMeshDict @@ -39,8 +39,7 @@ geometry type wall; } } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/system/snappyHexMeshDict b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/system/snappyHexMeshDict index 8c6f193e8fc02793592604c3e196958be5f35dd9..9b3de4f0b7096f86a255290138d4b64ad293bb14 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/system/snappyHexMeshDict +++ b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/system/snappyHexMeshDict @@ -39,8 +39,7 @@ geometry type wall; } } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/createBafflesDict b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/createBafflesDict index a37daeabd7b02d38ce296d7ff402d7ddcc747b8a..1b77b4865ade9e3516b9603c9e2f79b8712bf598 100644 --- a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/createBafflesDict +++ b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/createBafflesDict @@ -27,7 +27,7 @@ baffles { //- Select faces and orientation through a searchableSurface type searchableSurface; - surface searchablePlate; + surface plate; origin (0.3042 0.0493 -100); span (0 0.1584 200); diff --git a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/snappyHexMeshDict b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/snappyHexMeshDict index 6a867bf1e4b5a1dfc7c20a99c55b28358479c88d..01ab19aaf6a7bb8af17fb38b772bf97ffecfc965 100644 --- a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/snappyHexMeshDict +++ b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/snappyHexMeshDict @@ -130,7 +130,8 @@ geometry name rotating; type triSurfaceMesh; } -}; +} + // Settings for the castellatedMesh generation. castellatedMeshControls diff --git a/tutorials/multiphase/interFoam/RAS/motorBike/system/snappyHexMeshDict b/tutorials/multiphase/interFoam/RAS/motorBike/system/snappyHexMeshDict index be0d7895237ee21e21cc6614b3bdfb507391478d..f5651c7fad0fde5fd95a6913d9003b8e91bacf63 100644 --- a/tutorials/multiphase/interFoam/RAS/motorBike/system/snappyHexMeshDict +++ b/tutorials/multiphase/interFoam/RAS/motorBike/system/snappyHexMeshDict @@ -33,7 +33,7 @@ geometry type triSurfaceMesh; name motorBike; } -}; +} //// Optional: avoid patch-face merging. Allows mesh to be used for diff --git a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/blockMeshDict index 269478ea6264c7c6b85500675b3567a22a0d61b5..81fa05fbf8c4f7eeeeac5c595d77ffd67c2f467a 100644 --- a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/blockMeshDict +++ b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/blockMeshDict @@ -30,10 +30,10 @@ geometry { cylinder { - type searchableCylinder; - point1 (0 0 -1); - point2 (0 0 1); - radius $radius; + type cylinder; + point1 (0 0 -1); + point2 (0 0 1); + radius $radius; } } diff --git a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/snappyHexMeshDict b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/snappyHexMeshDict index bedc98daf10550755025878aea7c3af12bdb2b20..196bfc10d6e232b43b340329b08d3396425a931e 100644 --- a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/snappyHexMeshDict +++ b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/system/snappyHexMeshDict @@ -27,7 +27,7 @@ geometry type closedTriSurfaceMesh; name sloshingCylinder; } -}; +} castellatedMeshControls { diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict index cd6b48bc2764317c7c8397be0d7c1a513e49f6df..af76695cf850933c01e71aec3ba30bac11e7fdb4 100644 --- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict +++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict @@ -36,7 +36,7 @@ geometry { ascii { - name innerCylinder; + name innerCylinder; } } } @@ -48,7 +48,7 @@ geometry { ascii { - name innerCylinderSmall; + name innerCylinderSmall; } } } @@ -60,7 +60,7 @@ geometry { ascii { - name outerCylinder; + name outerCylinder; } } } @@ -72,7 +72,7 @@ geometry { ascii { - name propellerTip; + name propellerTip; } } } @@ -84,7 +84,7 @@ geometry { ascii { - name propellerStem1; + name propellerStem1; } } } @@ -96,7 +96,7 @@ geometry { ascii { - name propellerStem2; + name propellerStem2; } } } @@ -108,11 +108,11 @@ geometry { ascii { - name propellerStem3; + name propellerStem3; } } } -}; +} diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict index 6571cf04a82fd5e327057e724d7e12c132a8ffa0..34ff570335464c5d52064202fc7637bcf36d52f2 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict @@ -45,20 +45,19 @@ geometry refinement1 { - type searchableSphere; + type sphere; centre (0 0 0.0025); radius 0.0075; } refinement2 { - type searchableCylinder; + type cylinder; point1 (0 0 0); point2 (0 0 0.03); radius 0.0075; } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 index 301c84d059ae9e6dacd216a0b1f3868535a5a2e2..c7b4d24594b03d3d80e8e7662ca1d3d0162611b9 100644 --- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 +++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 @@ -794,10 +794,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces @@ -821,10 +821,10 @@ boundary /* optional surface { - type searchableCylinder; // none - point1 (0 0 -1); - point2 (0 0 1); - radius 0.5; + type cylinder; // none + point1 (0 0 -1); + point2 (0 0 1); + radius 0.5; } */ faces diff --git a/tutorials/preProcessing/createZeroDirectory/motorBike/system/snappyHexMeshDict b/tutorials/preProcessing/createZeroDirectory/motorBike/system/snappyHexMeshDict index ddf69acfdd005592ff54604c3a4761340a5c7d92..86be389d3335c45c256bdc981d719c2fc6d90158 100644 --- a/tutorials/preProcessing/createZeroDirectory/motorBike/system/snappyHexMeshDict +++ b/tutorials/preProcessing/createZeroDirectory/motorBike/system/snappyHexMeshDict @@ -36,12 +36,11 @@ geometry refinementBox { - type searchableBox; - min (-1.0 -0.7 0.0); - max ( 8.0 0.7 2.5); + type box; + min (-1.0 -0.7 0.0); + max ( 8.0 0.7 2.5); } -}; - +} // Settings for the castellatedMesh generation. diff --git a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/snappyHexMeshDict b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/snappyHexMeshDict index 064012e82151ecf2d17b52d5bf995c5e6037c955..dc96c7e5d7abcccf2cc723d77681584ae74fe214 100644 --- a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/snappyHexMeshDict +++ b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/snappyHexMeshDict @@ -61,12 +61,11 @@ geometry //refinementBox //{ - // type searchableBox; - // min (-0.3 -0.4 -0.1); - // max ( 3.0 0.4 1.4); - // } -}; - + // type box; + // min (-0.3 -0.4 -0.1); + // max ( 3.0 0.4 1.4); + //} +} // Settings for the castellatedMesh generation.