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

Method NonZeroPattern

fem/tensorcoefficient.cpp:1317–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315 }
1316
1317 void EinsumCoefficientFunction::NonZeroPattern(
1318 const class ProxyUserData &ud,
1319 FlatVector<AutoDiffDiff<1, NonZero>> values) const
1320 {
1321 if (node)
1322 {
1323 node->NonZeroPattern(ud, values);
1324 return;
1325 }
1326
1327 Array<Vector<AutoDiffDiff<1, NonZero>>> vecs(cfs.Size());
1328 for (int i: Range(cfs)) {
1329 vecs[i].SetSize(cfs[i]->Dimension());
1330 cfs[i]->NonZeroPattern(ud, vecs[i]);
1331 }
1332
1333 values = NonZero(false);
1334 const auto cres = cfs.Size();
1335 for (size_t I: Range(index_maps.Height())) {
1336 if (!nz_all(I))
1337 continue;
1338 const auto& I_map = index_maps.Row(I);
1339 AutoDiffDiff<1, NonZero> tmp(true);
1340 for (size_t i: Range(vecs))
1341 tmp *= vecs[i](I_map(i));
1342 values(I_map(cres)) += tmp;
1343 }
1344 }
1345
1346 void EinsumCoefficientFunction::NonZeroPattern(
1347 const class ProxyUserData &ud,

Callers 3

nonzero_patternFunction · 0.45
SymbolicEnergyMethod · 0.45

Calls 7

NonZeroClass · 0.85
RangeFunction · 0.50
SizeMethod · 0.45
SetSizeMethod · 0.45
DimensionMethod · 0.45
HeightMethod · 0.45
RowMethod · 0.45

Tested by

no test coverage detected