OpenFOAM logo
Open Source CFD Toolkit

slicedFvPatchField.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     slicedFvPatchField
00027 
00028 Description
00029     Special for of fvPatchField which creates the underlying fvPatchField
00030     as a slice of the given complete field.  The destructor is wrapped
00031     to avoid deallocation of the storage of the complete fields when this is
00032     destroyed.
00033 
00034     slicedFvPatchField should be only used as a template argument for
00035     SlicedGeometricField.
00036 
00037 SourceFiles
00038     slicedFvPatchField.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef slicedFvPatchField_H
00043 #define slicedFvPatchField_H
00044 
00045 #include "fvPatchField.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class slicedFvPatch Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 template<class Type>
00057 class slicedFvPatchField
00058 :
00059     public fvPatchField<Type>
00060 {
00061 
00062 public:
00063 
00064     //- Runtime type information
00065     TypeName("sliced");
00066 
00067 
00068     // Constructors
00069 
00070         //- Construct from patch, internal field and field to slice
00071         slicedFvPatchField
00072         (
00073             const fvPatch&,
00074             const Field<Type>&,
00075             const Field<Type>&
00076         );
00077 
00078         //- Construct from patch and internal field
00079         slicedFvPatchField
00080         (
00081             const fvPatch&,
00082             const Field<Type>&
00083         );
00084 
00085         //- Construct from patch, internal field and dictionary
00086         slicedFvPatchField
00087         (
00088             const fvPatch&,
00089             const Field<Type>&,
00090             const dictionary&
00091         );
00092 
00093         //- Construct by mapping the given slicedFvPatchField<Type>
00094         //  onto a new patch
00095         slicedFvPatchField
00096         (
00097             const slicedFvPatchField<Type>&,
00098             const fvPatch&,
00099             const Field<Type>&,
00100             const fvPatchFieldMapper&
00101         );
00102 
00103         //- Construct as copy
00104         slicedFvPatchField(const slicedFvPatchField<Type>&);
00105 
00106         //- Construct and return a clone
00107         virtual tmp<fvPatchField<Type> > clone() const;
00108 
00109         //- Construct as copy setting internal field reference
00110         slicedFvPatchField
00111         (
00112             const slicedFvPatchField<Type>&,
00113             const Field<Type>&
00114         );
00115 
00116         //- Construct and return a clone setting internal field reference
00117         virtual tmp<fvPatchField<Type> > clone(const Field<Type>& iF) const;
00118 
00119 
00120     // Destructor
00121 
00122         virtual ~slicedFvPatchField<Type>();
00123 
00124 
00125     // Member functions
00126 
00127         // Access
00128 
00129             //- Return true if this patch field fixes a value.
00130             //  Needed to check if a level has to be specified while solving
00131             //  Poissons equations.
00132             virtual bool fixesValue() const
00133             {
00134                 return true;
00135             }
00136 
00137 
00138         // Evaluation functions
00139 
00140             //- Return patch-normal gradient
00141             virtual tmp<Field<Type> > snGrad() const;
00142 
00143             //- Update the coefficients associated with the patch field
00144             //  Sets Updated to true
00145             virtual void updateCoeffs();
00146 
00147             //- Return internal field next to patch as patch field
00148             virtual tmp<Field<Type> > patchInternalField() const;
00149 
00150             //- Return neighbour coupled given internal cell data
00151             virtual tmp<Field<Type> > patchNeighbourField
00152             (
00153                 const Field<Type>& iField
00154             ) const;
00155 
00156             //- Return neighbour colouring.
00157             //  Needed for AMG solver agglomeration
00158             virtual tmp<labelField> nbrColour
00159             (
00160                 const labelField& iColour
00161             ) const;
00162 
00163             //- Return patchField of the values on the patch or on the
00164             //  opposite patch
00165             virtual tmp<Field<Type> > patchNeighbourField() const;
00166 
00167             //- Initialise the evaluation of the patch field
00168             virtual void initEvaluate(const bool=false);
00169 
00170             //- Evaluate the patch field, sets Updated to false
00171             virtual void evaluate();
00172 
00173 
00174             //- Return the matrix diagonal coefficients corresponding to the
00175             //  evaluation of the value of this patchField with given weights
00176             virtual tmp<Field<Type> > valueInternalCoeffs
00177             (
00178                 const tmp<scalarField>&
00179             ) const;
00180 
00181             //- Return the matrix source coefficients corresponding to the
00182             //  evaluation of the value of this patchField with given weights
00183             virtual tmp<Field<Type> > valueBoundaryCoeffs
00184             (
00185                 const tmp<scalarField>&
00186             ) const;
00187 
00188             //- Return the matrix diagonal coefficients corresponding to the
00189             //  evaluation of the gradient of this patchField
00190             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00191 
00192             //- Return the matrix source coefficients corresponding to the
00193             //  evaluation of the gradient of this patchField
00194             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00195 
00196 
00197         //- Write
00198         virtual void write(Ostream&) const;
00199 
00200 
00201     // Member operators
00202 
00203         virtual void operator=(const UList<Type>&) {}
00204 
00205         virtual void operator=(const fvPatchField<Type>&) {}
00206         virtual void operator+=(const fvPatchField<Type>&) {}
00207         virtual void operator-=(const fvPatchField<Type>&) {}
00208         virtual void operator*=(const fvPatchField<scalar>&) {}
00209         virtual void operator/=(const fvPatchField<scalar>&) {}
00210 
00211         virtual void operator+=(const Field<Type>&) {}
00212         virtual void operator-=(const Field<Type>&) {}
00213 
00214         virtual void operator*=(const Field<scalar>&) {}
00215         virtual void operator/=(const Field<scalar>&) {}
00216 
00217         virtual void operator=(const Type&) {}
00218         virtual void operator+=(const Type&) {}
00219         virtual void operator-=(const Type&) {}
00220         virtual void operator*=(const scalar) {}
00221         virtual void operator/=(const scalar) {}
00222 };
00223 
00224 
00225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00226 
00227 } // End namespace Foam
00228 
00229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00230 
00231 #ifdef NoRepository
00232 #   include "slicedFvPatchField.C"
00233 #endif
00234 
00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00236 
00237 #endif
00238 
00239 // ************************************************************************* //
For further information go to www.openfoam.org