FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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