mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Creation of OpenFOAM-dev repository 15/04/2008
This commit is contained in:
@ -0,0 +1,258 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedScalar operator+(const dimensionedScalar& ds1, const scalar s2)
|
||||
{
|
||||
return ds1 + dimensionedScalar(s2);
|
||||
}
|
||||
|
||||
dimensionedScalar operator+(const scalar s1, const dimensionedScalar& ds2)
|
||||
{
|
||||
return dimensionedScalar(s1) + ds2;
|
||||
}
|
||||
|
||||
dimensionedScalar operator-(const dimensionedScalar& ds1, const scalar s2)
|
||||
{
|
||||
return ds1 - dimensionedScalar(s2);
|
||||
}
|
||||
|
||||
dimensionedScalar operator-(const scalar s1, const dimensionedScalar& ds2)
|
||||
{
|
||||
return dimensionedScalar(s1) - ds2;
|
||||
}
|
||||
|
||||
dimensionedScalar operator*(const dimensionedScalar& ds1, const scalar s2)
|
||||
{
|
||||
return ds1 * dimensionedScalar(s2);
|
||||
}
|
||||
|
||||
dimensionedScalar operator/(const scalar s1, const dimensionedScalar& ds2)
|
||||
{
|
||||
return dimensionedScalar(s1)/ds2;
|
||||
}
|
||||
|
||||
|
||||
dimensionedScalar pow
|
||||
(
|
||||
const dimensionedScalar& ds,
|
||||
const dimensionedScalar& expt
|
||||
)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pow(" + ds.name() + ',' + expt.name() + ')',
|
||||
pow(ds.dimensions(), expt),
|
||||
::pow(ds.value(), expt.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar pow3(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pow3(" + ds.name() + ')',
|
||||
pow3(ds.dimensions()),
|
||||
pow3(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar pow4(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pow4(" + ds.name() + ')',
|
||||
pow4(ds.dimensions()),
|
||||
pow4(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar pow5(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pow5(" + ds.name() + ')',
|
||||
pow5(ds.dimensions()),
|
||||
pow5(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar pow6(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pow6(" + ds.name() + ')',
|
||||
pow6(ds.dimensions()),
|
||||
pow6(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar sqrt(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"sqrt(" + ds.name() + ')',
|
||||
pow(ds.dimensions(), dimensionedScalar("0.5", dimless, 0.5)),
|
||||
::sqrt(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar cbrt(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"cbrt(" + ds.name() + ')',
|
||||
pow(ds.dimensions(), dimensionedScalar("(1/3)", dimless, 1.0/3.0)),
|
||||
::cbrt(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar hypot
|
||||
(
|
||||
const dimensionedScalar& x,
|
||||
const dimensionedScalar& y
|
||||
)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"hypot(" + x.name() + ',' + y.name() + ')',
|
||||
x.dimensions() + y.dimensions(),
|
||||
::hypot(x.value(), y.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar sign(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"sign(" + ds.name() + ')',
|
||||
sign(ds.dimensions()),
|
||||
::Foam::sign(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar pos(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"pos(" + ds.name() + ')',
|
||||
pos(ds.dimensions()),
|
||||
::Foam::pos(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar neg(const dimensionedScalar& ds)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"neg(" + ds.name() + ')',
|
||||
neg(ds.dimensions()),
|
||||
::Foam::neg(ds.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorIn(#func "(const dimensionedScalar& ds)") \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(ds.value()) \
|
||||
); \
|
||||
}
|
||||
|
||||
transFunc(exp)
|
||||
transFunc(log)
|
||||
transFunc(log10)
|
||||
transFunc(sin)
|
||||
transFunc(cos)
|
||||
transFunc(tan)
|
||||
transFunc(asin)
|
||||
transFunc(acos)
|
||||
transFunc(atan)
|
||||
transFunc(sinh)
|
||||
transFunc(cosh)
|
||||
transFunc(tanh)
|
||||
transFunc(asinh)
|
||||
transFunc(acosh)
|
||||
transFunc(atanh)
|
||||
transFunc(erf)
|
||||
transFunc(erfc)
|
||||
transFunc(lgamma)
|
||||
transFunc(j0)
|
||||
transFunc(j1)
|
||||
transFunc(y0)
|
||||
transFunc(y1)
|
||||
|
||||
#undef transFunc
|
||||
|
||||
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const int n, const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorIn(#func "(const int n, const dimensionedScalar& ds)") \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + name(n) + ',' + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(n, ds.value()) \
|
||||
); \
|
||||
}
|
||||
|
||||
transFunc(jn)
|
||||
transFunc(yn)
|
||||
|
||||
#undef transFunc
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::dimensionedScalar
|
||||
|
||||
Description
|
||||
Dimensioned scalar obtained from generic dimensioned type.
|
||||
|
||||
SourceFiles
|
||||
dimensionedScalar.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedScalar_H
|
||||
#define dimensionedScalar_H
|
||||
|
||||
#include "dimensionedType.H"
|
||||
#include "scalar.H"
|
||||
#include "dimensionedScalarFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedScalar operator+(const dimensionedScalar&, const scalar);
|
||||
dimensionedScalar operator+(const scalar, const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar operator-(const dimensionedScalar&, const scalar);
|
||||
dimensionedScalar operator-(const scalar, const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar operator*(const dimensionedScalar&, const scalar);
|
||||
dimensionedScalar operator/(const scalar, const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar pow(const dimensionedScalar&, const dimensionedScalar&);
|
||||
dimensionedScalar pow3(const dimensionedScalar&);
|
||||
dimensionedScalar pow4(const dimensionedScalar&);
|
||||
dimensionedScalar pow5(const dimensionedScalar&);
|
||||
dimensionedScalar pow6(const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar sqrt(const dimensionedScalar&);
|
||||
dimensionedScalar cbrt(const dimensionedScalar&);
|
||||
dimensionedScalar hypot(const dimensionedScalar&, const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar sign(const dimensionedScalar&);
|
||||
dimensionedScalar pos(const dimensionedScalar&);
|
||||
dimensionedScalar neg(const dimensionedScalar&);
|
||||
|
||||
dimensionedScalar exp(const dimensionedScalar&);
|
||||
dimensionedScalar log(const dimensionedScalar&);
|
||||
dimensionedScalar log10(const dimensionedScalar&);
|
||||
dimensionedScalar sin(const dimensionedScalar&);
|
||||
dimensionedScalar cos(const dimensionedScalar&);
|
||||
dimensionedScalar tan(const dimensionedScalar&);
|
||||
dimensionedScalar asin(const dimensionedScalar&);
|
||||
dimensionedScalar acos(const dimensionedScalar&);
|
||||
dimensionedScalar atan(const dimensionedScalar&);
|
||||
dimensionedScalar sinh(const dimensionedScalar&);
|
||||
dimensionedScalar cosh(const dimensionedScalar&);
|
||||
dimensionedScalar tanh(const dimensionedScalar&);
|
||||
dimensionedScalar asinh(const dimensionedScalar&);
|
||||
dimensionedScalar acosh(const dimensionedScalar&);
|
||||
dimensionedScalar atanh(const dimensionedScalar&);
|
||||
dimensionedScalar erf(const dimensionedScalar&);
|
||||
dimensionedScalar erfc(const dimensionedScalar&);
|
||||
dimensionedScalar lgamma(const dimensionedScalar&);
|
||||
dimensionedScalar j0(const dimensionedScalar&);
|
||||
dimensionedScalar j1(const dimensionedScalar&);
|
||||
dimensionedScalar jn(const int, const dimensionedScalar&);
|
||||
dimensionedScalar y0(const dimensionedScalar&);
|
||||
dimensionedScalar y1(const dimensionedScalar&);
|
||||
dimensionedScalar yn(const int, const dimensionedScalar&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedScalarFwd_H
|
||||
#define dimensionedScalarFwd_H
|
||||
|
||||
#include "scalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
class dimensioned;
|
||||
|
||||
typedef dimensioned<scalar> dimensionedScalar;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,88 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Dimensioned sphericalTensor obtained from generic dimensioned type.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dimensionedSphericalTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
dimensionedSphericalTensor dimensionedSphericalTensor::T() const
|
||||
{
|
||||
return dimensionedSphericalTensor
|
||||
(
|
||||
name()+".T()",
|
||||
dimensions(),
|
||||
value().T()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedScalar tr(const dimensionedSphericalTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"tr("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
tr(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedScalar det(const dimensionedSphericalTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"det("+dt.name()+')',
|
||||
pow(dt.dimensions(), sphericalTensor::dim),
|
||||
det(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSphericalTensor inv(const dimensionedSphericalTensor& dt)
|
||||
{
|
||||
return dimensionedSphericalTensor
|
||||
(
|
||||
"inv("+dt.name()+')',
|
||||
dimless/dt.dimensions(),
|
||||
inv(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,68 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::dimensionedSphericalTensor
|
||||
|
||||
Description
|
||||
Dimensioned sphericalTensor obtained from generic dimensioned type.
|
||||
|
||||
SourceFiles
|
||||
dimensionedSphericalTensor.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedSphericalTensor_H
|
||||
#define dimensionedSphericalTensor_H
|
||||
|
||||
#include "dimensionedType.H"
|
||||
#include "sphericalTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
typedef dimensioned<sphericalTensor> dimensionedSphericalTensor;
|
||||
|
||||
|
||||
// global functions
|
||||
|
||||
dimensionedScalar tr(const dimensionedSphericalTensor&);
|
||||
dimensionedScalar det(const dimensionedSphericalTensor&);
|
||||
dimensionedSphericalTensor inv(const dimensionedSphericalTensor&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -0,0 +1,156 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Dimensioned tensor obtained from generic dimensioned type.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dimensionedSymmTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
dimensionedSymmTensor dimensionedSymmTensor::T() const
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
name()+".T()",
|
||||
dimensions(),
|
||||
value().T()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedSymmTensor sqr(const dimensionedVector& dv)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"sqr("+dv.name()+')',
|
||||
sqr(dv.dimensions()),
|
||||
sqr(dv.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedScalar tr(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"tr("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
tr(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor symm(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"symm("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
symm(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"twoSymm("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
twoSymm(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor dev(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"dev("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
dev(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor dev2(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"dev2("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
dev2(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedScalar det(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"det("+dt.name()+')',
|
||||
pow(dt.dimensions(), symmTensor::dim),
|
||||
det(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor inv(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"inv("+dt.name()+')',
|
||||
dimless/dt.dimensions(),
|
||||
inv(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedVector operator*(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedVector
|
||||
(
|
||||
"*"+dt.name(),
|
||||
dt.dimensions(),
|
||||
*dt.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,80 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::dimensionedSymmTensor
|
||||
|
||||
Description
|
||||
Dimensioned tensor obtained from generic dimensioned type.
|
||||
|
||||
SourceFiles
|
||||
dimensionedSymmTensor.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedSymmTensor_H
|
||||
#define dimensionedSymmTensor_H
|
||||
|
||||
#include "dimensionedVector.H"
|
||||
#include "symmTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
typedef dimensioned<symmTensor> dimensionedSymmTensor;
|
||||
|
||||
|
||||
// global functions
|
||||
|
||||
dimensionedSymmTensor sqr(const dimensionedVector&);
|
||||
|
||||
dimensionedScalar tr(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor symm(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor dev(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor dev2(const dimensionedSymmTensor&);
|
||||
dimensionedScalar det(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor inv(const dimensionedSymmTensor&);
|
||||
|
||||
|
||||
// global operators
|
||||
|
||||
//- Hodge Dual operator (tensor -> vector)
|
||||
dimensionedVector operator*(const dimensionedSymmTensor&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -0,0 +1,209 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Dimensioned tensor obtained from generic dimensioned type.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dimensionedTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
dimensionedTensor dimensionedTensor::T() const
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
name()+".T()",
|
||||
dimensions(),
|
||||
value().T()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedScalar tr(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"tr("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
tr(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor dev(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"dev("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
dev(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor dev2(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"dev2("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
dev2(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedScalar det(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
"det("+dt.name()+')',
|
||||
pow(dt.dimensions(), tensor::dim),
|
||||
det(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor inv(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"inv("+dt.name()+')',
|
||||
dimless/dt.dimensions(),
|
||||
inv(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor symm(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"symm("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
symm(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedSymmTensor twoSymm(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"twoSymm("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
twoSymm(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedTensor skew(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"skew("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
skew(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedVector eigenValues(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedVector
|
||||
(
|
||||
"eigenValues("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
eigenValues(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor eigenVectors(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"eigenVectors("+dt.name()+')',
|
||||
dimless,
|
||||
eigenVectors(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedVector eigenValues(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedVector
|
||||
(
|
||||
"eigenValues("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
eigenValues(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor eigenVectors(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"eigenVectors("+dt.name()+')',
|
||||
dimless,
|
||||
eigenVectors(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
dimensionedVector operator*(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedVector
|
||||
(
|
||||
"*"+dt.name(),
|
||||
dt.dimensions(),
|
||||
*dt.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor operator*(const dimensionedVector& dv)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"*"+dv.name(),
|
||||
dv.dimensions(),
|
||||
*dv.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::dimensionedTensor
|
||||
|
||||
Description
|
||||
Dimensioned tensor obtained from generic dimensioned type.
|
||||
|
||||
SourceFiles
|
||||
dimensionedTensor.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedTensor_H
|
||||
#define dimensionedTensor_H
|
||||
|
||||
#include "dimensionedVector.H"
|
||||
#include "dimensionedSymmTensor.H"
|
||||
#include "tensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
typedef dimensioned<tensor> dimensionedTensor;
|
||||
|
||||
|
||||
// global functions
|
||||
|
||||
dimensionedScalar tr(const dimensionedTensor&);
|
||||
dimensionedTensor dev(const dimensionedTensor&);
|
||||
dimensionedTensor dev2(const dimensionedTensor&);
|
||||
dimensionedScalar det(const dimensionedTensor&);
|
||||
dimensionedTensor inv(const dimensionedTensor&);
|
||||
dimensionedSymmTensor symm(const dimensionedTensor&);
|
||||
dimensionedSymmTensor twoSymm(const dimensionedTensor&);
|
||||
dimensionedTensor skew(const dimensionedTensor&);
|
||||
|
||||
dimensionedVector eigenValues(const dimensionedTensor&);
|
||||
dimensionedTensor eigenVectors(const dimensionedTensor&);
|
||||
|
||||
dimensionedVector eigenValues(const dimensionedSymmTensor&);
|
||||
dimensionedTensor eigenVectors(const dimensionedSymmTensor&);
|
||||
|
||||
|
||||
// global operators
|
||||
|
||||
//- Hodge Dual operator (tensor -> vector)
|
||||
dimensionedVector operator*(const dimensionedTensor&);
|
||||
|
||||
//- Hodge Dual operator (vector -> tensor)
|
||||
dimensionedTensor operator*(const dimensionedVector&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
512
src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C
Normal file
512
src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C
Normal file
@ -0,0 +1,512 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dimensionedType.H"
|
||||
#include "pTraits.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensionSet& dimSet,
|
||||
const Type t
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
dimensions_(dimSet),
|
||||
value_(t)
|
||||
{}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
dimensions_(dt.dimensions_),
|
||||
value_(dt.value_)
|
||||
{}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
(
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
name_(is),
|
||||
dimensions_(is),
|
||||
value_(pTraits<Type>(is))
|
||||
{}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
dimensions_(is),
|
||||
value_(pTraits<Type>(is))
|
||||
{}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensionSet& dimSet,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
dimensions_(dimSet),
|
||||
value_(pTraits<Type>(is))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
const word& dimensioned<Type>::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
word& dimensioned<Type>::name()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
const dimensionSet& dimensioned<Type>::dimensions() const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
dimensionSet& dimensioned<Type>::dimensions()
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
const Type& dimensioned<Type>::value() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type& dimensioned<Type>::value()
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::component
|
||||
(
|
||||
const direction d
|
||||
) const
|
||||
{
|
||||
return dimensioned<cmptType>
|
||||
(
|
||||
name_ + ".component(" + Foam::name(d) + ')',
|
||||
dimensions_,
|
||||
value_.component(d)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
void dimensioned<Type>::replace
|
||||
(
|
||||
const direction d,
|
||||
const dimensioned<typename dimensioned<Type>::cmptType>& dc
|
||||
)
|
||||
{
|
||||
dimensions_ = dc.dimensions();
|
||||
value_.replace(d, dc.value());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::operator[]
|
||||
(
|
||||
const direction d
|
||||
) const
|
||||
{
|
||||
return component(d);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
void dimensioned<Type>::operator+=
|
||||
(
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
{
|
||||
dimensions_ += dt.dimensions_;
|
||||
value_ += dt.value_;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
void dimensioned<Type>::operator-=
|
||||
(
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
{
|
||||
dimensions_ -= dt.dimensions_;
|
||||
value_ -= dt.value_;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
void dimensioned<Type>::operator*=
|
||||
(
|
||||
const scalar s
|
||||
)
|
||||
{
|
||||
value_ *= s;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
void dimensioned<Type>::operator/=
|
||||
(
|
||||
const scalar s
|
||||
)
|
||||
{
|
||||
value_ /= s;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type, int r>
|
||||
dimensioned<typename powProduct<Type, r>::type>
|
||||
pow(const dimensioned<Type>& dt, typename powProduct<Type, r>::type)
|
||||
{
|
||||
return dimensioned<typename powProduct<Type, r>::type>
|
||||
(
|
||||
"pow(" + dt.name() + ',' + name(r) + ')',
|
||||
pow(dt.dimensions(), r),
|
||||
pow(dt.value(), 2)
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensioned<typename outerProduct<Type, Type>::type>
|
||||
sqr(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<typename outerProduct<Type, Type>::type>
|
||||
(
|
||||
"sqr(" + dt.name() + ')',
|
||||
sqr(dt.dimensions()),
|
||||
sqr(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> magSqr(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<scalar>
|
||||
(
|
||||
"magSqr(" + dt.name() + ')',
|
||||
magSqr(dt.dimensions()),
|
||||
magSqr(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> mag(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<scalar>
|
||||
(
|
||||
"mag(" + dt.name() + ')',
|
||||
dt.dimensions(),
|
||||
mag(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> max
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
if (dt1.dimensions() != dt2.dimensions())
|
||||
{
|
||||
FatalErrorIn("max(const dimensioned<Type>&, const dimensioned<Type>&)")
|
||||
<< "dimensions of arguments are not equal"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return dimensioned<Type>
|
||||
(
|
||||
"max(" + dt1.name() + ',' + dt2.name() + ')',
|
||||
dt1.dimensions(),
|
||||
max(dt1.value(), dt2.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> min
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
if (dt1.dimensions() != dt2.dimensions())
|
||||
{
|
||||
FatalErrorIn("min(const dimensioned<Type>&, const dimensioned<Type>&)")
|
||||
<< "dimensions of arguments are not equal"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return dimensioned<Type>
|
||||
(
|
||||
"min(" + dt1.name() + ',' + dt2.name() + ')',
|
||||
dt1.dimensions(),
|
||||
min(dt1.value(), dt2.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
Istream& operator>>(Istream& is, dimensioned<Type>& dt)
|
||||
{
|
||||
// do a stream read op for a Type and a dimensions()et
|
||||
is >> dt.name_ >> dt.dimensions_ >> dt.value_;
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Istream& operator>>(Istream&, dimensioned<Type>&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt)
|
||||
{
|
||||
// do a stream write op for a dimensions()et
|
||||
os << dt.name() << token::SPACE
|
||||
<< dt.dimensions() << token::SPACE
|
||||
<< dt.value();
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const dimensioned<Type>&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
bool operator>
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dt1.value() > dt2.value();
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
bool operator<
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dt1.value() < dt2.value();
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> operator+
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
'(' + dt1.name() + '+' + dt2.name() + ')',
|
||||
dt1.dimensions() + dt2.dimensions(),
|
||||
dt1.value() + dt2.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> operator-(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
'-' + dt.name(),
|
||||
dt.dimensions(),
|
||||
-dt.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> operator-
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
'(' + dt1.name() + '-' + dt2.name() + ')',
|
||||
dt1.dimensions() - dt2.dimensions(),
|
||||
dt1.value() - dt2.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> operator*
|
||||
(
|
||||
const dimensioned<scalar>& ds,
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
'(' + ds.name() + '*' + dt.name() + ')',
|
||||
ds.dimensions() * dt.dimensions(),
|
||||
ds.value() * dt.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
dimensioned<Type> operator/
|
||||
(
|
||||
const dimensioned<Type>& dt,
|
||||
const dimensioned<scalar>& ds
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
'(' + dt.name() + '|' + ds.name() + ')',
|
||||
dt.dimensions()/ds.dimensions(),
|
||||
dt.value()/ds.value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Products
|
||||
// ~~~~~~~~
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
dimensioned<typename product<Type1, Type2>::type> \
|
||||
operator op(const dimensioned<Type1>& dt1, const dimensioned<Type2>& dt2) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type1, Type2>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + dt2.name() + ')', \
|
||||
dt1.dimensions() op dt2.dimensions(), \
|
||||
dt1.value() op dt2.value() \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Type, Form>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Type>& dt1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type, Form>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + name(t2) + ')', \
|
||||
dt1.dimensions(), \
|
||||
dt1.value() op static_cast<const Form&>(t2) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Form, Type>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t1, \
|
||||
const dimensioned<Type>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Form, Type>::type> \
|
||||
( \
|
||||
'(' + name(t1) + #op + dt2.name() + ')', \
|
||||
dt2.dimensions(), \
|
||||
static_cast<const Form&>(t1) op dt2.value() \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
PRODUCT_OPERATOR(outerProduct, *, outer)
|
||||
PRODUCT_OPERATOR(crossProduct, ^, cross)
|
||||
PRODUCT_OPERATOR(innerProduct, &, dot)
|
||||
PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
|
||||
|
||||
#undef PRODUCT_OPERATOR
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
286
src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H
Normal file
286
src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H
Normal file
@ -0,0 +1,286 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::dimensioned
|
||||
|
||||
Description
|
||||
Generic dimensioned Type class
|
||||
|
||||
SourceFiles
|
||||
dimensionedType.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedType_H
|
||||
#define dimensionedType_H
|
||||
|
||||
#include "word.H"
|
||||
#include "direction.H"
|
||||
#include "dimensionSet.H"
|
||||
#include "VectorSpace.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<class Type> class dimensioned;
|
||||
|
||||
template<class Type>
|
||||
Istream& operator>>(Istream&, dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<(Ostream&, const dimensioned<Type>&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class dimensioned Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template <class Type>
|
||||
class dimensioned
|
||||
{
|
||||
// private data
|
||||
|
||||
//- Variable name
|
||||
word name_;
|
||||
|
||||
//- The dimension set
|
||||
dimensionSet dimensions_;
|
||||
|
||||
//- The data value
|
||||
Type value_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Component type
|
||||
typedef typename pTraits<Type>::cmptType cmptType;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given a name, a value and its dimensionSet.
|
||||
dimensioned(const word&, const dimensionSet&, const Type);
|
||||
|
||||
//- Construct from a dimensioned<Type> changing the name.
|
||||
dimensioned(const word&, const dimensioned<Type>&);
|
||||
|
||||
//- Construct given a value (creates dimensionless value).
|
||||
dimensioned(const Type& t)
|
||||
:
|
||||
name_(::Foam::name(t)),
|
||||
dimensions_(dimless),
|
||||
value_(t)
|
||||
{}
|
||||
|
||||
//- Construct from Istream.
|
||||
dimensioned(Istream&);
|
||||
|
||||
//- Construct from an Istream with a given name
|
||||
dimensioned(const word&, Istream&);
|
||||
|
||||
//- Construct from an Istream with a given name and dimensions
|
||||
dimensioned(const word&, const dimensionSet&, Istream&);
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return const reference to name.
|
||||
const word& name() const;
|
||||
|
||||
//- Return non-const reference to name.
|
||||
word& name();
|
||||
|
||||
//- Return const reference to dimensions.
|
||||
const dimensionSet& dimensions() const;
|
||||
|
||||
//- Return non-const reference to dimensions.
|
||||
dimensionSet& dimensions();
|
||||
|
||||
//- Return const reference to value.
|
||||
const Type& value() const;
|
||||
|
||||
//- Return non-const reference to value.
|
||||
Type& value();
|
||||
|
||||
//- Return a component as a dimensioned<cmptType>
|
||||
dimensioned<cmptType> component(const direction) const;
|
||||
|
||||
//- Return a component with a dimensioned<cmptType>
|
||||
void replace(const direction, const dimensioned<cmptType>&);
|
||||
|
||||
//- Return transpose.
|
||||
dimensioned<Type> T() const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
//- Return a component as a dimensioned<cmptType>
|
||||
dimensioned<cmptType> operator[](const direction) const;
|
||||
|
||||
void operator+=(const dimensioned<Type>&);
|
||||
void operator-=(const dimensioned<Type>&);
|
||||
void operator*=(const scalar);
|
||||
void operator/=(const scalar);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
friend Istream& operator>>
|
||||
#ifndef __CINT__
|
||||
<Type>
|
||||
#endif
|
||||
(Istream&, dimensioned<Type>&);
|
||||
|
||||
friend Ostream& operator<<
|
||||
#ifndef __CINT__
|
||||
<Type>
|
||||
#endif
|
||||
(Ostream&, const dimensioned<Type>&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type, int r>
|
||||
dimensioned<typename powProduct<Type, r>::type>
|
||||
pow
|
||||
(
|
||||
const dimensioned<Type>&,
|
||||
typename powProduct<Type, r>::type
|
||||
= pTraits<typename powProduct<Type, r>::type>::zero
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<typename outerProduct<Type, Type>::type>
|
||||
sqr(const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> magSqr(const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> mag(const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> cmptMultiply
|
||||
(
|
||||
const dimensioned<Type>&,
|
||||
const dimensioned<Type>&
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> cmptDivide
|
||||
(
|
||||
const dimensioned<Type>&,
|
||||
const dimensioned<Type>&
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> max(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> min(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
bool operator>(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
bool operator<(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator+(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator-(const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator-(const dimensioned<Type>&, const dimensioned<Type>&);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator*
|
||||
(
|
||||
const dimensioned<scalar>&,
|
||||
const dimensioned<Type>&
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator/
|
||||
(
|
||||
const dimensioned<Type>&,
|
||||
const dimensioned<scalar>&
|
||||
);
|
||||
|
||||
|
||||
// Products
|
||||
// ~~~~~~~~
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
dimensioned<typename product<Type1, Type2>::type> \
|
||||
operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Type, Form>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Type>&, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& \
|
||||
); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Form, Type>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>&, \
|
||||
const dimensioned<Type>& \
|
||||
);
|
||||
|
||||
PRODUCT_OPERATOR(outerProduct, *, outer)
|
||||
PRODUCT_OPERATOR(crossProduct, ^, cross)
|
||||
PRODUCT_OPERATOR(innerProduct, &, dot)
|
||||
PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
|
||||
|
||||
#undef PRODUCT_OPERATOR
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "dimensionedType.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
42
src/OpenFOAM/dimensionedTypes/dimensionedTypes.H
Normal file
42
src/OpenFOAM/dimensionedTypes/dimensionedTypes.H
Normal file
@ -0,0 +1,42 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedTypes_H
|
||||
#define dimensionedTypes_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "dimensionedScalar.H"
|
||||
#include "dimensionedVector.H"
|
||||
#include "dimensionedSphericalTensor.H"
|
||||
#include "dimensionedSymmTensor.H"
|
||||
#include "dimensionedTensor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::dimensionedVector
|
||||
|
||||
Description
|
||||
Dimensioned vector obtained from generic dimensioned type.
|
||||
|
||||
SourceFiles
|
||||
dimensionedVector.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dimensionedVector_H
|
||||
#define dimensionedVector_H
|
||||
|
||||
#include "dimensionedScalar.H"
|
||||
#include "vector.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
typedef dimensioned<vector> dimensionedVector;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user