Reformat "template <..." to template<"

Add support for constructing VectorSpaces from forms with lower component type,
e.g. Vector<scalar> from Vector<label>
This commit is contained in:
Henry
2013-02-21 15:07:09 +00:00
parent eb3ae955e6
commit 944b8d438b
146 changed files with 869 additions and 863 deletions

View File

@ -86,7 +86,8 @@ public:
inline DiagTensor(); inline DiagTensor();
//- Construct given VectorSpace //- Construct given VectorSpace
inline DiagTensor(const VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>&); template<class Cmpt2>
inline DiagTensor(const VectorSpace<DiagTensor<Cmpt2>, Cmpt2, 3>&);
//- Construct given three components //- Construct given three components
inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz); inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz);

View File

@ -32,24 +32,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template<class Cmpt> template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor() inline DiagTensor<Cmpt>::DiagTensor()
{} {}
// Construct given VectorSpace
template<class Cmpt> template<class Cmpt>
template<class Cmpt2>
inline DiagTensor<Cmpt>::DiagTensor inline DiagTensor<Cmpt>::DiagTensor
( (
const VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>& vs const VectorSpace<DiagTensor<Cmpt2>, Cmpt2, 3>& vs
) )
: :
VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>(vs) VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>(vs)
{} {}
// Construct given three Cmpts
template<class Cmpt> template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor inline DiagTensor<Cmpt>::DiagTensor
( (
@ -64,7 +62,6 @@ inline DiagTensor<Cmpt>::DiagTensor
} }
// Construct from Istream
template<class Cmpt> template<class Cmpt>
inline DiagTensor<Cmpt>::DiagTensor(Istream& is) inline DiagTensor<Cmpt>::DiagTensor(Istream& is)
: :

View File

@ -91,9 +91,10 @@ public:
inline SphericalTensor(); inline SphericalTensor();
//- Construct given VectorSpace //- Construct given VectorSpace
template<class Cmpt2>
inline SphericalTensor inline SphericalTensor
( (
const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>& const VectorSpace<SphericalTensor<Cmpt2>, Cmpt2, 1>&
); );
//- Construct given the component //- Construct given the component

View File

@ -32,24 +32,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template<class Cmpt> template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor() inline SphericalTensor<Cmpt>::SphericalTensor()
{} {}
// Construct given VectorSpace
template<class Cmpt> template<class Cmpt>
template<class Cmpt2>
inline SphericalTensor<Cmpt>::SphericalTensor inline SphericalTensor<Cmpt>::SphericalTensor
( (
const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>& vs const VectorSpace<SphericalTensor<Cmpt2>, Cmpt2, 1>& vs
) )
: :
VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>(vs) VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>(vs)
{} {}
// Construct given three Cmpts
template<class Cmpt> template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor(const Cmpt& stii) inline SphericalTensor<Cmpt>::SphericalTensor(const Cmpt& stii)
{ {
@ -57,7 +55,6 @@ inline SphericalTensor<Cmpt>::SphericalTensor(const Cmpt& stii)
} }
// Construct from Istream
template<class Cmpt> template<class Cmpt>
inline SphericalTensor<Cmpt>::SphericalTensor(Istream& is) inline SphericalTensor<Cmpt>::SphericalTensor(Istream& is)
: :

View File

@ -91,8 +91,9 @@ public:
//- Construct null //- Construct null
inline SymmTensor(); inline SymmTensor();
//- Construct given VectorSpace //- Construct given VectorSpace of the same rank
inline SymmTensor(const VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>&); template<class Cmpt2>
inline SymmTensor(const VectorSpace<SymmTensor<Cmpt2>, Cmpt2, 6>&);
//- Construct given SphericalTensor //- Construct given SphericalTensor
inline SymmTensor(const SphericalTensor<Cmpt>&); inline SymmTensor(const SphericalTensor<Cmpt>&);

View File

@ -39,9 +39,10 @@ inline SymmTensor<Cmpt>::SymmTensor()
template<class Cmpt> template<class Cmpt>
template<class Cmpt2>
inline SymmTensor<Cmpt>::SymmTensor inline SymmTensor<Cmpt>::SymmTensor
( (
const VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>& vs const VectorSpace<SymmTensor<Cmpt2>, Cmpt2, 6>& vs
) )
: :
VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>(vs) VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>(vs)

View File

@ -94,8 +94,9 @@ public:
//- Construct null //- Construct null
inline Tensor(); inline Tensor();
//- Construct given VectorSpace //- Construct given VectorSpace of the same rank
inline Tensor(const VectorSpace<Tensor<Cmpt>, Cmpt, 9>&); template<class Cmpt2>
inline Tensor(const VectorSpace<Tensor<Cmpt2>, Cmpt2, 9>&);
//- Construct given SphericalTensor //- Construct given SphericalTensor
inline Tensor(const SphericalTensor<Cmpt>&); inline Tensor(const SphericalTensor<Cmpt>&);

View File

