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

Method NonZeroPattern

fem/coefficient_matrix.hpp:261–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 */
260
261 virtual void NonZeroPattern (const class ProxyUserData & ud,
262 FlatVector<AutoDiffDiff<1,NonZero>> values) const override
263 {
264 FlatArray<int> hdims = Dimensions();
265 Vector<AutoDiffDiff<1,NonZero>> va(hdims[0]*inner_dim), vb(hdims[1]*inner_dim);
266 c1->NonZeroPattern (ud, va);
267 c2->NonZeroPattern (ud, vb);
268
269 size_t d1 = hdims[1];
270
271 values = NonZero(false);
272
273 for (size_t j = 0; j < hdims[0]; j++)
274 for (size_t k = 0; k < hdims[1]; k++)
275 for (size_t l = 0; l < inner_dim; l++)
276 values(j*d1+k) += va(j*inner_dim+l) * vb(l*d1+k);
277 }
278
279
280 virtual void NonZeroPattern (const class ProxyUserData & ud,

Callers

nothing calls this directly

Calls 3

DimensionsFunction · 0.85
NonZeroClass · 0.85
NonZeroPatternMethod · 0.45

Tested by

no test coverage detected