MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / DiffJacobi

Method DiffJacobi

fem/coefficient.cpp:4535–4554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4533 }
4534
4535 shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override
4536 {
4537 auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this());
4538 if (cache.find(thisptr) != cache.end())
4539 return cache[thisptr];
4540
4541 if (this == var) return make_shared<ConstantCoefficientFunction>(1);
4542 auto diffc1 = c1->DiffJacobi (var, cache);
4543 Array<int> vardims = Array<int> (var->Dimensions());
4544 Array<int> dist(vardims.Size());
4545 int prod = 1;
4546 for (int i = dist.Size()-1; i >= 0; i--)
4547 {
4548 dist[i] = prod;
4549 prod *= vardims[i];
4550 }
4551 auto res = MakeSubTensorCoefficientFunction(diffc1, comp*var->Dimension(), std::move(vardims), std::move(dist));
4552 cache[thisptr] = res;
4553 return res;
4554 }
4555
4556
4557 /*

Callers

nothing calls this directly

Calls 8

findMethod · 0.80
DimensionsMethod · 0.80
shared_from_thisMethod · 0.45
endMethod · 0.45
DiffJacobiMethod · 0.45
SizeMethod · 0.45
DimensionMethod · 0.45

Tested by

no test coverage detected