Skip to content
Snippets Groups Projects
Commit 9bf0c5bb authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

ENH: Adds time step size to the time integrator

Adds time step size to the time integrator and the corresponding API
parent 98387bdd
No related branches found
No related tags found
No related merge requests found
......@@ -23,12 +23,10 @@ limitations under the License.
#include <g3log/g3log.hpp>
namespace imstk {
TimeIntegrator::TimeIntegrator(const TimeIntegrator::Type type)
namespace imstk
{
this->setType(type);
}
TimeIntegrator::TimeIntegrator(const TimeIntegrator::Type type, double dT) : m_type(type), m_dT(dT){}
void
TimeIntegrator::setType(const TimeIntegrator::Type type)
......@@ -65,4 +63,11 @@ TimeIntegrator::setCoefficients(const TimeIntegrator::Type type)
break;
}
}
void
TimeIntegrator::setTimestepSize(const double dT)
{
m_dT = dT;
}
}
......@@ -43,14 +43,15 @@ class TimeIntegrator
ForwardEuler,
BackwardEuler,
NewmarkBeta,
CentralDifference
CentralDifference,
none
};
public:
///
/// \brief Constructor
///
TimeIntegrator(const TimeIntegrator::Type type);
TimeIntegrator(const TimeIntegrator::Type type, double dT);
///
/// \brief Destructor
......@@ -68,6 +69,15 @@ public:
///
void setCoefficients(const TimeIntegrator::Type type);
///
/// \brief Set the time step size
///
void setTimestepSize(const double dT);
double getTimestepSize() const
{
return m_dT;
}
protected:
TimeIntegrator::Type m_type; ///> Type of the time integrator
......@@ -76,9 +86,9 @@ protected:
std::array<double,3> m_gamma;
std::array<double,3> m_beta;
double dT; ///> Delta T
double m_dT; ///> Delta T
};
}
} // imstk
#endif // ifndef imstkTimeIntegrator_h
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