Commit a52b8502 authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Remove necessity to bind the derivative to an element

parent c402a35e
Pipeline #43491 passed with stage
in 7 minutes and 18 seconds
......@@ -384,10 +384,8 @@ public:
**/
JacobianTransposed jacobianTransposed (const LocalCoordinate& local) const
{
if (!dMapping_) {
if (!dMapping_)
dMapping_.emplace(derivative(mapping()));
dMapping_->bind(mapping().localContext());
}
// coordinate in the localContext of the mapping
auto&& elementLocal = localGeometry().global(local);
......
......@@ -45,24 +45,9 @@ struct AffineMapping
// bind the mapping to a local element
void bind (const LocalContext&) {}
struct DerivativeAffineMapping
{
const LocalContext& localContext_;
const Dune::FieldMatrix<ctype,cdim,mydim>& A;
const auto& operator() (const Dune::FieldVector<ctype,mydim>& x) const
{
return A;
}
const LocalContext& localContext () const { return localContext_; }
void bind (const LocalContext&) {}
};
friend auto derivative (const AffineMapping& mapping)
{
return DerivativeAffineMapping{mapping.localContext_,mapping.A};
return [&A=mapping.A](const Dune::FieldVector<ctype,mydim>& x) { return A; };
}
private:
......
Supports Markdown
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