FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::SlicedGeometricField
26 
27 Description
28  Specialization of GeometricField which holds slices of given complete
29  fields in a form that they act as a GeometricField.
30 
31  The destructor is wrapped to avoid deallocation of the storage of the
32  complete fields when this is destroyed.
33 
34  SlicedGeometricField can only be instantiated with a valid form of
35  SlicedPatchField to handle the slicing and storage deallocation of the
36  boundary field.
37 
38 SourceFiles
39  SlicedGeometricField.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef SlicedGeometricField_H
44 #define SlicedGeometricField_H
45 
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class SlicedGeometricField Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template
58 <
59  class Type,
60  template<class> class PatchField,
61  template<class> class SlicedPatchField,
62  class GeoMesh
63 >
65 :
66  public GeometricField<Type, PatchField, GeoMesh>
67 {
68 public:
69 
70  typedef typename GeoMesh::Mesh Mesh;
72 
74 
75 
76 private:
77 
78  // Private Member Functions
79 
80  //- Slice the given field and a create a PtrList of SlicedPatchField
81  // from which the boundary field is built
82  tmp<FieldField<PatchField, Type> > slicedBoundaryField
83  (
84  const Mesh& mesh,
85  const Field<Type>& completeField,
86  const bool preserveCouples
87  );
88 
89  //- Slice the given field and a create a PtrList of SlicedPatchField
90  // from which the boundary field is built
91  tmp<FieldField<PatchField, Type> > slicedBoundaryField
92  (
93  const Mesh& mesh,
94  const FieldField<PatchField, Type>& bField,
95  const bool preserveCouples
96  );
97 
99  //SlicedGeometricField(const SlicedGeometricField&);
100 
101  //- Disallow default bitwise assignment
102  void operator=(const SlicedGeometricField&);
103 
104  //- Disallow standard assignment to GeometricField,
105  // == assignment is allowed.
106  void operator=(const GeometricField<Type, PatchField, GeoMesh>&);
107 
108  //- Disallow standard assignment to tmp<GeometricField>,
109  // == assignment is allowed.
110  void operator=(const tmp<GeometricField<Type, PatchField, GeoMesh> >&);
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from components and field to slice
119  (
120  const IOobject&,
121  const Mesh&,
122  const dimensionSet&,
123  const Field<Type>& completeField,
124  const bool preserveCouples=true
125  );
126 
127  //- Construct from components and separate fields to slice for the
128  // internal field and boundary field
130  (
131  const IOobject&,
132  const Mesh&,
133  const dimensionSet&,
134  const Field<Type>& completeIField,
135  const Field<Type>& completeBField,
136  const bool preserveCouples=true
137  );
138 
139  //- Construct from GeometricField. Reuses full internal and
140  // patch fields except on couples (preserveCouples=true).
142  (
143  const IOobject&,
145  const bool preserveCouples=true
146  );
147 
148  //- Construct as copy
150  (
152  <
153  Type,
154  PatchField,
155  SlicedPatchField,
156  GeoMesh
157  >&
158  );
159 
160 
161  // Destructor
162 
164 
165 
166  // Member functions
167 
168  //- Correct boundary field
170 };
171 
172 
173 /*---------------------------------------------------------------------------*\
174  Class SlicedGeometricField::DimensionedInternalField Declaration
175 \*---------------------------------------------------------------------------*/
176 
177 //- The internalField of a SlicedGeometricField
178 template
179 <
180  class Type,
181  template<class> class PatchField,
182  template<class> class SlicedPatchField,
183  class GeoMesh
184 >
185 class SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
187 :
188  public GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField
189 {
190 
191 public:
192 
193  // Constructors
194 
195  //- Construct from components and field to slice
197  (
198  const IOobject&,
199  const Mesh&,
200  const dimensionSet&,
201  const Field<Type>& iField
202  );
203 
204 
205  // Destructor
206 
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #ifdef NoRepository
219 #endif
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************ vim: set sw=4 sts=4 et: ************************ //