35#ifndef LIMEX_INTEGRATOR_HPP_
36#define LIMEX_INTEGRATOR_HPP_
70#include "../limex_tools.h"
75#include <nlohmann/json.hpp>
78#undef LIMEX_MULTI_THREAD
103 for(
size_t i=0;i<err.
num_msg();++i)
128 virtual void update_cost(std::vector<number> &costA,
const std::vector<size_t> &vSteps,
const size_t nstages) = 0;
137 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &m_vSteps,
const size_t nstages)
139 UG_ASSERT(m_costA.size() >= nstages,
"Huhh: Vectors match in size:" << m_costA.size() <<
"vs." << nstages);
141 UG_LOG(
"A_0="<< m_vSteps[0] << std::endl);
142 m_costA[0] = (1.0)*m_vSteps[0];
143 for (
size_t i=1; i<nstages; ++i)
145 m_costA[i] = m_costA[i-1] + (1.0)*m_vSteps[i];
146 UG_LOG(
"A_i="<< m_vSteps[i] << std::endl);
137 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &m_vSteps,
const size_t nstages) {
…}
159 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &nSteps,
const size_t nstages)
161 UG_ASSERT(m_costA.size() >= nstages,
"Huhh: Vectors match in size:" << m_costA.size() <<
"vs." << nstages);
165 for (
size_t i=1; i<=nstages; ++i)
159 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &nSteps,
const size_t nstages) {
…}
235 nlohmann::json j(*
this);
239 return std::string(
"EXCEPTION!!!");
242 return std::string(
"LimexTimeIntegratorConfig::config_string()");
249template<
class TDomain,
class TAlgebra>
332 m_vThreadData[i].get_time_stepper()->set_debug(spDebugWriter);
395#ifndef LIMEX_MULTI_THREAD
399 limexStepSingleton =
m_vThreadData.back().get_time_stepper();
406 if (spGamma.invalid()) {
412#ifndef LIMEX_MULTI_THREAD
434 UG_LOG(
"WARNING: add_stage(i, nsteps ,...) is deprecated. Please use 'add_stage(nsteps ,...) instead!'");
508 double alpha = pow(
m_tol, gamma);
594template<
class TDomain,
class TAlgebra>
598 const int nstages = m_vThreadData.size()-1;
599 for (
int i=nstages; i>=0; --i)
601 m_vThreadData[i].set_solution(u->clone());
602 m_vThreadData[i].set_derivative(u->clone());
603 m_vThreadData[i].get_time_stepper()->set_matrix_cache(m_useCachedMatrices);
608template<
class TDomain,
class TAlgebra>
612 const int nstages = m_vThreadData.size()-1;
613 for (
int i=nstages; i>=0; --i)
615 m_vThreadData[i].set_solution(
SPNULL);
616 m_vThreadData[i].set_derivative(
SPNULL);
637template<
class TDomain,
class TAlgebra>
652 for (
int i=0; i<=(int)nstages; ++i)
671 integrator.
set_solver(m_vThreadData[i].get_solver());
674 if(this->debug_writer_valid())
676 integrator.
set_debug(this->debug_writer());
677 char debug_name_ext[16]; snprintf(debug_name_ext, 16,
"%04d", i);
678 this->enter_debug_writer_section(std::string(
"Stage_") + debug_name_ext);
681 UG_ASSERT(m_spBanachSpace.valid(),
"Huhh: Need valid (default) banach space");
683 UG_LOG(
"Set space:" << m_spBanachSpace->config_string());
688 exec = integrator.
apply(m_vThreadData[i].get_solution(), t0+dtcurr, u0, t0);
696 UG_LOGN(
"Step "<< i<<
" failed on stage " << i <<
": " << err.
get_msg());
701 this->leave_debug_writer_section();
718template<
class TDomain,
class TAlgebra>
723 const int nstages = m_vThreadData.size()-1;
724 for (
int i=nstages; i>=0; --i)
726 m_vThreadData[i].get_time_stepper()->invalidate();
731template<
class TDomain,
class TAlgebra>
734 const int nstages = m_vThreadData.size()-1;
735 for (
int i=nstages; i>=0; --i)
737 UG_ASSERT(m_vThreadData[i].get_solution()->size()==ucommon->size(),
"LIMEX: Vectors must match in size!")
738 *m_vThreadData[i].get_solution() = *ucommon;
742template<
class TDomain,
class TAlgebra>
747 const size_t qold=qpred;
755 m_lambda[k] = pow(m_rhoSafety*m_tol/eps[j], 1.0/m_gamma[k]);
756 m_workload[k] = m_costA[j]/m_lambda[k];
757 UG_LOG(
"j=" << j <<
": eps=" << eps[j] <<
", lambda(j)=" <<m_lambda[k] <<
", epsilon(j)=" <<1.0/m_lambda[k] <<
"<= alpha(k, qcurr)=" << monitor(k,qold-1) <<
"< alpha(k, qcurr+1)=" << monitor(k,qold) <<
", A="<< m_costA[j] <<
", W="<< m_workload[k] <<std::endl);
759 for (j=2; j<ntest; ++j)
762 m_lambda[k] = pow(m_rhoSafety*m_tol/eps[j], 1.0/m_gamma[k]);
763 m_workload[k] = m_costA[j]/m_lambda[k];
764 UG_LOG(
"j=" << j <<
": eps=" << eps[j] <<
", lambda(j)=" <<m_lambda[k] <<
", epsilon(j)=" <<1.0/m_lambda[k] <<
"<= alpha(k, qcurr)=" << monitor(k,qold-1) <<
"< alpha(k, qcurr+1)=" << monitor(k,qold) <<
", A="<< m_costA[j] <<
", W="<< m_workload[k] <<std::endl);
769 qpred = (m_workload[qpred-1] > m_workload[k]) ? j : qpred;
770 jbest = (eps[jbest] > eps [j]) ? j : jbest;
776template<
class TDomain,
class TAlgebra>
793 init_integrator_threads(u0);
797 for (
unsigned int i=0; i<m_vThreadData.size(); ++i)
799 std::ostringstream ossName;
800 ossName << std::setfill(
'0') << std::setw(4);
801 ossName <<
"Limex_Init_iter" << 0 <<
"_stage" << i;
802 this->write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
808 size_t kmax = m_vThreadData.size();
809 size_t qpred = kmax-1;
810 size_t qcurr = qpred;
820 size_t limex_total = 1;
821 size_t limex_success = 0;
825 m_bInterrupt =
false;
827 bool bAsymptoticReduction =
false;
829 const size_t nSwitchHistory=16;
830 const size_t nSwitchLookBack=5;
831 int vSwitchHistory[nSwitchHistory] ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
834 while ((t < t1) && ((t1-t) > base_type::m_precisionBound))
839 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
"\n");
848 number dt = std::min(dtcurr, t1-t);
849 UG_COND_THROW(dt < base_type::get_dt_min(),
"Time step size below minimum. ABORTING! dt=" << dt <<
"; dt_min=" << base_type::get_dt_min() <<
"\n");
853 itime_integrator_type::notify_init_step(u, m_limex_step, t, dt);
858 ntest = std::min(kmax, qcurr+1);
859 UG_LOG(
"ntest="<< ntest << std::endl);
862 UG_ASSERT(m_vSteps.size() >= ntest,
"Huhh: sizes do not match: " << m_vSteps.size() <<
"<"<<ntest);
863 UG_ASSERT(m_vThreadData.size() >= ntest,
"Huhh: sizes do not match: " << m_vThreadData.size() <<
"< "<< ntest);
869 for (
size_t i=0; i<ntest; ++i)
871 std::ostringstream ossName;
872 ossName << std::setfill(
'0') << std::setw(4);
873 ossName <<
"Limex_BeforeSerial_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
874 this->write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
876 if(this->debug_writer_valid())
878 char debug_step_id_ext[16]; snprintf(debug_step_id_ext, 16,
"%04d", m_limex_step);
879 char debug_total_id_ext[16]; snprintf(debug_total_id_ext, 16,
"%04d", (
int) limex_total);
880 this->enter_debug_writer_section(std::string(
"LimexTimeIntegrator_iter") + debug_step_id_ext +
"_total" + debug_total_id_ext);
884 err = apply_integrator_threads(dt, u, t, ntest-1);
886 this->leave_debug_writer_section();
889 for (
size_t i=0; i<ntest; ++i)
891 std::ostringstream ossName;
892 ossName << std::setfill(
'0') << std::setw(4);
893 ossName <<
"Limex_AfterSerial_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
894 this->write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
897 join_integrator_threads();
906 UG_ASSERT(m_spErrorEstimator.valid(),
"Huhh: Invalid Error estimator?");
910 bool limexConverged =
false;
914 for (
unsigned int i=1; i<ntest; ++i)
916 UG_LOG(
"Checking consistency:" <<m_consistency_error[i] <<
"/" << m_consistency_error[i-1] <<
"="<< m_consistency_error[i]/m_consistency_error[i-1] << std::endl);
921 for (
unsigned int i=0; i<ntest; ++i)
923 UG_ASSERT(m_vThreadData[i].get_solution().valid(),
"Huhh: no valid solution?");
929 for (
size_t i=0; i<ntest; ++i)
931 std::ostringstream ossName;
932 ossName << std::setfill(
'0') << std::setw(4);
933 ossName <<
"Limex_Extrapolates_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
934 this->write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
940 UG_ASSERT(ntest<=eps.size(),
"Huhh: Not enough solutions?");
944 jbest = find_optimal_solution(eps, ntest, qpred);
945 UG_ASSERT(jbest < ntest,
"Huhh: Not enough solutions?");
948 ubest = timex.
get_solution(jbest-m_conservative).template cast_dynamic<grid_function_type>();
952 limexConverged = (epsmin <= m_tol) ;
958 vSwitchHistory[m_limex_step%nSwitchHistory] = (qpred - qcurr);
959 UG_DLOG(
LIB_LIMEX, 5,
"LIMEX-ASYMPTOTIC-ORDER switch: = " << (qpred - qcurr)<< std::endl);
962 for (
int s=nSwitchLookBack-1;
s>=0;
s--)
964 nSwitches += std::abs(vSwitchHistory[(m_limex_step-
s)%nSwitchHistory]);
965 UG_DLOG(
LIB_LIMEX, 6,
"LIMEX-ASYMPTOTIC-ORDER: s[" <<
s<<
"] = " << vSwitchHistory[(m_limex_step-
s)%nSwitchHistory] << std::endl);
967 UG_DLOG(
LIB_LIMEX, 5,
"LIMEX-ASYMPTOTIC-ORDER: nSwitches = " << nSwitches << std::endl);
1011 if (nSwitches >= m_max_reductions) {
1014 m_asymptotic_order = std::min<size_t>(m_asymptotic_order-1, 2);
1015 bAsymptoticReduction =
true;
1017 for (
int s=nSwitchLookBack-1;
s>=0;
s--)
1018 { vSwitchHistory[(m_limex_step-
s)%nSwitchHistory]=0; }
1027 if (bAsymptoticReduction)
1029 kmax = (kmax >= m_asymptotic_order ) ? m_asymptotic_order : kmax;
1032 UG_DLOG(
LIB_LIMEX, 5,
"(kmax=" << kmax <<
", asymptotic"<< m_asymptotic_order <<
") after "<<m_max_reductions<< std::endl);
1076 double dtpred = dtcurr*std::min(m_lambda[qpred-1], itime_integrator_type::get_increase_factor());
1078 UG_LOG(
"+++++\nget_increase_factor() gives "<<itime_integrator_type::get_increase_factor()<<
" \n+++++++")
1079 UG_LOG(
"koptim=\t" << jbest <<
",\t eps(k)=" << epsmin <<
",\t q=\t" << qpred<<
"("<< ntest <<
"), lambda(q)=" << m_lambda[qpred-1] <<
", alpha(q-1,q)=" << monitor(qpred-1, qpred) <<
"dt(q)=" << dtpred<< std::endl);
1087 if ((qpred+1==ntest)
1092 const double alpha = monitor(qpred-1, qpred);
1093 UG_LOG(
"CHECKING for order increase: "<< m_costA[qpred] <<
"*" << alpha <<
">" << m_costA[qpred+1]);
1095 if (m_costA[qpred] * alpha > m_costA[qpred+1])
1098 if (m_greedyOrderIncrease >0.0) {
1099 dtpred *= (1.0-m_greedyOrderIncrease) + m_greedyOrderIncrease*alpha;
1104 vSwitchHistory[m_limex_step%nSwitchHistory] = (qpred - qcurr);
1105 UG_LOG(
"LIMEX-ASYMPTOTIC-ORDER switch update: = " << (qpred - qcurr)<< std::endl);
1119 dtcurr = std::min(dtpred, itime_integrator_type::get_dt_max());
1126 dtcurr *= m_sigmaReduction;
1130 number watchTime = stopwatch.
ms()/1000.0;
1131 UG_LOGN(
"Time: " << std::setprecision(3) << watchTime <<
"s");
1133 if ((err==0) && limexConverged)
1136 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
" ACCEPTED"<< std::endl);
1137 UG_LOG(
" :\t time \t dt (success) \t dt (pred) \tq=\t order (curr)" << qcurr+1 << std::endl);
1138 UG_LOG(
"LIMEX-ACCEPTING:\t" << t <<
"\t"<< dt <<
"\t" << dtcurr <<
"\tq=\t" << qcurr+1 << std::endl);
1147 if (this->has_time_derivative())
1149 UG_LOG(
"Computing derivative" << std::endl);
1152 for (
size_t i=0; i<=jbest; ++i)
1154 timex.
set_solution(m_vThreadData[i].get_derivative(), i);
1156 timex.
apply(jbest+1,
false);
1158 udot = *timex.
get_solution(jbest).template cast_dynamic<grid_function_type>();
1160 std::ostringstream ossName;
1161 ossName << std::setfill(
'0');
1162 ossName <<
"Limex_Derivative_iter" << m_limex_step <<
"_total" << limex_total;
1163 this->write_debug(udot, ossName.str().c_str());
1173 itime_integrator_type::notify_finalize_step(u, m_limex_step++, t, dt);
1186 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
" FAILED" << std::endl);
1187 UG_LOG(
"LIMEX-REJECTING:\t" << t <<
"\t"<< dt <<
"\t" << dtcurr << std::endl);
1189 itime_integrator_type::notify_rewind_step(ubest, m_limex_step, t+dt, dt);
1196 UG_LOGN(
"Limex interrupted by external command.");
1202 update_integrator_threads(u, t);
1216 dispose_integrator_threads();
parameterString s
Definition Biogas.lua:2
Definition time_extrapolation.h:986
SmartPtr< vector_type > get_solution(size_t i)
get solution (on stage i)
Definition time_extrapolation.h:1020
void set_error_estimate(SmartPtr< ISubDiagErrorEst< vector_type > > subdiag)
set error estimator
Definition time_extrapolation.h:1024
const std::vector< number > & get_error_estimates() const
Definition time_extrapolation.h:1030
void apply(size_t nstages, bool with_error=true)
best error estimate
Definition time_extrapolation.h:1065
void set_solution(SmartPtr< vector_type > soli, int i)
set solution (for stage i)
Definition time_extrapolation.h:1016
virtual void set_debug(SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
Abstract class for the cost of a limex stage.
Definition limex_integrator.hpp:122
virtual ~ILimexCostStrategy()
destructor
Definition limex_integrator.hpp:125
virtual void update_cost(std::vector< number > &costA, const std::vector< size_t > &vSteps, const size_t nstages)=0
provides the cost for all 0...nstages stages.
Definition limex_integrator.hpp:112
SmartPtr< IRefiner > m_spRefiner
Definition limex_integrator.hpp:116
virtual ~ILimexRefiner()
Definition limex_integrator.hpp:113
Integration of non-linear systems (with bounds on dt)
Definition time_integrator.hpp:351
void set_dt_min(double min)
Definition time_integrator.hpp:370
void set_solver(SmartPtr< solver_type > solver)
Definition time_integrator.hpp:361
void set_reduction_factor(double dec)
Definition time_integrator.hpp:376
void set_dt_max(double max)
Definition time_integrator.hpp:373
Interface for sub-diagonal error estimator (w.r.t time in Aitken-Neville scheme)
Definition time_extrapolation.h:144
void set_time_step(double dt)
Set initial time step.
Definition time_integrator.hpp:152
double get_time_step()
Definition time_integrator.hpp:155
Cost is identical to (summation over) number of steps.
Definition limex_integrator.hpp:134
LimexDefaultCost()
Definition limex_integrator.hpp:136
void update_cost(std::vector< number > &m_costA, const std::vector< size_t > &m_vSteps, const size_t nstages)
provides the cost for all 0...nstages stages.
Definition limex_integrator.hpp:137
For.
Definition limex_integrator.hpp:153
double m_cMatAdd
! Cost for matrix assembly
Definition limex_integrator.hpp:174
double m_cAssemble
Definition limex_integrator.hpp:173
void update_cost(std::vector< number > &m_costA, const std::vector< size_t > &nSteps, const size_t nstages)
provides the cost for all 0...nstages stages.
Definition limex_integrator.hpp:159
int m_useGamma
! Cost for solving Jx=b
Definition limex_integrator.hpp:177
double m_cSolution
! Cost for J=A+B
Definition limex_integrator.hpp:175
LimexNonlinearCost()
Definition limex_integrator.hpp:155
Contains all data for parallel execution of time steps.
Definition limex_integrator.hpp:274
void get_error()
Definition limex_integrator.hpp:297
SmartPtr< timestep_type > get_time_stepper()
Definition limex_integrator.hpp:283
ThreadData(SmartPtr< timestep_type > spTimeStep)
Definition limex_integrator.hpp:278
SmartPtr< grid_function_type > m_dot
Definition limex_integrator.hpp:319
SmartPtr< solver_type > m_solver
Definition limex_integrator.hpp:316
void set_derivative(SmartPtr< grid_function_type > sol)
Definition limex_integrator.hpp:307
SmartPtr< grid_function_type > get_derivative()
Definition limex_integrator.hpp:310
void set_error(int e)
Definition limex_integrator.hpp:293
ThreadData()
Definition limex_integrator.hpp:282
SmartPtr< timestep_type > m_stepper
Definition limex_integrator.hpp:315
int m_error
Definition limex_integrator.hpp:320
void set_solution(SmartPtr< grid_function_type > sol)
Definition limex_integrator.hpp:301
void set_solver(SmartPtr< solver_type > solver)
Definition limex_integrator.hpp:287
SmartPtr< grid_function_type > m_sol
Definition limex_integrator.hpp:318
SmartPtr< solver_type > get_solver()
Definition limex_integrator.hpp:290
SmartPtr< grid_function_type > get_solution()
Definition limex_integrator.hpp:304
Definition limex_integrator.hpp:184
unsigned int m_nstages
Number of Aitken-Neville stages.
Definition limex_integrator.hpp:212
size_t m_asymptotic_order
For PDEs, we may apply an symptotic order reduction.
Definition limex_integrator.hpp:220
LimexTimeIntegratorConfig(unsigned int nstages)
Definition limex_integrator.hpp:198
double m_greedyOrderIncrease
Definition limex_integrator.hpp:217
std::string config_string() const
Definition limex_integrator.hpp:232
double m_tol
Definition limex_integrator.hpp:213
double m_rhoSafety
Definition limex_integrator.hpp:214
bool m_useCachedMatrices
Definition limex_integrator.hpp:222
unsigned int m_conservative
Definition limex_integrator.hpp:223
size_t m_max_reductions
Definition limex_integrator.hpp:219
LimexTimeIntegratorConfig()
Definition limex_integrator.hpp:186
double m_sigmaReduction
Definition limex_integrator.hpp:215
Base class for LIMEX time integrator.
Definition limex_integrator.hpp:254
void add_stage(size_t nsteps, SmartPtr< solver_type > solver, SmartPtr< domain_discretization_type > spDD)
Definition limex_integrator.hpp:425
INonlinearTimeIntegrator< TDomain, TAlgebra > itime_integrator_type
Definition limex_integrator.hpp:268
GridFunction< TDomain, TAlgebra > grid_function_type
Definition limex_integrator.hpp:261
void add_stage_ext(size_t nsteps, SmartPtr< solver_type > solver, SmartPtr< domain_discretization_type > spDD, SmartPtr< domain_discretization_type > spGamma)
Definition limex_integrator.hpp:428
bool apply(SmartPtr< grid_function_type > u, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Integrating from t0 -> t1.
Definition limex_integrator.hpp:778
void set_debug_for_timestepper(SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
forward debug info to time integrators
Definition limex_integrator.hpp:328
SmartPtr< grid_function_type > m_spDtSol
Time derivative.
Definition limex_integrator.hpp:579
SmartPtr< error_estim_type > m_spErrorEstimator
Definition limex_integrator.hpp:562
void set_stepsize_greedy_order_factor(double sigma)
Definition limex_integrator.hpp:369
void init_gamma()
aux: compute exponents gamma_k (for roots)
Definition limex_integrator.hpp:481
std::vector< number > m_costA
Cost A_i (for completing stage i)
Definition limex_integrator.hpp:569
TAlgebra algebra_type
Definition limex_integrator.hpp:258
std::vector< number > m_gamma
gamma_i: exponent
Definition limex_integrator.hpp:567
SmartPtr< IGridFunctionSpace< grid_function_type > > m_spBanachSpace
metric space
Definition limex_integrator.hpp:584
void add_error_estimator(SmartPtr< error_estim_type > spErrorEstim)
add an error estimator
Definition limex_integrator.hpp:375
base_type::solver_type solver_type
Definition limex_integrator.hpp:263
void set_tolerance(double tol)
tolerance
Definition limex_integrator.hpp:366
std::vector< ThreadData > m_vThreadData
vector with thread information
Definition limex_integrator.hpp:565
number & monitor(size_t k, size_t q)
Definition limex_integrator.hpp:474
void select_cost_strategy(SmartPtr< ILimexCostStrategy > cost)
Definition limex_integrator.hpp:540
ISubDiagErrorEst< vector_type > error_estim_type
Definition limex_integrator.hpp:270
SmartPtr< ILimexCostStrategy > m_spCostStrategy
Definition limex_integrator.hpp:581
size_t find_optimal_solution(const std::vector< number > &eps, size_t ntest, size_t &qpred)
Definition limex_integrator.hpp:744
std::vector< size_t > m_num_reductions
history of reductions
Definition limex_integrator.hpp:575
int m_limex_step
Current counter.
Definition limex_integrator.hpp:587
std::vector< number > m_monitor
Convergence monitor \alpha.
Definition limex_integrator.hpp:570
AitkenNevilleTimex< vector_type > timex_type
Definition limex_integrator.hpp:267
SimpleTimeIntegrator< TDomain, TAlgebra > time_integrator_type
Definition limex_integrator.hpp:269
std::vector< SmartPtr< ThreadData > > thread_vector_type
Definition limex_integrator.hpp:323
number get_workload(size_t i)
Definition limex_integrator.hpp:470
void set_time_derivative(SmartPtr< grid_function_type > udot)
setter for time derivative info (optional for setting $\Gamma$)
Definition limex_integrator.hpp:528
void add_stage(size_t i, size_t nsteps, SmartPtr< domain_discretization_type > spDD, SmartPtr< solver_type > solver)
! TODO: remove this function!
Definition limex_integrator.hpp:432
std::vector< number > m_consistency_error
Consistency error.
Definition limex_integrator.hpp:577
void dispose_integrator_threads()
Dispose integrator threads (w/ solutions)
Definition limex_integrator.hpp:609
void disable_matrix_cache()
Select approximate Newton (default)
Definition limex_integrator.hpp:538
void set_max_reductions(size_t nred)
Definition limex_integrator.hpp:371
IDomainDiscretization< algebra_type > domain_discretization_type
Definition limex_integrator.hpp:265
algebra_type::matrix_type matrix_type
Definition limex_integrator.hpp:259
std::vector< size_t > m_vSteps
generating sequence for extrapolation
Definition limex_integrator.hpp:564
std::vector< number > m_lambda
Definition limex_integrator.hpp:573
void set_space(SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace)
set banach space (e.g. for computing consistency error)
Definition limex_integrator.hpp:545
bool has_time_derivative()
status for time derivative info (optional for setting $\Gamma$)
Definition limex_integrator.hpp:534
SmartPtr< grid_function_type > get_time_derivative()
getter for time derivative info (optional for setting $\Gamma$)
Definition limex_integrator.hpp:531
LimexTimeIntegrator(int nstages)
Definition limex_integrator.hpp:344
void update_integrator_threads(ConstSmartPtr< grid_function_type > ucommon, number t)
Override thread-wise solutions with common solution.
Definition limex_integrator.hpp:732
LinearImplicitEuler< algebra_type > timestep_type
Definition limex_integrator.hpp:266
void enable_matrix_cache()
Select classic LIMEX.
Definition limex_integrator.hpp:537
void interrupt()
interrupt execution of apply() by external call via observer
Definition limex_integrator.hpp:552
SmartPtr< timestep_type > get_time_stepper(size_t i)
Definition limex_integrator.hpp:439
void set_stepsize_safety_factor(double rho)
Definition limex_integrator.hpp:367
number get_cost(size_t i)
Definition limex_integrator.hpp:468
void update_monitor()
convergence monitor
Definition limex_integrator.hpp:498
std::string config_string() const
Definition limex_integrator.hpp:557
void set_conservative(bool c)
Definition limex_integrator.hpp:554
number get_gamma(size_t i)
Definition limex_integrator.hpp:469
algebra_type::vector_type vector_type
Definition limex_integrator.hpp:260
void init_integrator_threads(ConstSmartPtr< grid_function_type > u)
Initialize integrator threads (w/ solutions)
Definition limex_integrator.hpp:595
void update_cost()
Updating workloads A_i for computing T_ii.
Definition limex_integrator.hpp:491
void add_stage_base(size_t nsteps, SmartPtr< solver_type > solver, SmartPtr< domain_discretization_type > spDD, SmartPtr< domain_discretization_type > spGamma=SPNULL)
add a new stage (at end of list)
Definition limex_integrator.hpp:379
bool m_bInterrupt
Definition limex_integrator.hpp:586
INonlinearTimeIntegrator< TDomain, TAlgebra > base_type
Definition limex_integrator.hpp:262
std::vector< number > m_workload
Definition limex_integrator.hpp:572
int apply_integrator_threads(number dtcurr, ConstSmartPtr< grid_function_type > u0, number t0, size_t nstages)
(Tentatively) apply integrators
Definition limex_integrator.hpp:638
void join_integrator_threads()
e.g. wait for all threads to complete
Definition limex_integrator.hpp:719
void set_asymptotic_order(size_t q)
Definition limex_integrator.hpp:372
void set_stepsize_reduction_factor(double sigma)
Definition limex_integrator.hpp:368
Definition linear_implicit_timestep.h:76
Integrate (a non-linear problem) over a given time interval.
Definition simple_integrator.hpp:50
number get_consistency_error() const
Definition simple_integrator.hpp:103
void set_banach_space(SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace)
Definition simple_integrator.hpp:106
void set_derivative(SmartPtr< grid_function_type > udot)
Definition simple_integrator.hpp:97
bool apply(SmartPtr< grid_function_type > u1, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Definition simple_integrator.hpp:82
const std::string & get_file(size_t i) const
unsigned long get_line(size_t i) const
const std::string & get_msg() const
const NullSmartPtr SPNULL
#define UG_ASSERT(expr, msg)
#define UG_DLOG(__debugID__, level, msg)
#define UG_COND_THROW(cond, msg)
static void MyPrintError(UGError &err)
Definition limex_integrator.hpp:101
DebugID LIB_LIMEX("LIB_LIMEX")
Definition limex_tools.h:54
#define PROFILE_FUNC_GROUP(groups)
SmartPtr< T, FreePolicy > make_sp(T *inst)
function ProblemDisc new(problemDesc, dom)