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

slicedFvsPatchField.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::slicedFvsPatchField
00027 
00028 Description
00029     Specialization of fvsPatchField which creates the underlying
00030     fvsPatchField 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     slicedFvsPatchField.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef slicedFvsPatchField_H
00043 #define slicedFvsPatchField_H
00044 
00045 #include "fvsPatchField.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class slicedFvsPatch Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 template<class Type>
00057 class slicedFvsPatchField
00058 :
00059     public fvsPatchField<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         slicedFvsPatchField
00072         (
00073             const fvPatch&,
00074             const DimensionedField<Type, surfaceMesh>&,
00075             const Field<Type>&
00076         );
00077 
00078         //- Construct from patch and internal field
00079         slicedFvsPatchField
00080         (
00081             const fvPatch&,
00082             const DimensionedField<Type, surfaceMesh>&
00083         );
00084 
00085         //- Construct from patch, internal field and dictionary
00086         slicedFvsPatchField
00087         (
00088             const fvPatch&,
00089             const DimensionedField<Type, surfaceMesh>&,
00090             const dictionary&
00091         );
00092 
00093         //- Construct by mapping the given slicedFvsPatchField<Type>
00094         //  onto a new patch
00095         slicedFvsPatchField
00096         (
00097             const slicedFvsPatchField<Type>&,
00098             const fvPatch&,
00099             const DimensionedField<Type, surfaceMesh>&,
00100             const fvPatchFieldMapper&
00101         );
00102 
00103         //- Construct as copy
00104         slicedFvsPatchField(const slicedFvsPatchField<Type>&);
00105 
00106         //- Construct and return a clone
00107         virtual tmp<fvsPatchField<Type> > clone() const;
00108 
00109         //- Construct as copy setting internal field reference
00110         slicedFvsPatchField
00111         (
00112             const slicedFvsPatchField<Type>&,
00113             const DimensionedField<Type, surfaceMesh>&
00114         );
00115 
00116         //- Construct and return a clone setting internal field reference
00117         virtual tmp<fvsPatchField<Type> > clone
00118         (
00119             const DimensionedField<Type, surfaceMesh>& iF
00120         ) const;
00121 
00122 
00123     // Destructor
00124 
00125         virtual ~slicedFvsPatchField<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         //- Write
00142         virtual void write(Ostream&) const;
00143 
00144 
00145     // Member operators
00146 
00147         virtual void operator=(const UList<Type>&) {}
00148 
00149         virtual void operator=(const fvsPatchField<Type>&) {}
00150         virtual void operator+=(const fvsPatchField<Type>&) {}
00151         virtual void operator-=(const fvsPatchField<Type>&) {}
00152         virtual void operator*=(const fvsPatchField<scalar>&) {}
00153         virtual void operator/=(const fvsPatchField<scalar>&) {}
00154 
00155         virtual void operator+=(const Field<Type>&) {}
00156         virtual void operator-=(const Field<Type>&) {}
00157 
00158         virtual void operator*=(const Field<scalar>&) {}
00159         virtual void operator/=(const Field<scalar>&) {}
00160 
00161         virtual void operator=(const Type&) {}
00162         virtual void operator+=(const Type&) {}
00163         virtual void operator-=(const Type&) {}
00164         virtual void operator*=(const scalar) {}
00165         virtual void operator/=(const scalar) {}
00166 };
00167 
00168 
00169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00170 
00171 } // End namespace Foam
00172 
00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00174 
00175 #ifdef NoRepository
00176 #   include "slicedFvsPatchField.C"
00177 #endif
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #endif
00182 
00183 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd