SlicedDimensionedField.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 OpenFOAM Foundation
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::SlicedDimensionedField
29
30Description
31 Specialisation of DimensionedField that holds a slice of a given
32 field so that it acts as a DimensionedField.
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef Foam_SlicedDimensionedField_H
37#define Foam_SlicedDimensionedField_H
38
39#include "DimensionedField.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class SlicedDimensionedField Declaration
48\*---------------------------------------------------------------------------*/
49
50template<class Type, class GeoMesh>
52:
53 public DimensionedField<Type, GeoMesh>
54{
55public:
56
57 // Public Typedefs
58
59 //- Type of mesh on which this SlicedDimensionedField is instantiated
60 typedef typename GeoMesh::Mesh Mesh;
61
62
63 // Constructors
64
65 //- Construct from components and field to slice
67 (
68 const IOobject& io,
69 const Mesh& mesh,
70 const dimensionSet& ds,
71 const Field<Type>& iField
72 )
73 :
74 DimensionedField<Type, GeoMesh>(io, mesh, ds, Field<Type>())
75 {
76 // Set internalField to the slice of the complete field
78 (
80 );
81 }
82
83
84 //- Destructor
86 {
87 // Set internalField to nullptr to avoid deletion of underlying field
89 }
90};
91
92
93// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95} // End namespace Foam
96
97// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98
99#endif
100
101// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
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
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...
GeoMesh::Mesh Mesh
Type of mesh on which this SlicedDimensionedField is instantiated.
SlicedDimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &ds, const Field< Type > &iField)
Construct from components and field to slice.
A List obtained as a section of another List.
Definition: SubList.H:70
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
void shallowCopy(const UList< T > &list)
Copy the pointer and size held by the given UList.
Definition: UListI.H:272
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.