incorporating feedback

This commit is contained in:
jtclemm
2024-02-26 12:09:19 -07:00
parent dda2bc7ac7
commit 73ae3200d0
2 changed files with 7 additions and 3 deletions

View File

@ -119,7 +119,7 @@ as
.. math:: .. math::
F^t_{ab} = \frac{15}{3\, \mathrm{Tr}(N)} (T_{ab} - \frac{1}{3} \mathrm{Tr}(T) \delta_{ab}) F^t_{ab} = \frac{5}{\mathrm{Tr}(N)} (T_{ab} - \frac{1}{3} \mathrm{Tr}(T) \delta_{ab})
where the tensor :math:`T` is defined as where the tensor :math:`T` is defined as

View File

@ -130,8 +130,12 @@ void GranSubModDampingTsuji::init()
double GranSubModDampingTsuji::calculate_forces() double GranSubModDampingTsuji::calculate_forces()
{ {
// in case argument < 0 due to precision issues // in case argument <= 0 due to precision issues
double sqrt1 = MAX(0, gm->meff * gm->Fnormal / gm->delta); double sqrt1;
if (gm->delta > 0.0)
sqrt1 = MAX(0.0, gm->meff * gm->Fnormal / gm->delta);
else
sqrt1 = 0.0;
damp_prefactor = damp * sqrt(sqrt1); damp_prefactor = damp * sqrt(sqrt1);
return -damp_prefactor * gm->vnnr; return -damp_prefactor * gm->vnnr;
} }