faMeshesRegistry.C
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) 2023-2024 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "faMeshesRegistry.H"
29 #include "faMesh.H"
30 #include "polyMesh.H"
31 #include "mapPolyMesh.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 :
45  MeshObject_type(mesh),
46  objects_
47  (
48  IOobject
49  (
50  faMesh::prefix(),
51  mesh.time().timeName(),
52  mesh.thisDb(),
53  IOobjectOption::NO_READ,
54  IOobjectOption::AUTO_WRITE,
55  IOobjectOption::REGISTER
56  )
57  )
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
64 {
65  for (faMesh& m : objects_.sorted<faMesh>())
66  {
67  m.movePoints();
68  }
69 
70  return true;
71 }
72 
73 
74 void Foam::faMeshesRegistry::updateMesh(const mapPolyMesh& mpm)
75 {
76  for (faMesh& m : objects_.sorted<faMesh>())
77  {
78  m.updateMesh(mpm);
79  }
80 }
81 
82 
84 (
85  IOstreamOption streamOpt,
86  const bool writeOnProc
87 ) const
88 {
89  // for (const faMesh& m : objects_.csorted<faMesh>())
90  // {
91  // m.write(writeOnProc);
92  // }
93  //
94  // return true;
95 
96  return objects_.writeObject(streamOpt, writeOnProc);
97 }
98 
99 
100 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
UPtrList< Type > sorted()
Return sorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict) ...
word timeName
Definition: getTimeIndex.H:3
virtual void updateMesh(const mapPolyMesh &mpm)
Update after topo change.
dynamicFvMesh & mesh
virtual bool movePoints()
Update after mesh motion.
defineTypeNameAndDebug(combustionModel, 0)
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write items (eg, faMesh) held in the registry.
A MeshObject registry on top of a polyMesh that provides an objectRegistry for holding multiple faMes...
faMeshesRegistry(const faMeshesRegistry &)=delete
No copy construct.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:180
Namespace for OpenFOAM.