initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvsPatchFields / basic / sliced / slicedFvsPatchField.C
blob7e4174119b0d5ee0e1f919d015a1abb8337213a7
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 \*---------------------------------------------------------------------------*/
27 #include "slicedFvsPatchField.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
34 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
36 template<class Type>
37 slicedFvsPatchField<Type>::slicedFvsPatchField
39     const fvPatch& p,
40     const DimensionedField<Type, surfaceMesh>& iF,
41     const Field<Type>& completeField
44     fvsPatchField<Type>(p, iF, Field<Type>())
46     // Set the fvsPatchField to a slice of the given complete field
47     UList<Type>::operator=(p.patchSlice(completeField));
51 template<class Type>
52 slicedFvsPatchField<Type>::slicedFvsPatchField
54     const fvPatch& p,
55     const DimensionedField<Type, surfaceMesh>& iF
58     fvsPatchField<Type>(p, iF)
62 template<class Type>
63 slicedFvsPatchField<Type>::slicedFvsPatchField
65     const slicedFvsPatchField<Type>& ptf,
66     const fvPatch& p,
67     const DimensionedField<Type, surfaceMesh>& iF,
68     const fvPatchFieldMapper& mapper
71     fvsPatchField<Type>(ptf, p, iF, mapper)
73     notImplemented
74     (
75         "slicedFvsPatchField<Type>::"
76         "slicedFvsPatchField(const slicedFvsPatchField<Type>&, "
77         "const fvPatch&, const Field<Type>&, const fvPatchFieldMapper&)"
78     );
82 template<class Type>
83 slicedFvsPatchField<Type>::slicedFvsPatchField
85     const fvPatch& p,
86     const DimensionedField<Type, surfaceMesh>& iF,
87     const dictionary& dict
90     fvsPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
92     notImplemented
93     (
94         "slicedFvsPatchField<Type>::"
95         "slicedFvsPatchField(const Field<Type>&, const dictionary&)"
96     );
100 template<class Type>
101 slicedFvsPatchField<Type>::slicedFvsPatchField
103     const slicedFvsPatchField<Type>& ptf,
104     const DimensionedField<Type, surfaceMesh>& iF
107     fvsPatchField<Type>(ptf.patch(), iF, Field<Type>())
109     // Transfer the slice from the argument
110     UList<Type>::operator=(ptf);
113 template<class Type>
114 tmp<fvsPatchField<Type> > slicedFvsPatchField<Type>::clone() const
116     return tmp<fvsPatchField<Type> >
117     (
118         new slicedFvsPatchField<Type>(*this)
119     );
123 template<class Type>
124 slicedFvsPatchField<Type>::slicedFvsPatchField
126     const slicedFvsPatchField<Type>& ptf
129     fvsPatchField<Type>
130     (
131         ptf.patch(),
132         ptf.dimensionedInternalField(),
133         Field<Type>()
134     )
136     // Transfer the slice from the argument
137     UList<Type>::operator=(ptf);
141 template<class Type>
142 tmp<fvsPatchField<Type> > slicedFvsPatchField<Type>::clone
144     const DimensionedField<Type, surfaceMesh>& iF
145 ) const
147     return tmp<fvsPatchField<Type> >
148     (
149         new slicedFvsPatchField<Type>(*this, iF)
150     );
154 template<class Type>
155 slicedFvsPatchField<Type>::~slicedFvsPatchField<Type>()
157     // Set the fvsPatchField storage pointer to NULL before its destruction
158     // to protect the field it a slice of.
159     UList<Type>::operator=(UList<Type>(NULL, 0));
163 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
165 template<class Type>
166 void slicedFvsPatchField<Type>::write(Ostream& os) const
168     fvsPatchField<Type>::write(os);
169     this->writeEntry("value", os);
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // ************************************************************************* //