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::slicedFvPatchField
28 Specialization of fvPatchField which creates the underlying
29 fvPatchField 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 slicedFvPatchField_H
42 #define slicedFvPatchField_H
44 #include "fvPatchField.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class slicedFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
56 class slicedFvPatchField
58 public fvPatchField<Type>
63 //- Runtime type information
69 //- Construct from patch, internal field and field to slice
73 const DimensionedField<Type, volMesh>&,
77 //- Construct from patch and internal field. Assign value later.
81 const DimensionedField<Type, volMesh>&
84 //- Construct from patch, internal field and dictionary
88 const DimensionedField<Type, volMesh>&,
92 //- Construct by mapping the given slicedFvPatchField<Type>
96 const slicedFvPatchField<Type>&,
98 const DimensionedField<Type, volMesh>&,
99 const fvPatchFieldMapper&
102 //- Construct as copy
103 slicedFvPatchField(const slicedFvPatchField<Type>&);
105 //- Construct and return a clone
106 virtual tmp<fvPatchField<Type> > clone() const;
108 //- Construct as copy setting internal field reference
111 const slicedFvPatchField<Type>&,
112 const DimensionedField<Type, volMesh>&
115 //- Construct and return a clone setting internal field reference
116 virtual tmp<fvPatchField<Type> > clone
118 const DimensionedField<Type, volMesh>& iF
123 virtual ~slicedFvPatchField<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
139 // Evaluation functions
141 //- Return patch-normal gradient
142 virtual tmp<Field<Type> > snGrad() const;
144 //- Update the coefficients associated with the patch field
145 // Sets Updated to true
146 virtual void updateCoeffs();
148 //- Return internal field next to patch as patch field
149 virtual tmp<Field<Type> > patchInternalField() const;
151 //- Return neighbour coupled given internal cell data
152 virtual tmp<Field<Type> > patchNeighbourField
154 const Field<Type>& iField
157 //- Return patchField of the values on the patch or on the
159 virtual tmp<Field<Type> > patchNeighbourField() const;
161 //- Initialise the evaluation of the patch field
162 virtual void initEvaluate
164 const Pstream::commsTypes commsType=Pstream::blocking
168 //- Evaluate the patch field, sets Updated to false
169 virtual void evaluate
171 const Pstream::commsTypes commsType=Pstream::blocking
175 //- Return the matrix diagonal coefficients corresponding to the
176 // evaluation of the value of this patchField with given weights
177 virtual tmp<Field<Type> > valueInternalCoeffs
179 const tmp<scalarField>&
182 //- Return the matrix source coefficients corresponding to the
183 // evaluation of the value of this patchField with given weights
184 virtual tmp<Field<Type> > valueBoundaryCoeffs
186 const tmp<scalarField>&
189 //- Return the matrix diagonal coefficients corresponding to the
190 // evaluation of the gradient of this patchField
191 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
193 //- Return the matrix source coefficients corresponding to the
194 // evaluation of the gradient of this patchField
195 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
199 virtual void write(Ostream&) const;
204 virtual void operator=(const UList<Type>&) {}
206 virtual void operator=(const fvPatchField<Type>&) {}
207 virtual void operator+=(const fvPatchField<Type>&) {}
208 virtual void operator-=(const fvPatchField<Type>&) {}
209 virtual void operator*=(const fvPatchField<scalar>&) {}
210 virtual void operator/=(const fvPatchField<scalar>&) {}
212 virtual void operator+=(const Field<Type>&) {}
213 virtual void operator-=(const Field<Type>&) {}
215 virtual void operator*=(const Field<scalar>&) {}
216 virtual void operator/=(const Field<scalar>&) {}
218 virtual void operator=(const Type&) {}
219 virtual void operator+=(const Type&) {}
220 virtual void operator-=(const Type&) {}
221 virtual void operator*=(const scalar) {}
222 virtual void operator/=(const scalar) {}
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 } // End namespace Foam
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 # include "slicedFvPatchField.C"
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 // ************************************************************************* //