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

Method DiffJacobi

fem/coefficient.cpp:2221–2244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2219 }
2220
2221 shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override
2222 {
2223 auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this());
2224 if (cache.find(thisptr) != cache.end())
2225 return cache[thisptr];
2226 int dimvar = var->Dimension();
2227 int mydim = this->Dimension();
2228
2229 Array<int> dimres { this -> Dimensions() + var->Dimensions() };
2230
2231 if (this == var)
2232 return IdentityCF(this->Dimensions());
2233
2234 auto diffc1 = c1->DiffJacobi(var, cache);
2235 auto diffc2 = c2->DiffJacobi(var, cache);
2236
2237 auto prod1_ = c2 -> Reshape(mydim, 1) * diffc1 -> Reshape(1, dimvar);
2238 auto prod1 = prod1_ -> Reshape(dimres);
2239
2240 auto prod2 = c1 * diffc2;
2241 auto res = prod1 + prod2;
2242 cache[thisptr] = res;
2243 return res;
2244 }
2245
2246
2247

Callers

nothing calls this directly

Calls 7

IdentityCFFunction · 0.85
findMethod · 0.80
DimensionsMethod · 0.80
shared_from_thisMethod · 0.45
endMethod · 0.45
DimensionMethod · 0.45
DiffJacobiMethod · 0.45

Tested by

no test coverage detected