interRegionOption.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::interRegionOption
29 
30 Description
31  Intermediate class for handling inter-region exchanges.
32 
33 Usage
34  Minimal example by using \c constant/fvOptions:
35  \verbatim
36  <userDefinedName1>
37  {
38  // Mandatory/Optional (inherited) entries
39  ...
40 
41  // Mandatory entries (unmodifiable)
42  nbrRegion <nbrRegionName>;
43 
44  // Optional entries (unmodifiable)
45  master true;
46 
47  // Mandatory/Optional (derived) entries
48  ...
49  }
50  \endverbatim
51 
52  where the entries mean:
53  \table
54  Property | Description | Type | Reqd | Dflt
55  nbrRegion | Name of the neighbour region to map | word | yes | -
56  master | Flag to determine whether master or <!--
57  --> secondary region | bool | no | true
58  \endtable
59 
60  The inherited entries are elaborated in:
61  - \link fvOption.H \endlink
62  - \link meshToMesh.H \endlink
63 
64 SourceFiles
65  interRegionOption.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef interRegionOption_H
70 #define interRegionOption_H
71 
72 #include "fvOption.H"
73 #include "volFields.H"
74 #include "autoPtr.H"
75 #include "meshToMesh.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 namespace fv
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class interRegionOption Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class interRegionOption
89 :
90  public fv::option
91 {
92 protected:
93 
94  // Protected Data
95 
96  //- Master or slave region
97  bool master_;
98 
99  //- Name of the neighbour region to map
100  word nbrRegionName_;
101 
102  //- Mesh to mesh interpolation object
103  autoPtr<meshToMesh> meshInterpPtr_;
104 
105 
106  // Protected Member Functions
107 
108  //- Set the mesh to mesh interpolation object
109  void setMapper();
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("interRegionOption");
116 
117 
118  // Constructors
119 
120  //- Construct from dictionary
122  (
123  const word& name,
124  const word& modelType,
125  const dictionary& dict,
126  const fvMesh& mesh
127  );
128 
129  //- No copy construct
130  interRegionOption(const interRegionOption&) = delete;
131 
132  //- No copy assignment
133  void operator=(const interRegionOption&) = delete;
134 
135 
136  //- Destructor
137  virtual ~interRegionOption() = default;
138 
139 
140  // Member Functions
141 
142  // Access
143 
144  //- Return const access to the neighbour region name
145  inline const word& nbrRegionName() const;
146 
147  //- Return const access to the mapToMap pointer
148  inline const meshToMesh& meshInterp() const;
149 
150 
151  // IO
152 
153  //- Read dictionary
154  virtual bool read(const dictionary& dict);
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace fv
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #include "interRegionOptionI.H"
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
volFields.H
Foam::fv::interRegionOption::nbrRegionName_
word nbrRegionName_
Name of the neighbour region to map.
Definition: interRegionOption.H:119
Foam::fv::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::interRegionOption::setMapper
void setMapper()
Set the mesh to mesh interpolation object.
Definition: interRegionOption.C:44
Foam::fv::interRegionOption::operator=
void operator=(const interRegionOption &)=delete
No copy assignment.
meshToMesh.H
Foam::fv::interRegionOption::master_
bool master_
Master or slave region.
Definition: interRegionOption.H:116
Foam::meshToMesh
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:64
Foam::fv::option
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:126
Foam::fv::interRegionOption
Intermediate class for handling inter-region exchanges.
Definition: interRegionOption.H:107
Foam::fv::interRegionOption::meshInterpPtr_
autoPtr< meshToMesh > meshInterpPtr_
Mesh to mesh interpolation object.
Definition: interRegionOption.H:122
Foam::fv::interRegionOption::~interRegionOption
virtual ~interRegionOption()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::interRegionOption::nbrRegionName
const word & nbrRegionName() const
Return const access to the neighbour region name.
Definition: interRegionOptionI.H:32
fv
labelList fv(nPoints)
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
interRegionOptionI.H
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
fvOption.H
Foam::fv::interRegionOption::TypeName
TypeName("interRegionOption")
Runtime type information.
Foam::fv::interRegionOption::interRegionOption
interRegionOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
Definition: interRegionOption.C:100
Foam::fv::interRegionOption::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: interRegionOption.C:127
Foam::fv::interRegionOption::meshInterp
const meshToMesh & meshInterp() const
Return const access to the mapToMap pointer.
Definition: interRegionOptionI.H:39
autoPtr.H