OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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     Foam::slicedFvPatchField
00027 
00028 Description
00029     Specialization of fvPatchField which creates the underlying
00030     fvPatchField as a slice of the given complete field.
00031 
00032     The destructor is wrapped to avoid deallocation of the storage of the
00033     complete fields when this is destroyed.
00034 
00035     Should only used as a template argument for 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 DimensionedField<Type, volMesh>&,
00075             const Field<Type>&
00076         );
00077 
00078         //- Construct from patch and internal field. Assign value later.
00079         slicedFvPatchField
00080         (
00081             const fvPatch&,
00082             const DimensionedField<Type, volMesh>&
00083         );
00084 
00085         //- Construct from patch, internal field and dictionary
00086         slicedFvPatchField
00087         (
00088             const fvPatch&,
00089             const DimensionedField<Type, volMesh>&,
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 DimensionedField<Type, volMesh>&,
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 DimensionedField<Type, volMesh>&
00114         );
00115 
00116         //- Construct and return a clone setting internal field reference
00117         virtual tmp<fvPatchField<Type> > clone
00118         (
00119             const DimensionedField<Type, volMesh>& iF
00120         ) const;
00121 
00122 
00123     // Destructor
00124 
00125         virtual ~slicedFvPatchField<Type>();
00126 
00127 
00128     // Member functions
00129 
00130         // Access
00131 
00132             //- Return true if this patch field fixes a value.
00133             //  Needed to check if a level has to be specified while solving
00134             //  Poissons equations.
00135             virtual bool fixesValue() const
00136             {
00137                 return true;
00138             }
00139 
00140 
00141         // Evaluation functions
00142 
00143             //- Return patch-normal gradient
00144             virtual tmp<Field<Type> > snGrad() const;
00145 
00146             //- Update the coefficients associated with the patch field
00147             //  Sets Updated to true
00148             virtual void updateCoeffs();
00149 
00150             //- Return internal field next to patch as patch field
00151             virtual tmp<Field<Type> > patchInternalField() const;
00152 
00153             //- Return neighbour coupled given internal cell data
00154             virtual tmp<Field<Type> > patchNeighbourField
00155             (
00156                 const Field<Type>& iField
00157             ) const;
00158 
00159             //- Return patchField of the values on the patch or on the
00160             //  opposite patch
00161             virtual tmp<Field<Type> > patchNeighbourField() const;
00162 
00163             //- Initialise the evaluation of the patch field
00164             virtual void initEvaluate
00165             (
00166                 const Pstream::commsTypes commsType=Pstream::blocking
00167             )
00168             {}
00169 
00170             //- Evaluate the patch field, sets Updated to false
00171             virtual void evaluate
00172             (
00173                 const Pstream::commsTypes commsType=Pstream::blocking
00174             )
00175             {}
00176 
00177             //- Return the matrix diagonal coefficients corresponding to the
00178             //  evaluation of the value of this patchField with given weights
00179             virtual tmp<Field<Type> > valueInternalCoeffs
00180             (
00181                 const tmp<scalarField>&
00182             ) const;
00183 
00184             //- Return the matrix source coefficients corresponding to the
00185             //  evaluation of the value of this patchField with given weights
00186             virtual tmp<Field<Type> > valueBoundaryCoeffs
00187             (
00188                 const tmp<scalarField>&
00189             ) const;
00190 
00191             //- Return the matrix diagonal coefficients corresponding to the
00192             //  evaluation of the gradient of this patchField
00193             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00194 
00195             //- Return the matrix source coefficients corresponding to the
00196             //  evaluation of the gradient of this patchField
00197             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00198 
00199 
00200         //- Write
00201         virtual void write(Ostream&) const;
00202 
00203 
00204     // Member operators
00205 
00206         virtual void operator=(const UList<Type>&) {}
00207 
00208         virtual void operator=(const fvPatchField<Type>&) {}
00209         virtual void operator+=(const fvPatchField<Type>&) {}
00210         virtual void operator-=(const fvPatchField<Type>&) {}
00211         virtual void operator*=(const fvPatchField<scalar>&) {}
00212         virtual void operator/=(const fvPatchField<scalar>&) {}
00213 
00214         virtual void operator+=(const Field<Type>&) {}
00215         virtual void operator-=(const Field<Type>&) {}
00216 
00217         virtual void operator*=(const Field<scalar>&) {}
00218         virtual void operator/=(const Field<scalar>&) {}
00219 
00220         virtual void operator=(const Type&) {}
00221         virtual void operator+=(const Type&) {}
00222         virtual void operator-=(const Type&) {}
00223         virtual void operator*=(const scalar) {}
00224         virtual void operator/=(const scalar) {}
00225 };
00226 
00227 
00228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00229 
00230 } // End namespace Foam
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 #ifdef NoRepository
00235 #   include "slicedFvPatchField.C"
00236 #endif
00237 
00238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00239 
00240 #endif
00241 
00242 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd