swh:1:snp:597f10704966a63e22a6690fc91719ea5d363ec6
Tip revision: 35742ac3ab1ae42cf2bbe8761fd7c8e630a638c4 authored by JoshWolper on 28 October 2020, 15:53:00 UTC
Add files via upload
Add files via upload
Tip revision: 35742ac
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