Commit 74e57828 authored by Santiago Ospina's avatar Santiago Ospina

removed support for pre and post step

parent 435b5b4b
......@@ -23,8 +23,8 @@ public:
* @param[in] adaptpolicy The adapt policy
*/
SimulationBase(OutputPolicy outputpolicy, AdaptivityPolicy adaptpolicy)
: _outputpolicy(outputpolicy)
, _adaptpolicy(adaptpolicy)
: _output_policy(outputpolicy)
, _adapt_policy(adaptpolicy)
{}
/**
......@@ -40,7 +40,7 @@ public:
* @brief Constructs the SimulationBase.
*/
SimulationBase()
: SimulationBase( OutputPolicy::None, AdaptivityPolicy::None )
: SimulationBase(OutputPolicy::None, AdaptivityPolicy::None)
{}
/**
......@@ -48,21 +48,21 @@ public:
*
* @param[in] outputpolicy The output policy,
*/
void set_policy(OutputPolicy outputpolicy) {_outputpolicy = outputpolicy;}
void set_policy(OutputPolicy outputpolicy) {_output_policy = outputpolicy;}
/**
* @brief Sets the adaptivity policy.
*
* @param[in] adaptpolicy The adaptivity policy.
*/
void set_policy(AdaptivityPolicy adaptpolicy) {_adaptpolicy = adaptpolicy;}
void set_policy(AdaptivityPolicy adaptpolicy) {_adapt_policy = adaptpolicy;}
/**
* @brief Returns the current output policy.
*
* @return The current output policy.
*/
OutputPolicy output_policy() const {return _outputpolicy;}
OutputPolicy output_policy() const {return _output_policy;}
/**
......@@ -70,7 +70,7 @@ public:
*
* @return The current adaptivity policy.
*/
AdaptivityPolicy adaptivity_policy() const {return _adaptpolicy;}
AdaptivityPolicy adaptivity_policy() const {return _adapt_policy;}
/**
......@@ -78,7 +78,7 @@ public:
*/
void virtual write_data() const
{
if (_outputpolicy != OutputPolicy::None)
if (_output_policy != OutputPolicy::None)
DUNE_THROW(Dune::IOError,"Simulation can't write data!");
}
......@@ -102,7 +102,7 @@ public:
*/
virtual void adapt_grid()
{
if (_adaptpolicy != AdaptivityPolicy::None)
if (_adapt_policy != AdaptivityPolicy::None)
DUNE_THROW(Dune::NotImplemented,"Simulation can't be adapted!");
else
DUNE_THROW(Dune::InvalidStateException,"Simulation uses adaptivity"
......@@ -142,11 +142,6 @@ public:
*/
virtual void suggest_timestep(double dt) = 0;
/**
* @brief Operations before step of the simulation.
*/
virtual void pre_step() {};
/**
* @brief Performs one steps in direction to end_time(). The time-step
* should never result on a bigger step than the one suggested
......@@ -154,11 +149,6 @@ public:
*/
virtual void step() = 0;
/**
* @brief Operations after step of the simulation.
*/
virtual void post_step() {};
/**
* @brief Runs the model performing steps until current_time() equals
* end_time()
......@@ -167,12 +157,11 @@ public:
{
if (output_policy() != OutputPolicy::None)
write_data();
while( Dune::FloatCmp::lt( current_time(), end_time()) )
{
pre_step();
step();
post_step();
if (adaptivity_policy() != AdaptivityPolicy::None)
if ( Dune::FloatCmp::lt( current_time(), end_time()) )
{
......@@ -185,8 +174,8 @@ public:
}
private:
OutputPolicy _outputpolicy;
AdaptivityPolicy _adaptpolicy;
OutputPolicy _output_policy;
AdaptivityPolicy _adapt_policy;
};
} // namespace Dorie
......
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