FreeFOAM The Cross-Platform CFD Toolkit
fixedNormalSlipFvPatchField.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) 1991-2010 OpenCFD Ltd.
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::fixedNormalSlipFvPatchField
26 
27 Description
28  Foam::fixedNormalSlipFvPatchField
29 
30 SourceFiles
31  fixedNormalSlipFvPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fixedNormalSlipFvPatchField_H
36 #define fixedNormalSlipFvPatchField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class fixedNormalSlipFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
51 :
52  public transformFvPatchField<Type>
53 {
54  // Private data
55 
56  //- Value the normal component of which the boundary is set to
57  Field<Type> fixedValue_;
58 
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("fixedNormalSlip");
64 
65 
66  // Constructors
67 
68  //- Construct from patch and internal field
70  (
71  const fvPatch&,
73  );
74 
75  //- Construct from patch, internal field and dictionary
77  (
78  const fvPatch&,
80  const dictionary&
81  );
82 
83  //- Construct by mapping given fixedNormalSlipFvPatchField
84  // onto a new patch
86  (
88  const fvPatch&,
90  const fvPatchFieldMapper&
91  );
92 
93  //- Construct as copy
95  (
97  );
98 
99  //- Construct and return a clone
100  virtual tmp<fvPatchField<Type> > clone() const
101  {
102  return tmp<fvPatchField<Type> >
103  (
105  );
106  }
107 
108  //- Construct as copy setting internal field reference
110  (
113  );
114 
115  //- Construct and return a clone setting internal field reference
116  virtual tmp<fvPatchField<Type> > clone
117  (
119  ) const
120  {
121  return tmp<fvPatchField<Type> >
122  (
123  new fixedNormalSlipFvPatchField<Type>(*this, iF)
124  );
125  }
126 
127 
128  // Member functions
129 
130  // Mapping functions
131 
132  //- Map (and resize as needed) from self given a mapping object
133  virtual void autoMap
134  (
135  const fvPatchFieldMapper&
136  );
137 
138  //- Reverse map the given fvPatchField onto this fvPatchField
139  virtual void rmap
140  (
141  const fvPatchField<Type>&,
142  const labelList&
143  );
144 
145 
146  // Return defining fields
147 
149  {
150  return fixedValue_;
151  }
152 
153  virtual const Field<Type>& fixedValue() const
154  {
155  return fixedValue_;
156  }
157 
158 
159  // Evaluation functions
160 
161  //- Return gradient at boundary
162  virtual tmp<Field<Type> > snGrad() const;
163 
164  //- Evaluate the patch field
165  virtual void evaluate
166  (
167  const Pstream::commsTypes commsType=Pstream::blocking
168  );
169 
170  //- Return face-gradient transform diagonal
171  virtual tmp<Field<Type> > snGradTransformDiag() const;
172 
173 
174  //- Write
175  virtual void write(Ostream&) const;
176 
177 
178  // Member operators
179 
180  virtual void operator=(const UList<Type>&) {}
181 
182  virtual void operator=(const fvPatchField<Type>&) {}
183  virtual void operator+=(const fvPatchField<Type>&) {}
184  virtual void operator-=(const fvPatchField<Type>&) {}
185  virtual void operator*=(const fvPatchField<scalar>&) {}
186  virtual void operator/=(const fvPatchField<scalar>&) {}
187 
188  virtual void operator+=(const Field<Type>&) {}
189  virtual void operator-=(const Field<Type>&) {}
190 
191  virtual void operator*=(const Field<scalar>&) {}
192  virtual void operator/=(const Field<scalar>&) {}
193 
194  virtual void operator=(const Type&) {}
195  virtual void operator+=(const Type&) {}
196  virtual void operator-=(const Type&) {}
197  virtual void operator*=(const scalar) {}
198  virtual void operator/=(const scalar) {}
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #ifdef NoRepository
210 #endif
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************ vim: set sw=4 sts=4 et: ************************ //