Commit df4ca9a4 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some methods are set to const

parent 543b6e3c
...@@ -57,7 +57,7 @@ namespace AMDiS { ...@@ -57,7 +57,7 @@ namespace AMDiS {
BoundaryType type = localBC->getBoundaryType(); BoundaryType type = localBC->getBoundaryType();
TEST_EXIT(localBCs[type] == NULL) TEST_EXIT(localBCs[type] == NULL)
("There is already a condition for this type.\n"); ("There is already a condition for this type %d.\n",type);
localBCs[type] = localBC; localBCs[type] = localBC;
std::vector<BoundaryCondition*>& boundMap = globalBoundaryMap[type]; std::vector<BoundaryCondition*>& boundMap = globalBoundaryMap[type];
......
...@@ -417,7 +417,7 @@ namespace AMDiS { ...@@ -417,7 +417,7 @@ namespace AMDiS {
* transformation to the reference element. * transformation to the reference element.
* pure virtual => must be overriden in sub-class. * pure virtual => must be overriden in sub-class.
*/ */
virtual double getNormal(int side, WorldVector<double> &normal) = 0; virtual double getNormal(int side, WorldVector<double> &normal) const = 0;
/** \brief /** \brief
......
...@@ -186,7 +186,7 @@ namespace AMDiS { ...@@ -186,7 +186,7 @@ namespace AMDiS {
/* coord; return the absulute value of the determinant from the */ /* coord; return the absulute value of the determinant from the */
/* transformation to the reference element */ /* transformation to the reference element */
/****************************************************************************/ /****************************************************************************/
double ElInfo1d::getNormal(int side, WorldVector<double> &normal) double ElInfo1d::getNormal(int side, WorldVector<double> &normal) const
{ {
normal = coord[side] - coord[(side + 1) % 2]; normal = coord[side] - coord[(side + 1) % 2];
double det = norm(&normal); double det = norm(&normal);
......
...@@ -53,7 +53,7 @@ namespace AMDiS { ...@@ -53,7 +53,7 @@ namespace AMDiS {
double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
/// 1-dimensional realisation of ElInfo's getNormal method. /// 1-dimensional realisation of ElInfo's getNormal method.
double getNormal(int side, WorldVector<double> &normal); double getNormal(int side, WorldVector<double> &normal) const;
/// 1-dimensional realisation of ElInfo's getElementNormal method. /// 1-dimensional realisation of ElInfo's getElementNormal method.
double getElementNormal( WorldVector<double> &normal) const; double getElementNormal( WorldVector<double> &normal) const;
......
...@@ -711,7 +711,7 @@ namespace AMDiS { ...@@ -711,7 +711,7 @@ namespace AMDiS {
} }
double ElInfo2d::getNormal(int side, WorldVector<double> &normal) double ElInfo2d::getNormal(int side, WorldVector<double> &normal) const
{ {
FUNCNAME("ElInfo::getNormal()"); FUNCNAME("ElInfo::getNormal()");
...@@ -722,7 +722,7 @@ namespace AMDiS { ...@@ -722,7 +722,7 @@ namespace AMDiS {
normal[0] = coord[i1][1] - coord[i0][1]; normal[0] = coord[i1][1] - coord[i0][1];
normal[1] = coord[i0][0] - coord[i1][0]; normal[1] = coord[i0][0] - coord[i1][0];
} else { // dow == 3 } else { // dow == 3
WorldVector<double> e0, elementNormal; WorldVector<double> e0, e1, e2, elementNormal;
e0 = coord[i1]; e0 = coord[i1];
e0 -= coord[i0]; e0 -= coord[i0];
......
...@@ -54,7 +54,7 @@ namespace AMDiS { ...@@ -54,7 +54,7 @@ namespace AMDiS {
double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
/// 2-dimensional realisation of ElInfo's getNormal method. /// 2-dimensional realisation of ElInfo's getNormal method.
double getNormal(int side, WorldVector<double> &normal); double getNormal(int side, WorldVector<double> &normal) const;
/// 2-dimensional realisation of ElInfo's getElementNormal method. /// 2-dimensional realisation of ElInfo's getElementNormal method.
double getElementNormal(WorldVector<double> &normal) const; double getElementNormal(WorldVector<double> &normal) const;
......
...@@ -451,7 +451,7 @@ namespace AMDiS { ...@@ -451,7 +451,7 @@ namespace AMDiS {
} }
double ElInfo3d::getNormal(int face, WorldVector<double> &normal) double ElInfo3d::getNormal(int face, WorldVector<double> &normal) const
{ {
FUNCNAME("ElInfo3d::getNormal()"); FUNCNAME("ElInfo3d::getNormal()");
......
...@@ -66,7 +66,7 @@ namespace AMDiS { ...@@ -66,7 +66,7 @@ namespace AMDiS {
double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
/// 3-dimensional realisation of ElInfo's getNormal method. /// 3-dimensional realisation of ElInfo's getNormal method.
double getNormal(int side, WorldVector<double> &normal); double getNormal(int side, WorldVector<double> &normal) const;
/// update ElInfo after refinement (of some neighbours). Only in 3d! /// update ElInfo after refinement (of some neighbours). Only in 3d!
void update(); void update();
......
...@@ -57,7 +57,7 @@ namespace AMDiS { ...@@ -57,7 +57,7 @@ namespace AMDiS {
std::ifstream inputFile; std::ifstream inputFile;
inputFile.open(fn.c_str(), std::ios::in); inputFile.open(fn.c_str(), std::ios::in);
if (!inputFile.is_open()) if (!inputFile.is_open())
throw runtime_error("init-file cannot be opened for reading"); throw runtime_error("init-file '" + fn + "' cannot be opened for reading");
fn_include_list.insert(fn); fn_include_list.insert(fn);
read(inputFile); read(inputFile);
......
...@@ -120,8 +120,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_, ...@@ -120,8 +120,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_,
TEST_EXIT(velExt)("velExt not defined !\n"); TEST_EXIT(velExt)("velExt not defined !\n");
TEST_EXIT(vel_DOF_)("velocity vector vel_DOF_ not defined !\n"); TEST_EXIT(vel_DOF_)("velocity vector vel_DOF_ not defined !\n");
if (calcSDFct) if (calcSDFct) {
TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n"); TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
}
DOFVector<double> *newVel_DOF_ = DOFVector<double> *newVel_DOF_ =
new DOFVector<double>(vel_DOF_->getFeSpace(), "vel_DOF_"); new DOFVector<double>(vel_DOF_->getFeSpace(), "vel_DOF_");
...@@ -194,8 +195,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_, ...@@ -194,8 +195,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_,
int nVelDOFs = vel_DOF_.size(); int nVelDOFs = vel_DOF_.size();
if (calcSDFct) if (calcSDFct) {
TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n"); TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
}
std::vector<DOFVector<double> *> newVel_DOF_(nVelDOFs); std::vector<DOFVector<double> *> newVel_DOF_(nVelDOFs);
for (int nV = 0; nV < nVelDOFs; ++nV) { for (int nV = 0; nV < nVelDOFs; ++nV) {
...@@ -275,8 +277,9 @@ void HL_SignedDist::calcVelocityExtFromVelocityField(AdaptInfo *adaptInfo_, ...@@ -275,8 +277,9 @@ void HL_SignedDist::calcVelocityExtFromVelocityField(AdaptInfo *adaptInfo_,
TEST_EXIT(velExt)("velExt not defined !\n"); TEST_EXIT(velExt)("velExt not defined !\n");
TEST_EXIT(elFct == NULL)("not implemented yet for elFct != NULL !\n"); TEST_EXIT(elFct == NULL)("not implemented yet for elFct != NULL !\n");
if (calcSDFct) if (calcSDFct) {
TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n"); TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
}
((VelocityExtFromVelocityField *)(velExt))->setVelocityField(velField_, lS_DOF_, vel_DOF_); ((VelocityExtFromVelocityField *)(velExt))->setVelocityField(velField_, lS_DOF_, vel_DOF_);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment