2012-11-28 17:23:46 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
//!
|
|
|
|
|
//! \file TimeIntUtils.h
|
|
|
|
|
//!
|
|
|
|
|
//! \date Nov 28 2012
|
|
|
|
|
//!
|
|
|
|
|
//! \author Arne Morten Kvarving / SINTEF
|
|
|
|
|
//!
|
|
|
|
|
//! \brief Various helpers for time integration
|
|
|
|
|
//!
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
|
|
#include "TimeIntUtils.h"
|
|
|
|
|
|
|
|
|
|
namespace TimeIntegration {
|
|
|
|
|
|
|
|
|
|
int Order(Method method)
|
|
|
|
|
{
|
|
|
|
|
if (method == EULER || method == BE)
|
|
|
|
|
return 1;
|
|
|
|
|
|
2017-03-09 11:04:13 +01:00
|
|
|
if (method == HEUN || method == BDF2 || method == THETA)
|
2012-11-28 17:23:46 +00:00
|
|
|
return 2;
|
|
|
|
|
|
|
|
|
|
if (method == RK3)
|
|
|
|
|
return 3;
|
|
|
|
|
|
|
|
|
|
if (method == RK4)
|
2014-10-08 13:25:41 +00:00
|
|
|
return 4;
|
2012-11-28 17:23:46 +00:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Steps(Method method)
|
|
|
|
|
{
|
|
|
|
|
if (method == BDF2)
|
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|