Skip to content
Snippets Groups Projects
Commit d8887c56 authored by lisa_julia.nebel_at_tu-dresden.de's avatar lisa_julia.nebel_at_tu-dresden.de Committed by oliver.sander_at_tu-dresden.de
Browse files

Set the partition type for the assembler in a single location

In distributed situations, assembly has to happen on interior elements
only.  Select this partition type in a single location; previously
it was set several times in different places.
parent da77ce6a
No related branches found
No related tags found
1 merge request!23Various minor improvements by Lisa
......@@ -28,6 +28,12 @@ class FEAssembler {
public:
const Basis basis_;
/** \brief Partition type on which to assemble
*
* We want a fully nonoverlapping partition, and therefore need to skip ghost elements.
*/
static constexpr auto partitionType = Dune::Partitions::interiorBorder;
protected:
LocalFEStiffness<GridView,
......@@ -70,7 +76,7 @@ getNeighborsPerVertex(Dune::MatrixIndexSet& nb) const
nb.resize(n, n);
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior))
for (const auto& element : elements(basis_.getGridView(), partitionType))
{
const typename Basis::LocalFiniteElement& lfe = basis_.getLocalFiniteElement(element);
......@@ -111,7 +117,7 @@ assembleGradientAndHessian(const VectorType& sol,
gradient.resize(sol.size());
gradient = 0;
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior))
for (const auto& element : elements(basis_.getGridView(), partitionType))
{
const int numOfBaseFct = basis_.getLocalFiniteElement(element).localBasis().size();
......@@ -159,7 +165,7 @@ computeEnergy(const VectorType& sol) const
DUNE_THROW(Dune::Exception, "Solution vector doesn't match the basis!");
// Loop over all elements
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior))
for (const auto& element : elements(basis_.getGridView(), partitionType))
{
// Number of degrees of freedom on this element
size_t nDofs = basis_.getLocalFiniteElement(element).localBasis().size();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment