Loading...
Searching...
No Matches
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-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
35namespace Foam
38}
39
40
41// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
44:
45 MeshObject_type(mesh),
46 objects_
47 (
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
74void 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 // Could also restrict to faMesh only...
90 //
91 // for (const faMesh& m : objects_.csorted<faMesh>())
92 // {
93 // m.write(writeOnProc);
94 // }
95 //
96 // return true;
97
98 return objects_.writeObject(streamOpt, writeOnProc);
99}
100
101
102// ************************************************************************* //
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Definition IOobject.C:456
A simple container for options an IOstream can normally have.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
A MeshObject registry on top of a polyMesh that provides an objectRegistry for holding multiple faMes...
virtual bool movePoints()
Update after mesh motion.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write items (eg, faMesh) held in the registry.
faMeshesRegistry(const faMeshesRegistry &)=delete
No copy construct.
virtual void updateMesh(const mapPolyMesh &mpm)
Update after topo change.
const objectRegistry & thisDb() const noexcept
The registry of the objects.
const polyMesh & mesh() const noexcept
The polyMesh reference.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
UPtrList< Type > sorted()
Return sorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict).
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
word timeName
Definition getTimeIndex.H:3
Namespace for OpenFOAM.