OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

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-2007 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 DimensionedField<vector, pointMesh>&
00088         );
00089 
00090         //- Construct from patch, internal field and dictionary
00091         ComponentMixedPointPatchVectorField
00092         (
00093             const PointPatch&,
00094             const DimensionedField<vector, pointMesh>&,
00095             const dictionary&
00096         );
00097 
00098         //- Construct by mapping given patchVectorField onto a new patch
00099         ComponentMixedPointPatchVectorField
00100         (
00101             const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
00102             const PointPatch&,
00103             const DimensionedField<vector, pointMesh>&,
00104             const PointPatchFieldMapper&
00105         );
00106 
00107         //- Construct and return a clone
00108         virtual autoPtr<PatchField<vector> > clone() const
00109         {
00110             return autoPtr<PatchField<vector> >
00111             (
00112                 new ComponentMixedPointPatchVectorField
00113                 <PatchField, PointPatch>
00114                 (
00115                     *this
00116                 )
00117             );
00118         }
00119 
00120         //- Construct as copy setting internal field reference
00121         ComponentMixedPointPatchVectorField
00122         (
00123             const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
00124             const DimensionedField<vector, pointMesh>&
00125         );
00126 
00127         //- Construct and return a clone setting internal field reference
00128         virtual autoPtr<PatchField<vector> > clone
00129         (
00130             const DimensionedField<vector, pointMesh>& iF
00131         ) const
00132         {
00133             return autoPtr<PatchField<vector> >
00134             (
00135                 new ComponentMixedPointPatchVectorField
00136                 <PatchField, PointPatch>
00137                 (
00138                     *this,
00139                     iF
00140                 )
00141             );
00142         }
00143 
00144 
00145     // Member functions
00146 
00147         // Return defining fields
00148 
00149             virtual vectorField& refValue()
00150             {
00151                 return refValue_;
00152             }
00153 
00154             virtual const vectorField& refValue() const
00155             {
00156                 return refValue_;
00157             }
00158 
00159 
00160             virtual vectorField& valueFraction()
00161             {
00162                 return valueFraction_;
00163             }
00164 
00165             virtual const vectorField& valueFraction() const
00166             {
00167                 return valueFraction_;
00168             }
00169 
00170 
00171         // Mapping functions
00172 
00173             //- Map (and resize as needed) from self given a mapping object
00174             virtual void autoMap
00175             (
00176                 const PointPatchFieldMapper&
00177             );
00178 
00179             //- Reverse map the given PointPatchVectorField onto
00180             //  this PointPatchVectorField
00181             virtual void rmap
00182             (
00183                 const PointPatchField<PatchField, PointPatch, vector>&,
00184                 const labelList&
00185             );
00186 
00187 
00188         // Evaluation functions
00189 
00190             //- Insert boundary value into the internal field
00191             virtual void evaluate();
00192 
00193 
00194         //- Write
00195         virtual void write(Ostream&) const;
00196 
00197 };
00198 
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 } // End namespace Foam
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #ifdef NoRepository
00207 #    include "ComponentMixedPointPatchVectorField.C"
00208 #endif
00209 
00210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00211 
00212 #endif
00213 
00214 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd