Merge branch 'comp-generated-methods' into 'develop'

Generated methods

See merge request Development/openfoam!335
This commit is contained in:
Andrew Heather
2020-01-30 12:39:48 +00:00
101 changed files with 878 additions and 1021 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -105,7 +105,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
template<unsigned Width> class PackedList; template<unsigned Width> class PackedList;
class labelRange; class labelRange;
@ -230,7 +230,7 @@ public:
// Constructors // Constructors
//- Null constructor //- Default construct, zero-sized and no allocation
inline constexpr PackedList() noexcept; inline constexpr PackedList() noexcept;
//- Construct for given number of elements, initializes values to 0 //- Construct for given number of elements, initializes values to 0
@ -451,6 +451,7 @@ public:
class reference class reference
{ {
protected: protected:
friend class PackedList; // Access for parent friend class PackedList; // Access for parent
void operator&() = delete; // Refuse to provide its address void operator&() = delete; // Refuse to provide its address
@ -472,10 +473,16 @@ public:
public: public:
//- Copy construct
reference(const reference&) = default;
//- Move construct
reference(reference&&) = default;
//- Value assignment //- Value assignment
inline void operator=(const reference& other); inline void operator=(const reference& other);
//- Value assignment. //- Value assignment
inline void operator=(const unsigned int val); inline void operator=(const unsigned int val);
//- Conversion operator. //- Conversion operator.

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
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.
@ -54,7 +54,7 @@ See also
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class bitSet; class bitSet;
class labelRange; class labelRange;
@ -131,13 +131,14 @@ public:
class const_iterator; class const_iterator;
typedef unsigned int const_reference; typedef unsigned int const_reference;
//- Define class name and debug
//- Declare type-name (with debug switch)
ClassName("bitSet"); ClassName("bitSet");
// Constructors // Constructors
//- Construct an empty, zero-sized set //- Default construct an empty, zero-sized set
inline bitSet() noexcept; inline bitSet() noexcept;
//- Construct from Istream //- Construct from Istream
@ -438,6 +439,7 @@ public:
public PackedList<1>::reference public PackedList<1>::reference
{ {
protected: protected:
friend class bitSet; // Access for parent friend class bitSet; // Access for parent
void operator&() = delete; // Refuse to provide its address void operator&() = delete; // Refuse to provide its address
@ -447,6 +449,12 @@ public:
public: public:
//- Copy construct
reference(const reference&) = default;
//- Move construct
reference(reference&&) = default;
//- Flip the bit at the position, no range-checking //- Flip the bit at the position, no range-checking
inline void flip(); inline void flip();
@ -474,7 +482,7 @@ public:
//- Global position of the current \a on bit //- Global position of the current \a on bit
label pos_; label pos_;
//- Construct null - an end iterator //- Default construct - an end iterator
inline const_iterator() noexcept; inline const_iterator() noexcept;
//- Construct begin iterator //- Construct begin iterator

View File

@ -206,7 +206,7 @@ public:
// Constructors // Constructors
//- Construct null with default (128) table capacity //- Default construct with default (128) table capacity
HashTable(); HashTable();
//- Construct given initial table capacity //- Construct given initial table capacity
@ -550,6 +550,7 @@ protected:
class Iterator class Iterator
{ {
public: public:
// Typedefs // Typedefs
using iterator_category = std::forward_iterator_tag; using iterator_category = std::forward_iterator_tag;
using difference_type = this_type::difference_type; using difference_type = this_type::difference_type;
@ -671,6 +672,7 @@ public:
public Iterator<false> public Iterator<false>
{ {
public: public:
// Typedefs // Typedefs
using iterator_category = std::forward_iterator_tag; using iterator_category = std::forward_iterator_tag;
using difference_type = this_type::difference_type; using difference_type = this_type::difference_type;
@ -684,8 +686,8 @@ public:
// Constructors // Constructors
//- Construct null (end iterator) //- Default construct (end iterator)
inline iterator() = default; iterator() = default;
//- Copy construct from similar access type //- Copy construct from similar access type
inline explicit iterator(const Iterator<false>& iter) inline explicit iterator(const Iterator<false>& iter)
@ -729,6 +731,7 @@ public:
public Iterator<true> public Iterator<true>
{ {
public: public:
// Typedefs // Typedefs
using iterator_category = std::forward_iterator_tag; using iterator_category = std::forward_iterator_tag;
using difference_type = this_type::difference_type; using difference_type = this_type::difference_type;
@ -741,8 +744,11 @@ public:
// Constructors // Constructors
//- Construct null (end iterator) //- Default construct (end iterator)
inline const_iterator() = default; const_iterator() = default;
//- Copy construct
const_iterator(const const_iterator&) = default;
//- Copy construct from similar access type //- Copy construct from similar access type
inline explicit const_iterator(const Iterator<true>& iter) inline explicit const_iterator(const Iterator<true>& iter)
@ -781,8 +787,10 @@ public:
inline const_iterator& operator++(); inline const_iterator& operator++();
inline const_iterator operator++(int); inline const_iterator operator++(int);
// Assignment // Assignment
//- Copy assignment
const_iterator& operator=(const const_iterator&) = default; const_iterator& operator=(const const_iterator&) = default;
// Allow assign from iterator to const_iterator // Allow assign from iterator to const_iterator
@ -805,6 +813,7 @@ public:
public Iter public Iter
{ {
public: public:
using value_type = this_type::key_type; using value_type = this_type::key_type;
using reference = const Key&; using reference = const Key&;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -72,7 +72,7 @@ public:
//- Pointer to next entry in list //- Pointer to next entry in list
link* next_ = nullptr; link* next_ = nullptr;
//- Null construct //- Default construct
link() = default; link() = default;
//- Check if the node is registered with the list //- Check if the node is registered with the list
@ -85,7 +85,7 @@ public:
private: private:
// Private Member Data // Private Data
//- Pointer to first element //- Pointer to first element
link *first_ = nullptr; link *first_ = nullptr;
@ -97,15 +97,6 @@ private:
label size_ = 0; label size_ = 0;
// Private Member Functions
//- No copy construct
DLListBase(const DLListBase&) = delete;
//- No copy assignment
void operator=(const DLListBase&) = delete;
protected: protected:
// Protected Member Functions // Protected Member Functions
@ -142,11 +133,16 @@ public:
friend class const_iterator; friend class const_iterator;
// Constructors // Generated Methods
//- Null construct //- Default construct
DLListBase() = default; DLListBase() = default;
//- No copy construct
DLListBase(const DLListBase&) = delete;
//- No copy assignment
void operator=(const DLListBase&) = delete;
//- Destructor //- Destructor
~DLListBase() = default; ~DLListBase() = default;
@ -233,6 +229,9 @@ public:
public: public:
//- Copy construct
iterator(const iterator&) = default;
//- Construct for a node on a list //- Construct for a node on a list
inline iterator(DLListBase* list, link* item); inline iterator(DLListBase* list, link* item);
@ -280,15 +279,15 @@ public:
public: public:
//- Copy construct
const_iterator(const const_iterator&) = default;
//- Construct for a node on a list //- Construct for a node on a list
inline const_iterator(const DLListBase* list, const link* item); inline const_iterator(const DLListBase* list, const link* item);
//- Copy construct from a non-const iterator //- Copy construct from a non-const iterator
inline const_iterator(const DLListBase::iterator& iter); inline const_iterator(const DLListBase::iterator& iter);
//- Copy construct
const_iterator(const const_iterator&) = default;
//- The storage node //- The storage node
inline const link* get_node() const; inline const link* get_node() const;
@ -308,6 +307,7 @@ public:
//- Move forward through list //- Move forward through list
inline void next(); inline void next();
//- Copy assignment
const_iterator& operator=(const const_iterator&) = default; const_iterator& operator=(const const_iterator&) = default;
inline bool operator==(const const_iterator&) const; inline bool operator==(const const_iterator&) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -69,14 +69,14 @@ public:
//- Pointer to next entry in list //- Pointer to next entry in list
link* next_ = nullptr; link* next_ = nullptr;
//- Null construct //- Default construct
link() = default; link() = default;
}; };
private: private:
// Private Member Data // Private Data
//- A pointer to the last element. //- A pointer to the last element.
// last_->next_ points to first element, i.e. circular storage // last_->next_ points to first element, i.e. circular storage
@ -86,15 +86,6 @@ private:
label size_ = 0; label size_ = 0;
// Private Member Functions
//- No copy construct
SLListBase(const SLListBase&) = delete;
//- No copy assignment
void operator=(const SLListBase&) = delete;
protected: protected:
// Protected Member Functions // Protected Member Functions
@ -130,11 +121,16 @@ public:
friend class const_iterator; friend class const_iterator;
// Constructors // Generated Methods
//- Null construct //- Default construct
SLListBase() = default; SLListBase() = default;
//- No copy construct
SLListBase(const SLListBase&) = delete;
//- No copy assignment
void operator=(const SLListBase&) = delete;
//- Destructor //- Destructor
~SLListBase() = default; ~SLListBase() = default;
@ -209,6 +205,9 @@ public:
public: public:
//- Copy construct
iterator(const iterator&) = default;
//- Construct for a node on the list //- Construct for a node on the list
inline iterator(SLListBase* list, link* item); inline iterator(SLListBase* list, link* item);
@ -231,6 +230,7 @@ public:
//- Move forward through list //- Move forward through list
inline void next(); inline void next();
//- Copy assignment
inline void operator=(const iterator& iter); inline void operator=(const iterator& iter);
inline bool operator==(const iterator& iter) const; inline bool operator==(const iterator& iter) const;
@ -254,15 +254,15 @@ public:
public: public:
//- Copy construct
const_iterator(const const_iterator&) = default;
//- Construct for a node on the list //- Construct for a node on the list
inline const_iterator(const SLListBase* list, const link* item); inline const_iterator(const SLListBase* list, const link* item);
//- Construct from a non-const iterator //- Construct from a non-const iterator
inline const_iterator(const SLListBase::iterator& iter); inline const_iterator(const SLListBase::iterator& iter);
//- Copy construct
const_iterator(const const_iterator&) = default;
//- The storage node //- The storage node
inline const link* get_node() const; inline const link* get_node() const;
@ -282,6 +282,7 @@ public:
//- Move forward through list //- Move forward through list
inline void next(); inline void next();
//- Copy assignment
const_iterator& operator=(const const_iterator&) = default; const_iterator& operator=(const const_iterator&) = default;
inline bool operator==(const const_iterator& iter) const; inline bool operator==(const const_iterator& iter) const;
@ -306,7 +307,6 @@ public:
//- No reverse iteration //- No reverse iteration
const const_iterator& crend() const = delete; const const_iterator& crend() const = delete;
}; };

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -135,7 +135,7 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// Static Member Functions // Static Functions
//- Return a null FixedList //- Return a null FixedList
inline static const FixedList<T, N>& null(); inline static const FixedList<T, N>& null();
@ -143,8 +143,8 @@ public:
// Constructors // Constructors
//- Null constructor //- Default construct
inline FixedList() = default; FixedList() = default;
//- Construct and initialize all entries to given value //- Construct and initialize all entries to given value
inline explicit FixedList(const T& val); inline explicit FixedList(const T& val);
@ -155,7 +155,7 @@ public:
//- Copy construct from C-array //- Copy construct from C-array
inline explicit FixedList(const T list[N]); inline explicit FixedList(const T list[N]);
//- Copy constructor //- Copy construct
inline FixedList(const FixedList<T, N>& list); inline FixedList(const FixedList<T, N>& list);
//- Move construct by using move assignment for the individual //- Move construct by using move assignment for the individual

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -50,7 +50,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
template<class T> class SubList; template<class T> class SubList;
// Common list types // Common list types
@ -70,12 +70,18 @@ class SubList
{ {
public: public:
// Static Member Functions // Static Functions
//- Return a null SubList //- Return a null SubList
inline static const SubList<T>& null(); inline static const SubList<T>& null();
// Generated Methods
//- Copy construct
SubList(const SubList&) = default;
// Constructors // Constructors
//- Construct from UList, the entire size //- Construct from UList, the entire size
@ -122,7 +128,7 @@ public:
//- Copy assign entries from given sub-list //- Copy assign entries from given sub-list
inline void operator=(const SubList<T>& list); inline void operator=(const SubList<T>& list);
//- Copy assign entries to the given list //- Copy assign entries from given list
inline void operator=(const UList<T>& list); inline void operator=(const UList<T>& list);
//- Assign all entries to the given value //- Assign all entries to the given value

View File

@ -66,7 +66,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class labelRange; class labelRange;
template<class T> class List; template<class T> class List;
template<class T> class SubList; template<class T> class SubList;
@ -87,7 +87,7 @@ typedef UList<label> labelUList; //!< A UList of labels
template<class T> template<class T>
class UList class UList
{ {
// Private data // Private Data
//- Number of elements in UList //- Number of elements in UList
label size_; label size_;
@ -167,13 +167,13 @@ public:
friend class SubList<T>; friend class SubList<T>;
// Static Member Functions // Static Functions
//- Return a UList reference to a nullObject //- Return a UList reference to a nullObject
inline static const UList<T>& null(); inline static const UList<T>& null();
// Public classes // Public Classes
//- A list compare binary predicate for normal sort //- A list compare binary predicate for normal sort
struct less struct less
@ -208,9 +208,15 @@ public:
}; };
// Generated Methods
//- Copy construct
UList(const UList<T>&) = default;
// Constructors // Constructors
//- Null constructor //- Default construct, zero-sized and nullptr
inline constexpr UList() noexcept; inline constexpr UList() noexcept;
//- Construct from components //- Construct from components
@ -331,7 +337,7 @@ public:
void deepCopy(const UList<T>& list); void deepCopy(const UList<T>& list);
// Member operators // Member Operators
//- Return element of UList //- Return element of UList
inline T& operator[](const label i); inline T& operator[](const label i);

View File

@ -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)
{} {}

View File

@ -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,

View File

@ -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)
: :

View File

@ -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,

View File

@ -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)
: :

View File

@ -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>()
);
} }

View File

@ -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;
}; };

View File

@ -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)
: :

View File

@ -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>()
);
} }

