diff --git a/src/meshTools/sets/cellSources/boundaryToCell/boundaryToCell.H b/src/meshTools/sets/cellSources/boundaryToCell/boundaryToCell.H index b703447e1b..f9ebfbde26 100644 --- a/src/meshTools/sets/cellSources/boundaryToCell/boundaryToCell.H +++ b/src/meshTools/sets/cellSources/boundaryToCell/boundaryToCell.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,10 +27,49 @@ Class Foam::boundaryToCell Description - A topoSetCellSource to select all external (boundary) faces. + A \c topoSetCellSource to select all cells possessing + at least a single face on all external boundaries. - \heading Dictionary parameters - None + Operands: + \table + Operand | Type | Location + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ + \endtable + +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source boundaryToCell; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + name | Name of cellSet | word | yes | - + type | Type name: cellSet | word | yes | - + action | Action applied on cells - see below | word | yes | - + source | Source name: boundaryToCell | word | yes | - + \endtable + + Options for the \c action entry: + \verbatim + new | Create a new cellSet from selected cells + add | Add selected cells into this cellSet + subtract | Remove selected cells from this cellSet + \endverbatim + +See also + - Foam::topoSetSource + - Foam::topoSetCellSource + - Foam::patchToCell SourceFiles boundaryToCell.C @@ -55,7 +94,7 @@ class boundaryToCell : public topoSetCellSource { - // Private data + // Private Data //- Add usage string static addToUsageTable usage_; @@ -71,6 +110,7 @@ public: //- Runtime type information TypeName("boundaryToCell"); + // Constructors //- Construct from components @@ -94,7 +134,6 @@ public: const topoSetSource::setAction action, topoSet& set ) const; - }; diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H index c6ee8e1972..a83a8db090 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,20 +28,80 @@ Class Foam::boxToCell Description - A topoSetCellSource to select cells based on cell centres inside box(es). + A \c topoSetCellSource to select all cells + whose cell centre inside given bounding box(es). - \heading Dictionary parameters + Operands: \table - Property | Description | Required | Default - boxes | Multiple bounding boxes | partly | - box | A single bounding box | partly | - min | Minimum point for a single box | partly | - max | Maximum point for a single box | partly | + Operand | Type | Location + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ \endtable +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source boxToCell; + + // Conditional mandatory entries + // Select either of the below + + // Option-1 + boxes + ( + ( ) ( ) // box-1 + ( ) ( ) // box-2 + ... + ); + + // Option-2 + box ( ) ( ); + + // Option-3 + min ( ); + max ( ); + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + name | Name of cellSet | word | yes | - + type | Type name: cellSet | word | yes | - + action | Action applied on cells - see below | word | yes | - + source | Source name: boxToCell | word | yes | - + \endtable + + Options for the \c action entry: + \verbatim + new | Create a new cellSet from selected cells + add | Add selected cells into this cellSet + subtract | Remove selected cells from this cellSet + \endverbatim + + Options for the conditional mandatory entries: + \verbatim + Entry | Description | Type | Req'd | Dflt + boxes | Multiple bounding boxes | vectorList | cond'l | - + box | A single bounding box | vector | cond'l | - + min | Minimum point for a single box | vector | cond'l | - + max | Maximum point for a single box | vector | cond'l | - + \verbatim + Note - Must specify "boxes", "box" or a "min/max" pair - (compatibility with searchable box) - highest to lowest precedence. + The order of precedence among the conditional mandatory entries from the + highest to the lowest is \c boxes, \c box or a \c min-max pair + (compatibility with \c searchableBox). + +See also + - Foam::topoSetSource + - Foam::topoSetCellSource SourceFiles boxToCell.C @@ -67,7 +127,7 @@ class boxToCell : public topoSetCellSource { - // Private data + // Private Data //- Add usage string static addToUsageTable usage_; @@ -86,6 +146,7 @@ public: //- Runtime type information TypeName("boxToCell"); + // Constructors //- Construct from components, copying bounding boxes diff --git a/src/meshTools/sets/cellSources/cellToCell/cellToCell.H b/src/meshTools/sets/cellSources/cellToCell/cellToCell.H index dc52f334fc..52ae643dde 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.H +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,17 +28,73 @@ Class Foam::cellToCell Description - A topoSetCellSource to select the cells from another cellSet. + A \c topoSetCellSource to select all the cells from given \c cellSet(s). - \heading Dictionary parameters + Operands: \table - Property | Description | Required | Default - sets | The input cellSet names | possibly | - set | The input cellSet name | possibly | + Operand | Type | Location + input | cellSet(s) | $FOAM_CASE/constant/polyMesh/sets/\ + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ \endtable +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source cellToCell; + + // Conditional mandatory entries + // Select either of the below + + // Option-1 + sets + ( + + + ... + ); + + // Option-2 + set ; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + name | Name of cellSet | word | yes | - + type | Type name: cellSet | word | yes | - + action | Action applied on cells - see below | word | yes | - + source | Source name: cellToCell | word | yes | - + \endtable + + Options for the \c action entry: + \verbatim + new | Create a new cellSet from selected cells + add | Add selected cells into this cellSet + subtract | Remove selected cells from this cellSet + \endverbatim + + Options for the conditional mandatory entries: + \verbatim + Entry | Description | Type | Req'd | Dflt + sets | Names of input cellSets | wordList | cond'l | - + set | Name of input cellSet | word | cond'l | - + \verbatim + Note - Must specify "sets" or "set" (highest to lowest precedence). + The order of precedence among the conditional mandatory entries from the + highest to the lowest is \c sets, and \c set. + +See also + - Foam::topoSetSource + - Foam::topoSetCellSource SourceFiles cellToCell.C @@ -63,7 +119,7 @@ class cellToCell : public topoSetCellSource { - // Private data + // Private Data //- Add usage string static addToUsageTable usage_; @@ -77,6 +133,7 @@ public: //- Runtime type information TypeName("cellToCell"); + // Constructors //- Construct from components @@ -100,7 +157,6 @@ public: const topoSetSource::setAction action, topoSet& set ) const; - }; diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C index c233045bf9..54b4bf1903 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C @@ -121,7 +121,15 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell point2_(point2), radius_(radius), innerRadius_(innerRadius) -{} +{ + if (innerRadius_ > radius_) + { + FatalErrorInFunction + << "inner radius = " << innerRadius_ << "cannot be larger than " + << "outer radius = " << radius_ + << exit(FatalIOError); + } +} Foam::cylinderAnnulusToCell::cylinderAnnulusToCell @@ -135,8 +143,8 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell mesh, dict.get("p1"), dict.get("p2"), - dict.get("outerRadius"), - dict.get("innerRadius") + dict.getCheck("outerRadius", scalarMinMax::ge(SMALL)), + dict.getCheck("innerRadius", scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H index fa8314b013..7a449fb2a1 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,19 +27,64 @@ License Class Foam::cylinderAnnulusToCell -Description - A topoSetCellSource to select cells based on cell centres inside a - cylinder annulus. +Group + grpCellSources - \heading Dictionary parameters +Description + A \c topoSetCellSource to select all cells whose cell + centre inside a given bounding cylinder annulus. + + Operands: \table - Property | Description | Required | Default - p1 | Coordinate of endpoint | yes | - p2 | Coordinate of endpoint | yes | - outerRadius | Cylinder outer radius | yes | - innerRadius | Cylinder inner radius | yes | + Operand | Type | Location + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ \endtable +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source cylinderAnnulusToCell; + p1 ( ); + p2 ( ); + outerRadius ; + + // Optional entries + innerRadius ; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + name | Name of cellSet | word | yes | - + type | Type name: cellSet | word | yes | - + action | Action applied on cells - see below | word | yes | - + source | Source name: cylinderAnnulusToCell | word | yes | - + p1 | Coordinate of one of the endpoints | vector | yes | - + p2 | Coordinate of the other endpoint | vector | yes | - + outerRadius | Cylinder outer radius | scalar | yes | - + innerRadius | Cylinder inner radius | scalar | no | 0 + \endtable + + Options for the \c action entry: + \verbatim + new | Create a new cellSet from selected cells + add | Add selected cells into this cellSet + subtract | Remove selected cells from this cellSet + \endverbatim + +See also + - Foam::topoSetSource + - Foam::topoSetCellSource + - Foam::cylinderToCell + SourceFiles cylinderAnnulusToCell.C @@ -63,8 +108,7 @@ class cylinderAnnulusToCell : public topoSetCellSource { - - // Private data + // Private Data //- Add usage string static addToUsageTable usage_; @@ -123,7 +167,6 @@ public: const topoSetSource::setAction action, topoSet& set ) const; - }; diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C index 3114d74cf0..1856b4184d 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C @@ -110,7 +110,15 @@ Foam::cylinderToCell::cylinderToCell point2_(point2), radius_(radius), innerRadius_(innerRadius) -{} +{ + if (innerRadius_ > radius_) + { + FatalErrorInFunction + << "inner radius = " << innerRadius_ << "cannot be larger than " + << "outer radius = " << radius_ + << exit(FatalIOError); + } +} Foam::cylinderToCell::cylinderToCell @@ -124,8 +132,8 @@ Foam::cylinderToCell::cylinderToCell mesh, dict.get("p1"), dict.get("p2"), - dict.get("radius"), - dict.getOrDefault("innerRadius", 0) + dict.getCheck("radius", scalarMinMax::ge(SMALL)), + dict.getCheckOrDefault("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H index d98015ac8c..035fe2283d 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,17 +28,60 @@ Class Foam::cylinderToCell Description - A topoSetCellSource to select cells with their centres inside a cylinder. + A \c topoSetCellSource to select all cells whose cell centre + inside a given bounding cylinder or cylinder annulus. - \heading Dictionary parameters + Operands: \table - Property | Description | Required | Default - p1 | Coordinate of endpoint | yes | - p2 | Coordinate of endpoint | yes | - radius | Cylinder (outer) radius | yes | - innerRadius | Cylinder inner radius | no | 0 + Operand | Type | Location + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ \endtable +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source cylinderToCell; + p1 ( ); + p2 ( ); + radius ; + + // Optional entries + innerRadius ; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + name | Name of cellSet | word | yes | - + type | Type name: cellSet | word | yes | - + action | Action applied on cells - see below | word | yes | - + source | Source name: cylinderToCell | word | yes | - + p1 | Coordinate of one of the endpoints | vector | yes | - + p2 | Coordinate of the other endpoint | vector | yes | - + radius | Cylinder outer radius | scalar | yes | - + innerRadius | Cylinder inner radius | scalar | no | 0 + \endtable + + Options for the \c action entry: + \verbatim + new | Create a new cellSet from selected cells + add | Add selected cells into this cellSet + subtract | Remove selected cells from this cellSet + \endverbatim + +See also + - Foam::topoSetSource + - Foam::topoSetCellSource + - Foam::cylinderAnnulusToCell + SourceFiles cylinderToCell.C @@ -62,8 +105,7 @@ class cylinderToCell : public topoSetCellSource { - - // Private data + // Private Data //- Add usage string static addToUsageTable usage_; @@ -122,7 +164,6 @@ public: const topoSetSource::setAction action, topoSet& set ) const; - }; diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.H b/src/meshTools/sets/cellSources/faceToCell/faceToCell.H index 68652e4cfb..8e39500ba3 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.H +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,18 +28,86 @@ Class Foam::faceToCell Description - A topoSetCellSource to select cells based on usage in a face set. + A \c topoSetCellSource to select all cells based on usage in given + \c faceSet(s), e.g. select cells that are the \c owner/neighbour/any + of the faces in a given \c faceSet. - \heading Dictionary parameters + Operands: \table - Property | Description | Required | Default - sets | The faceSet names to use | possibly | - set | The faceSet name to use | possibly | - option | Selection type (all/any/owner/neighbour) | yes | + Operand | Type | Location + input | faceSet(s) | $FOAM_CASE/constant/polyMesh/sets/\ + output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\ \endtable +Usage + Minimal example by using \c system/topoSetDict.actions: + \verbatim + { + // Mandatory (inherited) entries + name ; + type cellSet; + action ; + + // Mandatory entries + source faceToCell; + option