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

Method ApplyLinearizedMatrixAdd1

comp/bilinearform.cpp:6605–6724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6603
6604 template <class SCAL>
6605 void S_BilinearForm<SCAL> :: ApplyLinearizedMatrixAdd1 (SCAL val,
6606 const BaseVector & lin,
6607 const BaseVector & x,
6608 BaseVector & y, LocalHeap & lh) const
6609 {
6610 if (!MixedSpaces())
6611
6612 {
6613 Array<int> dnums;
6614
6615 int ne = ma->GetNE();
6616 int dim = GetFESpace()->GetDimension();
6617 //LocalHeap lh (2000000, "biform-ApplyLinearized");
6618
6619 bool hasbound = false;
6620 bool hasinner = false;
6621
6622 for (int j = 0; j < NumIntegrators(); j++)
6623 {
6624 const BilinearFormIntegrator & bfi = *GetIntegrator(j);
6625 if (bfi.BoundaryForm())
6626 hasbound = true;
6627 else
6628 hasinner = true;
6629 }
6630
6631
6632 if (hasinner)
6633 for (int i = 0; i < ne; i++)
6634 {
6635 HeapReset hr(lh);
6636 ElementId ei(VOL, i);
6637 const FiniteElement & fel = fespace->GetFE (ei, lh);
6638 ElementTransformation & eltrans = ma->GetTrafo (ei, lh);
6639 fespace->GetDofNrs (ei, dnums);
6640
6641 FlatVector<SCAL> elveclin (dnums.Size() * dim, lh);
6642 FlatVector<SCAL> elvecx (dnums.Size() * dim, lh);
6643 FlatVector<SCAL> elvecy (dnums.Size() * dim, lh);
6644
6645 lin.GetIndirect (dnums, elveclin);
6646 fespace->TransformVec (ei, elveclin, TRANSFORM_SOL);
6647
6648 x.GetIndirect (dnums, elvecx);
6649 fespace->TransformVec (ei, elvecx, TRANSFORM_SOL);
6650
6651 for (int j = 0; j < NumIntegrators(); j++)
6652 {
6653 const BilinearFormIntegrator & bfi = *parts[j];
6654
6655 if (bfi.BoundaryForm()) continue;
6656 if (!bfi.DefinedOn (ma->GetElIndex (ei))) continue;
6657 if (!bfi.DefinedOnElement(ei.Nr())) continue;
6658
6659 bfi.ApplyLinearizedElementMatrix (fel, eltrans, elveclin, elvecx, elvecy, lh);
6660
6661 fespace->TransformVec (ei, elvecy, TRANSFORM_RHS);
6662

Callers

nothing calls this directly

Calls 14

MixedSpacesFunction · 0.85
GetIndirectMethod · 0.80
TransformVecMethod · 0.80
GetFESpaceFunction · 0.70
NumIntegratorsFunction · 0.70
GetIntegratorFunction · 0.70
GetDimensionMethod · 0.45
BoundaryFormMethod · 0.45
GetDofNrsMethod · 0.45
SizeMethod · 0.45
DefinedOnMethod · 0.45

Tested by

no test coverage detected