Commit 600d8dca authored by Henry's avatar Henry
Browse files

lagrangian: Replace dummy "notImplemented" functions with abstract functions...

lagrangian: Replace dummy "notImplemented" functions with abstract functions making base classes abstract
Make clone functions const and abstract in abstract base classes
Change copy constructors to take const argument
Make private data mutable where necessary
parent 1619a273
......@@ -117,7 +117,7 @@ Foam::DispersionRASModel<CloudType>::DispersionRASModel
template<class CloudType>
Foam::DispersionRASModel<CloudType>::DispersionRASModel
(
DispersionRASModel<CloudType>& dm
const DispersionRASModel<CloudType>& dm
)
:
DispersionModel<CloudType>(dm),
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -59,13 +59,13 @@ protected:
const volScalarField* kPtr_;
//- Take ownership of the k field
bool ownK_;
mutable bool ownK_;
//- Turbulence epsilon
const volScalarField* epsilonPtr_;
//- Take ownership of the epsilon field
bool ownEpsilon_;
mutable bool ownEpsilon_;
// Protected Functions
......@@ -89,10 +89,10 @@ public:
DispersionRASModel(const dictionary& dict, CloudType& owner);
//- Construct copy
DispersionRASModel(DispersionRASModel<CloudType>& dm);
DispersionRASModel(const DispersionRASModel<CloudType>& dm);
//- Construct and return a clone
virtual autoPtr<DispersionModel<CloudType> > clone()
virtual autoPtr<DispersionModel<CloudType> > clone() const
{
return autoPtr<DispersionModel<CloudType> >
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -45,7 +45,7 @@ Foam::GradientDispersionRAS<CloudType>::GradientDispersionRAS
template<class CloudType>
Foam::GradientDispersionRAS<CloudType>::GradientDispersionRAS
(
GradientDispersionRAS<CloudType>& dm
const GradientDispersionRAS<CloudType>& dm
)
:
DispersionRASModel<CloudType>(dm),
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -75,10 +75,10 @@ public:
GradientDispersionRAS(const dictionary& dict, CloudType& owner);
//- Construct copy
GradientDispersionRAS(GradientDispersionRAS<CloudType>& dm);
GradientDispersionRAS(const GradientDispersionRAS<CloudType>& dm);
//- Construct and return a clone
virtual autoPtr<DispersionModel<CloudType> > clone()
virtual autoPtr<DispersionModel<CloudType> > clone() const
{
return autoPtr<DispersionModel<CloudType> >
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -41,7 +41,7 @@ Foam::StochasticDispersionRAS<CloudType>::StochasticDispersionRAS
template<class CloudType>
Foam::StochasticDispersionRAS<CloudType>::StochasticDispersionRAS
(
StochasticDispersionRAS<CloudType>& dm
const StochasticDispersionRAS<CloudType>& dm
)
:
DispersionRASModel<CloudType>(dm)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -62,10 +62,10 @@ public:
StochasticDispersionRAS(const dictionary& dict, CloudType& owner);
//- Construct copy
StochasticDispersionRAS(StochasticDispersionRAS<CloudType>& dm);
StochasticDispersionRAS(const StochasticDispersionRAS<CloudType>& dm);
//- Construct and return a clone
virtual autoPtr<DispersionModel<CloudType> > clone()
virtual autoPtr<DispersionModel<CloudType> > clone() const
{
return autoPtr<DispersionModel<CloudType> >
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -36,6 +36,7 @@ namespace Foam
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::distributionModels::distributionModel::check() const
......@@ -89,50 +90,4 @@ Foam::distributionModels::distributionModel::~distributionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::distributionModels::distributionModel::sample() const
{
notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::sample() const"
);
return 0.0;
}
Foam::scalar Foam::distributionModels::distributionModel::minValue() const
{
notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::minValue() const"
);
return 0.0;
}
Foam::scalar Foam::distributionModels::distributionModel::maxValue() const
{
notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::maxValue() const"
);
return 0.0;
}
Foam::scalar Foam::distributionModels::distributionModel::meanValue() const
{
notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::meanValue() const"
);
return 0.0;
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -121,10 +121,7 @@ public:
distributionModel(const distributionModel& p);
//- Construct and return a clone
virtual autoPtr<distributionModel> clone() const
{
return autoPtr<distributionModel>(new distributionModel(*this));
}
virtual autoPtr<distributionModel> clone() const = 0;
//- Selector
......@@ -142,16 +139,16 @@ public:
// Member Functions
//- Sample the distributionModel
virtual scalar sample() const;
virtual scalar sample() const = 0;
//- Return the minimum value
virtual scalar minValue() const;
virtual scalar minValue() const = 0;
//- Return the maximum value
virtual scalar maxValue() const;
virtual scalar maxValue() const = 0;
//- Return the maximum value
virtual scalar meanValue() const;
virtual scalar meanValue() const = 0;
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -54,38 +54,6 @@ Foam::IntegrationScheme<Type>::~IntegrationScheme()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
typename Foam::IntegrationScheme<Type>::integrationResult
Foam::IntegrationScheme<Type>::integrate
(
const Type& phi,
const scalar dt,
const Type& alphaBeta,
const scalar beta
) const
{
notImplemented
(
"Foam::IntegrationScheme<Type>::integrationResult"
"Foam::IntegrationScheme<Type>::integrate"
"("
"const Type&, "
"const scalar, "
"const Type&, "
"const scalar"
") const"
);
typename IntegrationScheme<Type>::integrationResult retValue;
retValue.average() = pTraits<Type>::zero;
retValue.value() = pTraits<Type>::zero;
return retValue;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "IntegrationSchemeNew.C"
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -154,13 +154,7 @@ public:
IntegrationScheme(const IntegrationScheme& is);
//- Construct and return clone
virtual autoPtr<IntegrationScheme<Type> > clone() const
{
return autoPtr<IntegrationScheme<Type> >
(
new IntegrationScheme<Type>(*this)
);
}
virtual autoPtr<IntegrationScheme<Type> > clone() const = 0;
// Selectors
......@@ -186,7 +180,7 @@ public:
const scalar dt,
const Type& alphaBeta,
const scalar beta
) const;
) const = 0;
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,7 +47,10 @@ Foam::CollisionModel<CloudType>::CollisionModel
template<class CloudType>
Foam::CollisionModel<CloudType>::CollisionModel(CollisionModel<CloudType>& cm)
Foam::CollisionModel<CloudType>::CollisionModel
(
const CollisionModel<CloudType>& cm
)
:
CloudSubModelBase<CloudType>(cm)
{}
......@@ -60,36 +63,6 @@ Foam::CollisionModel<CloudType>::~CollisionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::label Foam::CollisionModel<CloudType>::nSubCycles() const
{
notImplemented
(
"Foam::label Foam::CollisionModel<CloudType>::nSubCycles() const"
);
return 0;
}
template<class CloudType>
bool Foam::CollisionModel<CloudType>::controlsWallInteraction() const
{
notImplemented
(
"bool Foam::CollisionModel<CloudType>::controlsWallInteraction()"
);
return false;
}
template<class CloudType>
void Foam::CollisionModel<CloudType>::collide()
{
notImplemented("void Foam::CollisionModel<CloudType>::collide()");
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "CollisionModelNew.C"
......
......@@ -94,16 +94,10 @@ public:
);
//- Construct copy
CollisionModel(CollisionModel<CloudType>& cm);
CollisionModel(const CollisionModel<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<CollisionModel<CloudType> > clone()
{
return autoPtr<CollisionModel<CloudType> >
(
new CollisionModel<CloudType>(*this)
);
}
virtual autoPtr<CollisionModel<CloudType> > clone() const = 0;
//- Destructor
......@@ -122,14 +116,14 @@ public:
//- Return the number of times to subcycle the current
// timestep to meet the criteria of the collision model
virtual label nSubCycles() const;
virtual label nSubCycles() const = 0;
//- Indicates whether model determines wall collisions or not,
// used to determine what value to use for wallImpactDistance
virtual bool controlsWallInteraction() const;
virtual bool controlsWallInteraction() const = 0;
// Collision function
virtual void collide();
virtual void collide() = 0;
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -41,7 +41,7 @@ Foam::NoCollision<CloudType>::NoCollision
template<class CloudType>
Foam::NoCollision<CloudType>::NoCollision
(
NoCollision<CloudType>& cm
const NoCollision<CloudType>& cm
)
:
CollisionModel<CloudType>(cm)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -64,10 +64,10 @@ public:
NoCollision(const dictionary& dict, CloudType& owner);
//- Construct copy
NoCollision(NoCollision<CloudType>& cm);
NoCollision(const NoCollision<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<CollisionModel<CloudType> > clone()
virtual autoPtr<CollisionModel<CloudType> > clone() const
{
return autoPtr<CollisionModel<CloudType> >
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -597,13 +597,17 @@ Foam::PairCollision<CloudType>::PairCollision
template<class CloudType>
Foam::PairCollision<CloudType>::PairCollision(PairCollision<CloudType>& cm)
Foam::PairCollision<CloudType>::PairCollision
(
const PairCollision<CloudType>& cm
)
:
CollisionModel<CloudType>(cm),
pairModel_(NULL),
wallModel_(NULL),
il_(cm.owner().mesh())
{
// Need to clone to PairModel and WallModel
notImplemented
(
"Foam::PairCollision<CloudType>::PairCollision"
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -151,10 +151,10 @@ public:
PairCollision(const dictionary& dict, CloudType& owner);
//- Construct copy
PairCollision(PairCollision<CloudType>& cm);
PairCollision(const PairCollision<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<CollisionModel<CloudType> > clone()
virtual autoPtr<CollisionModel<CloudType> > clone() const
{
return autoPtr<CollisionModel<CloudType> >
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -49,7 +49,7 @@ Foam::DispersionModel<CloudType>::DispersionModel
template<class CloudType>
Foam::DispersionModel<CloudType>::DispersionModel
(
DispersionModel<CloudType>& dm
const DispersionModel<CloudType>& dm
)
:
CloudSubModelBase<CloudType>(dm)
......@@ -63,36 +63,6 @@ Foam::DispersionModel<CloudType>::~DispersionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::vector Foam::DispersionModel<CloudType>::update
(
const scalar,
const label,
const vector&,
const vector& Uc,
vector&,
scalar&
)
{
notImplemented
(
"Foam::vector Foam::DispersionModel<CloudType>::update"
"("
"const scalar, "
"const label, "
"const vector&, "
"const vector&, "
"vector&, "
"scalar&"
")"
);
return Uc;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "DispersionModelNew.C"
......
......@@ -85,16 +85,10 @@ public:
);
//- Construct copy
DispersionModel(DispersionModel<CloudType>& dm);
DispersionModel(const DispersionModel<CloudType>& dm);
//- Construct and return a clone
virtual autoPtr<DispersionModel<CloudType> > clone()
{
return autoPtr<DispersionModel<CloudType> >
(
new DispersionModel<CloudType>(*this)
);
}
virtual autoPtr<DispersionModel<CloudType> > clone() const = 0;
//- Destructor
......@@ -120,7 +114,7 @@ public:
const vector& Uc,