externalPoints.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "externalPoints.H"
27 #include "multiValveEngine.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  namespace zoneGenerators
35  {
38  (
42  );
43  }
44 }
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
49 (
50  const word& name,
51  const polyMesh& mesh,
52  const dictionary& dict
53 )
54 :
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
60 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
68 {
70  (
71  refCast<const fvMeshMovers::multiValveEngine>
72  (
73  refCast<const fvMesh>(mesh_).mover()
74  )
75  );
76 
78 
79  return zoneGenerator::New
80  (
81  name_,
82  mesh_,
84  (
85  "type", "invert",
86  "internalPoints", dictionary::entries
87  (
88  "type", "point",
89  "internalCells", dictionary::entries
90  (
91  "type", "cylinder",
92  "zoneType", "cell",
93  "point1", piston.centre() - 10*piston.bore()*piston.axis,
94  "point2", piston.centre() + 10*piston.bore()*piston.axis,
95  "radius", piston.bore()/2
96  )
97  )
98  )
99  )->generate();
100 }
101 
102 
103 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static std::tuple< const Entries &... > entries(const Entries &...)
Construct an entries tuple from which to make a dictionary.
scalar bore() const
Return the bore.
Definition: piston.C:113
vector centre() const
Return the piston centre.
Definition: piston.C:119
A mesh mover using explicit node translation based on scaled distance functions per moving object....
const pistonObject & piston
Piston object.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for handling words, derived from string.
Definition: word.H:63
Abstract base class for all zoneGenerators, providing runtime selection.
Definition: zoneGenerator.H:57
static autoPtr< zoneGenerator > New(const word &name, const polyMesh &mesh, const dictionary &dict)
Select constructed from name, mesh and dictionary.
Definition: zoneGenerator.C:66
A zoneGenerator which selects the static external points.
virtual zoneSet generate() const
Generate and return the zoneSet.
virtual ~externalPoints()
Destructor.
externalPoints(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(cylinderHeadPoints, 0)
addToRunTimeSelectionTable(zoneGenerator, cylinderHeadPoints, dictionary)
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict