Makes the time step control parallel.

The only stage where parallelism changes the adaptive time
stepping is when some inner products on the saturation and
pressure are computed.
This commit makes this part parallel by added an additonal boost::any
parameter to the time stepping and the controller. Per default this
is empty. In a parallel run it contains a ParallelIstlInformation object
encapsulating the information about the parallelisation. This then used
to compute the parallel inner product.
This commit is contained in:
Markus Blatt
2015-05-22 20:51:59 +02:00
parent b6d5a3cad5
commit 384ef84556
4 changed files with 61 additions and 16 deletions

View File

@@ -33,7 +33,8 @@ namespace Opm {
// AdaptiveTimeStepping
//---------------------
AdaptiveTimeStepping::AdaptiveTimeStepping( const parameter::ParameterGroup& param )
AdaptiveTimeStepping::AdaptiveTimeStepping( const parameter::ParameterGroup& param,
const boost::any& parallel_information )
: timeStepControl_()
, restart_factor_( param.getDefault("solver.restartfactor", double(0.1) ) )
, growth_factor_( param.getDefault("solver.growthfactor", double(1.25) ) )
@@ -51,13 +52,13 @@ namespace Opm {
const double tol = param.getDefault("timestep.control.tol", double(1e-3) );
if( control == "pid" ) {
timeStepControl_ = TimeStepControlType( new PIDTimeStepControl( tol ) );
timeStepControl_ = TimeStepControlType( new PIDTimeStepControl( tol, parallel_information ) );
}
else if ( control == "pid+iteration" )
{
const int iterations = param.getDefault("timestep.control.targetiteration", defaultTargetIterations );
const double maxgrowth = param.getDefault("timestep.control.maxgrowth", double(3.0) );
timeStepControl_ = TimeStepControlType( new PIDAndIterationCountTimeStepControl( iterations, tol, maxgrowth ) );
timeStepControl_ = TimeStepControlType( new PIDAndIterationCountTimeStepControl( iterations, tol, maxgrowth, parallel_information ) );
}
else if ( control == "iterationcount" )
{