SlicedGeometricField.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) 2011-2017,2022 OpenFOAM Foundation
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::SlicedGeometricField
28
29Description
30 Specialization of GeometricField which holds slices of given complete
31 fields in a form that they act as a GeometricField.
32
33 The destructor is wrapped to avoid deallocation of the storage of the
34 complete fields when this is destroyed.
35
36 SlicedGeometricField can only be instantiated with a valid form of
37 SlicedPatchField to handle the slicing and storage deallocation of the
38 boundary field.
39
40SourceFiles
41 SlicedGeometricField.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_SlicedGeometricField_H
46#define Foam_SlicedGeometricField_H
47
48#include "GeometricField.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class SlicedGeometricField Declaration
58\*---------------------------------------------------------------------------*/
59
60template
61<
62 class Type,
63 template<class> class PatchField,
64 template<class> class SlicedPatchField,
65 class GeoMesh
68:
69 public GeometricField<Type, PatchField, GeoMesh>
70{
71public:
72
73 // Public Typedefs
75 typedef typename GeoMesh::Mesh Mesh;
76 typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
77
78 //- The internal field slice for this SlicedGeometricField
80
81
82private:
83
84 // Private Member Functions
85
86 //- Slice the given field and a create a PtrList of SlicedPatchField
87 // from which the boundary field is built
89 slicedBoundaryField
90 (
91 const Mesh& mesh,
92 const Field<Type>& completeField,
93 const bool preserveCouples,
94 const bool preserveProcessorOnly = false
95 );
96
97 //- Slice the given field and a create a PtrList of SlicedPatchField
98 // from which the boundary field is built
100 slicedBoundaryField
101 (
102 const Mesh& mesh,
103 const FieldField<PatchField, Type>& bField,
104 const bool preserveCouples
105 );
106
107 // Note - copy construct allowed
108
109 //- No copy assignment
110 void operator=(const SlicedGeometricField&) = delete;
111
112 //- No copy assignment from GeometricField,
113 // == assignment is allowed.
114 void operator=
115 (
117 ) = delete;
118
119 //- No copy assignment from tmp<GeometricField>,
120 // == assignment is allowed.
121 void operator=
122 (
124 ) = delete;
125
126
127public:
128
129 // Constructors
130
131 //- Construct from components and field to slice
133 (
134 const IOobject&,
135 const Mesh&,
136 const dimensionSet&,
137 const Field<Type>& completeField,
138 const bool preserveCouples=true
139 );
140
141 //- Construct from components and separate fields to slice for the
142 //- internal field and boundary field
144 (
145 const IOobject&,
146 const Mesh&,
147 const dimensionSet&,
148 const Field<Type>& completeIField,
149 const Field<Type>& completeBField,
150 const bool preserveCouples=true,
151 const bool preserveProcessorOnly = false
152 );
153
154 //- Construct from GeometricField. Reuses full internal and
155 //- patch fields except on couples (preserveCouples=true).
157 (
158 const IOobject&,
160 const bool preserveCouples=true
161 );
162
163 //- Copy construct
165 (
167 <
168 Type,
169 PatchField,
170 SlicedPatchField,
171 GeoMesh
172 >&
173 );
174
175 //- Clone
177 clone() const;
178
179
180 //- Destructor
182
183
184 // Member Functions
185
186 //- Correct boundary field
188};
189
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193} // End namespace Foam
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197#ifdef NoRepository
198 #include "SlicedGeometricField.C"
199#endif
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#endif
204
205// ************************************************************************* //
const Mesh & mesh() const
Return mesh.
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
Generic templated field type.
Definition: Field.H:82
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:49
MESH Mesh
Definition: GeoMesh.H:62
MESH::BoundaryMesh BoundaryMesh
Definition: GeoMesh.H:63
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
Specialisation of DimensionedField that holds a slice of a given field so that it acts as a Dimension...
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
SlicedDimensionedField< Type, GeoMesh > Internal
The internal field slice for this SlicedGeometricField.
tmp< SlicedGeometricField< Type, PatchField, SlicedPatchField, GeoMesh > > clone() const
Clone.
GeoMesh::BoundaryMesh BoundaryMesh
void correctBoundaryConditions()
Correct boundary field.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.