Commit 10979afd by GILLES Sebastien

#531 Fewer scale of local matrices; result remains the same.

parent 4bac08c9
 ... ... @@ -38,7 +38,7 @@ namespace HappyHeart static void InjectInGlobalMatrix531(const LinearAlgebraTupleT& linear_algebra_tuple, const LocalFEltSpace& local_felt_space, LocalVariationalOperatorT& local_variational_operator); }; ... ... @@ -61,6 +61,29 @@ namespace HappyHeart template struct ZeroSpecialCase { static double FetchPreviousCoefficient(const LinearAlgebraTupleT& linear_algebra_tuple); }; template struct ZeroSpecialCase { static double FetchPreviousCoefficient(const LinearAlgebraTupleT& linear_algebra_tuple); }; } //namespace Impl ... ...
 ... ... @@ -34,7 +34,7 @@ namespace HappyHeart Recursivity::Assembly531(linear_algebra_tuple); } template template ... ... @@ -54,8 +54,19 @@ namespace HappyHeart const double coefficient = std::get(linear_algebra_tuple).second; if (!Utilities::AreEqual(coefficient, 1.)) local_matrix *= coefficient; const double previous_coefficient = ZeroSpecialCase::FetchPreviousCoefficient(linear_algebra_tuple); assert(!Utilities::IsZero(previous_coefficient)); // Trick here: local matrix was multiplied by a coefficient in previous iteration; we here both apply // the new one and cancel the previous one. const auto factor = coefficient / previous_coefficient; if (!Utilities::AreEqual(factor, 1.)) local_matrix *= factor; const auto& row_numbering_subset = global_matrix.GetRowNumberingSubset(); const auto& col_numbering_subset = global_matrix.GetColNumberingSubset(); ... ... @@ -96,11 +107,6 @@ namespace HappyHeart } if (!Utilities::AreEqual(coefficient, 1.)) // \todo #531 Be clever and get rid of it (use value from previous iteration in the first product). local_matrix *= 1. / coefficient; Recursivity::InjectInGlobalMatrix531(linear_algebra_tuple, local_felt_space, local_variational_operator); ... ... @@ -130,6 +136,25 @@ namespace HappyHeart } template double ZeroSpecialCase ::FetchPreviousCoefficient(const LinearAlgebraTupleT& linear_algebra_tuple) { static_cast(linear_algebra_tuple); return 1.; } template double ZeroSpecialCase ::FetchPreviousCoefficient(const LinearAlgebraTupleT& linear_algebra_tuple) { return std::get(linear_algebra_tuple).second; } } //namespace Impl ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!