NuTo
Numerics Tool
Public Member Functions | Public Attributes | List of all members
NuTo::AdaptiveSolve Class Reference

#include <AdaptiveSolve.h>

Public Member Functions

 AdaptiveSolve (std::function< int(double)> doStepFunction, std::function< void(double)> postProcessFunction=[](double){})
 ctor More...
 
void Solve (double tEnd, double tStart=0)
 Perform an adaptive time integration from t = tStart to t = tEnd. More...
 

Public Attributes

double dt = 0.1
 
double dtMax = 0.1
 
double dtMin = 1.e-6
 
double increaseFactor = 1.5
 
double decreaseFactor = 0.5
 

Constructor & Destructor Documentation

AdaptiveSolve::AdaptiveSolve ( std::function< int(double)>  doStepFunction,
std::function< void(double)>  postProcessFunction = [](double) {} 
)

ctor

Parameters
doStepFunctionfunction that solves a problem for a given t and returns the number of iterations required. -1 indicates a failed solve
postProcessFunctionfunction that is called with the current time

Member Function Documentation

void AdaptiveSolve::Solve ( double  tEnd,
double  tStart = 0 
)

Perform an adaptive time integration from t = tStart to t = tEnd.

One time step starts at time t and tries to apply the increment dt. If the step finishes without an exception, it is finalized by updating the time to t+dt calling the postprocess function. Only NoConvergence exception will be caught. They cause a decrease in the time step.

Parameters
tEndend time
tStartstart time
Remarks
tStart comes second (may be unintuitive) to default it to zero.

Member Data Documentation

double NuTo::AdaptiveSolve::decreaseFactor = 0.5
double NuTo::AdaptiveSolve::dt = 0.1
double NuTo::AdaptiveSolve::dtMax = 0.1
double NuTo::AdaptiveSolve::dtMin = 1.e-6
double NuTo::AdaptiveSolve::increaseFactor = 1.5

The documentation for this class was generated from the following files: