Commit f52df387 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#531 Fix the monolithic Stokes (that failed due to my temporary assumption in...

#531 Fix the monolithic Stokes (that failed due to my temporary assumption in the computation of the local matrix to inject into the global one).
parent ef862ead
......@@ -155,10 +155,28 @@ namespace HappyHeart
{
const auto& elementary_data = local_variational_operator.GetElementaryData();
// #197 const_cast to remove! Very ugly, but I guarantee the underlying value is not modified...
auto& local_matrix = const_cast<LocalMatrix&>(elementary_data.GetMatrixResult());
const auto& unknown_and_numbering_subset_list =
local_variational_operator.GetUnknownAndNumberingSubsetList();
if (row_numbering_subset == col_numbering_subset
&& std::all_of(unknown_and_numbering_subset_list.cbegin(),
unknown_and_numbering_subset_list.cend(),
[&row_numbering_subset](const auto& item_ptr)
{
assert(!(!item_ptr));
return item_ptr->GetNumberingSubset() == row_numbering_subset;
}))
{
// Monolithic case; we can return directly the whole matrix.
return local_matrix;
}
Unknown::vector_const_shared_ptr row_unknown_list;
Unknown::vector_const_shared_ptr col_unknown_list;
......@@ -184,9 +202,7 @@ namespace HappyHeart
// assert(it != reduced_local_matrix_.cend());
// `auto& ret = it->second;
// #197 const_cast to remove! Very ugly, but I guarantee the underlying value is not modified...
auto& local_matrix = const_cast<LocalMatrix&>(elementary_data.GetMatrixResult());
auto block = elementary_data.ExtractBlockFromLocalMatrix(elementary_data.GetRefFElt(unknown1),
elementary_data.GetRefFElt(unknown2),
local_matrix);
......
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