33 #ifndef LIMEX_INTEGRATOR_HPP_
34 #define LIMEX_INTEGRATOR_HPP_
68 #include "../limex_tools.h"
73 #include <nlohmann/json.hpp>
76 #undef LIMEX_MULTI_THREAD
101 for(
size_t i=0;i<err.
num_msg();++i)
126 virtual void update_cost(std::vector<number> &costA,
const std::vector<size_t> &vSteps,
const size_t nstages) = 0;
135 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &m_vSteps,
const size_t nstages)
137 UG_ASSERT(m_costA.size() >= nstages,
"Huhh: Vectors match in size:" << m_costA.size() <<
"vs." << nstages);
139 UG_LOG(
"A_0="<< m_vSteps[0] << std::endl);
140 m_costA[0] = (1.0)*m_vSteps[0];
141 for (
size_t i=1; i<nstages; ++i)
143 m_costA[i] = m_costA[i-1] + (1.0)*m_vSteps[i];
144 UG_LOG(
"A_i="<< m_vSteps[i] << std::endl);
157 void update_cost(std::vector<number> &m_costA,
const std::vector<size_t> &nSteps,
const size_t nstages)
159 UG_ASSERT(m_costA.size() >= nstages,
"Huhh: Vectors match in size:" << m_costA.size() <<
"vs." << nstages);
163 for (
size_t i=1; i<=nstages; ++i)
233 nlohmann::json j(*
this);
237 return std::string(
"EXCEPTION!!!");
240 return std::string(
"LimexTimeIntegratorConfig::config_string()");
247 template<
class TDomain,
class TAlgebra>
330 m_vThreadData[i].get_time_stepper()->set_debug(spDebugWriter);
393 #ifndef LIMEX_MULTI_THREAD
397 limexStepSingleton =
m_vThreadData.back().get_time_stepper();
404 if (spGamma.invalid()) {
410 #ifndef LIMEX_MULTI_THREAD
432 UG_LOG(
"WARNING: add_stage(i, nsteps ,...) is deprecated. Please use 'add_stage(nsteps ,...) instead!'");
506 double alpha = pow(
m_tol, gamma);
592 template<
class TDomain,
class TAlgebra>
596 const int nstages = m_vThreadData.size()-1;
597 for (
int i=nstages; i>=0; --i)
599 m_vThreadData[i].set_solution(u->clone());
600 m_vThreadData[i].set_derivative(u->clone());
601 m_vThreadData[i].get_time_stepper()->set_matrix_cache(m_useCachedMatrices);
606 template<
class TDomain,
class TAlgebra>
610 const int nstages = m_vThreadData.size()-1;
611 for (
int i=nstages; i>=0; --i)
613 m_vThreadData[i].set_solution(
SPNULL);
614 m_vThreadData[i].set_derivative(
SPNULL);
635 template<
class TDomain,
class TAlgebra>
650 for (
int i=0; i<=(int)nstages; ++i)
669 integrator.
set_solver(m_vThreadData[i].get_solver());
672 UG_ASSERT(m_spBanachSpace.valid(),
"Huhh: Need valid (default) banach space");
674 UG_LOG(
"Set space:" << m_spBanachSpace->config_string());
679 exec = integrator.
apply(m_vThreadData[i].get_solution(), t0+dtcurr, u0, t0);
687 UG_LOGN(
"Step "<< i<<
" failed on stage " << i <<
": " << err.
get_msg());
707 template<
class TDomain,
class TAlgebra>
712 const int nstages = m_vThreadData.size()-1;
713 for (
int i=nstages; i>=0; --i)
715 m_vThreadData[i].get_time_stepper()->invalidate();
720 template<
class TDomain,
class TAlgebra>
723 const int nstages = m_vThreadData.size()-1;
724 for (
int i=nstages; i>=0; --i)
726 UG_ASSERT(m_vThreadData[i].get_solution()->size()==ucommon->size(),
"LIMEX: Vectors must match in size!")
727 *m_vThreadData[i].get_solution() = *ucommon;
731 template<
class TDomain,
class TAlgebra>
736 const size_t qold=qpred;
744 m_lambda[k] = pow(m_rhoSafety*m_tol/eps[j], 1.0/m_gamma[k]);
745 m_workload[k] = m_costA[j]/m_lambda[k];
746 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);
748 for (j=2; j<ntest; ++j)
751 m_lambda[k] = pow(m_rhoSafety*m_tol/eps[j], 1.0/m_gamma[k]);
752 m_workload[k] = m_costA[j]/m_lambda[k];
753 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);
758 qpred = (m_workload[qpred-1] > m_workload[k]) ? j : qpred;
759 jbest = (eps[jbest] > eps [j]) ? j : jbest;
765 template<
class TDomain,
class TAlgebra>
782 init_integrator_threads(u0);
786 for (
unsigned int i=0; i<m_vThreadData.size(); ++i)
788 std::ostringstream ossName;
789 ossName << std::setfill(
'0') << std::setw(4);
790 ossName <<
"Limex_Init_iter" << 0 <<
"_stage" << i;
791 write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
797 size_t kmax = m_vThreadData.size();
798 size_t qpred = kmax-1;
799 size_t qcurr = qpred;
809 size_t limex_total = 1;
810 size_t limex_success = 0;
814 m_bInterrupt =
false;
816 bool bAsymptoticReduction =
false;
818 const size_t nSwitchHistory=16;
819 const size_t nSwitchLookBack=5;
820 int vSwitchHistory[nSwitchHistory] ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
823 while ((t < t1) && ((t1-t) > base_type::m_precisionBound))
828 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
"\n");
837 number dt = std::min(dtcurr, t1-t);
838 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");
842 itime_integrator_type::notify_init_step(u, m_limex_step, t, dt);
847 ntest = std::min(kmax, qcurr+1);
848 UG_LOG(
"ntest="<< ntest << std::endl);
851 UG_ASSERT(m_vSteps.size() >= ntest,
"Huhh: sizes do not match: " << m_vSteps.size() <<
"<"<<ntest);
852 UG_ASSERT(m_vThreadData.size() >= ntest,
"Huhh: sizes do not match: " << m_vThreadData.size() <<
"< "<< ntest);
858 for (
size_t i=0; i<ntest; ++i)
860 std::ostringstream ossName;
861 ossName << std::setfill(
'0') << std::setw(4);
862 ossName <<
"Limex_BeforeSerial_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
863 write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
867 err = apply_integrator_threads(dt, u, t, ntest-1);
870 for (
size_t i=0; i<ntest; ++i)
872 std::ostringstream ossName;
873 ossName << std::setfill(
'0') << std::setw(4);
874 ossName <<
"Limex_AfterSerial_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
875 write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
878 join_integrator_threads();
887 UG_ASSERT(m_spErrorEstimator.valid(),
"Huhh: Invalid Error estimator?");
891 bool limexConverged =
false;
895 for (
unsigned int i=1; i<ntest; ++i)
897 UG_LOG(
"Checking consistency:" <<m_consistency_error[i] <<
"/" << m_consistency_error[i-1] <<
"="<< m_consistency_error[i]/m_consistency_error[i-1] << std::endl);
902 for (
unsigned int i=0; i<ntest; ++i)
904 UG_ASSERT(m_vThreadData[i].get_solution().valid(),
"Huhh: no valid solution?");
910 for (
size_t i=0; i<ntest; ++i)
912 std::ostringstream ossName;
913 ossName << std::setfill(
'0') << std::setw(4);
914 ossName <<
"Limex_Extrapolates_iter" << m_limex_step <<
"_stage" << i <<
"_total" << limex_total;
915 write_debug(*m_vThreadData[i].get_solution(), ossName.str().c_str());
921 UG_ASSERT(ntest<=eps.size(),
"Huhh: Not enough solutions?");
925 jbest = find_optimal_solution(eps, ntest, qpred);
926 UG_ASSERT(jbest < ntest,
"Huhh: Not enough solutions?");
929 ubest = timex.
get_solution(jbest-m_conservative).template cast_dynamic<grid_function_type>();
933 limexConverged = (epsmin <= m_tol) ;
939 vSwitchHistory[m_limex_step%nSwitchHistory] = (qpred - qcurr);
940 UG_DLOG(
LIB_LIMEX, 5,
"LIMEX-ASYMPTOTIC-ORDER switch: = " << (qpred - qcurr)<< std::endl);
943 for (
int s=nSwitchLookBack-1;
s>=0;
s--)
945 nSwitches += std::abs(vSwitchHistory[(m_limex_step-
s)%nSwitchHistory]);
946 UG_DLOG(
LIB_LIMEX, 6,
"LIMEX-ASYMPTOTIC-ORDER: s[" <<
s<<
"] = " << vSwitchHistory[(m_limex_step-
s)%nSwitchHistory] << std::endl);
948 UG_DLOG(
LIB_LIMEX, 5,
"LIMEX-ASYMPTOTIC-ORDER: nSwitches = " << nSwitches << std::endl);
992 if (nSwitches >= m_max_reductions) {
995 m_asymptotic_order = std::min<size_t>(m_asymptotic_order-1, 2);
996 bAsymptoticReduction =
true;
998 for (
int s=nSwitchLookBack-1;
s>=0;
s--)
999 { vSwitchHistory[(m_limex_step-
s)%nSwitchHistory]=0; }
1008 if (bAsymptoticReduction)
1010 kmax = (kmax >= m_asymptotic_order ) ? m_asymptotic_order : kmax;
1013 UG_DLOG(
LIB_LIMEX, 5,
"(kmax=" << kmax <<
", asymptotic"<< m_asymptotic_order <<
") after "<<m_max_reductions<< std::endl);
1057 double dtpred = dtcurr*std::min(m_lambda[qpred-1], itime_integrator_type::get_increase_factor());
1059 UG_LOG(
"+++++\nget_increase_factor() gives "<<itime_integrator_type::get_increase_factor()<<
" \n+++++++")
1060 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);
1068 if ((qpred+1==ntest)
1073 const double alpha = monitor(qpred-1, qpred);
1074 UG_LOG(
"CHECKING for order increase: "<< m_costA[qpred] <<
"*" << alpha <<
">" << m_costA[qpred+1]);
1076 if (m_costA[qpred] * alpha > m_costA[qpred+1])
1079 if (m_greedyOrderIncrease >0.0) {
1080 dtpred *= (1.0-m_greedyOrderIncrease) + m_greedyOrderIncrease*alpha;
1085 vSwitchHistory[m_limex_step%nSwitchHistory] = (qpred - qcurr);
1086 UG_LOG(
"LIMEX-ASYMPTOTIC-ORDER switch update: = " << (qpred - qcurr)<< std::endl);
1100 dtcurr = std::min(dtpred, itime_integrator_type::get_dt_max());
1107 dtcurr *= m_sigmaReduction;
1111 number watchTime = stopwatch.
ms()/1000.0;
1112 UG_LOGN(
"Time: " << std::setprecision(3) << watchTime <<
"s");
1114 if ((err==0) && limexConverged)
1117 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
" ACCEPTED"<< std::endl);
1118 UG_LOG(
" :\t time \t dt (success) \t dt (pred) \tq=\t order (curr)" << qcurr+1 << std::endl);
1119 UG_LOG(
"LIMEX-ACCEPTING:\t" << t <<
"\t"<< dt <<
"\t" << dtcurr <<
"\tq=\t" << qcurr+1 << std::endl);
1128 if (this->has_time_derivative())
1130 UG_LOG(
"Computing derivative" << std::endl);
1133 for (
size_t i=0; i<=jbest; ++i)
1135 timex.
set_solution(m_vThreadData[i].get_derivative(), i);
1137 timex.
apply(jbest+1,
false);
1139 udot = *timex.
get_solution(jbest).template cast_dynamic<grid_function_type>();
1141 std::ostringstream ossName;
1142 ossName << std::setfill(
'0');
1143 ossName <<
"Limex_Derivative_iter" << m_limex_step <<
"_total" << limex_total;
1144 write_debug(udot, ossName.str().c_str());
1154 itime_integrator_type::notify_finalize_step(u, m_limex_step++, t, dt);
1167 UG_LOG(
"+++ LimexTimestep +++" << m_limex_step <<
" FAILED" << std::endl);
1168 UG_LOG(
"LIMEX-REJECTING:\t" << t <<
"\t"<< dt <<
"\t" << dtcurr << std::endl);
1170 itime_integrator_type::notify_rewind_step(ubest, m_limex_step, t+dt, dt);
1177 UG_LOGN(
"Limex interrupted by external command.");
1183 update_integrator_threads(u, t);
1197 dispose_integrator_threads();
Definition: time_extrapolation.h:973
void set_error_estimate(SmartPtr< ISubDiagErrorEst< vector_type > > subdiag)
set error estimator
Definition: time_extrapolation.h:1011
void apply(size_t nstages, bool with_error=true)
best error estimate
Definition: time_extrapolation.h:1052
void set_solution(SmartPtr< vector_type > soli, int i)
set solution (for stage i)
Definition: time_extrapolation.h:1003
const std::vector< number > & get_error_estimates() const
Definition: time_extrapolation.h:1017
SmartPtr< vector_type > get_solution(size_t i)
get solution (on stage i)
Definition: time_extrapolation.h:1007
Abstract class for the cost of a limex stage.
Definition: limex_integrator.hpp:120
virtual ~ILimexCostStrategy()
destructor
Definition: limex_integrator.hpp:123
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:110
SmartPtr< IRefiner > m_spRefiner
Definition: limex_integrator.hpp:111
virtual ~ILimexRefiner()
Definition: limex_integrator.hpp:111
integration of non-linear systems (with bounds on dt)
Definition: time_integrator.hpp:1097
void set_dt_min(double min)
Definition: time_integrator.hpp:1116
void set_solver(SmartPtr< solver_type > solver)
Definition: time_integrator.hpp:1107
void set_reduction_factor(double dec)
Definition: time_integrator.hpp:1122
void set_dt_max(double max)
Definition: time_integrator.hpp:1119
Interface for sub-diagonal error estimator (w.r.t time in Aitken-Neville scheme)
Definition: time_extrapolation.h:142
void set_time_step(double dt)
Set initial time step.
Definition: time_integrator.hpp:570
double get_time_step()
Definition: time_integrator.hpp:573
Cost is identical to (summation over) number of steps.
Definition: limex_integrator.hpp:132
LimexDefaultCost()
Definition: limex_integrator.hpp:134
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:135
For.
Definition: limex_integrator.hpp:151
double m_cMatAdd
! Cost for matrix assembly
Definition: limex_integrator.hpp:172
double m_cAssemble
Definition: limex_integrator.hpp:171
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:157
int m_useGamma
! Cost for solving Jx=b
Definition: limex_integrator.hpp:175
double m_cSolution
! Cost for J=A+B
Definition: limex_integrator.hpp:173
LimexNonlinearCost()
Definition: limex_integrator.hpp:153
Contains all data for parallel execution of time steps.
Definition: limex_integrator.hpp:272
void get_error()
Definition: limex_integrator.hpp:295
ThreadData(SmartPtr< timestep_type > spTimeStep)
Definition: limex_integrator.hpp:276
SmartPtr< grid_function_type > get_solution()
Definition: limex_integrator.hpp:302
SmartPtr< grid_function_type > m_dot
Definition: limex_integrator.hpp:317
SmartPtr< solver_type > m_solver
Definition: limex_integrator.hpp:314
void set_derivative(SmartPtr< grid_function_type > sol)
Definition: limex_integrator.hpp:305
SmartPtr< timestep_type > get_time_stepper()
Definition: limex_integrator.hpp:281
void set_error(int e)
Definition: limex_integrator.hpp:291
ThreadData()
Definition: limex_integrator.hpp:280
SmartPtr< timestep_type > m_stepper
Definition: limex_integrator.hpp:313
int m_error
Definition: limex_integrator.hpp:318
void set_solution(SmartPtr< grid_function_type > sol)
Definition: limex_integrator.hpp:299
SmartPtr< solver_type > get_solver()
Definition: limex_integrator.hpp:288
void set_solver(SmartPtr< solver_type > solver)
Definition: limex_integrator.hpp:285
SmartPtr< grid_function_type > m_sol
Definition: limex_integrator.hpp:316
SmartPtr< grid_function_type > get_derivative()
Definition: limex_integrator.hpp:308
Definition: limex_integrator.hpp:182
unsigned int m_nstages
Number of Aitken-Neville stages.
Definition: limex_integrator.hpp:210
size_t m_asymptotic_order
For PDEs, we may apply an symptotic order reduction.
Definition: limex_integrator.hpp:218
LimexTimeIntegratorConfig(unsigned int nstages)
Definition: limex_integrator.hpp:196
double m_greedyOrderIncrease
Definition: limex_integrator.hpp:215
std::string config_string() const
Definition: limex_integrator.hpp:230
double m_tol
Definition: limex_integrator.hpp:211
double m_rhoSafety
Definition: limex_integrator.hpp:212
bool m_useCachedMatrices
Definition: limex_integrator.hpp:220
unsigned int m_conservative
Definition: limex_integrator.hpp:221
size_t m_max_reductions
Definition: limex_integrator.hpp:217
LimexTimeIntegratorConfig()
Definition: limex_integrator.hpp:184
double m_sigmaReduction
Definition: limex_integrator.hpp:213
Base class for LIMEX time integrator.
Definition: limex_integrator.hpp:252
void add_stage(size_t nsteps, SmartPtr< solver_type > solver, SmartPtr< domain_discretization_type > spDD)
Definition: limex_integrator.hpp:423
INonlinearTimeIntegrator< TDomain, TAlgebra > itime_integrator_type
Definition: limex_integrator.hpp:266
GridFunction< TDomain, TAlgebra > grid_function_type
Definition: limex_integrator.hpp:259
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:426
bool apply(SmartPtr< grid_function_type > u, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Integrating from t0 -> t1.
Definition: limex_integrator.hpp:767
void set_debug_for_timestepper(SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
forward debug info to time integrators
Definition: limex_integrator.hpp:326
SmartPtr< grid_function_type > m_spDtSol
Time derivative.
Definition: limex_integrator.hpp:577
SmartPtr< error_estim_type > m_spErrorEstimator
Definition: limex_integrator.hpp:560
void set_stepsize_greedy_order_factor(double sigma)
Definition: limex_integrator.hpp:367
void init_gamma()
aux: compute exponents gamma_k (for roots)
Definition: limex_integrator.hpp:479
std::vector< number > m_costA
Cost A_i (for completing stage i)
Definition: limex_integrator.hpp:567
TAlgebra algebra_type
Definition: limex_integrator.hpp:256
std::vector< number > m_gamma
gamma_i: exponent
Definition: limex_integrator.hpp:565
SmartPtr< IGridFunctionSpace< grid_function_type > > m_spBanachSpace
metric space
Definition: limex_integrator.hpp:582
void add_error_estimator(SmartPtr< error_estim_type > spErrorEstim)
add an error estimator
Definition: limex_integrator.hpp:373
base_type::solver_type solver_type
Definition: limex_integrator.hpp:261
void set_tolerance(double tol)
tolerance
Definition: limex_integrator.hpp:364
std::vector< ThreadData > m_vThreadData
vector with thread information
Definition: limex_integrator.hpp:563
void select_cost_strategy(SmartPtr< ILimexCostStrategy > cost)
Definition: limex_integrator.hpp:538
ISubDiagErrorEst< vector_type > error_estim_type
Definition: limex_integrator.hpp:268
SmartPtr< ILimexCostStrategy > m_spCostStrategy
Definition: limex_integrator.hpp:579
size_t find_optimal_solution(const std::vector< number > &eps, size_t ntest, size_t &qpred)
Definition: limex_integrator.hpp:733
std::vector< size_t > m_num_reductions
history of reductions
Definition: limex_integrator.hpp:573
int m_limex_step
Current counter.
Definition: limex_integrator.hpp:585
std::vector< number > m_monitor
Convergence monitor \alpha.
Definition: limex_integrator.hpp:568
AitkenNevilleTimex< vector_type > timex_type
Definition: limex_integrator.hpp:265
SimpleTimeIntegrator< TDomain, TAlgebra > time_integrator_type
Definition: limex_integrator.hpp:267
std::vector< SmartPtr< ThreadData > > thread_vector_type
Definition: limex_integrator.hpp:321
number get_workload(size_t i)
Definition: limex_integrator.hpp:468
void set_time_derivative(SmartPtr< grid_function_type > udot)
setter for time derivative info (optional for setting $\Gamma$)
Definition: limex_integrator.hpp:526
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:430
std::vector< number > m_consistency_error
Consistency error.
Definition: limex_integrator.hpp:575
void dispose_integrator_threads()
Dispose integrator threads (w/ solutions)
Definition: limex_integrator.hpp:607
void disable_matrix_cache()
Select approximate Newton (default)
Definition: limex_integrator.hpp:536
void set_max_reductions(size_t nred)
Definition: limex_integrator.hpp:369
IDomainDiscretization< algebra_type > domain_discretization_type
Definition: limex_integrator.hpp:263
algebra_type::matrix_type matrix_type
Definition: limex_integrator.hpp:257
std::vector< size_t > m_vSteps
generating sequence for extrapolation
Definition: limex_integrator.hpp:562
std::vector< number > m_lambda
Definition: limex_integrator.hpp:571
void set_space(SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace)
set banach space (e.g. for computing consistency error)
Definition: limex_integrator.hpp:543
bool has_time_derivative()
status for time derivative info (optional for setting $\Gamma$)
Definition: limex_integrator.hpp:532
SmartPtr< timestep_type > get_time_stepper(size_t i)
Definition: limex_integrator.hpp:437
LimexTimeIntegrator(int nstages)
Definition: limex_integrator.hpp:342
void update_integrator_threads(ConstSmartPtr< grid_function_type > ucommon, number t)
Override thread-wise solutions with common solution.
Definition: limex_integrator.hpp:721
LinearImplicitEuler< algebra_type > timestep_type
Definition: limex_integrator.hpp:264
void enable_matrix_cache()
Select classic LIMEX.
Definition: limex_integrator.hpp:535
void interrupt()
interrupt execution of apply() by external call via observer
Definition: limex_integrator.hpp:550
void set_stepsize_safety_factor(double rho)
Definition: limex_integrator.hpp:365
number get_cost(size_t i)
Definition: limex_integrator.hpp:466
void update_monitor()
convergence monitor
Definition: limex_integrator.hpp:496
number & monitor(size_t k, size_t q)
Definition: limex_integrator.hpp:472
std::string config_string() const
Definition: limex_integrator.hpp:555
void set_conservative(bool c)
Definition: limex_integrator.hpp:552
number get_gamma(size_t i)
Definition: limex_integrator.hpp:467
algebra_type::vector_type vector_type
Definition: limex_integrator.hpp:258
void init_integrator_threads(ConstSmartPtr< grid_function_type > u)
Initialize integrator threads (w/ solutions)
Definition: limex_integrator.hpp:593
void update_cost()
Updating workloads A_i for computing T_ii.
Definition: limex_integrator.hpp:489
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:377
bool m_bInterrupt
Definition: limex_integrator.hpp:584
SmartPtr< grid_function_type > get_time_derivative()
getter for time derivative info (optional for setting $\Gamma$)
Definition: limex_integrator.hpp:529
INonlinearTimeIntegrator< TDomain, TAlgebra > base_type
Definition: limex_integrator.hpp:260
std::vector< number > m_workload
Definition: limex_integrator.hpp:570
int apply_integrator_threads(number dtcurr, ConstSmartPtr< grid_function_type > u0, number t0, size_t nstages)
(Tentatively) apply integrators
Definition: limex_integrator.hpp:636
void join_integrator_threads()
e.g. wait for all threads to complete
Definition: limex_integrator.hpp:708
void set_asymptotic_order(size_t q)
Definition: limex_integrator.hpp:370
void set_stepsize_reduction_factor(double sigma)
Definition: limex_integrator.hpp:366
Definition: linear_implicit_timestep.h:74
Integrate (a non-linear problem) over a given time interval.
Definition: simple_integrator.hpp:11
number get_consistency_error() const
Definition: simple_integrator.hpp:53
void set_banach_space(SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace)
Definition: simple_integrator.hpp:56
void set_derivative(SmartPtr< grid_function_type > udot)
Definition: simple_integrator.hpp:47
bool apply(SmartPtr< grid_function_type > u1, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Definition: simple_integrator.hpp:38
const std::string & get_file(size_t i) const
unsigned long get_line(size_t i) const
const std::string & get_msg() const
ParallelMatrix< SparseMatrix< double > > matrix_type
ParallelVector< Vector< double > > vector_type
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:99
DebugID LIB_LIMEX("LIB_LIMEX")
Definition: limex_tools.h:51
#define PROFILE_FUNC_GROUP(groups)
SmartPtr< T, FreePolicy > make_sp(T *inst)
function ProblemDisc new(problemDesc, dom)