Skip to content
Snippets Groups Projects
Commit efb2ca41 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

corrected visibility bug in lambda

parent 1ba68264
No related branches found
No related tags found
1 merge request!58Add generalized derivative and local-to-global adapter to handle the global derivatives uniformly
......@@ -220,6 +220,10 @@ public:
using Domain = typename Super::Domain;
using Super::DerivativeLocalFunctionBase;
using Super::globalFunction_;
using Super::geometry_;
using Super::subTree_;
using Super::localView_;
/// Evaluate Gradient at bound element in local coordinates
Range operator()(Domain const& x) const
......@@ -227,18 +231,18 @@ public:
assert( Super::bound_ );
Range dy(0);
auto&& coefficients = *Super::globalFunction_.dofVector_;
auto&& nodeToRangeEntry = Super::globalFunction_.nodeToRangeEntry_;
for_each_leaf_node(*Super::subTree_, [&,this](auto const& node, auto const& tp)
auto&& coefficients = *globalFunction_.dofVector_;
auto&& nodeToRangeEntry = globalFunction_.nodeToRangeEntry_;
for_each_leaf_node(*subTree_, [&,this](auto const& node, auto const& tp)
{
auto localBasis = makeLocalToGlobalBasisAdapter(node, Super::geometry_.value());
auto localBasis = makeLocalToGlobalBasisAdapter(node, geometry_.value());
auto const& gradients = localBasis.gradientsAt(x);
// Get range entry associated to this node
auto re = Dune::Functions::flatVectorView(nodeToRangeEntry(node, tp, dy));
for (std::size_t i = 0; i < localBasis.size(); ++i) {
auto&& multiIndex = Super::localView_.index(node.localIndex(i));
auto&& multiIndex = localView_.index(node.localIndex(i));
// Get coefficient associated to i-th shape function
auto c = Dune::Functions::flatVectorView(coefficients[multiIndex]);
......@@ -273,6 +277,10 @@ public:
using Domain = typename Super::Domain;
using Super::DerivativeLocalFunctionBase;
using Super::globalFunction_;
using Super::geometry_;
using Super::subTree_;
using Super::localView_;
/// Evaluate divergence at bound element in local coordinates
Range operator()(Domain const& x) const
......@@ -294,10 +302,10 @@ private:
assert( Super::bound_ );
Range dy(0);
auto&& coefficients = *Super::globalFunction_.dofVector_;
auto&& node = *Super::subTree_;
auto&& coefficients = *globalFunction_.dofVector_;
auto&& node = *subTree_;
auto localBasis = makeLocalToGlobalBasisAdapter(node.child(0), Super::geometry_.value());
auto localBasis = makeLocalToGlobalBasisAdapter(node.child(0), geometry_.value());
auto const& gradients = localBasis.gradientsAt(x);
auto re = Dune::Functions::flatVectorView(dy);
......@@ -307,7 +315,7 @@ private:
assert(int(grad.size()) == GridView::dimensionworld);
for (std::size_t j = 0; j < GridView::dimensionworld; ++j) {
auto&& multiIndex = Super::localView_.index(node.child(j).localIndex(i));
auto&& multiIndex = localView_.index(node.child(j).localIndex(i));
re[0] += coefficients[multiIndex] * grad[j];
}
}
......@@ -328,6 +336,10 @@ public:
using Domain = typename Super::Domain;
using Super::DerivativeLocalFunctionBase;
using Super::globalFunction_;
using Super::geometry_;
using Super::subTree_;
using Super::localView_;
/// Evaluate partial derivative at bound element in local coordinates
Range operator()(Domain const& x) const
......@@ -335,18 +347,20 @@ public:
assert( Super::bound_ );
Range dy(0);
auto&& coefficients = *Super::globalFunction_.dofVector_;
auto&& nodeToRangeEntry = Super::globalFunction_.nodeToRangeEntry_;
for_each_leaf_node(*Super::subTree_, [&,this](auto const& node, auto const& tp)
std::size_t comp = Super::type_.comp;
auto&& coefficients = *globalFunction_.dofVector_;
auto&& nodeToRangeEntry = globalFunction_.nodeToRangeEntry_;
for_each_leaf_node(*subTree_, [&,this](auto const& node, auto const& tp)
{
auto localBasis = makeLocalToGlobalBasisAdapter(node, Super::geometry_.value());
auto const& partial = localBasis.partialsAt(x, Super::type_.comp);
auto localBasis = makeLocalToGlobalBasisAdapter(node, geometry_.value());
auto const& partial = localBasis.partialsAt(x, comp);
// Get range entry associated to this node
auto re = Dune::Functions::flatVectorView(nodeToRangeEntry(node, tp, dy));
for (std::size_t i = 0; i < localBasis.size(); ++i) {
auto&& multiIndex = Super::localView_.index(node.localIndex(i));
auto&& multiIndex = localView_.index(node.localIndex(i));
// Get coefficient associated to i-th shape function
auto c = Dune::Functions::flatVectorView(coefficients[multiIndex]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment