Commit 5fb3baff authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some minor correction to eliminate warnings and pedantic errors

parent af1268e7
......@@ -89,15 +89,15 @@ public:
}
/// This method is called before \ref beginIteration, \ref oneIteration and \ref endIteration.
virtual void initTimestep(AdaptInfo *adaptInfo)
virtual void initTimestep(AdaptInfo *adaptInfo) override
{}
/// calls \ref writeFiles
virtual void closeTimestep(AdaptInfo *adaptInfo);
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
virtual void beginIteration(AdaptInfo *adaptInfo);
virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);
virtual void endIteration(AdaptInfo *adaptInfo);
virtual void beginIteration(AdaptInfo *adaptInfo) override;
virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION) override;
virtual void endIteration(AdaptInfo *adaptInfo) override;
/// Calls writeFiles of the problem
virtual void writeFiles(AdaptInfo *adaptInfo, bool force)
......
......@@ -42,15 +42,15 @@ namespace detail {
CahnHilliard(const std::string &name_);
~CahnHilliard() {};
void solveInitialProblem(AMDiS::AdaptInfo *adaptInfo) override;
virtual void solveInitialProblem(AMDiS::AdaptInfo *adaptInfo) override;
double getEpsilon() { return eps; }
int getDoubleWellType() { return doubleWell; }
void fillOperators() override;
void fillBoundaryConditions() override {}
virtual void fillOperators() override;
virtual void fillBoundaryConditions() override {}
void finalizeData() override;
virtual void finalizeData() override;
protected: // protected variables
......
......@@ -24,9 +24,18 @@ namespace AMDiS { namespace base_problems {
CahnHilliardNavierStokes_RB::CahnHilliardNavierStokes_RB(const std::string &name_) :
super(name_),
reinit(NULL),
velocity(NULL),
useMobility(false),
useConservationForm(false),
dim(2),
laplaceType(0),
nonLinTerm(3),
doubleWell(1),
oldTimestep(0.0),
viscosity(1.0),
density(1.0),
c(0.0),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
......@@ -34,16 +43,8 @@ CahnHilliardNavierStokes_RB::CahnHilliardNavierStokes_RB(const std::string &name
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
laplaceType(0),
nonLinTerm(3),
oldTimestep(0.0),
viscosity(1.0),
density(1.0),
c(0.0),
sigma(1.0),
surfaceTension(1.0),
reinit(NULL),
velocity(NULL),
fileWriter(NULL)
{
// parameters for CH
......@@ -91,8 +92,7 @@ CahnHilliardNavierStokes_RB::CahnHilliardNavierStokes_RB(const std::string &name
CahnHilliardNavierStokes_RB::~CahnHilliardNavierStokes_RB()
{ FUNCNAME("CahnHilliardNavierStokes_RB::~CahnHilliardNavierStokes_RB()");
{
if (reinit != NULL) {
delete reinit;
reinit = NULL;
......@@ -107,8 +107,7 @@ CahnHilliardNavierStokes_RB::~CahnHilliardNavierStokes_RB()
void CahnHilliardNavierStokes_RB::initData()
{ FUNCNAME("CahnHilliardNavierStokes_RB::initData()");
{
dim = getMesh()->getDim();
// create instance redistancing class
reinit = new HL_SignedDistTraverse("reinit", dim);
......@@ -122,8 +121,7 @@ void CahnHilliardNavierStokes_RB::initData()
void CahnHilliardNavierStokes_RB::transferInitialSolution(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_RB::transferInitialSolution()");
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
......@@ -367,8 +365,7 @@ void CahnHilliardNavierStokes_RB::fillOperators()
void CahnHilliardNavierStokes_RB::addLaplaceTerm(int i)
{ FUNCNAME("CahnHilliardNavierStokes_RB::addLaplaceTerm()");
{
/// < nu*[grad(u)+grad(u)^t] , grad(psi) >
if (laplaceType == 1) {
for (unsigned j = 0; j < dow; ++j) {
......@@ -389,8 +386,7 @@ void CahnHilliardNavierStokes_RB::addLaplaceTerm(int i)
}
void CahnHilliardNavierStokes_RB::closeTimestep(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_RB::closeTimestep()");
{
calcVelocity();
fileWriter->writeFiles(adaptInfo, false);
writeFiles(adaptInfo, false);
......
......@@ -52,11 +52,7 @@ public: // public methods
virtual void fillBoundaryConditions() {}
virtual void addLaplaceTerm(int i);
protected: // protected variables
HL_SignedDistTraverse *reinit;
DOFVector<WorldVector<double> >* velocity;
protected: // methods
void calcVelocity()
{
......@@ -67,6 +63,12 @@ protected: // protected variables
else if (dow == 3)
transformDOF(prob->getSolution()->getDOFVector(2), prob->getSolution()->getDOFVector(3), prob->getSolution()->getDOFVector(4), velocity, new AMDiS::Vec3WorldVec<double>);
}
protected: // protected variables
HL_SignedDistTraverse *reinit;
DOFVector<WorldVector<double> >* velocity;
bool useMobility;
bool useConservationForm;
......
......@@ -25,28 +25,29 @@ namespace AMDiS { namespace base_problems {
CahnHilliardNavierStokes_TwoPhase::CahnHilliardNavierStokes_TwoPhase(const std::string &name_) :
super(name_),
reinit(NULL),
velocity(NULL),
useMobility(false),
useConservationForm(false),
doubleWell(1),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
epsInv(10.0),
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
dim(2),
laplaceType(0),
nonLinTerm(3),
doubleWell(1),
oldTimestep(0.0),
viscosity1(1.0),
viscosity2(1.0),
density1(1.0),
density2(1.0),
c(0.0),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
epsInv(10.0),
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
sigma(1.0),
surfaceTension(1.0),
reinit(NULL),
velocity(NULL),
fileWriter(NULL)
{
// parameters for CH
......@@ -97,8 +98,7 @@ CahnHilliardNavierStokes_TwoPhase::CahnHilliardNavierStokes_TwoPhase(const std::
CahnHilliardNavierStokes_TwoPhase::~CahnHilliardNavierStokes_TwoPhase()
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::~CahnHilliardNavierStokes_TwoPhase()");
{
if (reinit != NULL) {
delete reinit;
reinit = NULL;
......@@ -113,8 +113,7 @@ CahnHilliardNavierStokes_TwoPhase::~CahnHilliardNavierStokes_TwoPhase()
void CahnHilliardNavierStokes_TwoPhase::initData()
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::initData()");
{
dim = getMesh()->getDim();
// create instance redistancing class
reinit = new HL_SignedDistTraverse("reinit", dim);
......@@ -128,8 +127,7 @@ void CahnHilliardNavierStokes_TwoPhase::initData()
void CahnHilliardNavierStokes_TwoPhase::transferInitialSolution(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::transferInitialSolution()");
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
......@@ -394,8 +392,7 @@ void CahnHilliardNavierStokes_TwoPhase::addMaterialDerivativeNonConst(int i)
void CahnHilliardNavierStokes_TwoPhase::addLaplaceTermConst(int i)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::addLaplaceTerm()");
{
/// < alpha*[grad(u)+grad(u)^t] , grad(psi) >
if (laplaceType == 1) {
for (size_t j = 0; j < dow; ++j) {
......@@ -413,8 +410,7 @@ void CahnHilliardNavierStokes_TwoPhase::addLaplaceTermConst(int i)
void CahnHilliardNavierStokes_TwoPhase::addLaplaceTermNonConst(int i)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::addLaplaceTerm()");
{
/// < alpha*[grad(u)+grad(u)^t] , grad(psi) >
if (laplaceType == 1) {
for (size_t j = 0; j < dow; ++j) {
......@@ -437,8 +433,7 @@ void CahnHilliardNavierStokes_TwoPhase::addLaplaceTermNonConst(int i)
void CahnHilliardNavierStokes_TwoPhase::closeTimestep(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase::closeTimestep()");
{
calcVelocity();
fileWriter->writeFiles(adaptInfo, false);
writeFiles(adaptInfo, false);
......
......@@ -37,10 +37,10 @@ public: // public methods
CahnHilliardNavierStokes_TwoPhase(const std::string &name_);
~CahnHilliardNavierStokes_TwoPhase();
virtual void initData();
virtual void initData() override;
virtual void transferInitialSolution(AdaptInfo *adaptInfo);
virtual void closeTimestep(AdaptInfo *adaptInfo);
virtual void transferInitialSolution(AdaptInfo *adaptInfo) override;
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
double getEpsilon() { return eps; }
int getDoubleWellType() { return doubleWell; }
......@@ -50,20 +50,15 @@ public: // public methods
return velocity;
}
virtual void fillOperators();
virtual void fillBoundaryConditions() {}
virtual void fillOperators() override;
virtual void fillBoundaryConditions() override {}
virtual void addMaterialDerivativeConst(int i);
virtual void addMaterialDerivativeNonConst(int i);
virtual void addLaplaceTermConst(int i);
virtual void addLaplaceTermNonConst(int i);
protected: // protected variables
HL_SignedDistTraverse *reinit;
DOFVector<WorldVector<double> >* velocity;
protected: // methods
void calcVelocity()
{
if (dow == 1)
......@@ -73,6 +68,12 @@ protected: // protected variables
else if (dow == 3)
transformDOF(prob->getSolution()->getDOFVector(2), prob->getSolution()->getDOFVector(3), prob->getSolution()->getDOFVector(4), velocity, new AMDiS::Vec3WorldVec<double>);
}
protected: // protected variables
HL_SignedDistTraverse *reinit;
DOFVector<WorldVector<double> >* velocity;
bool useMobility;
bool useConservationForm;
......
......@@ -100,8 +100,7 @@ CahnHilliardNavierStokes_TwoPhase_RB::CahnHilliardNavierStokes_TwoPhase_RB(const
CahnHilliardNavierStokes_TwoPhase_RB::~CahnHilliardNavierStokes_TwoPhase_RB()
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase_RB::~CahnHilliardNavierStokes_TwoPhase_RB()");
{
if (velocity != NULL) {
delete velocity;
velocity = NULL;
......@@ -112,8 +111,7 @@ CahnHilliardNavierStokes_TwoPhase_RB::~CahnHilliardNavierStokes_TwoPhase_RB()
void CahnHilliardNavierStokes_TwoPhase_RB::initData()
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase_RB::initData()");
{
dim = getMesh()->getDim();
if (velocity == NULL)
......@@ -125,8 +123,7 @@ void CahnHilliardNavierStokes_TwoPhase_RB::initData()
void CahnHilliardNavierStokes_TwoPhase_RB::transferInitialSolution(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase_RB::transferInitialSolution()");
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
......@@ -446,8 +443,7 @@ void CahnHilliardNavierStokes_TwoPhase_RB::fillOperators()
void CahnHilliardNavierStokes_TwoPhase_RB::addStressTerm(int i)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase_RB::addStressTerm()");
{
/// < nu*[grad(u)+grad(u)^t] , grad(psi) >
if (laplaceType == 1) {
for (unsigned j = 0; j < dow; ++j) {
......@@ -509,8 +505,7 @@ void CahnHilliardNavierStokes_TwoPhase_RB::addStressTerm(int i)
}
void CahnHilliardNavierStokes_TwoPhase_RB::closeTimestep(AdaptInfo *adaptInfo)
{ FUNCNAME("CahnHilliardNavierStokes_TwoPhase_RB::closeTimestep()");
{
calcVelocity();
fileWriter->writeFiles(adaptInfo, false);
writeFiles(adaptInfo, false);
......
......@@ -45,9 +45,9 @@ public:
~CouplingBaseProblem() { }
void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
virtual void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
{
for (size_t i = 0; i < baseProblems.size(); i++) {
for (size_t j = 0; j < baseProblems[i]->getNumProblems(); j++)
......
......@@ -138,9 +138,9 @@ public:
~CouplingBaseProblem() { }
void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
virtual void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
{
using namespace AMDiS::extensions;
tools::FOR_EACH< detail::AddProblem >::loop2(*this, baseProblems);
......
......@@ -130,9 +130,9 @@ public:
* iterationInterface in this method. This order can be changed manually in the oneIteration
* method.
**/
void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
virtual void initialize(Flag initFlag,
ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING) override
{
tools::FOR_EACH< detail::AddProblem >::loop2(*this, baseProblems);
tools::FOR_EACH< detail::AddIterationInterface >::loop2(*this, baseProblems);
......
......@@ -23,22 +23,14 @@ using namespace std;
DiffuseDomainFsi::DiffuseDomainFsi(const std::string &name_) :
super(name_),
phase(NULL),
bcPhase(NULL),
phaseInv(NULL),
velocity(NULL),
displacement(NULL),
beta(1.0),
epsilon(1.e-1),
alpha(3.0),
mu(1.0),
viscosity(1.0),
density(1.0),
lambda(1.0),
rho(1.0),
nonLinTerm(3),
fileWriterPhase(NULL),
fileWriterVelocity(NULL),
dbc_factor(1.0), pressure_factor(1.0),
beta(1.0), epsilon(1.e-1), alpha(3.0),
nonLinTerm(3), oldTimestep(1.0),
viscosity(1.0), density(1.0),
mu(1.0), lambda(1.0), rho(1.0),
phase(NULL), phaseInv(NULL), phaseInvDisturbed(NULL),
bcPhase(NULL), velocity(NULL), displacement(NULL),
fileWriterPhase(NULL), fileWriterVelocity(NULL),
fileWriterDisplacement(NULL)
{
......@@ -61,7 +53,7 @@ DiffuseDomainFsi::DiffuseDomainFsi(const std::string &name_) :
// 2... u^old*grad(u_i)
// 3... u*grad(u_i^old) + u^old*grad(u_i) - u^old*grad(u_i^old)
Parameters::get(name + "->non-linear term", nonLinTerm);
};
}
DiffuseDomainFsi::~DiffuseDomainFsi()
{
......@@ -79,7 +71,7 @@ DiffuseDomainFsi::~DiffuseDomainFsi()
}
void DiffuseDomainFsi::initData()
{
{ FUNCNAME("DiffuseDomainFsi::initData()");
super::initData();
phaseInv = new DOFVector<double>(getFeSpace(0), "phaseInv");
......@@ -88,15 +80,14 @@ void DiffuseDomainFsi::initData()
displacement = new DOFVector<WorldVector<double> >(getFeSpace(dow+1), "displacement");
dbc_factor = beta/std::pow(epsilon, alpha);
MSG_DBG("dbc_factor = %f\n", dbc_factor);
MSG("dbc_factor = %f\n", dbc_factor);
pressure_factor = -(lambda+(2.0/3.0)*mu);
MSG("pressure_factor = %f\n", pressure_factor);
}
void DiffuseDomainFsi::transferInitialSolution(AdaptInfo *adaptInfo)
{ FUNCNAME("DiffuseDomainFsi::transferInitialSolution()");
{
fileWriterPhase = new FileWriter(name + "->phase->output", getFeSpace()->getMesh(), phase);
fileWriterVelocity = new FileVectorWriter(name + "->velocity->output", getFeSpace()->getMesh(), velocity);
fileWriterDisplacement = new FileVectorWriter(name + "->displacement->output", getFeSpace()->getMesh(), displacement);
......@@ -257,8 +248,7 @@ void DiffuseDomainFsi::fillOperators()
void DiffuseDomainFsi::addLaplaceTerm(int i)
{ FUNCNAME("DiffuseDomainFsi::addLaplaceTerm()");
{
for (size_t j = 0; j < dow; ++j) {
/// < nu*[grad(u)+grad(u)^t] , grad(psi) >
Operator *opLaplaceUi1 = new Operator(prob->getFeSpace(i), prob->getFeSpace(j));
......
......@@ -43,12 +43,12 @@ public: // typedefs
public: // methods
DiffuseDomainFsi(const std::string &name_);
~DiffuseDomainFsi();
virtual ~DiffuseDomainFsi();
virtual void initData();
virtual void transferInitialSolution(AdaptInfo *adaptInfo);
virtual void initTimestep(AdaptInfo *adaptInfo);
virtual void closeTimestep(AdaptInfo *adaptInfo);
virtual void initData() override;
virtual void transferInitialSolution(AdaptInfo *adaptInfo) override;
virtual void initTimestep(AdaptInfo *adaptInfo) override;
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
// === getting/setting methods ===
......
......@@ -94,8 +94,8 @@ public: // methods
epsilon = epsilon_;
}
virtual void fillOperators();
virtual void fillBoundaryConditions();
virtual void fillOperators() override;
virtual void fillBoundaryConditions() override;
virtual void addLaplaceTerm(int i);
protected: // variables
......
......@@ -50,14 +50,14 @@ namespace detail {
* viscosity/density DOFVectors,
* initTimeInterface of super
**/
void initData() override;
void transferInitialSolution(AdaptInfo *adaptInfo) override;
virtual void initData() override;
virtual void transferInitialSolution(AdaptInfo *adaptInfo) override;
/** initTimestep of super and
* initialization of densityPhase and viscosityPhase
**/
void initTimestep(AdaptInfo *adaptInfo) override;
void closeTimestep(AdaptInfo *adaptInfo) override;
virtual void initTimestep(AdaptInfo *adaptInfo) override;
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
/** pointer to the multiPhase DOFVector, that
* indicates the different phases. Will be initialized
......@@ -65,9 +65,9 @@ namespace detail {
**/
void setMultiPhase(DOFVector<double>* p) { multiPhase=p; }
void fillOperators() override;
virtual void fillOperators() override;
void addLaplaceTerm(int i) override;
virtual void addLaplaceTerm(int i) override;
// get-methods
......
......@@ -32,8 +32,8 @@ NavierStokes_TH_MultiPhase<P>::NavierStokes_TH_MultiPhase(const std::string &nam
densityPhase(NULL),
viscosityPhase(NULL),
multiPhase(NULL),
stepSolution(NULL),
oldSolution(NULL)
oldSolution(NULL),
stepSolution(NULL)
{ FUNCNAME("NavierStokes_TH_MultiPhase::_constructor()");
Initfile::get(self::name + "->viscosity1", viscosity1); // viscosity of fluid 1
......
......@@ -45,15 +45,15 @@ namespace detail
NavierStokes_TaylorHood(const std::string &name_, bool createProblem = true);
~NavierStokes_TaylorHood();
virtual ~NavierStokes_TaylorHood();
void initData() override;
virtual void initData() override;
void transferInitialSolution(AdaptInfo *adaptInfo) override;
virtual void transferInitialSolution(AdaptInfo *adaptInfo) override;
void closeTimestep(AdaptInfo *adaptInfo) override;
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
void writeFiles(AdaptInfo *adaptInfo, bool force = false) override;
virtual void writeFiles(AdaptInfo *adaptInfo, bool force = false) override;
// === getting/setting methods ===
......@@ -74,7 +74,7 @@ namespace detail
double getDensity() { return density; }
double getViscosity() { return viscosity; }
void fillOperators() override;
virtual void fillOperators() override;
virtual void addLaplaceTerm(int i);
......
......@@ -44,13 +44,13 @@ namespace detail {
DOFVector<double>* getDensity() { return self::prob->getSolution(1); }
double calcEnergy();
void initData() override ;
void transferInitialSolution(AdaptInfo *adaptInfo) override;
virtual void initData() override ;
virtual void transferInitialSolution(AdaptInfo *adaptInfo) override;
void closeTimestep(AdaptInfo *adaptInfo) override;
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
void fillOperators() override ;
void fillBoundaryConditions() override {};
virtual void fillOperators() override ;
virtual void fillBoundaryConditions() override {};
void rejectTimestep()
{
......
......@@ -58,7 +58,7 @@ namespace AMDiS { namespace base_problems {