initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvsPatchFields / basic / sliced / slicedFvsPatchField.H
blob2b34a585ad1d387a2c485e462b2b6a2861067776
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::slicedFvsPatchField
28 Description
29     Specialization of fvsPatchField which creates the underlying
30     fvsPatchField 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     slicedFvsPatchField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef slicedFvsPatchField_H
43 #define slicedFvsPatchField_H
45 #include "fvsPatchField.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 /*---------------------------------------------------------------------------*\
53                            Class slicedFvsPatch Declaration
54 \*---------------------------------------------------------------------------*/
56 template<class Type>
57 class slicedFvsPatchField
59     public fvsPatchField<Type>
62 public:
64     //- Runtime type information
65     TypeName("sliced");
68     // Constructors
70         //- Construct from patch, internal field and field to slice
71         slicedFvsPatchField
72         (
73             const fvPatch&,
74             const DimensionedField<Type, surfaceMesh>&,
75             const Field<Type>&
76         );
78         //- Construct from patch and internal field
79         slicedFvsPatchField
80         (
81             const fvPatch&,
82             const DimensionedField<Type, surfaceMesh>&
83         );
85         //- Construct from patch, internal field and dictionary
86         slicedFvsPatchField
87         (
88             const fvPatch&,
89             const DimensionedField<Type, surfaceMesh>&,
90             const dictionary&
91         );
93         //- Construct by mapping the given slicedFvsPatchField<Type>
94         //  onto a new patch
95         slicedFvsPatchField
96         (
97             const slicedFvsPatchField<Type>&,
98             const fvPatch&,
99             const DimensionedField<Type, surfaceMesh>&,
100             const fvPatchFieldMapper&
101         );
103         //- Construct as copy
104         slicedFvsPatchField(const slicedFvsPatchField<Type>&);
106         //- Construct and return a clone
107         virtual tmp<fvsPatchField<Type> > clone() const;
109         //- Construct as copy setting internal field reference
110         slicedFvsPatchField
111         (
112             const slicedFvsPatchField<Type>&,
113             const DimensionedField<Type, surfaceMesh>&
114         );
116         //- Construct and return a clone setting internal field reference
117         virtual tmp<fvsPatchField<Type> > clone
118         (
119             const DimensionedField<Type, surfaceMesh>& iF
120         ) const;
123     // Destructor
125         virtual ~slicedFvsPatchField<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         //- Write
142         virtual void write(Ostream&) const;
145     // Member operators
147         virtual void operator=(const UList<Type>&) {}
149         virtual void operator=(const fvsPatchField<Type>&) {}
150         virtual void operator+=(const fvsPatchField<Type>&) {}
151         virtual void operator-=(const fvsPatchField<Type>&) {}
152         virtual void operator*=(const fvsPatchField<scalar>&) {}
153         virtual void operator/=(const fvsPatchField<scalar>&) {}
155         virtual void operator+=(const Field<Type>&) {}
156         virtual void operator-=(const Field<Type>&) {}
158         virtual void operator*=(const Field<scalar>&) {}
159         virtual void operator/=(const Field<scalar>&) {}
161         virtual void operator=(const Type&) {}
162         virtual void operator+=(const Type&) {}
163         virtual void operator-=(const Type&) {}
164         virtual void operator*=(const scalar) {}
165         virtual void operator/=(const scalar) {}
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #ifdef NoRepository
176 #   include "slicedFvsPatchField.C"
177 #endif
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 #endif
183 // ************************************************************************* //