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

Method GenerateMatrixRef

comp/l2hofespace.cpp:3398–3418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3396
3397 template <typename IP, typename MAT>
3398 static void GenerateMatrixRef (const FiniteElement & bfel, const IP & ip,
3399 MAT && mat, LocalHeap & lh)
3400 {
3401 auto & fel = static_cast<const VectorFiniteElement&> (bfel);
3402 auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
3403
3404 int ndofi = feli.GetNDof();
3405 FlatMatrix<> grad (ndofi, DIM_SPC, lh);
3406 feli.CalcDShape(ip, grad);
3407
3408 // Mat<DIM_SPC,DIM_SPC> trans = 1/(mip.GetJacobiDet())*mip.GetJacobian();
3409 mat.AddSize(DimRef(), bfel.GetNDof()) = 0.0;
3410 for (int i = 0; i < DIM_SPC; i++)
3411 for (int j = 0; j < DIM_SPC; j++)
3412 mat.Row(i*DIM_SPC+j).Range(i*ndofi, (i+1)*ndofi) = grad.Col(j);
3413
3414 FlatVector<> val (ndofi, lh);
3415 feli.CalcShape(ip, val);
3416 for (int i = 0; i < DIM_SPC; i++)
3417 mat.Row(DIM_SPC*DIM_SPC+i).Range(i*ndofi, (i+1)*ndofi) = val;
3418 }
3419
3420 template <typename MIP, typename MAT>
3421 static void CalcTransformationMatrix (const MIP & mip,

Callers

nothing calls this directly

Calls 6

GetNDofMethod · 0.45
CalcDShapeMethod · 0.45
RangeMethod · 0.45
RowMethod · 0.45
ColMethod · 0.45
CalcShapeMethod · 0.45

Tested by

no test coverage detected