Commit b810b92a authored by Praetorius, Simon's avatar Praetorius, Simon

parameter-initialization sourced out from contructor to init() method

parent 9fa45563
......@@ -145,21 +145,11 @@ namespace AMDiS {
deserialized(false),
rosenbrockMode(false)
{
Parameters::get( name_ + "->start time", startTime);
time = startTime;
Parameters::get(name_ + "->timestep", timestep);
Parameters::get(name_ + "->end time", endTime);
Parameters::get(name_ + "->max iteration", maxSpaceIteration);
Parameters::get(name_ + "->max timestep iteration", maxTimestepIteration);
Parameters::get(name_ + "->max time iteration", maxTimeIteration);
Parameters::get(name_ + "->min timestep", minTimestep);
Parameters::get(name_ + "->max timestep", maxTimestep);
Parameters::get(name_ + "->number of timesteps", nTimesteps);
init();
char number[5];
for (int i = 0; i < size; i++) {
sprintf(number, "[%d]", i);
scalContents[i] = new ScalContent(name + std::string(number));
sprintf(number, "[%d]", i);
scalContents[i] = new ScalContent(name + std::string(number));
}
}
......@@ -167,9 +157,25 @@ namespace AMDiS {
virtual ~AdaptInfo()
{
for (unsigned int i = 0; i < scalContents.size(); i++)
delete scalContents[i];
delete scalContents[i];
}
/// Sets initial values to time/timestep variables
inline void init()
{
Parameters::get(name + "->start time", startTime);
time = startTime;
Parameters::get(name + "->timestep", timestep);
Parameters::get(name + "->end time", endTime);
Parameters::get(name + "->max iteration", maxSpaceIteration);
Parameters::get(name + "->max timestep iteration", maxTimestepIteration);
Parameters::get(name + "->max time iteration", maxTimeIteration);
Parameters::get(name + "->min timestep", minTimestep);
Parameters::get(name + "->max timestep", maxTimestep);
Parameters::get(name + "->number of timesteps", nTimesteps);
}
/// Resets all variables to zero (or something equivalent)
inline void reset()
{
spaceIteration = -1;
......
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