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 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.C
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{
50
51/*---------------------------------------------------------------------------*\
52 Class parFaFieldDistributorCache Declaration
53\*---------------------------------------------------------------------------*/
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 //- Redistribute and write fields of given type (file-scope use)
75 template<class GeoField>
76 static void redistributeAndWrite
77 (
78 const faMeshDistributor& distributor,
79 PtrList<GeoField>& fields,
80 const bool isWriteProc
81 );
82
83
84public:
85
86 // Constructors
87
88 //- No copy construct
90
91 //- No copy assignment
92 void operator=(const parFaFieldDistributorCache&) = delete;
93
94 //- Default construct
96
97
98 // Member Functions
99
100 //- Read distributed fields
101 void read
102 (
103 const Time& baseRunTime,
104 const fileName& proc0CaseName,
105 const bool decompose, // i.e. read from undecomposed case
106
107 const boolList& areaMeshOnProc,
108 const fileName& areaMeshInstance,
109 faMesh& mesh
110 );
112 void redistributeAndWrite
113 (
114 const faMeshDistributor& distributor,
115 const bool isWriteProc
116 );
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
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:80
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:100
A class for handling file names.
Definition: fileName.H:76
Simple container to manage read/write, redistribute finiteArea fields.
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 boolList &areaMeshOnProc, const fileName &areaMeshInstance, faMesh &mesh)
Read distributed fields.
void redistributeAndWrite(const faMeshDistributor &distributor, const bool isWriteProc)
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.
#define declareField(Type)
Namespace for OpenFOAM.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97