From d848fed76e4861f61d95b8064e1be64d7e84953c Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Thu, 18 Feb 2010 08:29:08 +0000 Subject: [PATCH] Some changed due to Rainers ideas. --- AMDiS/src/Assembler.cc | 4 ++-- AMDiS/src/ElInfo1d.cc | 4 ++-- AMDiS/src/ProblemInstat.h | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/AMDiS/src/Assembler.cc b/AMDiS/src/Assembler.cc index 5d49cb97..fc2c89e3 100644 --- a/AMDiS/src/Assembler.cc +++ b/AMDiS/src/Assembler.cc @@ -116,12 +116,12 @@ namespace AMDiS { } if (firstOrderAssemblerGrdPsi) { - ERROR_EXIT("Not yet implemented for not zero order assembler!\n"); + ERROR_EXIT("Not yet implemented for first order assembler!\n"); firstOrderAssemblerGrdPsi->calculateElementMatrix(smallElInfo, mat); } if (firstOrderAssemblerGrdPhi) { - ERROR_EXIT("Not yet implemented for not zero order assembler!\n"); + ERROR_EXIT("Not yet implemented for first order assembler!\n"); firstOrderAssemblerGrdPhi->calculateElementMatrix(smallElInfo, mat); } diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc index 1a05bd0a..c8f9212f 100644 --- a/AMDiS/src/ElInfo1d.cc +++ b/AMDiS/src/ElInfo1d.cc @@ -22,8 +22,8 @@ namespace AMDiS { {0.0, 0.5}}; mtl::dense2D<double> ElInfo1d::mat_d1_left(mat_d1_left_val); - double ElInfo1d::mat_d1_right_val[2][2] = {{0.5, 1.0}, - {0.5, 0.0}}; + double ElInfo1d::mat_d1_right_val[2][2] = {{0.5, 0.0}, + {0.5, 1.0}}; mtl::dense2D<double> ElInfo1d::mat_d1_right(mat_d1_right_val); double ElInfo1d::mat_d2_val[3][3] = {{1.0, 0.0, 0.0}, diff --git a/AMDiS/src/ProblemInstat.h b/AMDiS/src/ProblemInstat.h index 352ee24b..3ed09724 100644 --- a/AMDiS/src/ProblemInstat.h +++ b/AMDiS/src/ProblemInstat.h @@ -54,6 +54,13 @@ namespace AMDiS { ProblemInstat *adoptProblem = NULL, Flag adoptFlag = INIT_NOTHING); + virtual void setTime(AdaptInfo* adaptInfo) + { + cTime = adaptInfo->getTime(); + tau = adaptInfo->getTimestep(); + invTau = 1.0 / tau; + } + virtual void solve(AdaptInfo* adaptInfo) {} virtual void solve(AdaptInfo *adaptInfo, bool fixedMatrix) @@ -96,12 +103,35 @@ namespace AMDiS { /// Used by \ref problemInitial virtual void solveInitialProblem(AdaptInfo *adaptInfo); + double* getTime() + { + return &cTime; + } + + double* getTau() + { + return τ + } + + double* getInvTau() + { + return &invTau; + } protected: /// Name of the problem. std::string name; ProblemStatBase *initialProblem; + + /// Time + double cTime; + + /// Timestep + double tau; + + /// 1 / timestep + double invTau; }; -- GitLab