@ -32,21 +32,19 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct null
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor() inline Tensor<Cmpt>::Tensor()
{} {}
//- Construct given VectorSpace
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor(const VectorSpace<Tensor<Cmpt>, Cmpt, 9>& vs) template<class Cmpt2>
inline Tensor<Cmpt>::Tensor(const VectorSpace<Tensor<Cmpt2>, Cmpt2, 9>& vs)
: :
VectorSpace<Tensor<Cmpt>, Cmpt, 9>(vs) VectorSpace<Tensor<Cmpt>, Cmpt, 9>(vs)
{} {}
//- Construct given SphericalTensor
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor(const SphericalTensor<Cmpt>& st) inline Tensor<Cmpt>::Tensor(const SphericalTensor<Cmpt>& st)
{ {
@ -56,7 +54,6 @@ inline Tensor<Cmpt>::Tensor(const SphericalTensor<Cmpt>& st)
} }
//- Construct given SymmTensor
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st) inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st)
{ {
@ -66,7 +63,6 @@ inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st)
} }
//- Construct given triad
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor(const Vector<Vector<Cmpt> >& tr) inline Tensor<Cmpt>::Tensor(const Vector<Vector<Cmpt> >& tr)
{ {
@ -84,7 +80,6 @@ inline Tensor<Cmpt>::Tensor(const Vector<Vector<Cmpt> >& tr)
} }
//- Construct given the three vector components
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor inline Tensor<Cmpt>::Tensor
( (
@ -99,7 +94,6 @@ inline Tensor<Cmpt>::Tensor
} }
//- Construct from components
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor inline Tensor<Cmpt>::Tensor
( (
@ -114,7 +108,6 @@ inline Tensor<Cmpt>::Tensor
} }
//- Construct from Istream
template<class Cmpt> template<class Cmpt>
inline Tensor<Cmpt>::Tensor(Istream& is) inline Tensor<Cmpt>::Tensor(Istream& is)
: :

View File

@ -93,8 +93,9 @@ public:
//- Construct null //- Construct null
inline Vector(); inline Vector();
//- Construct given VectorSpace //- Construct given VectorSpace of the same rank
inline Vector(const VectorSpace<Vector<Cmpt>, Cmpt, 3>&); template<class Cmpt2>
inline Vector(const VectorSpace<Vector<Cmpt2>, Cmpt2, 3>&);
//- Construct given three components //- Construct given three components
inline Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz); inline Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz);

View File

@ -30,21 +30,19 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template<class Cmpt> template<class Cmpt>
inline Vector<Cmpt>::Vector() inline Vector<Cmpt>::Vector()
{} {}
// Construct given VectorSpace
template<class Cmpt> template<class Cmpt>
inline Vector<Cmpt>::Vector(const VectorSpace<Vector<Cmpt>, Cmpt, 3>& vs) template<class Cmpt2>
inline Vector<Cmpt>::Vector(const VectorSpace<Vector<Cmpt2>, Cmpt2, 3>& vs)
: :
VectorSpace<Vector<Cmpt>, Cmpt, 3>(vs) VectorSpace<Vector<Cmpt>, Cmpt, 3>(vs)
{} {}
// Construct given three Cmpts
template<class Cmpt> template<class Cmpt>
inline Vector<Cmpt>::Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz) inline Vector<Cmpt>::Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz)
{ {
@ -54,7 +52,6 @@ inline Vector<Cmpt>::Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz)
} }
// Construct from Istream
template<class Cmpt> template<class Cmpt>
inline Vector<Cmpt>::Vector(Istream& is) inline Vector<Cmpt>::Vector(Istream& is)
: :

View File

@ -107,6 +107,10 @@ public:
//- Construct as copy //- Construct as copy
inline VectorSpace(const VectorSpace<Form, Cmpt, nCmpt>&); inline VectorSpace(const VectorSpace<Form, Cmpt, nCmpt>&);
//- Construct as copy of another VectorSpace type of the same rank
template<class Form2, class Cmpt2>
inline VectorSpace(const VectorSpace<Form2, Cmpt2, nCmpt>&);
// Member Functions // Member Functions

View File

@ -50,6 +50,17 @@ inline VectorSpace<Form, Cmpt, nCmpt>::VectorSpace
} }
template<class Form, class Cmpt, int nCmpt>
template<class Form2, class Cmpt2>
inline VectorSpace<Form, Cmpt, nCmpt>::VectorSpace
(
const VectorSpace<Form2, Cmpt2, nCmpt>& vs
)
{
VectorSpaceOps<nCmpt,0>::eqOp(*this, vs, eqOp<Cmpt>());
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Form, class Cmpt, int nCmpt> template<class Form, class Cmpt, int nCmpt>

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "extendedCellToCellStencil.H" #include "extendedCellToCellStencil.H"
#include "extendedCellToFaceStencil.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -52,7 +53,7 @@ Foam::tmp
// Collect internal and boundary values // Collect internal and boundary values
List<List<Type> > stencilFld; List<List<Type> > stencilFld;
collectData(map, stencil, fld, stencilFld); extendedCellToFaceStencil::collectData(map, stencil, fld, stencilFld);
tmp<WeightedFieldType> twf tmp<WeightedFieldType> twf
( (
@ -65,11 +66,11 @@ Foam::tmp
mesh mesh
), ),
mesh, mesh,
dimensioned<Type> dimensioned<WeightedType>
( (
fld.name(), fld.name(),
fld.dimensions(), fld.dimensions(),
pTraits<Type>::zero pTraits<WeightedType>::zero
) )
) )
); );

View File

@ -131,7 +131,7 @@ public:
const List<List<WeightType> >& stencilWeights const List<List<WeightType> >& stencilWeights
) const ) const
{ {
return weightedSum return extendedCellToCellStencil::weightedSum
( (
map(), map(),
stencil(), stencil(),