Skip to content
Snippets Groups Projects
Commit 08bbf755 authored by Robert K's avatar Robert K
Browse files

Some improvements.

parent 3ac4ef62
No related branches found
No related tags found
1 merge request!4Latest features added to dune-fem-dg.
......@@ -167,10 +167,10 @@ namespace Fem
template <class Entity>
void setEntity( const Entity& entity ) const
{
//if( hasAdvection )
// advection_.init( entity );
//if( hasDiffusion )
// diffusion_.init( entity );
if( hasAdvection )
advection_.init( entity );
if( hasDiffusion )
diffusion_.init( entity );
}
inline bool hasStiffSource() const { return AdditionalType::hasStiffSource; }
......
......@@ -415,6 +415,7 @@ namespace Fem
void operator()( const DestinationType& arg, DestinationType& dest ) const
{
++operatorCalled_;
std::cout << "Operator call." << std::endl;
pass2_( arg, dest );
}
......@@ -458,7 +459,7 @@ namespace Fem
// copy U to uTmp_
if( polOrd > 0 )
{
//std::cout << "Called extra limit" << std::endl;
std::cout << "Called extra limit" << std::endl;
if( ! uTmp_ )
uTmp_.reset(new LimiterDestinationType("limitTmp", limiterSpace_) );
......
......@@ -10,6 +10,7 @@
#include <dune/fem/operator/common/spaceoperatorif.hh>
// dune-fem-dg includes
#include <dune/fem-dg/algorithm/evolution.hh>
#include <dune/fem-dg/operator/fluxes/advection/fluxes.hh>
#include <dune/fem-dg/operator/fluxes/euler/fluxes.hh>
#include <dune/fem-dg/operator/dg/operatortraits.hh>
......@@ -81,7 +82,8 @@ namespace Fem
DGOperator( const DiscreteFunctionSpaceType& space,
const AdvectionModel &advectionModel,
const DiffusionModel &diffusionModel )
const DiffusionModel &diffusionModel,
const TimeSteppingParameters& param = TimeSteppingParameters() )
: space_( space ),
extra_(),
tp_( space_.gridPart().comm()),
......@@ -92,10 +94,8 @@ namespace Fem
rkSolver_( tp_, fullOperator_, explOperator_, implOperator_, name() ),
initialized_( false )
{
std::string keyPrefix("femdg.stepper.");
const double maxTimeStep =
Dune::Fem::Parameter::getValue< double >( keyPrefix + "maxtimestep", 1e-4);
fixedTimeStep_ = Dune::Fem::Parameter::getValue< double >( keyPrefix + "fixedtimestep" , 0.0 );
const double maxTimeStep = 1e-3;//param.maxTimeStep();
fixedTimeStep_ = param.fixedTimeStep();
// start first time step with prescribed fixed time step
// if it is not 0 otherwise use the internal estimate
tp_.provideTimeStepEstimate(maxTimeStep);
......@@ -127,15 +127,19 @@ namespace Fem
{
if( !initialized_ )
{
const double dt = tp_.timeStepEstimate();
//const double dt = tp_.timeStepEstimate();
rkSolver_.initialize( dest );
initialized_ = true;
// tp_.provideTimeStepEstimate( dt );
}
std::cout << "Start operator solve!" << std::endl;
Dune :: Timer timer;
// limit( dest );
rkSolver_.solve( dest, monitor_ );
std::cout << "Operator solve called: " << timer.elapsed() << std::endl;
// next time step is prescribed by fixedTimeStep
if ( fixedTimeStep_ > 1e-20 )
tp_.next( fixedTimeStep_ );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment