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

Method DiffJacobi

fem/coefficient_matrix.cpp:639–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637 }
638
639 shared_ptr<CoefficientFunction>
640 DiffJacobi (const CoefficientFunction * var, typename BASE::T_DJC & cache) const override
641 {
642 auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this());
643 if (cache.find(thisptr) != cache.end())
644 return cache[thisptr];
645
646 if (this == var) return make_shared<ConstantCoefficientFunction>(1);
647 if (c1.get() == var) return CofactorCF (c1);
648 auto input = c1->InputCoefficientFunctions();
649 if (input.Size() == 0) return ZeroCF(var->Dimensions());
650
651 auto cof = CofactorCF(c1) -> Reshape( 1, D*D );
652 auto diffc1 = c1->DiffJacobi (var, cache) -> Reshape( D*D, var->Dimension() );
653 auto prod = cof * diffc1;
654 auto res = prod->Reshape(var->Dimensions());
655
656 /*
657 auto cof = CofactorCF(c1) -> Reshape( D*D );
658 auto diffc1 = c1->DiffJacobi (var, cache) -> Reshape( D*D, var->Dimension() );
659 auto res = diffc1->Transpose() * cof;
660 */
661
662 cache[thisptr] = res;
663 return res;
664 }
665
666
667 };

Callers

nothing calls this directly

Calls 11

CofactorCFFunction · 0.85
ZeroCFFunction · 0.85
findMethod · 0.80
DimensionsMethod · 0.80
shared_from_thisMethod · 0.45
endMethod · 0.45
getMethod · 0.45
SizeMethod · 0.45
DiffJacobiMethod · 0.45
DimensionMethod · 0.45

Tested by

no test coverage detected