slicedFvPatchField.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 | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::slicedFvPatchField
26 
27 Group
28  grpGenericBoundaryConditions
29 
30 Description
31  Specialization of fvPatchField which creates the underlying
32  fvPatchField as a slice of the given complete field.
33 
34  The destructor is wrapped to avoid deallocation of the storage of the
35  complete fields when this is destroyed.
36 
37  Should only used as a template argument for SlicedGeometricField.
38 
39 SeeAlso
40  Foam::fvPatchField
41 
42 SourceFiles
43  slicedFvPatchField.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef slicedFvPatchField_H
48 #define slicedFvPatchField_H
49 
50 #include "fvPatchField.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class slicedFvPatch Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
63 :
64  public fvPatchField<Type>
65 {
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("sliced");
71 
72 
73  // Constructors
74 
75  //- Construct from patch, internal field and field to slice
77  (
78  const fvPatch&,
80  const Field<Type>&
81  );
82 
83  //- Construct from patch and internal field. Assign value later.
85  (
86  const fvPatch&,
88  );
89 
90  //- Construct from patch, internal field and dictionary
92  (
93  const fvPatch&,
95  const dictionary&
96  );
97 
98  //- Construct by mapping the given slicedFvPatchField<Type>
99  // onto a new patch
101  (
103  const fvPatch&,
105  const fvPatchFieldMapper&
106  );
107 
108  //- Construct as copy
110 
111  //- Construct and return a clone
112  virtual tmp<fvPatchField<Type> > clone() const;
113 
114  //- Construct as copy setting internal field reference
116  (
119  );
120 
121  //- Construct and return a clone setting internal field reference
122  virtual tmp<fvPatchField<Type> > clone
123  (
125  ) const;
126 
127 
128  //- Destructor
129  virtual ~slicedFvPatchField<Type>();
130 
131 
132  // Member functions
133 
134  // Access
135 
136  //- Return true if this patch field fixes a value.
137  // Needed to check if a level has to be specified while solving
138  // Poissons equations.
139  virtual bool fixesValue() const
140  {
141  return true;
142  }
143 
144 
145  // Evaluation functions
146 
147  //- Return patch-normal gradient
148  virtual tmp<Field<Type> > snGrad() const;
149 
150  //- Update the coefficients associated with the patch field
151  // Sets Updated to true
152  virtual void updateCoeffs();
153 
154  //- Return internal field next to patch as patch field
155  virtual tmp<Field<Type> > patchInternalField() const;
156 
157  //- Return internal field next to patch as patch field
158  virtual void patchInternalField(Field<Type>&) const;
159 
160  //- Return neighbour coupled given internal cell data
162  (
163  const Field<Type>& iField
164  ) const;
165 
166  //- Return patchField of the values on the patch or on the
167  // opposite patch
168  virtual tmp<Field<Type> > patchNeighbourField() const;
169 
170  //- Initialise the evaluation of the patch field
171  virtual void initEvaluate
172  (
173  const Pstream::commsTypes commsType=Pstream::blocking
174  )
175  {}
176 
177  //- Evaluate the patch field, sets Updated to false
178  virtual void evaluate
179  (
180  const Pstream::commsTypes commsType=Pstream::blocking
181  )
182  {}
183 
184  //- Return the matrix diagonal coefficients corresponding to the
185  // evaluation of the value of this patchField with given weights
187  (
188  const tmp<scalarField>&
189  ) const;
190 
191  //- Return the matrix source coefficients corresponding to the
192  // evaluation of the value of this patchField with given weights
194  (
195  const tmp<scalarField>&
196  ) const;
197 
198  //- Return the matrix diagonal coefficients corresponding to the
199  // evaluation of the gradient of this patchField
200  virtual tmp<Field<Type> > gradientInternalCoeffs() const;
201 
202  //- Return the matrix source coefficients corresponding to the
203  // evaluation of the gradient of this patchField
204  virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
205 
206 
207  //- Write
208  virtual void write(Ostream&) const;
209 
210 
211  // Member operators
212 
213  virtual void operator=(const UList<Type>&) {}
214 
215  virtual void operator=(const fvPatchField<Type>&) {}
216  virtual void operator+=(const fvPatchField<Type>&) {}
217  virtual void operator-=(const fvPatchField<Type>&) {}
218  virtual void operator*=(const fvPatchField<scalar>&) {}
219  virtual void operator/=(const fvPatchField<scalar>&) {}
220 
221  virtual void operator+=(const Field<Type>&) {}
222  virtual void operator-=(const Field<Type>&) {}
223 
224  virtual void operator*=(const Field<scalar>&) {}
225  virtual void operator/=(const Field<scalar>&) {}
226 
227  virtual void operator=(const Type&) {}
228  virtual void operator+=(const Type&) {}
229  virtual void operator-=(const Type&) {}
230  virtual void operator*=(const scalar) {}
231  virtual void operator/=(const scalar) {}
232 };
233 
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 } // End namespace Foam
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #ifdef NoRepository
242 # include "slicedFvPatchField.C"
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::slicedFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: slicedFvPatchField.H:217
Foam::slicedFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: slicedFvPatchField.H:230
Foam::slicedFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: slicedFvPatchField.H:214
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::slicedFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
Definition: slicedFvPatchField.C:156
Foam::slicedFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: slicedFvPatchField.H:221
Foam::slicedFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: slicedFvPatchField.C:165
Foam::slicedFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: slicedFvPatchField.H:227
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::slicedFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: slicedFvPatchField.H:216
Foam::slicedFvPatchField::initEvaluate
virtual void initEvaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Initialise the evaluation of the patch field.
Definition: slicedFvPatchField.H:171
Foam::Field< Type >
Foam::slicedFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field, sets Updated to false.
Definition: slicedFvPatchField.H:178
Foam::slicedFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: slicedFvPatchField.H:228
Foam::slicedFvPatchField::slicedFvPatchField
slicedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const Field< Type > &)
Construct from patch, internal field and field to slice.
Definition: slicedFvPatchField.C:37
Foam::slicedFvPatchField::TypeName
TypeName("sliced")
Runtime type information.
Foam::slicedFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: slicedFvPatchField.H:138
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::slicedFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: slicedFvPatchField.H:218
Foam::slicedFvPatchField
Specialization of fvPatchField which creates the underlying fvPatchField as a slice of the given comp...
Definition: slicedFvPatchField.H:61
Foam::slicedFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: slicedFvPatchField.H:224
Foam::slicedFvPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: slicedFvPatchField.C:233
Foam::slicedFvPatchField::operator=
virtual void operator=(const Type &)
Definition: slicedFvPatchField.H:226
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::slicedFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: slicedFvPatchField.H:220
Foam::slicedFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: slicedFvPatchField.C:210
Foam::slicedFvPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: slicedFvPatchField.C:242
Foam::slicedFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: slicedFvPatchField.H:215
Foam::UList< Type >
slicedFvPatchField.C
Foam::slicedFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: slicedFvPatchField.H:212
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::slicedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: slicedFvPatchField.C:104
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::slicedFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: slicedFvPatchField.H:229
Foam::slicedFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: slicedFvPatchField.C:222
Foam::slicedFvPatchField::patchInternalField
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
Definition: slicedFvPatchField.C:172
Foam::slicedFvPatchField::patchNeighbourField
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField of the values on the patch or on the.
Definition: slicedFvPatchField.C:200
Foam::slicedFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: slicedFvPatchField.C:251
Foam::slicedFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: slicedFvPatchField.H:223
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
fvPatchField.H