OpenFOAM logo
Open Source CFD Toolkit

ComponentMixedPointPatchVectorField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     ComponentMixedPointPatchVectorField. The boundary condition is a mix
00027     of a fixedValue and a zeroGradient boundary condition, where a
00028     fixedValue/zeroGradient mix may be different for each direction.
00029 
00030     I am still not sure how to do the fixedValue-fixedGradient
00031     combination. 
00032 
00033 Description
00034 
00035 SourceFiles
00036     ComponentMixedPointPatchVectorField.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef ComponentMixedPointPatchVectorField_H
00041 #define ComponentMixedPointPatchVectorField_H
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049             Class ComponentMixedPointPatchVectorField Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template
00053 <
00054     template<class> class PatchField,
00055     class PointPatch
00056 >
00057 class ComponentMixedPointPatchVectorField
00058 :
00059     public PatchField<vector>
00060 {
00061     // Private data
00062 
00063         //- Fraction vector of value used for boundary condition
00064         vectorField refValue_;
00065 
00066         //- Fraction vector of value used for boundary condition
00067         vectorField valueFraction_;
00068 
00069 
00070     // Private member functions
00071 
00072         void checkFieldSize() const;
00073 
00074 
00075 public:
00076 
00077     //- Runtime type information
00078     TypeName("componentMixed");
00079 
00080 
00081     // Constructors
00082 
00083         //- Construct from patch and internal field
00084         ComponentMixedPointPatchVectorField
00085         (
00086             const PointPatch&,
00087             const vectorField&
00088         );
00089 
00090         //- Construct from patch and internal field, value
00091         // and value fraction
00092         ComponentMixedPointPatchVectorField
00093         (
00094             const PointPatch&,
00095             const vectorField&,
00096             const vectorField&,
00097             const vectorField&
00098         );
00099 
00100         //- Construct from patch, internal field and dictionary
00101         ComponentMixedPointPatchVectorField
00102         (
00103             const PointPatch&,
00104             const vectorField&,
00105             const dictionary&
00106         );
00107 
00108         //- Construct by mapping given patchVectorField onto a new patch
00109         ComponentMixedPointPatchVectorField
00110         (
00111             const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
00112             const PointPatch&,
00113             const vectorField&,
00114             const PointPatchFieldMapper&
00115         );
00116 
00117         //- Construct and return a clone
00118         virtual autoPtr<PatchField<vector> > clone() const
00119         {
00120             return autoPtr<PatchField<vector> >
00121             (
00122                 new ComponentMixedPointPatchVectorField
00123                 <PatchField, PointPatch>
00124                 (
00125                     *this
00126                 )
00127             );
00128         }
00129 
00130         //- Construct as copy setting internal field reference
00131         ComponentMixedPointPatchVectorField
00132         (
00133             const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
00134             const vectorField&
00135         );
00136 
00137         //- Construct and return a clone setting internal field reference
00138         virtual autoPtr<PatchField<vector> > clone(const vectorField& iF) const
00139         {
00140             return autoPtr<PatchField<vector> >
00141             (
00142                 new ComponentMixedPointPatchVectorField
00143                 <PatchField, PointPatch>
00144                 (
00145                     *this,
00146                     iF
00147                 )
00148             );
00149         }
00150 
00151 
00152     // Member functions
00153 
00154         // Return defining fields
00155 
00156             virtual vectorField& refValue()
00157             {
00158                 return refValue_;
00159             }
00160 
00161             virtual const vectorField& refValue() const
00162             {
00163                 return refValue_;
00164             }
00165 
00166 
00167             virtual vectorField& valueFraction()
00168             {
00169                 return valueFraction_;
00170             }
00171 
00172             virtual const vectorField& valueFraction() const
00173             {
00174                 return valueFraction_;
00175             }
00176 
00177 
00178         // Mapping functions
00179 
00180             //- Map (and resize as needed) from self given a mapping object
00181             virtual void autoMap
00182             (
00183                 const PointPatchFieldMapper&
00184             );
00185 
00186             //- Reverse map the given PointPatchVectorField onto
00187             //  this PointPatchVectorField
00188             virtual void rmap
00189             (
00190                 const PointPatchField<PatchField, PointPatch, vector>&,
00191                 const labelList&
00192             );
00193 
00194 
00195         // Evaluation functions
00196 
00197             //- Insert boundary value into the internal field
00198             virtual void evaluate();
00199 
00200 
00201         //- Write
00202         virtual void write(Ostream&) const;
00203 
00204 };
00205 
00206 
00207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00208 
00209 } // End namespace Foam
00210 
00211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00212 
00213 #ifdef NoRepository
00214 #    include "ComponentMixedPointPatchVectorField.C"
00215 #endif
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 #endif
00220 
00221 // ************************************************************************* //
For further information go to www.openfoam.org