Remove trailing whitespace systematically
[foam-extend-3.2.git] / applications / solvers / solidMechanics / deprecatedSolvers / materialModels / fvPatchFields / newDirectionMixed / newDirectionMixedFvPatchField.H
blobdf90a5e231de71ad94fafd1a275dc288999dfce4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
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     newDirectionMixedFvPatchField
27 Description
28     Doubly mixed fixed value-fixed gradient boundary condition
29     separated into a normal and a tangential component given a
30     direction vector.  The mixture is controlled by two separate
31     valueFraction coefficients in the normal and tangential direction.
33 SourceFiles
34     newDirectionMixedFvPatchField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef newDirectionMixedFvPatchField_H
39 #define newDirectionMixedFvPatchField_H
41 #include "fvPatchField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                       Class directionMixedFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type>
53 class newDirectionMixedFvPatchField
55     public fvPatchField<Type>
57     // Private data
59         //- Value field
60         Field<Type> refValue_;
62         //- Gradient field
63         Field<Type> refGrad_;
65         //- Normal direction
66         vectorField nHat_;
68         //- Fraction (0-1) of value used for normal component
69         scalarField normalValueFraction_;
71         //- Fraction (0-1) of value used for tangential component
72         scalarField tangentialValueFraction_;
75     // Private Member Functions
77         //- Check and normalize nHat
78         void checkNHat();
81 public:
83     //- Runtime type information
84     TypeName("newDirectionMixed");
87     // Constructors
89         //- Construct from patch and internal field
90         newDirectionMixedFvPatchField
91         (
92             const fvPatch&,
93             const DimensionedField<Type, volMesh>&
94         );
96         //- Construct from patch, internal field and dictionary
97         newDirectionMixedFvPatchField
98         (
99             const fvPatch&,
100             const DimensionedField<Type, volMesh>&,
101             const dictionary&
102         );
104         //- Construct by mapping given newDirectionMixedFvPatchField onto
105         //  a new patch
106         newDirectionMixedFvPatchField
107         (
108             const newDirectionMixedFvPatchField<Type>&,
109             const fvPatch&,
110             const DimensionedField<Type, volMesh>&,
111             const fvPatchFieldMapper&
112         );
114         //- Construct and return a clone
115         virtual tmp<fvPatchField<Type> > clone() const
116         {
117             return tmp<fvPatchField<Type> >
118             (
119                 new newDirectionMixedFvPatchField<Type>(*this)
120             );
121         }
123         //- Construct as copy setting internal field reference
124         newDirectionMixedFvPatchField
125         (
126             const newDirectionMixedFvPatchField<Type>&,
127             const DimensionedField<Type, volMesh>&
128         );
130         //- Construct and return a clone setting internal field reference
131         virtual tmp<fvPatchField<Type> > clone
132         (
133             const DimensionedField<Type, volMesh>& iF
134         ) const
135         {
136             return tmp<fvPatchField<Type> >
137             (
138                 new newDirectionMixedFvPatchField<Type>(*this, iF)
139             );
140         }
143     // Member functions
145         // Access
147             //- Return true if this patch field fixes a value.
148             //  Needed to check if a level has to be specified while solving
149             //  Poissons equations.
150             virtual bool fixesValue() const
151             {
152                 return true;
153             }
156         // Mapping functions
158             //- Map (and resize as needed) from self given a mapping object
159             virtual void autoMap
160             (
161                 const fvPatchFieldMapper&
162             );
164             //- Reverse map the given fvPatchField onto this fvPatchField
165             virtual void rmap
166             (
167                 const fvPatchField<Type>&,
168                 const labelList&
169             );
172         // Return defining fields
174             virtual Field<Type>& refValue()
175             {
176                 return refValue_;
177             }
179             virtual const Field<Type>& refValue() const
180             {
181                 return refValue_;
182             }
184             virtual Field<Type>& refGrad()
185             {
186                 return refGrad_;
187             }
189             virtual const Field<Type>& refGrad() const
190             {
191                 return refGrad_;
192             }
194             virtual vectorField& nHat()
195             {
196                 return nHat_;
197             }
199             virtual const vectorField& nHat() const
200             {
201                 return nHat_;
202             }
204             virtual scalarField& normalValueFraction()
205             {
206                 return normalValueFraction_;
207             }
209             virtual const scalarField& normalValueFraction() const
210             {
211                 return normalValueFraction_;
212             }
215             virtual scalarField& tangentialValueFraction()
216             {
217                 return tangentialValueFraction_;
218             }
220             virtual const scalarField& tangentialValueFraction() const
221             {
222                 return tangentialValueFraction_;
223             }
226         // Evaluation functions
228             //- Return gradient at boundary
229             virtual tmp<Field<Type> > snGrad() const;
231             //- Evaluate the patch field
232             virtual void evaluate();
234             //- Return the matrix diagonal coefficients corresponding to the
235             //  evaluation of the value of this patchField with given weights
236             virtual tmp<Field<Type> > valueInternalCoeffs
237             (
238                 const tmp<scalarField>&
239             ) const;
241             //- Return the matrix source coefficients corresponding to the
242             //  evaluation of the value of this patchField with given weights
243             virtual tmp<Field<Type> > valueBoundaryCoeffs
244             (
245                 const tmp<scalarField>&
246             ) const;
248             //- Return the matrix diagonal coefficients corresponding to the
249             //  evaluation of the gradient of this patchField
250             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
252             //- Return the matrix source coefficients corresponding to the
253             //  evaluation of the gradient of this patchField
254             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
257         //- Write
258         virtual void write(Ostream&) const;
261     // Member operators
263         virtual void operator=(const fvPatchField<Type>&) {}
264         virtual void operator+=(const fvPatchField<Type>&) {}
265         virtual void operator-=(const fvPatchField<Type>&) {}
266         virtual void operator*=(const fvPatchField<Type>&) {}
267         virtual void operator/=(const fvPatchField<Type>&) {}
269         virtual void operator=(const Field<Type>&) {}
270         virtual void operator+=(const Field<Type>&) {}
271         virtual void operator-=(const Field<Type>&) {}
272         virtual void operator*=(const Field<scalar>&) {}
273         virtual void operator/=(const Field<scalar>&) {}
275         virtual void operator=(const Type&) {}
276         virtual void operator+=(const Type&) {}
277         virtual void operator-=(const Type&) {}
278         virtual void operator*=(const scalar) {}
279         virtual void operator/=(const scalar) {}
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 } // End namespace Foam
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289 #ifdef NoRepository
290 #   include "newDirectionMixedFvPatchField.C"
291 #else
292 #   ifdef xlC
293 #   pragma implementation("newDirectionMixedFvPatchField.C")
294 #   endif
295 #endif
297 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 #endif
301 // ************************************************************************* //