FreeFOAM The Cross-Platform CFD Toolkit
mixedPointPatchField.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::mixedPointPatchField
26 
27 Description
28  A mixed FixedValue / ZeroGradient boundary condition for pointField.
29 
30  I am still not sure how to do the FixedValue-fixedGradient combination.
31 
32 SourceFiles
33  mixedPointPatchField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef mixedPointPatchField_H
38 #define mixedPointPatchField_H
39 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class mixedPointPatchField Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public valuePointPatchField<Type>
55 {
56  // Private data
57 
58  //- Value field
59  Field<Type> refValue_;
60 
61  //- Fraction (0-1) of value used for boundary condition
62  scalarField valueFraction_;
63 
64 
65  // Private member functions
66 
67  void checkFieldSize() const;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("mixed");
74 
75 
76  // Constructors
77 
78  //- Construct from patch and internal field
80  (
81  const pointPatch&,
83  );
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const pointPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given patchField<Type> onto a new patch
95  (
97  const pointPatch&,
100  );
101 
102  //- Construct and return a clone
104  {
106  (
108  (
109  *this
110  )
111  );
112  }
113 
114  //- Construct as copy setting internal field reference
116  (
119  );
120 
121  //- Construct and return a clone setting internal field reference
123  (
125  ) const
126  {
128  (
130  (
131  *this,
132  iF
133  )
134  );
135  }
136 
137 
138  // Member functions
139 
140  // Return defining fields
141 
143  {
144  return refValue_;
145  }
146 
147  virtual const Field<Type>& refValue() const
148  {
149  return refValue_;
150  }
151 
153  {
154  return valueFraction_;
155  }
156 
157  virtual const scalarField& valueFraction() const
158  {
159  return valueFraction_;
160  }
161 
162 
163  // Mapping functions
164 
165  //- Map (and resize as needed) from self given a mapping object
166  virtual void autoMap
167  (
168  const pointPatchFieldMapper&
169  );
170 
171  //- Reverse map the given PointPatchField onto
172  // this PointPatchField
173  virtual void rmap
174  (
175  const pointPatchField<Type>&,
176  const labelList&
177  );
178 
179 
180  // Evaluation functions
181 
182  //- Update the patch field
183  virtual void evaluate
184  (
185  const Pstream::commsTypes commsType=Pstream::blocking
186  );
187 
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #ifdef NoRepository
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************ vim: set sw=4 sts=4 et: ************************ //