Loading...
Searching...
No Matches
parFaFieldDistributorCache.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) 2022-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
26Class
27 Foam::parFaFieldDistributorCache
28
29Description
30 Simple container to manage read/write, redistribute finiteArea fields.
31
32SourceFiles
33 parFaFieldDistributorCache.cxx
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_parFaFieldDistributorCache_H
38#define Foam_parFaFieldDistributorCache_H
39
40#include "faMesh.H"
41#include "faMeshDistributor.H"
42#include "areaFieldsFwd.H"
43#include "edgeFieldsFwd.H"
44#include "PtrList.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class parFaFieldDistributorCache Declaration
53\*---------------------------------------------------------------------------*/
54
55class parFaFieldDistributorCache
56{
57 // Private Data
58
59 #undef declareField
60 #define declareField(Type) \
61 PtrList<GeometricField<Type, faPatchField, areaMesh>> Type##AreaFields_; \
62 PtrList<GeometricField<Type, faePatchField, edgeMesh>> Type##EdgeFields_;
63
64 declareField(scalar);
69 #undef declareField
70
71
72 // Private Member Functions
73
74 //- Read distributed fields
75 template<class BoolListType>
76 void readImpl
77 (
78 const Time& baseRunTime,
79 const fileName& proc0CaseName,
80 const bool decompose, // i.e. read from undecomposed case
81
82 const BoolListType& areaMeshOnProc,
83 refPtr<fileOperation>& readHandler,
84 const fileName& areaMeshInstance,
85 faMesh& mesh
86 );
87
88 //- Redistribute and write fields of given type (file-scope use)
89 template<class GeoField>
90 static void redistributeAndWrite
91 (
92 const faMeshDistributor& distributor,
93 PtrList<GeoField>& fields,
94 const bool isWriteProc
95 );
96
97
98public:
99
100 // Constructors
101
102 //- No copy construct
105 //- No copy assignment
106 void operator=(const parFaFieldDistributorCache&) = delete;
107
108 //- Default construct
110
111
112 // Member Functions
113
114 //- Read distributed fields
115 void read
116 (
117 const Time& baseRunTime,
118 const fileName& proc0CaseName,
120 const bool decompose,
122 const bitSet& areaMeshOnProc,
123 refPtr<fileOperation>& readHandler,
124 const fileName& areaMeshInstance,
125 faMesh& mesh
126 );
127
128 //- Read distributed fields
129 void read
130 (
131 const Time& baseRunTime,
132 const fileName& proc0CaseName,
134 const bool decompose,
136 const boolUList& areaMeshOnProc,
137 refPtr<fileOperation>& readHandler,
138 const fileName& areaMeshInstance,
139 faMesh& mesh
140 );
141
142 void redistributeAndWrite
143 (
144 const faMeshDistributor& distributor,
145 const bool isWriteProc
146 );
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#endif
157
158// ************************************************************************* //
Forwards and collection of common area field types.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
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 class for handling file names.
Definition fileName.H:75
void operator=(const parFaFieldDistributorCache &)=delete
No copy assignment.
parFaFieldDistributorCache(const parFaFieldDistributorCache &)=delete
No copy construct.
parFaFieldDistributorCache()=default
Default construct.
void read(const Time &baseRunTime, const fileName &proc0CaseName, const bool decompose, const bitSet &areaMeshOnProc, refPtr< fileOperation > &readHandler, const fileName &areaMeshInstance, faMesh &mesh)
Read distributed fields.
void read(const Time &baseRunTime, const fileName &proc0CaseName, const bool decompose, const boolUList &areaMeshOnProc, refPtr< fileOperation > &readHandler, const fileName &areaMeshInstance, faMesh &mesh)
Read distributed fields.
void redistributeAndWrite(const faMeshDistributor &distributor, const bool isWriteProc)
A class for managing references or pointers (no reference counting).
Definition refPtr.H:54
Tensor of scalars, i.e. Tensor<scalar>.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
dynamicFvMesh & mesh
Forwards for edge field types.
Namespace for OpenFOAM.
UList< bool > boolUList
A UList of bools.
Definition UList.H:73
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55
#define declareField(Type)
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields