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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fv::interRegionOption
29
30Description
31 Intermediate class for handling inter-region exchanges.
32
33Usage
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
64SourceFiles
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
79namespace Foam
80{
81namespace fv
82{
83
84/*---------------------------------------------------------------------------*\
85 Class interRegionOption Declaration
86\*---------------------------------------------------------------------------*/
87
88class interRegionOption
89:
90 public fv::option
91{
92protected:
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
108 //- Set the mesh to mesh interpolation object
109 void setMapper();
110
111
112public:
113
114 //- Runtime type information
115 TypeName("interRegionOption");
117
118 // Constructors
120 //- Construct from dictionary
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;
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;
150
151 // IO
153 //- Read dictionary
154 virtual bool read(const dictionary& dict);
155};
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// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Intermediate class for handling inter-region exchanges.
word nbrRegionName_
Name of the neighbour region to map.
void operator=(const interRegionOption &)=delete
No copy assignment.
virtual ~interRegionOption()=default
Destructor.
autoPtr< meshToMesh > meshInterpPtr_
Mesh to mesh interpolation object.
virtual bool read(const dictionary &dict)
Read dictionary.
const word & nbrRegionName() const
Return const access to the neighbour region name.
void setMapper()
Set the mesh to mesh interpolation object.
TypeName("interRegionOption")
Runtime type information.
bool master_
Master or slave region.
const meshToMesh & meshInterp() const
Return const access to the mapToMap pointer.
interRegionOption(const interRegionOption &)=delete
No copy construct.
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:127
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73