1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::slicedFvsPatchField
28 Specialization of fvsPatchField which creates the underlying
29 fvsPatchField as a slice of the given complete field.
31 The destructor is wrapped to avoid deallocation of the storage of the
32 complete fields when this is destroyed.
34 Should only used as a template argument for SlicedGeometricField.
39 \*---------------------------------------------------------------------------*/
41 #ifndef slicedFvsPatchField_H
42 #define slicedFvsPatchField_H
44 #include "fvsPatchField.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class slicedFvsPatch Declaration
53 \*---------------------------------------------------------------------------*/
56 class slicedFvsPatchField
58 public fvsPatchField<Type>
63 //- Runtime type information
69 //- Construct from patch, internal field and field to slice
73 const DimensionedField<Type, surfaceMesh>&,
77 //- Construct from patch and internal field
81 const DimensionedField<Type, surfaceMesh>&
84 //- Construct from patch, internal field and dictionary
88 const DimensionedField<Type, surfaceMesh>&,
92 //- Construct by mapping the given slicedFvsPatchField<Type>
96 const slicedFvsPatchField<Type>&,
98 const DimensionedField<Type, surfaceMesh>&,
99 const fvPatchFieldMapper&
102 //- Construct as copy
103 slicedFvsPatchField(const slicedFvsPatchField<Type>&);
105 //- Construct and return a clone
106 virtual tmp<fvsPatchField<Type> > clone() const;
108 //- Construct as copy setting internal field reference
111 const slicedFvsPatchField<Type>&,
112 const DimensionedField<Type, surfaceMesh>&
115 //- Construct and return a clone setting internal field reference
116 virtual tmp<fvsPatchField<Type> > clone
118 const DimensionedField<Type, surfaceMesh>& iF
123 virtual ~slicedFvsPatchField<Type>();
130 //- Return true if this patch field fixes a value.
131 // Needed to check if a level has to be specified while solving
132 // Poissons equations.
133 virtual bool fixesValue() const
140 virtual void write(Ostream&) const;
145 virtual void operator=(const UList<Type>&) {}
147 virtual void operator=(const fvsPatchField<Type>&) {}
148 virtual void operator+=(const fvsPatchField<Type>&) {}
149 virtual void operator-=(const fvsPatchField<Type>&) {}
150 virtual void operator*=(const fvsPatchField<scalar>&) {}
151 virtual void operator/=(const fvsPatchField<scalar>&) {}
153 virtual void operator+=(const Field<Type>&) {}
154 virtual void operator-=(const Field<Type>&) {}
156 virtual void operator*=(const Field<scalar>&) {}
157 virtual void operator/=(const Field<scalar>&) {}
159 virtual void operator=(const Type&) {}
160 virtual void operator+=(const Type&) {}
161 virtual void operator-=(const Type&) {}
162 virtual void operator*=(const scalar) {}
163 virtual void operator/=(const scalar) {}
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 # include "slicedFvsPatchField.C"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //