mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: declare generated methods for vector-space, primitives
- make read construct from Istream explicit BUG: sph(const SymmTensor2D<Cmpt>&) - had incorrect constant, but the 2D routines still need more attention (#1575)
This commit is contained in:
committed by
Andrew Heather
parent
6953760460
commit
4ecc6ccfca
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -73,7 +74,7 @@ class pTraits<List<T>>
|
|||||||
public:
|
public:
|
||||||
typedef label cmptType;
|
typedef label cmptType;
|
||||||
|
|
||||||
pTraits(Istream& is)
|
explicit pTraits(Istream& is)
|
||||||
:
|
:
|
||||||
List<T>(is)
|
List<T>(is)
|
||||||
{}
|
{}
|
||||||
@ -87,7 +88,7 @@ class pTraits<UList<T>>
|
|||||||
public:
|
public:
|
||||||
typedef label cmptType;
|
typedef label cmptType;
|
||||||
|
|
||||||
pTraits(Istream& is)
|
explicit pTraits(Istream& is)
|
||||||
:
|
:
|
||||||
UList<T>(is)
|
UList<T>(is)
|
||||||
{}
|
{}
|
||||||
@ -101,7 +102,7 @@ class pTraits<Field<T>>
|
|||||||
public:
|
public:
|
||||||
typedef label cmptType;
|
typedef label cmptType;
|
||||||
|
|
||||||
pTraits(Istream& is)
|
explicit pTraits(Istream& is)
|
||||||
:
|
:
|
||||||
Field<T>(is)
|
Field<T>(is)
|
||||||
{}
|
{}
|
||||||
@ -115,7 +116,7 @@ class pTraits<face>
|
|||||||
public:
|
public:
|
||||||
typedef label cmptType;
|
typedef label cmptType;
|
||||||
|
|
||||||
pTraits(Istream& is)
|
explicit pTraits(Istream& is)
|
||||||
:
|
:
|
||||||
face(is)
|
face(is)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016-2017 OpenFOAM Foundation
|
Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,11 +58,13 @@ class Barycentric
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Barycentric<label> labelType;
|
typedef Barycentric<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Barycentric is 1
|
//- Rank of Barycentric is 1
|
||||||
static constexpr direction rank = 1;
|
static constexpr direction rank = 1;
|
||||||
@ -72,15 +74,18 @@ public:
|
|||||||
enum components { A, B, C, D };
|
enum components { A, B, C, D };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Barycentric();
|
Barycentric() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Barycentric(const Foam::zero);
|
inline Barycentric(const Foam::zero);
|
||||||
|
|
||||||
//- Construct given four components
|
//- Construct from components
|
||||||
inline Barycentric
|
inline Barycentric
|
||||||
(
|
(
|
||||||
const Cmpt& va,
|
const Cmpt& va,
|
||||||
|
|||||||
@ -27,11 +27,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Barycentric<Cmpt>::Barycentric()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Barycentric<Cmpt>::Barycentric(const Foam::zero)
|
inline Foam::Barycentric<Cmpt>::Barycentric(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenFOAM Foundation
|
Copyright (C) 2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -61,11 +61,13 @@ class BarycentricTensor
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Tensor<label> labelType;
|
typedef Tensor<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of BarycentricTensor is 2
|
//- Rank of BarycentricTensor is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
@ -75,16 +77,19 @@ public:
|
|||||||
enum components { XA, XB, XC, XD, YA, YB, YC, YD, ZA, ZB, ZC, ZD };
|
enum components { XA, XB, XC, XD, YA, YB, YC, YD, ZA, ZB, ZC, ZD };
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
BarycentricTensor() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
BarycentricTensor();
|
|
||||||
|
|
||||||
//- Construct initialised to zero
|
//- Construct initialised to zero
|
||||||
BarycentricTensor(const Foam::zero);
|
inline BarycentricTensor(const Foam::zero);
|
||||||
|
|
||||||
//- Construct given three barycentric components (rows)
|
//- Construct given three barycentric components (rows)
|
||||||
BarycentricTensor
|
inline BarycentricTensor
|
||||||
(
|
(
|
||||||
const Barycentric<Cmpt>& x,
|
const Barycentric<Cmpt>& x,
|
||||||
const Barycentric<Cmpt>& y,
|
const Barycentric<Cmpt>& y,
|
||||||
@ -92,7 +97,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct given four vector components (columns)
|
//- Construct given four vector components (columns)
|
||||||
BarycentricTensor
|
inline BarycentricTensor
|
||||||
(
|
(
|
||||||
const Vector<Cmpt>& a,
|
const Vector<Cmpt>& a,
|
||||||
const Vector<Cmpt>& b,
|
const Vector<Cmpt>& b,
|
||||||
|
|||||||
@ -27,11 +27,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::BarycentricTensor<Cmpt>::BarycentricTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::BarycentricTensor<Cmpt>::BarycentricTensor(const Foam::zero)
|
inline Foam::BarycentricTensor<Cmpt>::BarycentricTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenFOAM Foundation
|
Copyright (C) 2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,7 +31,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::barycentric barycentric01
|
static inline Foam::barycentric barycentric01Impl
|
||||||
(
|
(
|
||||||
Foam::scalar s,
|
Foam::scalar s,
|
||||||
Foam::scalar t,
|
Foam::scalar t,
|
||||||
@ -71,13 +72,11 @@ Foam::barycentric barycentric01
|
|||||||
|
|
||||||
Foam::barycentric Foam::barycentric01(Random& rndGen)
|
Foam::barycentric Foam::barycentric01(Random& rndGen)
|
||||||
{
|
{
|
||||||
return
|
const scalar s(rndGen.sample01<scalar>());
|
||||||
::barycentric01
|
const scalar t(rndGen.sample01<scalar>());
|
||||||
(
|
const scalar u(rndGen.sample01<scalar>());
|
||||||
rndGen.sample01<scalar>(),
|
|
||||||
rndGen.sample01<scalar>(),
|
return barycentric01Impl(s, t, u);
|
||||||
rndGen.sample01<scalar>()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenFOAM Foundation
|
Copyright (C) 2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,11 +58,13 @@ class Barycentric2D
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Barycentric2D<label> labelType;
|
typedef Barycentric2D<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Barycentric2D is 1
|
//- Rank of Barycentric2D is 1
|
||||||
static constexpr direction rank = 1;
|
static constexpr direction rank = 1;
|
||||||
@ -72,15 +74,18 @@ public:
|
|||||||
enum components { A, B, C };
|
enum components { A, B, C };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods: copy construct/assignment
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Barycentric2D();
|
Barycentric2D() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Barycentric2D(const Foam::zero);
|
inline Barycentric2D(const Foam::zero);
|
||||||
|
|
||||||
//- Construct given four components
|
//- Construct from components
|
||||||
inline Barycentric2D
|
inline Barycentric2D
|
||||||
(
|
(
|
||||||
const Cmpt& va,
|
const Cmpt& va,
|
||||||
@ -109,7 +114,6 @@ public:
|
|||||||
|
|
||||||
//- True if any coordinates are negative
|
//- True if any coordinates are negative
|
||||||
inline bool outside() const;
|
inline bool outside() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Barycentric2D<Cmpt>::Barycentric2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Barycentric2D<Cmpt>::Barycentric2D(const Foam::zero)
|
inline Foam::Barycentric2D<Cmpt>::Barycentric2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenFOAM Foundation
|
Copyright (C) 2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,7 +31,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::barycentric2D barycentric2D01
|
static inline Foam::barycentric2D barycentric2D01Impl
|
||||||
(
|
(
|
||||||
Foam::scalar s,
|
Foam::scalar s,
|
||||||
Foam::scalar t
|
Foam::scalar t
|
||||||
@ -53,12 +54,10 @@ Foam::barycentric2D barycentric2D01
|
|||||||
|
|
||||||
Foam::barycentric2D Foam::barycentric2D01(Random& rndGen)
|
Foam::barycentric2D Foam::barycentric2D01(Random& rndGen)
|
||||||
{
|
{
|
||||||
return
|
const scalar s(rndGen.sample01<scalar>());
|
||||||
::barycentric2D01
|
const scalar t(rndGen.sample01<scalar>());
|
||||||
(
|
|
||||||
rndGen.sample01<scalar>(),
|
return barycentric2D01Impl(s, t);
|
||||||
rndGen.sample01<scalar>()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,14 +58,15 @@ class DiagTensor
|
|||||||
:
|
:
|
||||||
public VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>
|
public VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef DiagTensor<label> labelType;
|
typedef DiagTensor<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of DiagTensor is 2
|
//- Rank of DiagTensor is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
@ -75,10 +76,19 @@ public:
|
|||||||
enum components { XX, YY, ZZ };
|
enum components { XX, YY, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline DiagTensor();
|
DiagTensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
DiagTensor(const DiagTensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
DiagTensor& operator=(const DiagTensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline DiagTensor(const Foam::zero);
|
inline DiagTensor(const Foam::zero);
|
||||||
@ -91,7 +101,7 @@ public:
|
|||||||
inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz);
|
inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline DiagTensor(Istream&);
|
inline explicit DiagTensor(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::DiagTensor<Cmpt>::DiagTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::DiagTensor<Cmpt>::DiagTensor(const Foam::zero)
|
inline Foam::DiagTensor<Cmpt>::DiagTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
@ -289,7 +284,10 @@ inline Cmpt tr(const DiagTensor<Cmpt>& dt)
|
|||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline SphericalTensor<Cmpt> sph(const DiagTensor<Cmpt>& dt)
|
inline SphericalTensor<Cmpt> sph(const DiagTensor<Cmpt>& dt)
|
||||||
{
|
{
|
||||||
return 0.5*tr(dt);
|
return SphericalTensor<Cmpt>
|
||||||
|
(
|
||||||
|
1.0/3.0*tr(dt)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenFOAM Foundation
|
Copyright (C) 2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -60,34 +60,35 @@ class MatrixSpace
|
|||||||
:
|
:
|
||||||
public VectorSpace<Form, Cmpt, Mrows*Ncols>
|
public VectorSpace<Form, Cmpt, Mrows*Ncols>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- MatrixSpace type
|
//- MatrixSpace type
|
||||||
typedef MatrixSpace<Form, Cmpt, Mrows, Ncols> msType;
|
typedef MatrixSpace<Form, Cmpt, Mrows, Ncols> msType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
static constexpr direction mRows = Mrows;
|
static constexpr direction mRows = Mrows;
|
||||||
static constexpr direction nCols = Ncols;
|
static constexpr direction nCols = Ncols;
|
||||||
|
|
||||||
|
|
||||||
// Static member functions
|
// Static Member Functions
|
||||||
|
|
||||||
//- Return the number of rows
|
//- The number of rows
|
||||||
static direction m() noexcept
|
static direction m() noexcept
|
||||||
{
|
{
|
||||||
return Mrows;
|
return Mrows;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the number of columns
|
//- The number of columns
|
||||||
static direction n() noexcept
|
static direction n() noexcept
|
||||||
{
|
{
|
||||||
return Ncols;
|
return Ncols;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the identity matrix for square matrix spaces
|
//- An identity matrix for square matrix-spaces
|
||||||
inline static msType identity();
|
inline static msType identity();
|
||||||
|
|
||||||
|
|
||||||
@ -149,13 +150,13 @@ public:
|
|||||||
static const direction mRows = SubTensor::mRows;
|
static const direction mRows = SubTensor::mRows;
|
||||||
static const direction nCols = SubTensor::nCols;
|
static const direction nCols = SubTensor::nCols;
|
||||||
|
|
||||||
//- Return the number of rows in the block
|
//- The number of rows in the block
|
||||||
static direction m()
|
static direction m()
|
||||||
{
|
{
|
||||||
return mRows;
|
return mRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the number of columns in the block
|
//- The number of columns in the block
|
||||||
static direction n()
|
static direction n()
|
||||||
{
|
{
|
||||||
return nCols;
|
return nCols;
|
||||||
@ -199,10 +200,13 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline MatrixSpace();
|
MatrixSpace() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline MatrixSpace(const Foam::zero);
|
inline MatrixSpace(const Foam::zero);
|
||||||
@ -227,7 +231,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
MatrixSpace(Istream&);
|
explicit MatrixSpace(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -29,11 +29,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
|
|
||||||
inline Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::MatrixSpace()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
|
template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
|
||||||
inline Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::MatrixSpace
|
inline Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::MatrixSpace
|
||||||
(
|
(
|
||||||
|
|||||||
@ -70,6 +70,8 @@ class pTraits<Scalar>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef Scalar cmptType;
|
typedef Scalar cmptType;
|
||||||
|
|
||||||
@ -80,8 +82,7 @@ public:
|
|||||||
typedef label labelType;
|
typedef label labelType;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Constants
|
||||||
// Member constants
|
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -93,7 +94,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -108,11 +109,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from primitive
|
//- Copy construct from primitive
|
||||||
explicit pTraits(const Scalar& val);
|
explicit pTraits(const Scalar& val);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,20 +57,21 @@ class SphericalTensor
|
|||||||
:
|
:
|
||||||
public VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>
|
public VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef SphericalTensor<label> labelType;
|
typedef SphericalTensor<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of SphericalTensor is 2
|
//- Rank of SphericalTensor is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const SphericalTensor I;
|
static const SphericalTensor I;
|
||||||
static const SphericalTensor oneThirdI;
|
static const SphericalTensor oneThirdI;
|
||||||
@ -81,10 +82,19 @@ public:
|
|||||||
enum components { II };
|
enum components { II };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SphericalTensor();
|
SphericalTensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SphericalTensor(const SphericalTensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SphericalTensor& operator=(const SphericalTensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SphericalTensor(const Foam::zero);
|
inline SphericalTensor(const Foam::zero);
|
||||||
@ -97,10 +107,10 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct given the component
|
//- Construct given the component
|
||||||
inline SphericalTensor(const Cmpt& tii);
|
inline explicit SphericalTensor(const Cmpt& tii);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline SphericalTensor(Istream&);
|
inline explicit SphericalTensor(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -111,7 +121,7 @@ public:
|
|||||||
inline Cmpt& ii();
|
inline Cmpt& ii();
|
||||||
|
|
||||||
|
|
||||||
//- Transpose
|
//- Transpose (no-op)
|
||||||
inline const SphericalTensor<Cmpt>& T() const;
|
inline const SphericalTensor<Cmpt>& T() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -29,11 +29,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SphericalTensor<Cmpt>::SphericalTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SphericalTensor<Cmpt>::SphericalTensor(const Foam::zero)
|
inline Foam::SphericalTensor<Cmpt>::SphericalTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,16 +57,21 @@ class SphericalTensor2D
|
|||||||
:
|
:
|
||||||
public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>
|
public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Member constants
|
// Typedefs
|
||||||
|
|
||||||
|
//- Equivalent type of labels used for valid component indexing
|
||||||
|
typedef SphericalTensor2D<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of SphericalTensor2D is 2
|
//- Rank of SphericalTensor2D is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const SphericalTensor2D I;
|
static const SphericalTensor2D I;
|
||||||
static const SphericalTensor2D oneThirdI;
|
static const SphericalTensor2D oneThirdI;
|
||||||
@ -77,10 +82,19 @@ public:
|
|||||||
enum components { II };
|
enum components { II };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SphericalTensor2D();
|
SphericalTensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SphericalTensor2D(const SphericalTensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SphericalTensor2D& operator=(const SphericalTensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SphericalTensor2D(const Foam::zero);
|
inline SphericalTensor2D(const Foam::zero);
|
||||||
@ -92,10 +106,10 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct given the component
|
//- Construct given the component
|
||||||
inline SphericalTensor2D(const Cmpt& tii);
|
inline explicit SphericalTensor2D(const Cmpt& tii);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline SphericalTensor2D(Istream&);
|
inline explicit SphericalTensor2D(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -29,11 +29,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SphericalTensor2D<Cmpt>::SphericalTensor2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SphericalTensor2D<Cmpt>::SphericalTensor2D(const Foam::zero)
|
inline Foam::SphericalTensor2D<Cmpt>::SphericalTensor2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,20 +59,21 @@ class SymmTensor
|
|||||||
:
|
:
|
||||||
public VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>
|
public VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef SymmTensor<label> labelType;
|
typedef SymmTensor<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of SymmTensor is 2
|
//- Rank of SymmTensor is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const SymmTensor I;
|
static const SymmTensor I;
|
||||||
|
|
||||||
@ -81,10 +82,19 @@ public:
|
|||||||
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor();
|
SymmTensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor& operator=(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor(const Foam::zero);
|
inline SymmTensor(const Foam::zero);
|
||||||
@ -105,7 +115,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline SymmTensor(Istream&);
|
inline explicit SymmTensor(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
@ -313,7 +308,10 @@ inline Cmpt tr(const SymmTensor<Cmpt>& st)
|
|||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline SphericalTensor<Cmpt> sph(const SymmTensor<Cmpt>& st)
|
inline SphericalTensor<Cmpt> sph(const SymmTensor<Cmpt>& st)
|
||||||
{
|
{
|
||||||
return (1.0/3.0)*tr(st);
|
return SphericalTensor<Cmpt>
|
||||||
|
(
|
||||||
|
(1.0/3.0)*tr(st)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,20 +59,21 @@ class SymmTensor2D
|
|||||||
:
|
:
|
||||||
public VectorSpace<SymmTensor2D<Cmpt>, Cmpt, 3>
|
public VectorSpace<SymmTensor2D<Cmpt>, Cmpt, 3>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef SymmTensor2D<label> labelType;
|
typedef SymmTensor2D<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of SymmTensor2D is 2
|
//- Rank of SymmTensor2D is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const SymmTensor2D I;
|
static const SymmTensor2D I;
|
||||||
|
|
||||||
@ -81,10 +82,19 @@ public:
|
|||||||
enum components { XX, XY, YY };
|
enum components { XX, XY, YY };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor2D();
|
SymmTensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor2D(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor2D& operator=(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor2D(const Foam::zero);
|
inline SymmTensor2D(const Foam::zero);
|
||||||
@ -103,7 +113,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline SymmTensor2D(Istream&);
|
inline explicit SymmTensor2D(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
@ -252,7 +247,10 @@ inline Cmpt tr(const SymmTensor2D<Cmpt>& st)
|
|||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline SphericalTensor2D<Cmpt> sph(const SymmTensor2D<Cmpt>& st)
|
inline SphericalTensor2D<Cmpt> sph(const SymmTensor2D<Cmpt>& st)
|
||||||
{
|
{
|
||||||
return (1.0/2.0)*tr(st);
|
return SphericalTensor2D<Cmpt>
|
||||||
|
(
|
||||||
|
0.5*tr(st)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -67,20 +67,21 @@ class Tensor
|
|||||||
:
|
:
|
||||||
public MatrixSpace<Tensor<Cmpt>, Cmpt, 3, 3>
|
public MatrixSpace<Tensor<Cmpt>, Cmpt, 3, 3>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Tensor<label> labelType;
|
typedef Tensor<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Tensor is 2
|
//- Rank of Tensor is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const Tensor I;
|
static const Tensor I;
|
||||||
|
|
||||||
@ -89,10 +90,19 @@ public:
|
|||||||
enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
|
enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Tensor();
|
Tensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Tensor(const Tensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Tensor& operator=(const Tensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Tensor(const Foam::zero);
|
inline Tensor(const Foam::zero);
|
||||||
@ -150,7 +160,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline Tensor(Istream& is);
|
inline explicit Tensor(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Tensor<Cmpt>::Tensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Tensor<Cmpt>::Tensor(const Foam::zero)
|
inline Foam::Tensor<Cmpt>::Tensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
@ -66,12 +61,10 @@ inline Foam::Tensor<Cmpt>::Tensor
|
|||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Tensor<Cmpt>::Tensor(const SphericalTensor<Cmpt>& st)
|
inline Foam::Tensor<Cmpt>::Tensor(const SphericalTensor<Cmpt>& st)
|
||||||
:
|
|
||||||
Tensor::msType(Zero)
|
|
||||||
{
|
{
|
||||||
this->v_[XX] = st.ii();
|
this->v_[XX] = st.ii(); this->v_[XY] = 0; this->v_[XZ] = 0;
|
||||||
this->v_[YY] = st.ii();
|
this->v_[YX] = 0; this->v_[YY] = st.ii(); this->v_[YZ] = 0;
|
||||||
this->v_[ZZ] = st.ii();
|
this->v_[ZX] = 0; this->v_[ZY] = 0; this->v_[ZZ] = st.ii();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -706,7 +699,10 @@ inline Cmpt tr(const Tensor<Cmpt>& t)
|
|||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline SphericalTensor<Cmpt> sph(const Tensor<Cmpt>& t)
|
inline SphericalTensor<Cmpt> sph(const Tensor<Cmpt>& t)
|
||||||
{
|
{
|
||||||
return (1.0/3.0)*tr(t);
|
return SphericalTensor<Cmpt>
|
||||||
|
(
|
||||||
|
(1.0/3.0)*tr(t)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -61,20 +61,21 @@ class Tensor2D
|
|||||||
:
|
:
|
||||||
public VectorSpace<Tensor2D<Cmpt>, Cmpt, 4>
|
public VectorSpace<Tensor2D<Cmpt>, Cmpt, 4>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Tensor2D<label> labelType;
|
typedef Tensor2D<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Tensor2D is 2
|
//- Rank of Tensor2D is 2
|
||||||
static constexpr direction rank = 2;
|
static constexpr direction rank = 2;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const Tensor2D I;
|
static const Tensor2D I;
|
||||||
|
|
||||||
@ -82,11 +83,18 @@ public:
|
|||||||
//- Component labeling enumeration
|
//- Component labeling enumeration
|
||||||
enum components { XX, XY, YX, YY };
|
enum components { XX, XY, YX, YY };
|
||||||
|
|
||||||
|
|
||||||
// Generated Methods
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
Tensor2D() = default;
|
Tensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Tensor2D(const Tensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Tensor2D& operator=(const Tensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -117,7 +125,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline Tensor2D(Istream&);
|
inline explicit Tensor2D(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -55,11 +55,9 @@ inline Foam::Tensor2D<Cmpt>::Tensor2D(const SymmTensor2D<Cmpt>& st)
|
|||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Tensor2D<Cmpt>::Tensor2D(const SphericalTensor2D<Cmpt>& st)
|
inline Foam::Tensor2D<Cmpt>::Tensor2D(const SphericalTensor2D<Cmpt>& st)
|
||||||
:
|
|
||||||
Tensor2D::vsType(Zero)
|
|
||||||
{
|
{
|
||||||
this->v_[XX] = st.ii();
|
this->v_[XX] = st.ii(); this->v_[XY] = 0;
|
||||||
this->v_[YY] = st.ii();
|
this->v_[YX] = 0; this->v_[YY] = st.ii();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -467,7 +465,10 @@ inline Cmpt tr(const Tensor2D<Cmpt>& t)
|
|||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline SphericalTensor2D<Cmpt> sph(const Tensor2D<Cmpt>& t)
|
inline SphericalTensor2D<Cmpt> sph(const Tensor2D<Cmpt>& t)
|
||||||
{
|
{
|
||||||
return 0.5*tr(t);
|
return SphericalTensor2D<Cmpt>
|
||||||
|
(
|
||||||
|
0.5*tr(t)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -64,14 +64,15 @@ class Vector
|
|||||||
:
|
:
|
||||||
public VectorSpace<Vector<Cmpt>, Cmpt, 3>
|
public VectorSpace<Vector<Cmpt>, Cmpt, 3>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Vector<label> labelType;
|
typedef Vector<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Vector is 1
|
//- Rank of Vector is 1
|
||||||
static constexpr direction rank = 1;
|
static constexpr direction rank = 1;
|
||||||
@ -81,10 +82,19 @@ public:
|
|||||||
enum components { X, Y, Z };
|
enum components { X, Y, Z };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Vector();
|
Vector() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Vector(const Vector&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Vector& operator=(const Vector&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Vector(const Foam::zero);
|
inline Vector(const Foam::zero);
|
||||||
@ -97,7 +107,7 @@ public:
|
|||||||
inline Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz);
|
inline Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline Vector(Istream& is);
|
inline explicit Vector(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -130,7 +140,6 @@ public:
|
|||||||
(
|
(
|
||||||
const Foam::List<Vector<Cmpt>>&
|
const Foam::List<Vector<Cmpt>>&
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Vector<Cmpt>::Vector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Vector<Cmpt>::Vector(const Foam::zero)
|
inline Foam::Vector<Cmpt>::Vector(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,14 +57,15 @@ class Vector2D
|
|||||||
:
|
:
|
||||||
public VectorSpace<Vector2D<Cmpt>, Cmpt, 2>
|
public VectorSpace<Vector2D<Cmpt>, Cmpt, 2>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Equivalent type of labels used for valid component indexing
|
//- Equivalent type of labels used for valid component indexing
|
||||||
typedef Vector2D<label> labelType;
|
typedef Vector2D<label> labelType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Rank of Vector2D is 1
|
//- Rank of Vector2D is 1
|
||||||
static constexpr direction rank = 1;
|
static constexpr direction rank = 1;
|
||||||
@ -74,10 +75,19 @@ public:
|
|||||||
enum components { X, Y };
|
enum components { X, Y };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Vector2D();
|
Vector2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Vector2D(const Vector2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Vector2D& operator=(const Vector2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Vector2D(const Foam::zero);
|
inline Vector2D(const Foam::zero);
|
||||||
@ -89,7 +99,7 @@ public:
|
|||||||
inline Vector2D(const Cmpt& vx, const Cmpt& vy);
|
inline Vector2D(const Cmpt& vx, const Cmpt& vy);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline Vector2D(Istream& is);
|
inline explicit Vector2D(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -113,7 +123,6 @@ public:
|
|||||||
|
|
||||||
//- Perp dot product (dot product with perpendicular vector)
|
//- Perp dot product (dot product with perpendicular vector)
|
||||||
inline scalar perp(const Vector2D<Cmpt>& b) const;
|
inline scalar perp(const Vector2D<Cmpt>& b) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Vector2D<Cmpt>::Vector2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Vector2D<Cmpt>::Vector2D(const Foam::zero)
|
inline Foam::Vector2D<Cmpt>::Vector2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -52,7 +52,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
|
|
||||||
template<class Form, class Cmpt, direction Ncmpts> class VectorSpace;
|
template<class Form, class Cmpt, direction Ncmpts> class VectorSpace;
|
||||||
|
|
||||||
@ -149,17 +149,17 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline VectorSpace();
|
VectorSpace() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline VectorSpace(const Foam::zero);
|
inline VectorSpace(const Foam::zero);
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
VectorSpace(Istream& is);
|
|
||||||
|
|
||||||
//- Copy construct
|
//- Copy construct
|
||||||
inline VectorSpace(const VectorSpace<Form, Cmpt, Ncmpts>& vs);
|
inline VectorSpace(const VectorSpace<Form, Cmpt, Ncmpts>& vs);
|
||||||
|
|
||||||
@ -167,11 +167,17 @@ public:
|
|||||||
template<class Form2, class Cmpt2>
|
template<class Form2, class Cmpt2>
|
||||||
inline explicit VectorSpace(const VectorSpace<Form2, Cmpt2, Ncmpts>&);
|
inline explicit VectorSpace(const VectorSpace<Form2, Cmpt2, Ncmpts>&);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
explicit VectorSpace(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the number of elements in the VectorSpace = Ncmpts.
|
//- The number of elements in the VectorSpace = Ncmpts.
|
||||||
inline static constexpr direction size();
|
static constexpr direction size() noexcept
|
||||||
|
{
|
||||||
|
return Ncmpts;
|
||||||
|
}
|
||||||
|
|
||||||
inline const Cmpt& component(const direction) const;
|
inline const Cmpt& component(const direction) const;
|
||||||
inline Cmpt& component(const direction);
|
inline Cmpt& component(const direction);
|
||||||
@ -255,7 +261,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of a VectorSpace
|
//- A word representation of a VectorSpace
|
||||||
template<class Form, class Cmpt, direction Ncmpts>
|
template<class Form, class Cmpt, direction Ncmpts>
|
||||||
|
|||||||
@ -32,14 +32,8 @@ License
|
|||||||
#include "ops.H"
|
#include "ops.H"
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
|
||||||
inline Foam::VectorSpace<Form, Cmpt, Ncmpts>::VectorSpace()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
||||||
inline Foam::VectorSpace<Form, Cmpt, Ncmpts>::VectorSpace(const Foam::zero)
|
inline Foam::VectorSpace<Form, Cmpt, Ncmpts>::VectorSpace(const Foam::zero)
|
||||||
{
|
{
|
||||||
@ -88,13 +82,6 @@ inline Foam::VectorSpace<Form, Cmpt, Ncmpts>::ConstBlock<SubVector, BStart>
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
|
||||||
inline constexpr Foam::direction Foam::VectorSpace<Form, Cmpt, Ncmpts>::size()
|
|
||||||
{
|
|
||||||
return Ncmpts;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
template<class Form, class Cmpt, Foam::direction Ncmpts>
|
||||||
inline const Cmpt& Foam::VectorSpace<Form, Cmpt, Ncmpts>::component
|
inline const Cmpt& Foam::VectorSpace<Form, Cmpt, Ncmpts>::component
|
||||||
(
|
(
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -43,11 +43,10 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Istream& operator>>(Istream& is, bool& b);
|
Istream& operator>>(Istream& is, bool& b);
|
||||||
Ostream& operator<<(Ostream& os, const bool b);
|
Ostream& operator<<(Ostream& os, const bool b);
|
||||||
|
|
||||||
@ -72,6 +71,8 @@ class pTraits<bool>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef bool cmptType;
|
typedef bool cmptType;
|
||||||
|
|
||||||
@ -79,7 +80,7 @@ public:
|
|||||||
typedef bool magType;
|
typedef bool magType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -91,7 +92,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -101,11 +102,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from primitive
|
//- Copy construct from primitive
|
||||||
explicit pTraits(const bool& p);
|
explicit pTraits(const bool& p);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2014 OpenFOAM Foundation
|
Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -90,14 +90,26 @@ class complex
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
complex(const complex&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
complex& operator=(const complex&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
complex(complex&&) = default;
|
||||||
|
|
||||||
|
//- Move assignment
|
||||||
|
complex& operator=(complex&&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null as zero-initialized
|
//- Default construct, as zero-initialized
|
||||||
inline constexpr complex() noexcept;
|
inline constexpr complex() noexcept;
|
||||||
|
|
||||||
//- Default copy constructor
|
|
||||||
complex(const complex&) = default;
|
|
||||||
|
|
||||||
//- Construct zero-initialized from zero class
|
//- Construct zero-initialized from zero class
|
||||||
inline constexpr complex(const Foam::zero) noexcept;
|
inline constexpr complex(const Foam::zero) noexcept;
|
||||||
|
|
||||||
@ -173,9 +185,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Copy assignment
|
|
||||||
inline void operator=(const complex& c);
|
|
||||||
|
|
||||||
//- Assign zero
|
//- Assign zero
|
||||||
inline void operator=(const Foam::zero);
|
inline void operator=(const Foam::zero);
|
||||||
|
|
||||||
@ -250,6 +259,8 @@ class pTraits<complex>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef complex cmptType;
|
typedef complex cmptType;
|
||||||
|
|
||||||
@ -287,11 +298,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from primitive
|
//- Copy construct from primitive
|
||||||
explicit pTraits(const complex& val);
|
explicit pTraits(const complex& val);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -116,13 +116,6 @@ inline Foam::complex Foam::complex::conjugate() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::complex::operator=(const complex& c)
|
|
||||||
{
|
|
||||||
re = c.re;
|
|
||||||
im = c.im;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::complex::operator=(const Foam::zero)
|
inline void Foam::complex::operator=(const Foam::zero)
|
||||||
{
|
{
|
||||||
re = 0;
|
re = 0;
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +52,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
|
|
||||||
class vectorTensorTransform;
|
class vectorTensorTransform;
|
||||||
Istream& operator>>(Istream& is, vectorTensorTransform&);
|
Istream& operator>>(Istream& is, vectorTensorTransform&);
|
||||||
Ostream& operator<<(Ostream& os, const vectorTensorTransform& C);
|
Ostream& operator<<(Ostream& os, const vectorTensorTransform& C);
|
||||||
@ -63,7 +63,7 @@ Ostream& operator<<(Ostream& os, const vectorTensorTransform& C);
|
|||||||
|
|
||||||
class vectorTensorTransform
|
class vectorTensorTransform
|
||||||
{
|
{
|
||||||
// private data
|
// Private Data
|
||||||
|
|
||||||
//- Translation vector
|
//- Translation vector
|
||||||
vector t_;
|
vector t_;
|
||||||
@ -79,7 +79,7 @@ class vectorTensorTransform
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Static data members
|
// Static Data
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
|
|
||||||
@ -88,13 +88,30 @@ public:
|
|||||||
static const vectorTensorTransform I;
|
static const vectorTensorTransform I;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
vectorTensorTransform(const vectorTensorTransform&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
vectorTensorTransform&
|
||||||
|
operator=(const vectorTensorTransform&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
vectorTensorTransform(vectorTensorTransform&&) = default;
|
||||||
|
|
||||||
|
//- Move assignment
|
||||||
|
vectorTensorTransform&
|
||||||
|
operator=(vectorTensorTransform&&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct - no translation, identity rotation.
|
||||||
inline vectorTensorTransform();
|
inline vectorTensorTransform();
|
||||||
|
|
||||||
//- Construct given a translation vector, rotation tensor and
|
//- Construct given a translation vector, rotation tensor and
|
||||||
// hasR bool
|
//- hasR bool
|
||||||
inline vectorTensorTransform
|
inline vectorTensorTransform
|
||||||
(
|
(
|
||||||
const vector& t,
|
const vector& t,
|
||||||
@ -103,18 +120,18 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct a pure translation vectorTensorTransform given a
|
//- Construct a pure translation vectorTensorTransform given a
|
||||||
// translation vector
|
//- translation vector
|
||||||
inline explicit vectorTensorTransform(const vector& t);
|
inline explicit vectorTensorTransform(const vector& t);
|
||||||
|
|
||||||
//- Construct a pure rotation vectorTensorTransform given a
|
//- Construct a pure rotation vectorTensorTransform given a
|
||||||
// rotation tensor
|
//- rotation tensor
|
||||||
inline explicit vectorTensorTransform(const tensor& R);
|
inline explicit vectorTensorTransform(const tensor& R);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
vectorTensorTransform(Istream&);
|
explicit vectorTensorTransform(Istream&);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
@ -151,11 +168,11 @@ public:
|
|||||||
tmp<Field<Type>> transform(const Field<Type>&) const;
|
tmp<Field<Type>> transform(const Field<Type>&) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const vectorTensorTransform&);
|
|
||||||
inline void operator&=(const vectorTensorTransform&);
|
inline void operator&=(const vectorTensorTransform&);
|
||||||
|
|
||||||
|
//- Assign translation
|
||||||
inline void operator=(const vector&);
|
inline void operator=(const vector&);
|
||||||
inline void operator+=(const vector&);
|
inline void operator+=(const vector&);
|
||||||
inline void operator-=(const vector&);
|
inline void operator-=(const vector&);
|
||||||
@ -164,7 +181,7 @@ public:
|
|||||||
inline void operator&=(const tensor&);
|
inline void operator&=(const tensor&);
|
||||||
|
|
||||||
|
|
||||||
// IOstream operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Istream& operator>>(Istream& is, vectorTensorTransform&);
|
friend Istream& operator>>(Istream& is, vectorTensorTransform&);
|
||||||
|
|
||||||
|
|||||||
@ -173,17 +173,6 @@ inline Foam::pointField Foam::vectorTensorTransform::invTransformPosition
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::vectorTensorTransform::operator=
|
|
||||||
(
|
|
||||||
const vectorTensorTransform& tr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
t_ = tr.t_;
|
|
||||||
R_ = tr.R_;
|
|
||||||
hasR_ = tr.hasR_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::vectorTensorTransform::operator&=
|
inline void Foam::vectorTensorTransform::operator&=
|
||||||
(
|
(
|
||||||
const vectorTensorTransform& tr
|
const vectorTensorTransform& tr
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2014-2016 OpenFOAM Foundation
|
Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -47,7 +47,6 @@ SourceFiles
|
|||||||
#include "pTraits.H"
|
#include "pTraits.H"
|
||||||
#include "direction.H"
|
#include "direction.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -139,6 +138,8 @@ class pTraits<int32_t>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef int32_t cmptType;
|
typedef int32_t cmptType;
|
||||||
|
|
||||||
@ -146,7 +147,7 @@ public:
|
|||||||
typedef int32_t magType;
|
typedef int32_t magType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -158,7 +159,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -176,7 +177,7 @@ public:
|
|||||||
explicit pTraits(const int32_t& val);
|
explicit pTraits(const int32_t& val);
|
||||||
|
|
||||||
//- Read construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2014-2016 OpenFOAM Foundation
|
Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -137,6 +137,8 @@ class pTraits<int64_t>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef int64_t cmptType;
|
typedef int64_t cmptType;
|
||||||
|
|
||||||
@ -144,7 +146,7 @@ public:
|
|||||||
typedef int64_t magType;
|
typedef int64_t magType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -156,7 +158,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -174,7 +176,7 @@ public:
|
|||||||
explicit pTraits(const int64_t& val);
|
explicit pTraits(const int64_t& val);
|
||||||
|
|
||||||
//- Read construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2014-2016 OpenFOAM Foundation
|
Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -127,11 +127,13 @@ class pTraits<uint32_t>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef uint32_t cmptType;
|
typedef uint32_t cmptType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -143,7 +145,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -161,7 +163,7 @@ public:
|
|||||||
explicit pTraits(const uint32_t& val);
|
explicit pTraits(const uint32_t& val);
|
||||||
|
|
||||||
//- Read construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2014-2016 OpenFOAM Foundation
|
Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -136,11 +136,13 @@ class pTraits<uint64_t>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
//- Component type
|
//- Component type
|
||||||
typedef uint64_t cmptType;
|
typedef uint64_t cmptType;
|
||||||
|
|
||||||
|
|
||||||
// Member constants
|
// Member Constants
|
||||||
|
|
||||||
//- Dimensionality of space
|
//- Dimensionality of space
|
||||||
static constexpr direction dim = 3;
|
static constexpr direction dim = 3;
|
||||||
@ -152,7 +154,7 @@ public:
|
|||||||
static constexpr direction nComponents = 1;
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static Data Members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
static const char* const componentNames[];
|
static const char* const componentNames[];
|
||||||
@ -170,7 +172,7 @@ public:
|
|||||||
explicit pTraits(const uint64_t& val);
|
explicit pTraits(const uint64_t& val);
|
||||||
|
|
||||||
//- Read construct from Istream
|
//- Read construct from Istream
|
||||||
pTraits(Istream& is);
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -43,6 +44,7 @@ Description
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
class Istream;
|
class Istream;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -54,19 +56,18 @@ class pTraits
|
|||||||
:
|
:
|
||||||
public PrimitiveType
|
public PrimitiveType
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from primitive
|
//- Copy construct from primitive
|
||||||
pTraits(const PrimitiveType& p)
|
explicit pTraits(const PrimitiveType& p)
|
||||||
:
|
:
|
||||||
PrimitiveType(p)
|
PrimitiveType(p)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
pTraits(Istream& is)
|
explicit pTraits(Istream& is)
|
||||||
:
|
:
|
||||||
PrimitiveType(is)
|
PrimitiveType(is)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -127,10 +127,25 @@ public:
|
|||||||
static const quaternion I;
|
static const quaternion I;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline quaternion();
|
quaternion() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
quaternion(const quaternion&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
quaternion& operator=(const quaternion&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
quaternion(quaternion&&) = default;
|
||||||
|
|
||||||
|
//- Move assignment
|
||||||
|
quaternion& operator=(quaternion&&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct zero initialized
|
//- Construct zero initialized
|
||||||
inline quaternion(const Foam::zero);
|
inline quaternion(const Foam::zero);
|
||||||
@ -222,16 +237,15 @@ public:
|
|||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const quaternion& q);
|
|
||||||
inline void operator+=(const quaternion& q);
|
inline void operator+=(const quaternion& q);
|
||||||
inline void operator-=(const quaternion& q);
|
inline void operator-=(const quaternion& q);
|
||||||
inline void operator*=(const quaternion& q);
|
inline void operator*=(const quaternion& q);
|
||||||
inline void operator/=(const quaternion& q);
|
inline void operator/=(const quaternion& q);
|
||||||
|
|
||||||
//- Change scalar portion
|
//- Change scalar portion only
|
||||||
inline void operator=(const scalar s);
|
inline void operator=(const scalar s);
|
||||||
|
|
||||||
//- Change vector portion
|
//- Change vector portion only
|
||||||
inline void operator=(const vector& v);
|
inline void operator=(const vector& v);
|
||||||
|
|
||||||
inline void operator*=(const scalar s);
|
inline void operator*=(const scalar s);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -28,13 +28,9 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::quaternion::quaternion()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::quaternion::quaternion(const Foam::zero)
|
inline Foam::quaternion::quaternion(const Foam::zero)
|
||||||
:
|
:
|
||||||
w_(Zero),
|
w_(0),
|
||||||
v_(Zero)
|
v_(Zero)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -585,12 +581,6 @@ inline Foam::vector Foam::quaternion::eulerAngles
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::quaternion::operator=(const quaternion& q)
|
|
||||||
{
|
|
||||||
w_ = q.w_;
|
|
||||||
v_ = q.v_;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Foam::quaternion::operator+=(const quaternion& q)
|
inline void Foam::quaternion::operator+=(const quaternion& q)
|
||||||
{
|
{
|
||||||
w_ += q.w_;
|
w_ += q.w_;
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -32,17 +33,15 @@ License
|
|||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const char* const Foam::septernion::typeName = "septernion";
|
const char* const Foam::septernion::typeName = "septernion";
|
||||||
const Foam::septernion Foam::septernion::zero
|
const Foam::septernion Foam::septernion::zero(Zero);
|
||||||
(
|
|
||||||
vector(0, 0, 0),
|
|
||||||
quaternion(0, vector(0, 0, 0))
|
|
||||||
);
|
|
||||||
const Foam::septernion Foam::septernion::I
|
const Foam::septernion Foam::septernion::I
|
||||||
(
|
(
|
||||||
vector(0, 0, 0),
|
vector(Zero),
|
||||||
quaternion(1, vector(0, 0, 0))
|
quaternion(scalar(1))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::septernion::septernion(Istream& is)
|
Foam::septernion::septernion(Istream& is)
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -77,7 +77,7 @@ class septernion
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Static data members
|
// Static Data
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
|
|
||||||
@ -85,10 +85,28 @@ public:
|
|||||||
static const septernion I;
|
static const septernion I;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
septernion() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
septernion(const septernion&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
septernion& operator=(const septernion&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
septernion(septernion&&) = default;
|
||||||
|
|
||||||
|
//- Move assignment
|
||||||
|
septernion& operator=(septernion&&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct zero initialized
|
||||||
inline septernion();
|
inline septernion(const Foam::zero);
|
||||||
|
|
||||||
//- Construct given a translation vector and rotation quaternion
|
//- Construct given a translation vector and rotation quaternion
|
||||||
inline septernion(const vector& t, const quaternion& r);
|
inline septernion(const vector& t, const quaternion& r);
|
||||||
@ -103,10 +121,10 @@ public:
|
|||||||
inline explicit septernion(const spatialTransform& st);
|
inline explicit septernion(const spatialTransform& st);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
septernion(Istream&);
|
explicit septernion(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
@ -129,9 +147,8 @@ public:
|
|||||||
inline vector invTransformPoint(const vector& v) const;
|
inline vector invTransformPoint(const vector& v) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const septernion&);
|
|
||||||
inline void operator*=(const septernion&);
|
inline void operator*=(const septernion&);
|
||||||
|
|
||||||
inline void operator=(const vector&);
|
inline void operator=(const vector&);
|
||||||
@ -146,7 +163,7 @@ public:
|
|||||||
inline void operator/=(const scalar);
|
inline void operator/=(const scalar);
|
||||||
|
|
||||||
|
|
||||||
// IOstream operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Istream& operator>>(Istream& is, septernion&);
|
friend Istream& operator>>(Istream& is, septernion&);
|
||||||
friend Ostream& operator<<(Ostream& os, const septernion& C);
|
friend Ostream& operator<<(Ostream& os, const septernion& C);
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,27 +28,34 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::septernion::septernion()
|
inline Foam::septernion::septernion(const Foam::zero)
|
||||||
|
:
|
||||||
|
t_(Zero),
|
||||||
|
r_(Zero)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::septernion::septernion(const vector& t, const quaternion& r)
|
inline Foam::septernion::septernion(const vector& t, const quaternion& r)
|
||||||
:
|
:
|
||||||
t_(t),
|
t_(t),
|
||||||
r_(r)
|
r_(r)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::septernion::septernion(const vector& t)
|
inline Foam::septernion::septernion(const vector& t)
|
||||||
:
|
:
|
||||||
t_(t),
|
t_(t),
|
||||||
r_(quaternion::I)
|
r_(quaternion::I)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::septernion::septernion(const quaternion& r)
|
inline Foam::septernion::septernion(const quaternion& r)
|
||||||
:
|
:
|
||||||
t_(Zero),
|
t_(Zero),
|
||||||
r_(r)
|
r_(r)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::septernion::septernion(const spatialTransform& st)
|
inline Foam::septernion::septernion(const spatialTransform& st)
|
||||||
:
|
:
|
||||||
t_(st.r()),
|
t_(st.r()),
|
||||||
@ -95,12 +103,6 @@ inline Foam::vector Foam::septernion::invTransformPoint(const vector& v) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::septernion::operator=(const septernion& tr)
|
|
||||||
{
|
|
||||||
t_ = tr.t_;
|
|
||||||
r_ = tr.r_;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator*=(const septernion& tr)
|
inline void Foam::septernion::operator*=(const septernion& tr)
|
||||||
{
|
{
|
||||||
t_ = tr.t() + tr.r().invTransform(t_);
|
t_ = tr.t() + tr.r().invTransform(t_);
|
||||||
@ -114,11 +116,13 @@ inline void Foam::septernion::operator=(const vector& t)
|
|||||||
r_ = quaternion::I;
|
r_ = quaternion::I;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator+=(const vector& t)
|
inline void Foam::septernion::operator+=(const vector& t)
|
||||||
{
|
{
|
||||||
t_ += t;
|
t_ += t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator-=(const vector& t)
|
inline void Foam::septernion::operator-=(const vector& t)
|
||||||
{
|
{
|
||||||
t_ -= t;
|
t_ -= t;
|
||||||
@ -131,12 +135,14 @@ inline void Foam::septernion::operator=(const quaternion& r)
|
|||||||
r_ = r;
|
r_ = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator*=(const quaternion& r)
|
inline void Foam::septernion::operator*=(const quaternion& r)
|
||||||
{
|
{
|
||||||
t_ = r.invTransform(t_);
|
t_ = r.invTransform(t_);
|
||||||
r_ *= r;
|
r_ *= r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator/=(const quaternion& r)
|
inline void Foam::septernion::operator/=(const quaternion& r)
|
||||||
{
|
{
|
||||||
t_ = r.transform(t_);
|
t_ = r.transform(t_);
|
||||||
|
|||||||
Reference in New Issue
Block a user