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

Method DiffJacobi

fem/coefficient_matrix.cpp:860–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858 }
859
860 shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, typename BASE::T_DJC & cache) const override
861 {
862 auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this());
863 if (cache.find(thisptr) != cache.end())
864 return cache[thisptr];
865
866 if (this == var)
867 return IdentityCF(this->Dimensions());
868
869 shared_ptr<CoefficientFunction> res;
870
871 if (this->Dimensions()[0] == 2)
872 res = (TraceCF(c1)*IdentityCF(2)-TransposeCF(c1)) -> DiffJacobi (var, cache);
873 else if (this->Dimensions()[0] == 3)
874 {
875 auto trcf = TraceCF(c1);
876 auto prodcf = c1*c1;
877 res = (0.5*(trcf*trcf - TraceCF(prodcf))*IdentityCF(3) - trcf*TransposeCF(c1) + TransposeCF(prodcf)) -> DiffJacobi (var, cache);
878 }
879 else
880 res = (DeterminantCF(c1) * InverseCF(c1)->Transpose() ) -> DiffJacobi (var, cache);
881 cache[thisptr] = res;
882 return res;
883 }
884
885
886 };

Callers

nothing calls this directly

Calls 10

IdentityCFFunction · 0.85
TraceCFFunction · 0.85
TransposeCFFunction · 0.85
DeterminantCFFunction · 0.85
InverseCFFunction · 0.85
findMethod · 0.80
DimensionsMethod · 0.80
shared_from_thisMethod · 0.45
endMethod · 0.45
DiffJacobiMethod · 0.45

Tested by

no test coverage detected