1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 slicedFvsPatchField<Type>::slicedFvsPatchField
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));
52 slicedFvsPatchField<Type>::slicedFvsPatchField
55 const DimensionedField<Type, surfaceMesh>& iF
58 fvsPatchField<Type>(p, iF)
63 slicedFvsPatchField<Type>::slicedFvsPatchField
65 const slicedFvsPatchField<Type>& ptf,
67 const DimensionedField<Type, surfaceMesh>& iF,
68 const fvPatchFieldMapper& mapper
71 fvsPatchField<Type>(ptf, p, iF, mapper)
75 "slicedFvsPatchField<Type>::"
76 "slicedFvsPatchField(const slicedFvsPatchField<Type>&, "
77 "const fvPatch&, const Field<Type>&, const fvPatchFieldMapper&)"
83 slicedFvsPatchField<Type>::slicedFvsPatchField
86 const DimensionedField<Type, surfaceMesh>& iF,
87 const dictionary& dict
90 fvsPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
94 "slicedFvsPatchField<Type>::"
95 "slicedFvsPatchField(const Field<Type>&, const dictionary&)"
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);
114 tmp<fvsPatchField<Type> > slicedFvsPatchField<Type>::clone() const
116 return tmp<fvsPatchField<Type> >
118 new slicedFvsPatchField<Type>(*this)
124 slicedFvsPatchField<Type>::slicedFvsPatchField
126 const slicedFvsPatchField<Type>& ptf
132 ptf.dimensionedInternalField(),
136 // Transfer the slice from the argument
137 UList<Type>::operator=(ptf);
142 tmp<fvsPatchField<Type> > slicedFvsPatchField<Type>::clone
144 const DimensionedField<Type, surfaceMesh>& iF
147 return tmp<fvsPatchField<Type> >
149 new slicedFvsPatchField<Type>(*this, iF)
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 * * * * * * * * * * * * * //
166 void slicedFvsPatchField<Type>::write(Ostream& os) const
168 fvsPatchField<Type>::write(os);
169 this->writeEntry("value", os);
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // ************************************************************************* //