1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
27 \*----------------------------------------------------------------------------*/
29 #include "FadOneField.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 Foam::tmp<Foam::Field<Foam::FadOne<nVars> > >
35 Foam::ValueFadOneField(const UList<scalar>& u)
37 tmp<Foam::Field<FadOne<nVars> > > tr
39 new Foam::Field<FadOne<nVars> > (u.size())
42 Field<FadOne<nVars> >& r = tr();
54 Foam::tmp<Foam::scalarField> Foam::FadOneValue(const Field<FadOne<nVars> >& u)
56 tmp<scalarField> tr(new scalarField(u.size()));
57 scalarField& r = tr();
69 void Foam::FadOneSetValue
71 Field<FadOne<nVars> >& u,
72 const scalarField& val
77 u[i].value() = val[i];
83 Foam::tmp<Foam::scalarField> Foam::FadOneDeriv
85 const Field<FadOne<nVars> >& u,
89 tmp<scalarField> tr(new scalarField(u.size()));
90 scalarField& r = tr();
102 void Foam::FadOneSetDeriv
104 Field<FadOne<nVars> >& u,
106 const scalarField& der
111 u[i].deriv(d) = der[i];
116 // ************************************************************************* //