OpenFOAM
v2406
The open source CFD toolbox
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
-------------------------------------------------------------------------------
11
License
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
27
Class
28
Foam::SlicedDimensionedField
29
30
Description
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
43
namespace
Foam
44
{
45
46
/*---------------------------------------------------------------------------*\
47
Class SlicedDimensionedField Declaration
48
\*---------------------------------------------------------------------------*/
49
50
template
<
class
Type,
class
GeoMesh>
51
class
SlicedDimensionedField
52
:
53
public
DimensionedField
<Type, GeoMesh>
54
{
55
public
:
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
66
SlicedDimensionedField
67
(
68
const
IOobject
&
io
,
69
const
Mesh
&
mesh
,
70
const
dimensionSet
& dims,
71
const
Field<Type>
& iField
72
)
73
:
74
DimensionedField
<Type,
GeoMesh
>(
io
,
mesh
, dims,
Field
<Type>())
75
{
76
// Set internalField to the slice of the complete field
77
UList<Type>::shallowCopy
78
(
79
SubList<Type>
(iField, GeoMesh::size(
mesh
))
80
);
81
}
82
83
84
//- Destructor
85
~SlicedDimensionedField
()
86
{
87
// Set internalField to nullptr to avoid deletion of underlying field
88
UList<Type>::shallowCopy
(
nullptr
);
89
}
90
};
91
92
93
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95
}
// End namespace Foam
96
97
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98
99
#endif
100
101
// ************************************************************************* //
Foam::SlicedDimensionedField
Specialisation of DimensionedField that holds a slice of a given field so that it acts as a Dimension...
Definition:
SlicedDimensionedField.H:44
Foam::SlicedDimensionedField::SlicedDimensionedField
SlicedDimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Construct from components and field to slice.
Definition:
SlicedDimensionedField.H:64
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition:
dimensionSet.H:105
Foam::SubList< Type >
Foam::Field
Generic templated field type.
Definition:
Field.H:62
Foam::SlicedDimensionedField::~SlicedDimensionedField
~SlicedDimensionedField()
Destructor.
Definition:
SlicedDimensionedField.H:84
Foam::DimensionedField< scalar, Foam::volMesh >::Mesh
Foam::volMesh ::Mesh Mesh
The mesh type for the DimensionedField.
Definition:
DimensionedField.H:84
Foam::DimensionedField::mesh
const Mesh & mesh() const noexcept
Return mesh.
Definition:
DimensionedFieldI.H:26
Foam::GeoMesh::Mesh
MESH Mesh
Definition:
GeoMesh.H:58
DimensionedField.H
Foam::SlicedDimensionedField::Mesh
GeoMesh::Mesh Mesh
Type of mesh on which this SlicedDimensionedField is instantiated.
Definition:
SlicedDimensionedField.H:55
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition:
polyMeshFieldsFwd.H:31
Foam::UList::shallowCopy
void shallowCopy(T *__restrict__ ptr, const label len) noexcept
Copy the pointer and size.
Definition:
UListI.H:309
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition:
GeoMesh.H:42
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition:
IOobject.H:180
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
src
OpenFOAM
fields
DimensionedFields
DimensionedField
SlicedDimensionedField.H
Generated by
1.8.14