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

#531 LocalFEltSpace: add a method that computes the local2global needed by an...

#531 LocalFEltSpace: add a method that computes the local2global needed by an operator. This method is not efficient at the moment; a flag has been set to improve that later.
parent bc164804
......@@ -73,5 +73,5 @@ namespace HappyHeart
}
} // namespace HappyHeart
......@@ -105,6 +105,16 @@ namespace HappyHeart
* is not necessary for all global operators, so do not clutter space when it doesn't matter.
*/
void ComputeLocal2Global(DoComputeLocal2GlobalProcessorWise do_compute_local_2_global_processor_wise);
/*
*
* \todo #531 Improve the prototype: the std::vector should be allocated once in the class (with of course
* possibly several of them...). Mutable trick should be use here.
*/
template<MpiScale MpiScaleT>
std::vector<PetscInt> ComputeLocal2Global(const UnknownAndNumberingSubset::vector_const_shared_ptr& list,
const NumberingSubset& numbering_subset) const;
private:
......
......@@ -62,6 +62,36 @@ namespace HappyHeart
return node_bearer_list_;
}
template<MpiScale MpiScaleT>
std::vector<PetscInt> LocalFEltSpace
::ComputeLocal2Global(const UnknownAndNumberingSubset::vector_const_shared_ptr& list,
const NumberingSubset& numbering_subset) const
{
std::vector<PetscInt> ret;
for (const auto& item_ptr : list)
{
assert(!(!item_ptr));
const auto& item = *item_ptr;
if (item.GetNumberingSubset() != numbering_subset)
continue;
const auto& felt = GetFiniteElt(item);
const auto& felt_loc2glob = felt.GetLocal2Global<MpiScaleT>();
std::copy(felt_loc2glob.cbegin(),
felt_loc2glob.cend(),
std::back_inserter(ret));
}
return ret;
}
} // namespace HappyHeart
......
......@@ -71,7 +71,7 @@ namespace HappyHeart
* };
*
*/
const Unknown& GetUnknown(std::size_t index = 0) const;
const Unknown& GetUnknown(std::size_t index = 0) const; // \todo #531 Remove this accessor I dislike as it could be improperly used very easily
//! Return the list of Unkowns and their associated numbering subset.
......
......@@ -441,7 +441,7 @@ namespace HappyHeart
};
} // namespace HappyHeart
......
......@@ -153,6 +153,10 @@ namespace HappyHeart
const Unknown& unknown2);
} // namespace Private
......
......@@ -104,6 +104,7 @@ namespace HappyHeart
//! Gain non constant access to the elementary data.
ElementaryData<MatrixVectorNatureT>& GetNonCstElementaryData();
private:
......
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