MRFZones.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) 2012-2026 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 "MRFZones.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
33 }
34 
35 
36 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
37 
38 Foam::IOobject Foam::MRFZones::createIOobject
39 (
40  const fvMesh& mesh
41 ) const
42 {
43  typeIOobject<IOdictionary> io
44  (
45  "MRFProperties",
46  mesh.time().constant(),
47  mesh,
50  );
51 
52  if (io.headerOk())
53  {
55  << "Constructing MRF zones from " << io.name()
56  << endl;
57 
58  io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
59  return io;
60  }
61  else
62  {
63  io.readOpt() = IOobject::NO_READ;
64  return io;
65  }
66 }
67 
68 
69 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
70 
72 (
73  const fvMesh& mesh
74 )
75 :
77  <
78  fvMesh,
80  MRFZones,
82  >
83  (
84  createIOobject(mesh),
85  mesh
86  ),
87  MRFZoneList(mesh, *this)
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
92 
94 {}
95 
96 
98 {
99  update();
100  return true;
101 }
102 
103 
105 {
106  update();
107 }
108 
109 
111 {
112  update();
113 }
114 
115 
117 {
118  update();
119 }
120 
121 
123 {
124  if (regIOobject::read())
125  {
126  MRFZoneList::read(*this);
127  return true;
128  }
129  else
130  {
131  return false;
132  }
133 }
134 
135 
136 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:119
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:297
List container for MRF zones.
Definition: MRFZoneList.H:55
bool read(const dictionary &dict)
Read dictionary.
Definition: MRFZoneList.C:101
MRF zones DemandDrivenMeshObject read from MRFProperties dictionary.
Definition: MRFZones.H:76
virtual bool movePoints()
Update for mesh motion.
Definition: MRFZones.C:97
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
Definition: MRFZones.C:104
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: MRFZones.C:116
MRFZones(const fvMesh &mesh)
Construct from mesh.
Definition: MRFZones.C:72
virtual void preUpdateMesh()
Prepare for mesh update.
Definition: MRFZones.C:93
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: MRFZones.C:110
virtual bool read()
Read dictionary.
Definition: MRFZones.C:122
static const word & constant()
Return constant name.
Definition: TimePaths.H:122
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:433
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual bool read()
Read object.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
messageStream Info
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
Definition: Ostream.H:250
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)