View File

@ -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

View File

@ -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)
);
} }

View File

@ -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

View File

@ -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
( (

View File

@ -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

View File

@ -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;
}; };

View File

@ -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)
: :

View File

@ -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

View File

@ -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)
: :

View File

@ -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

View File

@ -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)
);
} }

View File

@ -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

View File

@ -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)
);
} }

View File

@ -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

View File

@ -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)
);
} }

View File

@ -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

View File

@ -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)
);
} }

View File

@ -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.
@ -75,8 +75,8 @@ public:
// Constructors // Constructors
//- Construct null //- Default construct
inline Tuple2() = default; Tuple2() = default;
//- Copy construct from components //- Copy construct from components
inline Tuple2(const T1& f, const T2& s) inline Tuple2(const T1& f, const T2& s)

View File

@ -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;
}; };

View File

@ -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)
: :

View File

@ -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;
}; };

View File

@ -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)
: :

View File

@ -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>

View File

@ -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
( (

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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.
@ -63,18 +64,21 @@ class Uniform
: :
public Constant<Type> public Constant<Type>
{ {
// Private Member Functions public:
//- Declare type-name, virtual type (with debug switch)
TypeName("uniform");
// Generated Methods
//- Copy construct
Uniform<Type>(const Uniform&) = default;
//- No copy assignment //- No copy assignment
void operator=(const Uniform<Type>&) = delete; void operator=(const Uniform<Type>&) = delete;
public:
// Runtime type information
TypeName("uniform");
// Constructors // Constructors
//- Construct from entry name and dictionary //- Construct from entry name and dictionary

View File

@ -34,33 +34,21 @@ Foam::Polynomial<PolySize>::Polynomial()
: :
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false), logActive_(false),
logCoeff_(0.0) logCoeff_(0)
{ {
for (int i = 0; i < PolySize; ++i) for (int i = 0; i < PolySize; ++i)
{ {
this->v_[i] = 0.0; this->v_[i] = 0;
} }
} }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial
(
const Polynomial<PolySize>& poly
)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
template<int PolySize> template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize]) Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
: :
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false), logActive_(false),
logCoeff_(0.0) logCoeff_(0)
{ {
for (int i=0; i<PolySize; i++) for (int i=0; i<PolySize; i++)
{ {
@ -74,7 +62,7 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
: :
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false), logActive_(false),
logCoeff_(0.0) logCoeff_(0)
{ {
if (coeffs.size() != PolySize) if (coeffs.size() != PolySize)
{ {
@ -96,7 +84,7 @@ Foam::Polynomial<PolySize>::Polynomial(Istream& is)
: :
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is), VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false), logActive_(false),
logCoeff_(0.0) logCoeff_(0)
{} {}
@ -105,7 +93,7 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
: :
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false), logActive_(false),
logCoeff_(0.0) logCoeff_(0)
{ {
word isName(is); word isName(is);

View File

@ -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.
@ -63,11 +64,10 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
template<int PolySize> template<int PolySize>
class Polynomial; class Polynomial;
// Forward declaration of friend functions
template<int PolySize> template<int PolySize>
Ostream& operator<< Ostream& operator<<
( (
@ -87,7 +87,7 @@ class Polynomial
{ {
static_assert(PolySize > 0, "Size must be positive (non-zero)"); static_assert(PolySize > 0, "Size must be positive (non-zero)");
// Private data // Private Data
//- Include the log term? - only activated using integralMinus1() //- Include the log term? - only activated using integralMinus1()
bool logActive_; bool logActive_;
@ -98,19 +98,20 @@ class Polynomial
public: public:
typedef Polynomial<PolySize> polyType; // Public Typedefs
typedef Polynomial<PolySize> polyType;
typedef Polynomial<PolySize+1> intPolyType; typedef Polynomial<PolySize+1> intPolyType;
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct null, with all coefficients = 0.0 //- Default construct, with all coefficients = 0
Polynomial(); Polynomial();
//- Copy constructor
Polynomial(const Polynomial&);
//- Construct from C-array of coefficients //- Construct from C-array of coefficients
explicit Polynomial(const scalar coeffs[PolySize]); explicit Polynomial(const scalar coeffs[PolySize]);
@ -118,10 +119,10 @@ public:
explicit Polynomial(const UList<scalar>& coeffs); explicit Polynomial(const UList<scalar>& coeffs);
//- Construct from Istream //- Construct from Istream
Polynomial(Istream&); explicit Polynomial(Istream& is);
//- Construct from name and Istream //- Construct from name and Istream
Polynomial(const word& name, Istream&); Polynomial(const word& name, Istream& is);
// Member Functions // Member Functions

View File

@ -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&);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
{} {}

View File

@ -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);

View File

@ -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_;

View File

@ -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)

View File

@ -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);

View File

@ -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_);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-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.
@ -65,8 +65,8 @@ public:
// Constructors // Constructors
//- Construct an empty list //- Default construct an empty list
inline hashedWordList() = default; hashedWordList() = default;
//- Copy construct. //- Copy construct.
inline hashedWordList(const hashedWordList& list); inline hashedWordList(const hashedWordList& list);

View File

@ -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.
@ -29,14 +30,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::referredWallFace::referredWallFace()
:
face(),
pts_(),
patchi_()
{}
Foam::referredWallFace::referredWallFace Foam::referredWallFace::referredWallFace
( (
const face& f, const face& f,
@ -48,36 +41,16 @@ Foam::referredWallFace::referredWallFace
pts_(pts), pts_(pts),
patchi_(patchi) patchi_(patchi)
{ {
if (this->size() != pts_.size()) if (face::size() != pts_.size())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Face and pointField are not the same size. " << nl << (*this) << "Face and pointField are not the same size." << nl
<< (*this) << nl
<< abort(FatalError); << abort(FatalError);
} }
} }
Foam::referredWallFace::referredWallFace(const referredWallFace& rWF)
:
face(rWF),
pts_(rWF.pts_),
patchi_(rWF.patchi_)
{
if (this->size() != pts_.size())
{
FatalErrorInFunction
<< "Face and pointField are not the same size. " << nl << (*this)
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::referredWallFace::~referredWallFace()
{}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const

View File

@ -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.
@ -47,16 +48,11 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
class referredWallFace; class referredWallFace;
Istream& operator>>(Istream&, referredWallFace&); Istream& operator>>(Istream&, referredWallFace&);
Ostream& operator<<(Ostream&, const referredWallFace&); Ostream& operator<<(Ostream&, const referredWallFace&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class referredWallFace Declaration Class referredWallFace Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -65,7 +61,7 @@ class referredWallFace
: :
public face public face
{ {
// Private data // Private Data
//- Points of face //- Points of face
pointField pts_; pointField pts_;
@ -76,10 +72,13 @@ class referredWallFace
public: public:
// Constructors // Generated Methods
//- Construct null //- Default construct
referredWallFace(); referredWallFace() = default;
// Constructors
//- Construct from components //- Construct from components
referredWallFace referredWallFace
@ -89,13 +88,6 @@ public:
label patchi label patchi
); );
//- Construct as copy
referredWallFace(const referredWallFace&);
//- Destructor
~referredWallFace();
// Member Functions // Member Functions
@ -119,6 +111,7 @@ public:
bool operator==(const referredWallFace&) const; bool operator==(const referredWallFace&) const;
bool operator!=(const referredWallFace&) const; bool operator!=(const referredWallFace&) const;
// IOstream Operators // IOstream Operators
friend Istream& operator>>(Istream&, referredWallFace&); friend Istream& operator>>(Istream&, referredWallFace&);

View File

@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::pointField& Foam::referredWallFace::points() const const Foam::pointField& Foam::referredWallFace::points() const

View File

@ -31,14 +31,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class PairType, class WallType>
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList()
:
pairRecords_(),
wallRecords_()
{}
template<class PairType, class WallType> template<class PairType, class WallType>
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList(Istream& is) Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList(Istream& is)
: :
@ -123,13 +115,6 @@ Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * /
template<class PairType, class WallType>
Foam::CollisionRecordList<PairType, WallType>::~CollisionRecordList()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class PairType, class WallType> template<class PairType, class WallType>
@ -386,24 +371,6 @@ void Foam::CollisionRecordList<PairType, WallType>::update()
} }
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class PairType, class WallType>
void Foam::CollisionRecordList<PairType, WallType>::operator=
(
const CollisionRecordList<PairType, WallType>& rhs
)
{
if (this == &rhs)
{
return; // Self-assignment is a no-op
}
pairRecords_ = rhs.pairRecords_;
wallRecords_ = rhs.wallRecords_;
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
template<class PairType, class WallType> template<class PairType, class WallType>

View File

@ -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.
@ -47,7 +48,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class PairType, class WallType> template<class PairType, class WallType>
class CollisionRecordList; class CollisionRecordList;
@ -79,7 +80,7 @@ Ostream& operator<<(Ostream&, const CollisionRecordList<PairType, WallType>&);
template<class PairType, class WallType> template<class PairType, class WallType>
class CollisionRecordList class CollisionRecordList
{ {
// Private data // Private Data
//- List of active pair collisions //- List of active pair collisions
DynamicList<PairCollisionRecord<PairType>> pairRecords_; DynamicList<PairCollisionRecord<PairType>> pairRecords_;
@ -90,13 +91,16 @@ class CollisionRecordList
public: public:
// Generated Methods
//- Default construct
CollisionRecordList() = default;
// Constructors // Constructors
//- Construct null
CollisionRecordList();
//- Construct from Istream //- Construct from Istream
CollisionRecordList(Istream&); explicit CollisionRecordList(Istream& is);
//- Construct from component fields (for IO) //- Construct from component fields (for IO)
CollisionRecordList CollisionRecordList
@ -110,9 +114,6 @@ public:
const Field<WallType>& wallData const Field<WallType>& wallData
); );
//- Destructor
~CollisionRecordList();
// Member Functions // Member Functions
@ -196,11 +197,6 @@ public:
void update(); void update();
// Member Operators
void operator=(const CollisionRecordList&);
// Friend Operators // Friend Operators
friend bool operator== <PairType, WallType> friend bool operator== <PairType, WallType>

View File

@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class PairType, class WallType> template<class PairType, class WallType>
@ -45,7 +43,4 @@ Foam::CollisionRecordList<PairType, WallType>::wallRecords() const
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -188,16 +188,6 @@ Foam::phaseProperties::phaseProperties()
{} {}
Foam::phaseProperties::phaseProperties(const phaseProperties& pp)
:
phase_(pp.phase_),
stateLabel_(pp.stateLabel_),
names_(pp.names_),
Y_(pp.Y_),
carrierIds_(pp.carrierIds_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::phaseProperties::reorder void Foam::phaseProperties::reorder

View File

@ -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.
@ -48,14 +49,11 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
class phaseProperties; class phaseProperties;
Istream& operator>>(Istream&, phaseProperties&); Istream& operator>>(Istream&, phaseProperties&);
Ostream& operator<<(Ostream&, const phaseProperties&); Ostream& operator<<(Ostream&, const phaseProperties&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class phaseProperties Declaration Class phaseProperties Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -64,7 +62,7 @@ class phaseProperties
{ {
public: public:
// Public data // Public Data
//- Phase type enumeration //- Phase type enumeration
enum phaseType enum phaseType
@ -81,7 +79,7 @@ public:
private: private:
// Private data // Private Data
//- Phase type //- Phase type
phaseType phase_; phaseType phase_;
@ -118,21 +116,14 @@ public:
// Constructors // Constructors
//- Null constructor //- Default construct, as 'UNKNOWN' state
phaseProperties(); phaseProperties();
//- Construct from Istream //- Construct from Istream
phaseProperties(Istream& is); explicit phaseProperties(Istream& is);
//- Construct as copy
phaseProperties(const phaseProperties& pp);
//- Destructor // Member Functions
~phaseProperties() = default;
// Public Member Functions
//- Reorder species to be consistent with the corresponding //- Reorder species to be consistent with the corresponding
// phase specie name list // phase specie name list

View File

@ -32,11 +32,7 @@ License
Foam::phaseProperties::phaseProperties(Istream& is) Foam::phaseProperties::phaseProperties(Istream& is)
: :
phase_(UNKNOWN), phaseProperties()
stateLabel_("(unknown)"),
names_(),
Y_(),
carrierIds_()
{ {
is >> *this; is >> *this;
} }
@ -59,7 +55,7 @@ Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)
const label nComponents = pp.names_.size(); const label nComponents = pp.names_.size();
pp.Y_.resize(nComponents, 0.0); pp.Y_.resize(nComponents, Zero);
pp.carrierIds_.resize(nComponents, -1); pp.carrierIds_.resize(nComponents, -1);
for (label cmpti = 0; cmpti < nComponents; ++cmpti) for (label cmpti = 0; cmpti < nComponents; ++cmpti)

View File

@ -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.
@ -50,7 +51,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class forceSuSp; class forceSuSp;
inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2); inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2);
@ -65,13 +66,12 @@ class forceSuSp
: :
public Tuple2<vector, scalar> public Tuple2<vector, scalar>
{ {
public: public:
// Constructors // Constructors
//- Construct null //- Default construct
inline forceSuSp(); forceSuSp() = default;
//- Construct zero-initialized content //- Construct zero-initialized content
inline forceSuSp(const zero); inline forceSuSp(const zero);
@ -83,7 +83,7 @@ public:
inline forceSuSp(const vector& Su, const scalar Sp); inline forceSuSp(const vector& Su, const scalar Sp);
//- Construct from Istream //- Construct from Istream
inline forceSuSp(Istream& is); inline explicit forceSuSp(Istream& is);
// Member Functions // Member Functions
@ -108,9 +108,6 @@ public:
// Operators // Operators
//- Assignment
inline void operator=(const forceSuSp& susp);
//- Addition //- Addition
inline void operator+=(const forceSuSp& susp); inline void operator+=(const forceSuSp& susp);
@ -118,7 +115,7 @@ public:
inline void operator-=(const forceSuSp& susp); inline void operator-=(const forceSuSp& susp);
// Friend operators // Friend Operators
//- Addition //- Addition
friend inline forceSuSp operator* friend inline forceSuSp operator*

View File

@ -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.
@ -27,13 +28,9 @@ License
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
inline Foam::forceSuSp::forceSuSp()
{}
inline Foam::forceSuSp::forceSuSp(const zero) inline Foam::forceSuSp::forceSuSp(const zero)
: :
Tuple2<vector, scalar>(vector::zero, 0.0) Tuple2<vector, scalar>(vector::zero, 0)
{} {}
@ -87,13 +84,6 @@ inline Foam::scalar& Foam::forceSuSp::Sp()
// * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * * //
inline void Foam::forceSuSp::operator=(const forceSuSp& susp)
{
first() = susp.first();
second() = susp.second();
}
inline void Foam::forceSuSp::operator+=(const forceSuSp& susp) inline void Foam::forceSuSp::operator+=(const forceSuSp& susp)
{ {
first() += susp.first(); first() += susp.first();

View File

@ -71,29 +71,6 @@ SingleKineticRateDevolatilisation
} }
template<class CloudType>
Foam::SingleKineticRateDevolatilisation<CloudType>::
SingleKineticRateDevolatilisation
(
const SingleKineticRateDevolatilisation<CloudType>& dm
)
:
DevolatilisationModel<CloudType>(dm),
volatileData_(dm.volatileData_),
YVolatile0_(dm.YVolatile0_),
volatileToGasMap_(dm.volatileToGasMap_),
residualCoeff_(dm.residualCoeff_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SingleKineticRateDevolatilisation<CloudType>::
~SingleKineticRateDevolatilisation()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>

View File

@ -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.
@ -68,6 +68,7 @@ Description
namespace Foam namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class SingleKineticRateDevolatilisation Declaration Class SingleKineticRateDevolatilisation Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -77,10 +78,10 @@ class SingleKineticRateDevolatilisation
: :
public DevolatilisationModel<CloudType> public DevolatilisationModel<CloudType>
{ {
// Helper class to store specie-local volatile data //- Helper class to store specie-local volatile data
class volatileData class volatileData
{ {
// Private data // Private Data
//- Specie name //- Specie name
word name_; word name_;
@ -91,41 +92,28 @@ class SingleKineticRateDevolatilisation
//- Pre-exponential factor //- Pre-exponential factor
scalar E_; scalar E_;
public: public:
// Constructors // Constructors
//- Null constructor //- Default construct
volatileData() volatileData()
: :
name_(word::null), name_(),
A1_(0.0), A1_(0),
E_(0.0) E_(0)
{} {}
//- Construct from Istream //- Construct from Istream
volatileData(Istream& is) explicit volatileData(Istream& is)
: :
name_(is), name_(is),
A1_(readScalar(is)), A1_(readScalar(is)),
E_(readScalar(is)) E_(readScalar(is))
{} {}
//- Construct as copy
volatileData(const volatileData& vd)
:
name_(vd.name_),
A1_(vd.A1_),
E_(vd.E_)
{}
// Member Functions
//- Destructor
~volatileData() = default;
// Public Member Functions
// Access // Access
@ -174,9 +162,9 @@ class SingleKineticRateDevolatilisation
}; };
// Private data // Private Data
// Model constants // Model Constants
//- List of volatile data - (name A1 E) //- List of volatile data - (name A1 E)
List<volatileData> volatileData_; List<volatileData> volatileData_;
@ -195,7 +183,7 @@ class SingleKineticRateDevolatilisation
public: public:
//- Runtime type information //- Declare type-name, virtual type (with debug switch)
TypeName("singleKineticRateDevolatilisation"); TypeName("singleKineticRateDevolatilisation");
@ -208,12 +196,6 @@ public:
CloudType& owner CloudType& owner
); );
//- Construct copy
SingleKineticRateDevolatilisation
(
const SingleKineticRateDevolatilisation<CloudType>& dm
);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<DevolatilisationModel<CloudType>> clone() const virtual autoPtr<DevolatilisationModel<CloudType>> clone() const
{ {
@ -225,7 +207,7 @@ public:
//- Destructor //- Destructor
virtual ~SingleKineticRateDevolatilisation(); virtual ~SingleKineticRateDevolatilisation() = default;
// Member Functions // Member Functions

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -39,13 +40,14 @@ SourceFiles
#ifndef constAnIsoSolidTransport_H #ifndef constAnIsoSolidTransport_H
#define constAnIsoSolidTransport_H #define constAnIsoSolidTransport_H
#include "vector.H" #include "vector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// Forward Declarations
template<class Thermo> class constAnIsoSolidTransport; template<class Thermo> class constAnIsoSolidTransport;
template<class Thermo> template<class Thermo>
@ -72,7 +74,7 @@ class constAnIsoSolidTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Constant anisotropic thermal conductivity. //- Constant anisotropic thermal conductivity.
vector kappa_; vector kappa_;
@ -86,6 +88,9 @@ class constAnIsoSolidTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
@ -96,7 +101,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
constAnIsoSolidTransport(const dictionary&); explicit constAnIsoSolidTransport(const dictionary& dict);
// Selector from dictionary // Selector from dictionary
inline static autoPtr<constAnIsoSolidTransport> New inline static autoPtr<constAnIsoSolidTransport> New
@ -105,7 +110,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -133,13 +138,12 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const constAnIsoSolidTransport&);
inline void operator+=(const constAnIsoSolidTransport&); inline void operator+=(const constAnIsoSolidTransport&);
// Friend operators // Friend Operators
friend constAnIsoSolidTransport operator* <Thermo> friend constAnIsoSolidTransport operator* <Thermo>
( (
@ -148,7 +152,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

View File

@ -83,7 +83,7 @@ inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const mu(const scalar p, const scalar T) const
{ {
NotImplemented; NotImplemented;
return scalar(0); return 0;
} }
@ -96,16 +96,6 @@ alphah(const scalar p, const scalar T) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo>
inline void Foam::constAnIsoSolidTransport<Thermo>::operator=
(
const constAnIsoSolidTransport<Thermo>& ct
)
{
kappa_ = ct.kappa_;
}
template<class Thermo> template<class Thermo>
inline void Foam::constAnIsoSolidTransport<Thermo>::operator+= inline void Foam::constAnIsoSolidTransport<Thermo>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,6 +48,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward Declarations
template<class Thermo> class constIsoSolidTransport; template<class Thermo> class constIsoSolidTransport;
template<class Thermo> template<class Thermo>
@ -73,7 +75,7 @@ class constIsoSolidTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Constant isotropic thermal conductivity //- Constant isotropic thermal conductivity
scalar kappa_; scalar kappa_;
@ -87,6 +89,9 @@ class constIsoSolidTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
@ -97,7 +102,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
constIsoSolidTransport(const dictionary& dict); explicit constIsoSolidTransport(const dictionary& dict);
// Selector from dictionary // Selector from dictionary
inline static autoPtr<constIsoSolidTransport> New inline static autoPtr<constIsoSolidTransport> New
@ -106,7 +111,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -134,13 +139,12 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const constIsoSolidTransport&);
inline void operator+=(const constIsoSolidTransport&); inline void operator+=(const constIsoSolidTransport&);
// Friend operators // Friend Operators
friend constIsoSolidTransport operator* <Thermo> friend constIsoSolidTransport operator* <Thermo>
( (
@ -149,7 +153,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

View File

@ -83,7 +83,7 @@ inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
mu(const scalar p, const scalar T) const mu(const scalar p, const scalar T) const
{ {
NotImplemented; NotImplemented;
return scalar(0); return 0;
} }
@ -96,17 +96,6 @@ alphah(const scalar p, const scalar T) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo>
inline void Foam::constIsoSolidTransport<thermo>::operator=
(
const constIsoSolidTransport<thermo>& ct
)
{
thermo::operator=(ct);
kappa_ = ct.kappa_;
}
template<class thermo> template<class thermo>
inline void Foam::constIsoSolidTransport<thermo>::operator+= inline void Foam::constIsoSolidTransport<thermo>::operator+=
( (
@ -125,7 +114,6 @@ inline void Foam::constIsoSolidTransport<thermo>::operator+=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo> template<class thermo>
inline Foam::constIsoSolidTransport<thermo> Foam::operator* inline Foam::constIsoSolidTransport<thermo> Foam::operator*
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,6 +45,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward Declarations
template<class Thermo> class exponentialSolidTransport; template<class Thermo> class exponentialSolidTransport;
template<class Thermo> template<class Thermo>
@ -70,7 +73,7 @@ class exponentialSolidTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Constant thermal coefficient. //- Constant thermal coefficient.
scalar kappa0_; scalar kappa0_;
@ -96,6 +99,9 @@ class exponentialSolidTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
@ -106,7 +112,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
exponentialSolidTransport(const dictionary&); explicit exponentialSolidTransport(const dictionary&);
// Selector from dictionary // Selector from dictionary
inline static autoPtr<exponentialSolidTransport> New inline static autoPtr<exponentialSolidTransport> New
@ -115,7 +121,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -142,13 +148,12 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const exponentialSolidTransport&);
inline void operator+=(const exponentialSolidTransport&); inline void operator+=(const exponentialSolidTransport&);
// Friend operators // Friend Operators
friend exponentialSolidTransport operator* <Thermo> friend exponentialSolidTransport operator* <Thermo>
( (
@ -156,7 +161,8 @@ public:
const exponentialSolidTransport& const exponentialSolidTransport&
); );
// Ostream Operator
// IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

View File

@ -95,7 +95,7 @@ inline Foam::scalar Foam::exponentialSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const mu(const scalar p, const scalar T) const
{ {
NotImplemented; NotImplemented;
return scalar(0); return 0;
} }
@ -108,19 +108,6 @@ alphah(const scalar p, const scalar T) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo>
inline void Foam::exponentialSolidTransport<Thermo>::operator=
(
const exponentialSolidTransport<Thermo>& ct
)
{
kappa0_ = ct.kappa0_;
n0_ = ct.n0_;
Tref_ = ct.Tref_;
}
template<class Thermo> template<class Thermo>
inline void Foam::exponentialSolidTransport<Thermo>::operator+= inline void Foam::exponentialSolidTransport<Thermo>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation Copyright (C) 2013-2017 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 @@ See also
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo, int PolySize> class polynomialSolidTransport; template<class Thermo, int PolySize> class polynomialSolidTransport;
@ -108,7 +109,7 @@ class polynomialSolidTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Thermal conductivity polynomial coefficients //- Thermal conductivity polynomial coefficients
// Note: input in [W/m/K] // Note: input in [W/m/K]
@ -133,6 +134,9 @@ class polynomialSolidTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
@ -143,7 +147,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
polynomialSolidTransport(const dictionary& dict); explicit polynomialSolidTransport(const dictionary& dict);
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<polynomialSolidTransport> clone() const; inline autoPtr<polynomialSolidTransport> clone() const;
@ -155,7 +159,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -183,14 +187,13 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const polynomialSolidTransport&);
inline void operator+=(const polynomialSolidTransport&); inline void operator+=(const polynomialSolidTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend polynomialSolidTransport operator+ <Thermo, PolySize> friend polynomialSolidTransport operator+ <Thermo, PolySize>
( (
@ -205,7 +208,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo, PolySize> friend Ostream& operator<< <Thermo, PolySize>
( (

View File

@ -81,7 +81,7 @@ inline Foam::scalar Foam::polynomialSolidTransport<Thermo, PolySize>::mu
) const ) const
{ {
NotImplemented; NotImplemented;
return scalar(0); return 0;
} }
@ -120,18 +120,6 @@ inline Foam::scalar Foam::polynomialSolidTransport<Thermo, PolySize>::alphah
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo, int PolySize>
inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator=
(
const polynomialSolidTransport<Thermo, PolySize>& pt
)
{
Thermo::operator=(pt);
kappaCoeffs_ = pt.kappaCoeffs_;
}
template<class Thermo, int PolySize> template<class Thermo, int PolySize>
inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator+= inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -76,7 +77,7 @@ See also
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Specie, int PolySize> template<class Specie, int PolySize>
class icoPolynomial; class icoPolynomial;
@ -119,7 +120,7 @@ class icoPolynomial
: :
public Specie public Specie
{ {
// Private data // Private Data
//- Density polynomial coefficients //- Density polynomial coefficients
Polynomial<PolySize> rhoCoeffs_; Polynomial<PolySize> rhoCoeffs_;
@ -136,6 +137,8 @@ class icoPolynomial
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct from components //- Construct from components
@ -146,7 +149,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
icoPolynomial(const dictionary& dict); explicit icoPolynomial(const dictionary& dict);
//- Construct as named copy //- Construct as named copy
inline icoPolynomial(const word& name, const icoPolynomial&); inline icoPolynomial(const word& name, const icoPolynomial&);
@ -158,7 +161,7 @@ public:
inline static autoPtr<icoPolynomial> New(const dictionary& dict); inline static autoPtr<icoPolynomial> New(const dictionary& dict);
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -209,14 +212,13 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const icoPolynomial&);
inline void operator+=(const icoPolynomial&); inline void operator+=(const icoPolynomial&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend icoPolynomial operator+ <Specie, PolySize> friend icoPolynomial operator+ <Specie, PolySize>
( (
@ -237,7 +239,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Specie, PolySize> friend Ostream& operator<< <Specie, PolySize>
( (

View File

@ -174,18 +174,6 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::CpMCv
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Specie, int PolySize>
inline void Foam::icoPolynomial<Specie, PolySize>::operator=
(
const icoPolynomial<Specie, PolySize>& ip
)
{
Specie::operator=(ip);
rhoCoeffs_ = ip.rhoCoeffs_;
}
template<class Specie, int PolySize> template<class Specie, int PolySize>
inline void Foam::icoPolynomial<Specie, PolySize>::operator+= inline void Foam::icoPolynomial<Specie, PolySize>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -50,7 +51,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Specie> class incompressiblePerfectGas; template<class Specie> class incompressiblePerfectGas;
@ -92,7 +93,7 @@ class incompressiblePerfectGas
: :
public Specie public Specie
{ {
// Private data // Private Data
//- Reference pressure //- Reference pressure
scalar pRef_; scalar pRef_;
@ -100,13 +101,16 @@ class incompressiblePerfectGas
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct from components //- Construct from components
inline incompressiblePerfectGas(const Specie& sp, const scalar pRef); inline incompressiblePerfectGas(const Specie& sp, const scalar pRef);
//- Construct from dictionary //- Construct from dictionary
incompressiblePerfectGas(const dictionary& dict); explicit incompressiblePerfectGas(const dictionary& dict);
//- Construct as named copy //- Construct as named copy
inline incompressiblePerfectGas inline incompressiblePerfectGas
@ -125,7 +129,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -178,14 +182,13 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const incompressiblePerfectGas&);
inline void operator+=(const incompressiblePerfectGas&); inline void operator+=(const incompressiblePerfectGas&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend incompressiblePerfectGas operator+ <Specie> friend incompressiblePerfectGas operator+ <Specie>
( (
@ -206,7 +209,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Specie> friend Ostream& operator<< <Specie>
( (

View File

@ -27,13 +27,13 @@ License
#include "incompressiblePerfectGas.H" #include "incompressiblePerfectGas.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Specie> template<class Specie>
inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas
( (
const Specie& sp, const scalar pRef const Specie& sp,
const scalar pRef
) )
: :
Specie(sp), Specie(sp),
@ -175,17 +175,6 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::CpMCv
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Specie>
inline void Foam::incompressiblePerfectGas<Specie>::operator=
(
const incompressiblePerfectGas<Specie>& ipg
)
{
Specie::operator=(ipg);
pRef_ = ipg.pRef_;
}
template<class Specie> template<class Specie>
inline void Foam::incompressiblePerfectGas<Specie>::operator+= inline void Foam::incompressiblePerfectGas<Specie>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -50,8 +51,7 @@ using namespace Foam::constant::thermodynamic;
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
class specie; class specie;
inline specie operator+(const specie&, const specie&); inline specie operator+(const specie&, const specie&);
@ -67,7 +67,7 @@ Ostream& operator<<(Ostream&, const specie&);
class specie class specie
{ {
// Private data // Private Data
//- Name of specie //- Name of specie
word name_; word name_;
@ -81,10 +81,16 @@ class specie
public: public:
//- Runtime type information //- Declare type-name (with debug switch)
ClassName("specie"); ClassName("specie");
// Generated Methods
//- Copy construct
specie(const specie&) = default;
// Constructors // Constructors
//- Construct from components without name //- Construct from components without name
@ -102,7 +108,7 @@ public:
inline specie(const word& name, const specie&); inline specie(const word& name, const specie&);
//- Construct from dictionary //- Construct from dictionary
specie(const dictionary& dict); explicit specie(const dictionary& dict);
// Member Functions // Member Functions
@ -122,27 +128,29 @@ public:
inline scalar R() const; inline scalar R() const;
// I-O // IO
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
//- Copy assignment, preserve original name
inline void operator=(const specie&); inline void operator=(const specie&);
inline void operator+=(const specie&); inline void operator+=(const specie&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
inline friend specie operator+(const specie&, const specie&); inline friend specie operator+(const specie&, const specie&);
inline friend specie operator*(const scalar, const specie&); inline friend specie operator*(const scalar, const specie&);
inline friend specie operator==(const specie&, const specie&); inline friend specie operator==(const specie&, const specie&);
// Ostream Operator // IOstream Operators
friend Ostream& operator<<(Ostream&, const specie&); friend Ostream& operator<<(Ostream&, const specie&);
}; };

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,14 +28,9 @@ License
#include "specie.H" #include "specie.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline specie::specie inline Foam::specie::specie
( (
const word& name, const word& name,
const scalar Y, const scalar Y,
@ -47,7 +43,7 @@ inline specie::specie
{} {}
inline specie::specie inline Foam::specie::specie
( (
const scalar Y, const scalar Y,
const scalar molWeight const scalar molWeight
@ -60,7 +56,7 @@ inline specie::specie
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline specie::specie(const word& name, const specie& st) inline Foam::specie::specie(const word& name, const specie& st)
: :
name_(name), name_(name),
Y_(st.Y_), Y_(st.Y_),
@ -70,25 +66,25 @@ inline specie::specie(const word& name, const specie& st)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const word& specie::name() const inline const Foam::word& Foam::specie::name() const
{ {
return name_; return name_;
} }
inline scalar specie::W() const inline Foam::scalar Foam::specie::W() const
{ {
return molWeight_; return molWeight_;
} }
inline scalar specie::Y() const inline Foam::scalar Foam::specie::Y() const
{ {
return Y_; return Y_;
} }
inline scalar specie::R() const inline Foam::scalar Foam::specie::R() const
{ {
return RR/molWeight_; return RR/molWeight_;
} }
@ -96,15 +92,15 @@ inline scalar specie::R() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void specie::operator=(const specie& st) inline void Foam::specie::operator=(const specie& st)
{ {
//name_ = st.name_; // Preserve original name
Y_ = st.Y_; Y_ = st.Y_;
molWeight_ = st.molWeight_; molWeight_ = st.molWeight_;
} }
inline void specie::operator+=(const specie& st) inline void Foam::specie::operator+=(const specie& st)
{ {
const scalar sumY = Y_ + st.Y_; const scalar sumY = Y_ + st.Y_;
if (mag(sumY) > SMALL) if (mag(sumY) > SMALL)
@ -116,7 +112,7 @@ inline void specie::operator+=(const specie& st)
} }
inline void specie::operator*=(const scalar s) inline void Foam::specie::operator*=(const scalar s)
{ {
Y_ *= s; Y_ *= s;
} }
@ -124,7 +120,7 @@ inline void specie::operator*=(const scalar s)
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline specie operator+(const specie& st1, const specie& st2) inline Foam::specie Foam::operator+(const specie& st1, const specie& st2)
{ {
const scalar sumY = max(st1.Y_ + st2.Y_, SMALL); const scalar sumY = max(st1.Y_ + st2.Y_, SMALL);
@ -143,7 +139,7 @@ inline specie operator+(const specie& st1, const specie& st2)
} }
inline specie operator*(const scalar s, const specie& st) inline Foam::specie Foam::operator*(const scalar s, const specie& st)
{ {
return specie return specie
( (
@ -153,7 +149,7 @@ inline specie operator*(const scalar s, const specie& st)
} }
inline specie operator==(const specie& st1, const specie& st2) inline Foam::specie Foam::operator==(const specie& st1, const specie& st2)
{ {
scalar diffY = st2.Y_ - st1.Y_; scalar diffY = st2.Y_ - st1.Y_;
if (mag(diffY) < SMALL) if (mag(diffY) < SMALL)
@ -180,8 +176,4 @@ inline specie operator==(const specie& st1, const specie& st2)
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -43,7 +44,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
class specieElement; class specieElement;
Ostream& operator<<(Ostream&, const specieElement&); Ostream& operator<<(Ostream&, const specieElement&);
@ -54,7 +55,7 @@ Ostream& operator<<(Ostream&, const specieElement&);
class specieElement class specieElement
{ {
// Private data // Private Data
//- Name of the element //- Name of the element
word name_; word name_;
@ -67,14 +68,14 @@ public:
// Constructors // Constructors
//- Construct null //- Default construct
inline specieElement(); inline specieElement();
//- Construct from components //- Construct from components
inline specieElement(const word& name, const label nAtoms); inline specieElement(const word& name, const label nAtoms);
//- Construct from Istream //- Construct from Istream
inline specieElement(Istream&); inline explicit specieElement(Istream& is);
// Member Functions // Member Functions

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -30,6 +31,9 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::specieElement::specieElement() inline Foam::specieElement::specieElement()
:
name_(),
nAtoms_(0)
{} {}

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -86,7 +87,7 @@ See also
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class EquationOfState, int PolySize> template<class EquationOfState, int PolySize>
class hPolynomialThermo; class hPolynomialThermo;
@ -129,7 +130,7 @@ class hPolynomialThermo
: :
public EquationOfState public EquationOfState
{ {
// Private data // Private Data
//- Heat of formation //- Heat of formation
scalar Hf_; scalar Hf_;
@ -170,6 +171,9 @@ class hPolynomialThermo
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
@ -222,20 +226,19 @@ public:
// I-O // IO
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const hPolynomialThermo&);
inline void operator+=(const hPolynomialThermo&); inline void operator+=(const hPolynomialThermo&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend hPolynomialThermo operator+ <EquationOfState, PolySize> friend hPolynomialThermo operator+ <EquationOfState, PolySize>
( (
@ -256,7 +259,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <EquationOfState, PolySize> friend Ostream& operator<< <EquationOfState, PolySize>
( (

View File

@ -159,22 +159,6 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dCpdT
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class EquationOfState, int PolySize>
inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator=
(
const hPolynomialThermo<EquationOfState, PolySize>& pt
)
{
EquationOfState::operator=(pt);
Hf_ = pt.Hf_;
Sf_ = pt.Sf_;
CpCoeffs_ = pt.CpCoeffs_;
hCoeffs_ = pt.hCoeffs_;
sCoeffs_ = pt.sCoeffs_;
}
template<class EquationOfState, int PolySize> template<class EquationOfState, int PolySize>
inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+= inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018 OpenFOAM Foundation Copyright (C) 2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -59,7 +60,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo> class WLFTransport; template<class Thermo> class WLFTransport;
@ -94,7 +95,7 @@ class WLFTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Dynamic viscosity at the reference temperature [Pa.s] //- Dynamic viscosity at the reference temperature [Pa.s]
scalar mu0_; scalar mu0_;
@ -108,7 +109,7 @@ class WLFTransport
//- WLF coefficient 2 [T] //- WLF coefficient 2 [T]
scalar C2_; scalar C2_;
//- Reciprocal Prandtl Number [] //- Reciprocal Prandtl Number [-]
scalar rPr_; scalar rPr_;
@ -120,13 +121,16 @@ class WLFTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
inline WLFTransport(const word&, const WLFTransport&); inline WLFTransport(const word&, const WLFTransport&);
//- Construct from dictionary //- Construct from dictionary
WLFTransport(const dictionary& dict); explicit WLFTransport(const dictionary& dict);
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<WLFTransport> clone() const; inline autoPtr<WLFTransport> clone() const;
@ -135,7 +139,7 @@ public:
inline static autoPtr<WLFTransport> New(const dictionary& dict); inline static autoPtr<WLFTransport> New(const dictionary& dict);
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -159,16 +163,14 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const WLFTransport&);
inline void operator+=(const WLFTransport&); inline void operator+=(const WLFTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend WLFTransport operator+ <Thermo> friend WLFTransport operator+ <Thermo>
( (
@ -183,7 +185,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

View File

@ -107,22 +107,6 @@ inline Foam::scalar Foam::WLFTransport<Thermo>::alphah
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo>
inline void Foam::WLFTransport<Thermo>::operator=
(
const WLFTransport<Thermo>& wlft
)
{
Thermo::operator=(wlft);
mu0_ = wlft.mu0_;
Tr_ = wlft.Tr_;
C1_ = wlft.C1_;
C2_ = wlft.C2_;
rPr_ = wlft.rPr_;
}
template<class Thermo> template<class Thermo>
inline void Foam::WLFTransport<Thermo>::operator+= inline void Foam::WLFTransport<Thermo>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,7 +49,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo> class constTransport; template<class Thermo> class constTransport;
@ -83,12 +84,12 @@ class constTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Constant dynamic viscosity [Pa.s] //- Constant dynamic viscosity [Pa.s]
scalar mu_; scalar mu_;
//- Reciprocal Prandtl Number [] //- Reciprocal Prandtl Number [-]
scalar rPr_; scalar rPr_;
@ -105,13 +106,16 @@ class constTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
inline constTransport(const word&, const constTransport&); inline constTransport(const word&, const constTransport&);
//- Construct from dictionary //- Construct from dictionary
constTransport(const dictionary& dict); explicit constTransport(const dictionary& dict);
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<constTransport> clone() const; inline autoPtr<constTransport> clone() const;
@ -120,7 +124,7 @@ public:
inline static autoPtr<constTransport> New(const dictionary& dict); inline static autoPtr<constTransport> New(const dictionary& dict);
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -144,16 +148,14 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const constTransport&);
inline void operator+=(const constTransport&); inline void operator+=(const constTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend constTransport operator+ <Thermo> friend constTransport operator+ <Thermo>
( (
@ -168,7 +170,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

View File

@ -110,19 +110,6 @@ inline Foam::scalar Foam::constTransport<Thermo>::alphah
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo>
inline void Foam::constTransport<Thermo>::operator=
(
const constTransport<Thermo>& ct
)
{
Thermo::operator=(ct);
mu_ = ct.mu_;
rPr_ = ct.rPr_;
}
template<class Thermo> template<class Thermo>
inline void Foam::constTransport<Thermo>::operator+= inline void Foam::constTransport<Thermo>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -93,7 +94,7 @@ See also
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo, int PolySize> class logPolynomialTransport; template<class Thermo, int PolySize> class logPolynomialTransport;
@ -128,7 +129,7 @@ class logPolynomialTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Dynamic viscosity polynomial coefficients //- Dynamic viscosity polynomial coefficients
// Note: input in [Pa.s], but internally uses [Pa.s/kmol] // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
@ -158,6 +159,9 @@ class logPolynomialTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
@ -168,7 +172,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
logPolynomialTransport(const dictionary& dict); explicit logPolynomialTransport(const dictionary& dict);
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<logPolynomialTransport> clone() const; inline autoPtr<logPolynomialTransport> clone() const;
@ -180,7 +184,7 @@ public:
); );
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -204,16 +208,14 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const logPolynomialTransport&);
inline void operator+=(const logPolynomialTransport&); inline void operator+=(const logPolynomialTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend logPolynomialTransport operator+ <Thermo, PolySize> friend logPolynomialTransport operator+ <Thermo, PolySize>
( (
@ -228,7 +230,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo, PolySize> friend Ostream& operator<< <Thermo, PolySize>
( (

View File

@ -108,19 +108,6 @@ inline Foam::scalar Foam::logPolynomialTransport<Thermo, PolySize>::alphah
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo, int PolySize>
inline void Foam::logPolynomialTransport<Thermo, PolySize>::operator=
(
const logPolynomialTransport<Thermo, PolySize>& pt
)
{
Thermo::operator=(pt);
muCoeffs_ = pt.muCoeffs_;
kappaCoeffs_ = pt.kappaCoeffs_;
}
template<class Thermo, int PolySize> template<class Thermo, int PolySize>
inline void Foam::logPolynomialTransport<Thermo, PolySize>::operator+= inline void Foam::logPolynomialTransport<Thermo, PolySize>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -84,7 +85,7 @@ See also
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo, int PolySize> class polynomialTransport; template<class Thermo, int PolySize> class polynomialTransport;
@ -119,7 +120,7 @@ class polynomialTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
//- Dynamic viscosity polynomial coefficients //- Dynamic viscosity polynomial coefficients
Polynomial<PolySize> muCoeffs_; Polynomial<PolySize> muCoeffs_;
@ -147,13 +148,16 @@ class polynomialTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct as named copy //- Construct as named copy
inline polynomialTransport(const word&, const polynomialTransport&); inline polynomialTransport(const word&, const polynomialTransport&);
//- Construct from dictionary //- Construct from dictionary
polynomialTransport(const dictionary& dict); explicit polynomialTransport(const dictionary& dict);
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<polynomialTransport> clone() const; inline autoPtr<polynomialTransport> clone() const;
@ -162,7 +166,7 @@ public:
inline static autoPtr<polynomialTransport> New(const dictionary& dict); inline static autoPtr<polynomialTransport> New(const dictionary& dict);
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -186,16 +190,14 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const polynomialTransport&);
inline void operator+=(const polynomialTransport&); inline void operator+=(const polynomialTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend polynomialTransport operator+ <Thermo, PolySize> friend polynomialTransport operator+ <Thermo, PolySize>
( (
@ -210,7 +212,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo, PolySize> friend Ostream& operator<< <Thermo, PolySize>
( (

View File

@ -108,19 +108,6 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::alphah
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Thermo, int PolySize>
inline void Foam::polynomialTransport<Thermo, PolySize>::operator=
(
const polynomialTransport<Thermo, PolySize>& pt
)
{
Thermo::operator=(pt);
muCoeffs_ = pt.muCoeffs_;
kappaCoeffs_ = pt.kappaCoeffs_;
}
template<class Thermo, int PolySize> template<class Thermo, int PolySize>
inline void Foam::polynomialTransport<Thermo, PolySize>::operator+= inline void Foam::polynomialTransport<Thermo, PolySize>::operator+=
( (

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -54,7 +55,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
template<class Thermo> class sutherlandTransport; template<class Thermo> class sutherlandTransport;
@ -89,7 +90,7 @@ class sutherlandTransport
: :
public Thermo public Thermo
{ {
// Private data // Private Data
// Sutherland's coefficients // Sutherland's coefficients
scalar As_, Ts_; scalar As_, Ts_;
@ -111,6 +112,9 @@ class sutherlandTransport
public: public:
// Generated Methods: copy construct, copy assignment
// Constructors // Constructors
//- Construct from components //- Construct from components
@ -133,7 +137,7 @@ public:
inline sutherlandTransport(const word&, const sutherlandTransport&); inline sutherlandTransport(const word&, const sutherlandTransport&);
//- Construct from dictionary //- Construct from dictionary
sutherlandTransport(const dictionary& dict); explicit sutherlandTransport(const dictionary& dict);
//- Construct from base thermo and dictionary //- Construct from base thermo and dictionary
sutherlandTransport(const Thermo& t,const dictionary& dict); sutherlandTransport(const Thermo& t,const dictionary& dict);
@ -145,7 +149,7 @@ public:
inline static autoPtr<sutherlandTransport> New(const dictionary& dict); inline static autoPtr<sutherlandTransport> New(const dictionary& dict);
// Member functions // Member Functions
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
@ -169,16 +173,14 @@ public:
void write(Ostream& os) const; void write(Ostream& os) const;
// Member operators // Member Operators
inline void operator=(const sutherlandTransport&);
inline void operator+=(const sutherlandTransport&); inline void operator+=(const sutherlandTransport&);
inline void operator*=(const scalar); inline void operator*=(const scalar);
// Friend operators // Friend Operators
friend sutherlandTransport operator+ <Thermo> friend sutherlandTransport operator+ <Thermo>
( (
@ -193,7 +195,7 @@ public:
); );
// Ostream Operator // IOstream Operators
friend Ostream& operator<< <Thermo> friend Ostream& operator<< <Thermo>
( (

Some files were not shown because too many files have changed in this diff Show More