Commit b2713d23 authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: declare generated methods for lagrangian and thermo/functions

parent c83cc8cb
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -63,16 +64,19 @@ class Uniform
:
public Constant<Type>
{
// Private Member Functions
public:
//- No copy assignment
void operator=(const Uniform<Type>&) = delete;
//- Declare type-name, virtual type (with debug switch)
TypeName("uniform");
public:
// Generated Methods
// Runtime type information
TypeName("uniform");
//- Copy construct
Uniform<Type>(const Uniform&) = default;
//- No copy assignment
void operator=(const Uniform<Type>&) = delete;
// Constructors
......
......@@ -34,33 +34,21 @@ Foam::Polynomial<PolySize>::Polynomial()
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false),
logCoeff_(0.0)
logCoeff_(0)
{
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>
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false),
logCoeff_(0.0)
logCoeff_(0)
{
for (int i=0; i<PolySize; i++)
{
......@@ -74,7 +62,7 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
logActive_(false),
logCoeff_(0.0)
logCoeff_(0)
{
if (coeffs.size() != PolySize)
{
......@@ -96,7 +84,7 @@ Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
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>(),
logActive_(false),
logCoeff_(0.0)
logCoeff_(0)
{
word isName(is);
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -63,11 +64,10 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
template<int PolySize>
class Polynomial;
// Forward declaration of friend functions
template<int PolySize>
Ostream& operator<<
(
......@@ -87,7 +87,7 @@ class Polynomial
{
static_assert(PolySize > 0, "Size must be positive (non-zero)");
// Private data
// Private Data
//- Include the log term? - only activated using integralMinus1()
bool logActive_;
......@@ -98,19 +98,20 @@ class Polynomial
public:
typedef Polynomial<PolySize> polyType;
// Public Typedefs
typedef Polynomial<PolySize+1> intPolyType;
typedef Polynomial<PolySize> polyType;
typedef Polynomial<PolySize+1> intPolyType;
// Generated Methods: copy construct, copy assignment
// Constructors
//- Construct null, with all coefficients = 0.0
//- Default construct, with all coefficients = 0
Polynomial();
//- Copy constructor
Polynomial(const Polynomial&);
//- Construct from C-array of coefficients
explicit Polynomial(const scalar coeffs[PolySize]);
......@@ -118,10 +119,10 @@ public:
explicit Polynomial(const UList<scalar>& coeffs);
//- Construct from Istream
Polynomial(Istream&);
explicit Polynomial(Istream& is);
//- Construct from name and Istream
Polynomial(const word& name, Istream&);
Polynomial(const word& name, Istream& is);
// Member Functions
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -29,14 +30,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::referredWallFace::referredWallFace()
:
face(),
pts_(),
patchi_()
{}
Foam::referredWallFace::referredWallFace
(
const face& f,
......@@ -48,36 +41,16 @@ Foam::referredWallFace::referredWallFace
pts_(pts),
patchi_(patchi)
{
if (this->size() != pts_.size())
if (face::size() != pts_.size())
{
FatalErrorInFunction
<< "Face and pointField are not the same size. " << nl << (*this)
<< "Face and pointField are not the same size." << nl
<< (*this) << nl
<< 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 * * * * * * * * * * * * * * //
bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -47,16 +48,11 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
// Forward Declarations
class referredWallFace;
Istream& operator>>(Istream&, referredWallFace&);
Ostream& operator<<(Ostream&, const referredWallFace&);
/*---------------------------------------------------------------------------*\
Class referredWallFace Declaration
\*---------------------------------------------------------------------------*/
......@@ -65,7 +61,7 @@ class referredWallFace
:
public face
{
// Private data
// Private Data
//- Points of face
pointField pts_;
......@@ -76,10 +72,13 @@ class referredWallFace
public:
// Constructors
// Generated Methods
//- Default construct
referredWallFace() = default;
//- Construct null
referredWallFace();
// Constructors
//- Construct from components
referredWallFace
......@@ -89,13 +88,6 @@ public:
label patchi
);
//- Construct as copy
referredWallFace(const referredWallFace&);
//- Destructor
~referredWallFace();
// Member Functions
......@@ -119,6 +111,7 @@ public:
bool operator==(const referredWallFace&) const;
bool operator!=(const referredWallFace&) const;
// IOstream Operators
friend Istream& operator>>(Istream&, referredWallFace&);
......
......@@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::pointField& Foam::referredWallFace::points() const
......
......@@ -31,14 +31,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class PairType, class WallType>
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList()
:
pairRecords_(),
wallRecords_()
{}
template<class PairType, class WallType>
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 * * * * * * * * * * * * * * //
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 * * * * * * * * * * * * * * //
template<class PairType, class WallType>
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -47,7 +48,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
template<class PairType, class WallType>
class CollisionRecordList;
......@@ -79,7 +80,7 @@ Ostream& operator<<(Ostream&, const CollisionRecordList<PairType, WallType>&);
template<class PairType, class WallType>
class CollisionRecordList
{
// Private data
// Private Data
//- List of active pair collisions
DynamicList<PairCollisionRecord<PairType>> pairRecords_;
......@@ -90,13 +91,16 @@ class CollisionRecordList
public:
// Constructors
// Generated Methods
//- Default construct
CollisionRecordList() = default;
//- Construct null
CollisionRecordList();
// Constructors
//- Construct from Istream
CollisionRecordList(Istream&);
explicit CollisionRecordList(Istream& is);
//- Construct from component fields (for IO)
CollisionRecordList
......@@ -110,9 +114,6 @@ public:
const Field<WallType>& wallData
);
//- Destructor
~CollisionRecordList();
// Member Functions
......@@ -196,11 +197,6 @@ public:
void update();
// Member Operators
void operator=(const CollisionRecordList&);
// Friend Operators
friend bool operator== <PairType, WallType>
......
......@@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class PairType, class WallType>
......@@ -45,7 +43,4 @@ Foam::CollisionRecordList<PairType, WallType>::wallRecords() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
......@@ -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 * * * * * * * * * * * * * //
void Foam::phaseProperties::reorder
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -48,14 +49,11 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class phaseProperties;
Istream& operator>>(Istream&, phaseProperties&);
Ostream& operator<<(Ostream&, const phaseProperties&);
/*---------------------------------------------------------------------------*\
Class phaseProperties Declaration
\*---------------------------------------------------------------------------*/
......@@ -64,7 +62,7 @@ class phaseProperties
{
public:
// Public data
// Public Data
//- Phase type enumeration
enum phaseType
......@@ -81,7 +79,7 @@ public:
private:
// Private data
// Private Data
//- Phase type
phaseType phase_;
......@@ -118,21 +116,14 @@ public:
// Constructors
//- Null constructor
//- Default construct, as 'UNKNOWN' state
phaseProperties();
//- Construct from Istream
phaseProperties(Istream& is);
//- Construct as copy
phaseProperties(const phaseProperties& pp);
//- Destructor
~phaseProperties() = default;
explicit phaseProperties(Istream& is);
// Public Member Functions
// Member Functions
//- Reorder species to be consistent with the corresponding
// phase specie name list
......
......@@ -32,11 +32,7 @@ License
Foam::phaseProperties::phaseProperties(Istream& is)
:
phase_(UNKNOWN),
stateLabel_("(unknown)"),
names_(),
Y_(),
carrierIds_()
phaseProperties()
{
is >> *this;
}
......@@ -59,7 +55,7 @@ Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)
const label nComponents = pp.names_.size();
pp.Y_.resize(nComponents, 0.0);
pp.Y_.resize(nComponents, Zero);
pp.carrierIds_.resize(nComponents, -1);
for (label cmpti = 0; cmpti < nComponents; ++cmpti)
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -50,7 +51,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class forceSuSp;
inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2);
......@@ -65,13 +66,12 @@ class forceSuSp
:
public Tuple2<vector, scalar>
{
public:
// Constructors
//- Construct null
inline forceSuSp();
//- Default construct
forceSuSp() = default;
//- Construct zero-initialized content
inline forceSuSp(const zero);
......@@ -83,7 +83,7 @@ public:
inline forceSuSp(const vector& Su, const scalar Sp);
//- Construct from Istream
inline forceSuSp(Istream& is);
inline explicit forceSuSp(Istream& is);
// Member Functions
......@@ -108,9 +108,6 @@ public:
// Operators