Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / derived / partialSlip / partialSlipFvPatchField.H
blob3bc1a4f1e914f03e146a1242d6251c9d38bee348
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::partialSlipFvPatchField
27 Description
28     Foam::partialSlipFvPatchField
30 SourceFiles
31     partialSlipFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef partialSlipFvPatchField_H
36 #define partialSlipFvPatchField_H
38 #include "transformFvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                       Class partialSlipFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class partialSlipFvPatchField
52     public transformFvPatchField<Type>
54     // Private data
56         //- Fraction (0-1) of value used for boundary condition
57         scalarField valueFraction_;
60 public:
62     //- Runtime type information
63     TypeName("partialSlip");
66     // Constructors
68         //- Construct from patch and internal field
69         partialSlipFvPatchField
70         (
71             const fvPatch&,
72             const DimensionedField<Type, volMesh>&
73         );
75         //- Construct from patch, internal field and dictionary
76         partialSlipFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&,
80             const dictionary&
81         );
83         //- Construct by mapping given partialSlipFvPatchField onto a new patch
84         partialSlipFvPatchField
85         (
86             const partialSlipFvPatchField<Type>&,
87             const fvPatch&,
88             const DimensionedField<Type, volMesh>&,
89             const fvPatchFieldMapper&
90         );
92         //- Construct as copy
93         partialSlipFvPatchField
94         (
95             const partialSlipFvPatchField<Type>&
96         );
98         //- Construct and return a clone
99         virtual tmp<fvPatchField<Type> > clone() const
100         {
101             return tmp<fvPatchField<Type> >
102             (
103                 new partialSlipFvPatchField<Type>(*this)
104             );
105         }
107         //- Construct as copy setting internal field reference
108         partialSlipFvPatchField
109         (
110             const partialSlipFvPatchField<Type>&,
111             const DimensionedField<Type, volMesh>&
112         );
114         //- Construct and return a clone setting internal field reference
115         virtual tmp<fvPatchField<Type> > clone
116         (
117             const DimensionedField<Type, volMesh>& iF
118         ) const
119         {
120             return tmp<fvPatchField<Type> >
121             (
122                 new partialSlipFvPatchField<Type>(*this, iF)
123             );
124         }
127     // Member functions
129         // Mapping functions
131             //- Map (and resize as needed) from self given a mapping object
132             virtual void autoMap
133             (
134                 const fvPatchFieldMapper&
135             );
137             //- Reverse map the given fvPatchField onto this fvPatchField
138             virtual void rmap
139             (
140                 const fvPatchField<Type>&,
141                 const labelList&
142             );
145         // Return defining fields
147             virtual scalarField& valueFraction()
148             {
149                 return valueFraction_;
150             }
152             virtual const scalarField& valueFraction() const
153             {
154                 return valueFraction_;
155             }
158         // Evaluation functions
160             //- Return gradient at boundary
161             virtual tmp<Field<Type> > snGrad() const;
163             //- Evaluate the patch field
164             //  Default argument needed to allow call in constructors
165             //  HJ, 30/Jun/2009
166             virtual void evaluate
167             (
168                 const Pstream::commsTypes commsType = Pstream::blocking
169             );
171             //- Return face-gradient transform diagonal
172             virtual tmp<Field<Type> > snGradTransformDiag() const;
175         //- Write
176         virtual void write(Ostream&) const;
179     // Member operators
181         virtual void operator=(const UList<Type>&) {}
183         virtual void operator=(const fvPatchField<Type>&) {}
184         virtual void operator+=(const fvPatchField<Type>&) {}
185         virtual void operator-=(const fvPatchField<Type>&) {}
186         virtual void operator*=(const fvPatchField<scalar>&) {}
187         virtual void operator/=(const fvPatchField<scalar>&) {}
189         virtual void operator+=(const Field<Type>&) {}
190         virtual void operator-=(const Field<Type>&) {}
192         virtual void operator*=(const Field<scalar>&) {}
193         virtual void operator/=(const Field<scalar>&) {}
195         virtual void operator=(const Type&) {}
196         virtual void operator+=(const Type&) {}
197         virtual void operator-=(const Type&) {}
198         virtual void operator*=(const scalar) {}
199         virtual void operator/=(const scalar) {}
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 } // End namespace Foam
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 #ifdef NoRepository
210 #   include "partialSlipFvPatchField.C"
211 #endif
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 #endif
217 // ************************************************************************* //