OpenFOAM logo
Open Source CFD Toolkit

coupledFaPatchField.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     coupledFaPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     coupledFaPatchField.C
00032 
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef coupledFaPatchField_H
00037 #define coupledFaPatchField_H
00038 
00039 #include "faPatchField.H"
00040 #include "coupledFaPatch.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class coupledFaPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class coupledFaPatchField
00053 :
00054     public faPatchField<Type>
00055 {
00056 
00057 public:
00058 
00059     //- Runtime type information
00060     TypeName("coupled");
00061 
00062 
00063     // Constructors
00064 
00065         //- Construct from patch and internal field
00066         coupledFaPatchField
00067         (
00068             const faPatch&,
00069             const Field<Type>&
00070         );
00071 
00072         //- Construct from patch and internal field and patch field
00073         coupledFaPatchField
00074         (
00075             const faPatch&,
00076             const Field<Type>&,
00077             const Field<Type>&
00078         );
00079 
00080         //- Construct from patch, internal field and dictionary
00081         coupledFaPatchField
00082         (
00083             const faPatch&,
00084             const Field<Type>&,
00085             const dictionary&
00086         );
00087 
00088         //- Construct by mapping the given coupledFaPatchField onto a new patch
00089         coupledFaPatchField
00090         (
00091             const coupledFaPatchField<Type>&,
00092             const faPatch&,
00093             const Field<Type>&,
00094             const faPatchFieldMapper&
00095         );
00096 
00097         //- Construct and return a clone
00098         virtual tmp<faPatchField<Type> > clone() const = 0;
00099 
00100         //- Construct as copy setting internal field reference
00101         coupledFaPatchField
00102         (
00103             const coupledFaPatchField<Type>&,
00104             const Field<Type>&
00105         );
00106 
00107         //- Construct and return a clone
00108         virtual tmp<faPatchField<Type> > clone(const Field<Type>&) const = 0;
00109 
00110 
00111     // Member functions
00112 
00113         // Access
00114 
00115             //- Return true if this patch field is derived from
00116             //  coupledFaPatchField<Type>.
00117             virtual bool coupled() const
00118             {
00119                 return true;
00120             }
00121 
00122             //- Initialise neighbour field transfer of given internal field
00123             virtual void initPatchNeighbourField(const Field<Type>&) const
00124             {}
00125 
00126             //- Return neighbour field given internal field
00127             virtual tmp<Field<Type> > patchNeighbourField
00128             (
00129                 const Field<Type>&
00130             ) const = 0;
00131 
00132 
00133         // Evaluation functions
00134 
00135             //- Return patch-normal gradient
00136             virtual tmp<Field<Type> > snGrad() const;
00137 
00138             //- Initialise neighbour field transfer of internal field
00139             virtual void initPatchNeighbourField() const;
00140 
00141             //- Return neighbour field of the internal field
00142             virtual tmp<Field<Type> > patchNeighbourField() const;
00143 
00144             //- Initialise the evaluation of the patch field
00145             virtual void initEvaluate(const bool);
00146 
00147             //- Evaluate the patch field
00148             virtual void evaluate();
00149 
00150             //- Return the matrix diagonal coefficients corresponding to the
00151             //  evaluation of the value of this patchField with given weights
00152             virtual tmp<Field<Type> > valueInternalCoeffs
00153             (
00154                 const tmp<scalarField>&
00155             ) const;
00156 
00157             //- Return the matrix source coefficients corresponding to the
00158             //  evaluation of the value of this patchField with given weights
00159             virtual tmp<Field<Type> > valueBoundaryCoeffs
00160             (
00161                 const tmp<scalarField>&
00162             ) const;
00163 
00164             //- Return the matrix diagonal coefficients corresponding to the
00165             //  evaluation of the gradient of this patchField
00166             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00167 
00168             //- Return the matrix source coefficients corresponding to the
00169             //  evaluation of the gradient of this patchField
00170             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00171 
00172 
00173         // Coupled interface functionality
00174 
00175             //- Return neighbour colouring
00176             virtual tmp<labelField> nbrColour
00177             (
00178                 const labelField&
00179             ) const = 0;
00180 
00181             //- Update result field based on interface functionality
00182             virtual void updateInterfaceMatrix
00183             (
00184                 const scalarField& psiInternal,
00185                 scalarField& result,
00186                 const lduMatrix&,
00187                 const scalarField& coeffs,
00188                 const direction
00189             ) const = 0;
00190 
00191         //- Write
00192         virtual void write(Ostream&) const;
00193 };
00194 
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 } // End namespace Foam
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 #ifdef NoRepository
00203 #   include "coupledFaPatchField.C"
00204 #endif
00205 
00206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00207 
00208 #endif
00209 
00210 // ************************************************************************* //
For further information go to www.openfoam.org