1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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
124 virtual ~slicedFvPatchField();
131 //- Return true if this patch field fixes a value.
132 // Needed to check if a level has to be specified while solving
133 // Poissons equations.
134 virtual bool fixesValue() const
140 // Evaluation functions
142 //- Return patch-normal gradient
143 virtual tmp<Field<Type> > snGrad() const;
145 //- Update the coefficients associated with the patch field
146 // Sets Updated to true
147 virtual void updateCoeffs();
149 //- Return internal field next to patch as patch field
150 virtual tmp<Field<Type> > patchInternalField() const;
152 //- Return neighbour coupled given internal cell data
153 virtual tmp<Field<Type> > patchNeighbourField
155 const Field<Type>& iField
158 //- Return patchField of the values on the patch or on the
160 virtual tmp<Field<Type> > patchNeighbourField() const;
162 //- Initialise the evaluation of the patch field
163 virtual void initEvaluate
165 const Pstream::commsTypes commsType = Pstream::blocking
169 //- Evaluate the patch field, sets Updated to false
170 virtual void evaluate
172 const Pstream::commsTypes commsType = Pstream::blocking
176 //- Return the matrix diagonal coefficients corresponding to the
177 // evaluation of the value of this patchField with given weights
178 virtual tmp<Field<Type> > valueInternalCoeffs
180 const tmp<scalarField>&
183 //- Return the matrix source coefficients corresponding to the
184 // evaluation of the value of this patchField with given weights
185 virtual tmp<Field<Type> > valueBoundaryCoeffs
187 const tmp<scalarField>&
190 //- Return the matrix diagonal coefficients corresponding to the
191 // evaluation of the gradient of this patchField
192 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
194 //- Return the matrix source coefficients corresponding to the
195 // evaluation of the gradient of this patchField
196 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
200 virtual void write(Ostream&) const;
205 virtual void operator=(const UList<Type>&) {}
207 virtual void operator=(const fvPatchField<Type>&) {}
208 virtual void operator+=(const fvPatchField<Type>&) {}
209 virtual void operator-=(const fvPatchField<Type>&) {}
210 virtual void operator*=(const fvPatchField<scalar>&) {}
211 virtual void operator/=(const fvPatchField<scalar>&) {}
213 virtual void operator+=(const Field<Type>&) {}
214 virtual void operator-=(const Field<Type>&) {}
216 virtual void operator*=(const Field<scalar>&) {}
217 virtual void operator/=(const Field<scalar>&) {}
219 virtual void operator=(const Type&) {}
220 virtual void operator+=(const Type&) {}
221 virtual void operator-=(const Type&) {}
222 virtual void operator*=(const scalar) {}
223 virtual void operator/=(const scalar) {}
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace Foam
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 # include "slicedFvPatchField.C"
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 // ************************************************************************* //