Commit 8435d463 authored by GILLES Sebastien's avatar GILLES Sebastien

#1303 Replace a dangerous test (floating point equality) by a more safe function.

parent 2b700c69
......@@ -365,6 +365,8 @@ namespace MoReFEM
{
const int int_coord_index = static_cast<int>(coord_index);
// const auto local_displacement_index =
// euclidean_dimension * shape_fct_index + coord_index;
const auto local_displacement_index = Nshape_function * coord_index + shape_fct_index;
assert(local_displacement_index < local_displacement.size());
......@@ -405,7 +407,7 @@ namespace MoReFEM
//PRETENSION
if (pretension != 0.)
if (NumericNS::IsZero(pretension))
{
const auto& covariant_metric_tensor = GetLocalMatrix<EnumUnderlyingType(LocalMatrixIndex::covariant_metric_tensor)>();
green_lagrange(0) += pretension * covariant_metric_tensor(0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment