https://github.com/penn-graphics-research/ziran2019
Tip revision: 8d3d27cd17bbceab18c317820dbe595178f6312a authored by fangy14 on 06 November 2019, 07:20:57 UTC
open source
open source
Tip revision: 8d3d27c
SoundSpeedCfl.h
#ifndef SOUND_SPEED_CFL_H
#define SOUND_SPEED_CFL_H
#include <cmath>
namespace ZIRAN {
//#########################################################################
// Function: evaluateSoundSpeedLinearElasticityAnalysis
//#########################################################################
template <class T>
inline T evaluateSoundSpeedLinearElasticityAnalysis(const T E, const T nu, const T rho)
{
return std::sqrt(E * (1 - nu) / ((1 + nu) * (1 - 2 * nu) * rho));
}
//#########################################################################
// Function: evaluateTimestepLinearElasticityAnalysis
//#########################################################################
template <class T>
inline T evaluateTimestepLinearElasticityAnalysis(const T E, const T nu, const T rho, const T dx, const T cfl)
{
return cfl * dx / evaluateSoundSpeedLinearElasticityAnalysis(E, nu, rho);
}
} // namespace ZIRAN
#endif
