BUGFIX: Seg-fault in multiphaseInterFoam. Author: Henrik Rusche. Merge: Hrvoje Jasak
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / basic / directionMixed / directionMixedFvPatchField.H
blobbac7b2e0064b32b9c45f576e061c6182632c45b3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::directionMixedFvPatchField
27 Description
28     Foam::directionMixedFvPatchField
30 SourceFiles
31     directionMixedFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef directionMixedFvPatchField_H
36 #define directionMixedFvPatchField_H
38 #include "transformFvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                       Class directionMixedFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class directionMixedFvPatchField
52     public transformFvPatchField<Type>
54     // Private data
56         //- Value field
57         Field<Type> refValue_;
59         //- Normal gradient field
60         Field<Type> refGrad_;
62         //- Fraction (0-1) of value used for boundary condition
63         symmTensorField valueFraction_;
66 public:
68     //- Runtime type information
69     TypeName("directionMixed");
72     // Constructors
74         //- Construct from patch and internal field
75         directionMixedFvPatchField
76         (
77             const fvPatch&,
78             const DimensionedField<Type, volMesh>&
79         );
81         //- Construct from patch, internal field and dictionary
82         directionMixedFvPatchField
83         (
84             const fvPatch&,
85             const DimensionedField<Type, volMesh>&,
86             const dictionary&
87         );
89         //- Construct by mapping given directionMixedFvPatchField onto
90         //  a new patch
91         directionMixedFvPatchField
92         (
93             const directionMixedFvPatchField<Type>&,
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct and return a clone
100         virtual tmp<fvPatchField<Type> > clone() const
101         {
102             return tmp<fvPatchField<Type> >
103             (
104                 new directionMixedFvPatchField<Type>(*this)
105             );
106         }
108         //- Construct as copy setting internal field reference
109         directionMixedFvPatchField
110         (
111             const directionMixedFvPatchField<Type>&,
112             const DimensionedField<Type, volMesh>&
113         );
115         //- Construct and return a clone setting internal field reference
116         virtual tmp<fvPatchField<Type> > clone
117         (
118             const DimensionedField<Type, volMesh>& iF
119         ) const
120         {
121             return tmp<fvPatchField<Type> >
122             (
123                 new directionMixedFvPatchField<Type>(*this, iF)
124             );
125         }
128     // Member functions
130         // Access
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
136             {
137                 return true;
138             }
141         // Mapping functions
143             //- Map (and resize as needed) from self given a mapping object
144             virtual void autoMap
145             (
146                 const fvPatchFieldMapper&
147             );
149             //- Reverse map the given fvPatchField onto this fvPatchField
150             virtual void rmap
151             (
152                 const fvPatchField<Type>&,
153                 const labelList&
154             );
157         // Return defining fields
159             virtual Field<Type>& refValue()
160             {
161                 return refValue_;
162             }
164             virtual const Field<Type>& refValue() const
165             {
166                 return refValue_;
167             }
169             virtual Field<Type>& refGrad()
170             {
171                 return refGrad_;
172             }
174             virtual const Field<Type>& refGrad() const
175             {
176                 return refGrad_;
177             }
179             virtual symmTensorField& valueFraction()
180             {
181                 return valueFraction_;
182             }
184             virtual const symmTensorField& valueFraction() const
185             {
186                 return valueFraction_;
187             }
190         // Evaluation functions
192             //- Return gradient at boundary
193             virtual tmp<Field<Type> > snGrad() const;
195             //- Evaluate the patch field
196             virtual void evaluate
197             (
198                 const Pstream::commsTypes commsType = Pstream::blocking
199             );
201             //- Return face-gradient transform diagonal
202             virtual tmp<Field<Type> > snGradTransformDiag() const;
205         //- Write
206         virtual void write(Ostream&) const;
209     // Member operators
211         virtual void operator=(const fvPatchField<Type>&) {}
212         virtual void operator+=(const fvPatchField<Type>&) {}
213         virtual void operator-=(const fvPatchField<Type>&) {}
214         virtual void operator*=(const fvPatchField<Type>&) {}
215         virtual void operator/=(const fvPatchField<Type>&) {}
217         virtual void operator=(const Field<Type>&) {}
218         virtual void operator+=(const Field<Type>&) {}
219         virtual void operator-=(const Field<Type>&) {}
220         virtual void operator*=(const Field<scalar>&) {}
221         virtual void operator/=(const Field<scalar>&) {}
223         virtual void operator=(const Type&) {}
224         virtual void operator+=(const Type&) {}
225         virtual void operator-=(const Type&) {}
226         virtual void operator*=(const scalar) {}
227         virtual void operator/=(const scalar) {}
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 } // End namespace Foam
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 #ifdef NoRepository
238 #   include "directionMixedFvPatchField.C"
239 #endif
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 #endif
245 // ************************************************************************* //