1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::slicedFvPatchField
29 Specialization of fvPatchField which creates the underlying
30 fvPatchField as a slice of the given complete field.
32 The destructor is wrapped to avoid deallocation of the storage of the
33 complete fields when this is destroyed.
35 Should only used as a template argument for SlicedGeometricField.
40 \*---------------------------------------------------------------------------*/
42 #ifndef slicedFvPatchField_H
43 #define slicedFvPatchField_H
45 #include "fvPatchField.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class slicedFvPatch Declaration
54 \*---------------------------------------------------------------------------*/
57 class slicedFvPatchField
59 public fvPatchField<Type>
64 //- Runtime type information
70 //- Construct from patch, internal field and field to slice
74 const DimensionedField<Type, volMesh>&,
78 //- Construct from patch and internal field. Assign value later.
82 const DimensionedField<Type, volMesh>&
85 //- Construct from patch, internal field and dictionary
89 const DimensionedField<Type, volMesh>&,
93 //- Construct by mapping the given slicedFvPatchField<Type>
97 const slicedFvPatchField<Type>&,
99 const DimensionedField<Type, volMesh>&,
100 const fvPatchFieldMapper&
103 //- Construct as copy
104 slicedFvPatchField(const slicedFvPatchField<Type>&);
106 //- Construct and return a clone
107 virtual tmp<fvPatchField<Type> > clone() const;
109 //- Construct as copy setting internal field reference
112 const slicedFvPatchField<Type>&,
113 const DimensionedField<Type, volMesh>&
116 //- Construct and return a clone setting internal field reference
117 virtual tmp<fvPatchField<Type> > clone
119 const DimensionedField<Type, volMesh>& iF
125 virtual ~slicedFvPatchField<Type>();
132 //- Return true if this patch field fixes a value.
133 // Needed to check if a level has to be specified while solving
134 // Poissons equations.
135 virtual bool fixesValue() const
141 // Evaluation functions
143 //- Return patch-normal gradient
144 virtual tmp<Field<Type> > snGrad() const;
146 //- Update the coefficients associated with the patch field
147 // Sets Updated to true
148 virtual void updateCoeffs();
150 //- Return internal field next to patch as patch field
151 virtual tmp<Field<Type> > patchInternalField() const;
153 //- Return neighbour coupled given internal cell data
154 virtual tmp<Field<Type> > patchNeighbourField
156 const Field<Type>& iField
159 //- Return patchField of the values on the patch or on the
161 virtual tmp<Field<Type> > patchNeighbourField() const;
163 //- Initialise the evaluation of the patch field
164 virtual void initEvaluate
166 const Pstream::commsTypes commsType=Pstream::blocking
170 //- Evaluate the patch field, sets Updated to false
171 virtual void evaluate
173 const Pstream::commsTypes commsType=Pstream::blocking
177 //- Return the matrix diagonal coefficients corresponding to the
178 // evaluation of the value of this patchField with given weights
179 virtual tmp<Field<Type> > valueInternalCoeffs
181 const tmp<scalarField>&
184 //- Return the matrix source coefficients corresponding to the
185 // evaluation of the value of this patchField with given weights
186 virtual tmp<Field<Type> > valueBoundaryCoeffs
188 const tmp<scalarField>&
191 //- Return the matrix diagonal coefficients corresponding to the
192 // evaluation of the gradient of this patchField
193 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
195 //- Return the matrix source coefficients corresponding to the
196 // evaluation of the gradient of this patchField
197 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
201 virtual void write(Ostream&) const;
206 virtual void operator=(const UList<Type>&) {}
208 virtual void operator=(const fvPatchField<Type>&) {}
209 virtual void operator+=(const fvPatchField<Type>&) {}
210 virtual void operator-=(const fvPatchField<Type>&) {}
211 virtual void operator*=(const fvPatchField<scalar>&) {}
212 virtual void operator/=(const fvPatchField<scalar>&) {}
214 virtual void operator+=(const Field<Type>&) {}
215 virtual void operator-=(const Field<Type>&) {}
217 virtual void operator*=(const Field<scalar>&) {}
218 virtual void operator/=(const Field<scalar>&) {}
220 virtual void operator=(const Type&) {}
221 virtual void operator+=(const Type&) {}
222 virtual void operator-=(const Type&) {}
223 virtual void operator*=(const scalar) {}
224 virtual void operator/=(const scalar) {}
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 } // End namespace Foam
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 # include "slicedFvPatchField.C"
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 // ************************************************************************* //