diff --git a/doc/src/compute_fabric.rst b/doc/src/compute_fabric.rst index 87fabe2374..77586e617a 100644 --- a/doc/src/compute_fabric.rst +++ b/doc/src/compute_fabric.rst @@ -119,7 +119,7 @@ as .. 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 diff --git a/src/GRANULAR/gran_sub_mod_damping.cpp b/src/GRANULAR/gran_sub_mod_damping.cpp index c635d90265..1ac0ce9030 100644 --- a/src/GRANULAR/gran_sub_mod_damping.cpp +++ b/src/GRANULAR/gran_sub_mod_damping.cpp @@ -130,8 +130,12 @@ void GranSubModDampingTsuji::init() double GranSubModDampingTsuji::calculate_forces() { - // in case argument < 0 due to precision issues - double sqrt1 = MAX(0, gm->meff * gm->Fnormal / gm->delta); + // in case argument <= 0 due to precision issues + 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); return -damp_prefactor * gm->vnnr; }