initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / sliced / slicedFvPatchField.H
blob3d73cfc08dbf9f8503ff3fb6afa3fcfad26758df
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::slicedFvPatchField
28 Description
29     Specialization of fvPatchField which creates the underlying
30     fvPatchField as a slice of the given complete field.
32     The destructor is wrapped to avoid deallocation of the storage of the
33     complete fields when this is destroyed.
35     Should only used as a template argument for SlicedGeometricField.
37 SourceFiles
38     slicedFvPatchField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef slicedFvPatchField_H
43 #define slicedFvPatchField_H
45 #include "fvPatchField.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 /*---------------------------------------------------------------------------*\
53                            Class slicedFvPatch Declaration
54 \*---------------------------------------------------------------------------*/
56 template<class Type>
57 class slicedFvPatchField
59     public fvPatchField<Type>
62 public:
64     //- Runtime type information
65     TypeName("sliced");
68     // Constructors
70         //- Construct from patch, internal field and field to slice
71         slicedFvPatchField
72         (
73             const fvPatch&,
74             const DimensionedField<Type, volMesh>&,
75             const Field<Type>&
76         );
78         //- Construct from patch and internal field. Assign value later.
79         slicedFvPatchField
80         (
81             const fvPatch&,
82             const DimensionedField<Type, volMesh>&
83         );
85         //- Construct from patch, internal field and dictionary
86         slicedFvPatchField
87         (
88             const fvPatch&,
89             const DimensionedField<Type, volMesh>&,
90             const dictionary&
91         );
93         //- Construct by mapping the given slicedFvPatchField<Type>
94         //  onto a new patch
95         slicedFvPatchField
96         (
97             const slicedFvPatchField<Type>&,
98             const fvPatch&,
99             const DimensionedField<Type, volMesh>&,
100             const fvPatchFieldMapper&
101         );
103         //- Construct as copy
104         slicedFvPatchField(const slicedFvPatchField<Type>&);
106         //- Construct and return a clone
107         virtual tmp<fvPatchField<Type> > clone() const;
109         //- Construct as copy setting internal field reference
110         slicedFvPatchField
111         (
112             const slicedFvPatchField<Type>&,
113             const DimensionedField<Type, volMesh>&
114         );
116         //- Construct and return a clone setting internal field reference
117         virtual tmp<fvPatchField<Type> > clone
118         (
119             const DimensionedField<Type, volMesh>& iF
120         ) const;
123     // Destructor
125         virtual ~slicedFvPatchField<Type>();
128     // Member functions
130         // Access
132             //- Return true if this patch field fixes a value.
133             //  Needed to check if a level has to be specified while solving
134             //  Poissons equations.
135             virtual bool fixesValue() const
136             {
137                 return true;
138             }
141         // Evaluation functions
143             //- Return patch-normal gradient
144             virtual tmp<Field<Type> > snGrad() const;
146             //- Update the coefficients associated with the patch field
147             //  Sets Updated to true
148             virtual void updateCoeffs();
150             //- Return internal field next to patch as patch field
151             virtual tmp<Field<Type> > patchInternalField() const;
153             //- Return neighbour coupled given internal cell data
154             virtual tmp<Field<Type> > patchNeighbourField
155             (
156                 const Field<Type>& iField
157             ) const;
159             //- Return patchField of the values on the patch or on the
160             //  opposite patch
161             virtual tmp<Field<Type> > patchNeighbourField() const;
163             //- Initialise the evaluation of the patch field
164             virtual void initEvaluate
165             (
166                 const Pstream::commsTypes commsType=Pstream::blocking
167             )
168             {}
170             //- Evaluate the patch field, sets Updated to false
171             virtual void evaluate
172             (
173                 const Pstream::commsTypes commsType=Pstream::blocking
174             )
175             {}
177             //- Return the matrix diagonal coefficients corresponding to the
178             //  evaluation of the value of this patchField with given weights
179             virtual tmp<Field<Type> > valueInternalCoeffs
180             (
181                 const tmp<scalarField>&
182             ) const;
184             //- Return the matrix source coefficients corresponding to the
185             //  evaluation of the value of this patchField with given weights
186             virtual tmp<Field<Type> > valueBoundaryCoeffs
187             (
188                 const tmp<scalarField>&
189             ) const;
191             //- Return the matrix diagonal coefficients corresponding to the
192             //  evaluation of the gradient of this patchField
193             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
195             //- Return the matrix source coefficients corresponding to the
196             //  evaluation of the gradient of this patchField
197             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
200         //- Write
201         virtual void write(Ostream&) const;
204     // Member operators
206         virtual void operator=(const UList<Type>&) {}
208         virtual void operator=(const fvPatchField<Type>&) {}
209         virtual void operator+=(const fvPatchField<Type>&) {}
210         virtual void operator-=(const fvPatchField<Type>&) {}
211         virtual void operator*=(const fvPatchField<scalar>&) {}
212         virtual void operator/=(const fvPatchField<scalar>&) {}
214         virtual void operator+=(const Field<Type>&) {}
215         virtual void operator-=(const Field<Type>&) {}
217         virtual void operator*=(const Field<scalar>&) {}
218         virtual void operator/=(const Field<scalar>&) {}
220         virtual void operator=(const Type&) {}
221         virtual void operator+=(const Type&) {}
222         virtual void operator-=(const Type&) {}
223         virtual void operator*=(const scalar) {}
224         virtual void operator/=(const scalar) {}
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 } // End namespace Foam
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 #ifdef NoRepository
235 #   include "slicedFvPatchField.C"
236 #endif
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 #endif
242 // ************************************************************************* //