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

Method CalcElementMatrix

bem/ngbem.cpp:583–1114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581
582 template <typename KERNEL>
583 void GenericIntegralOperator<KERNEL> ::
584 CalcElementMatrix(FlatMatrix<value_type> matrix,
585 ElementId ei_trial, ElementId ei_test,
586 LocalHeap &lh) const
587 {
588 auto mesh = this->trial_space->GetMeshAccess();
589 auto mesh2 = this->test_space->GetMeshAccess();
590
591 // static Timer tall("ngbem - elementmatrix " + KERNEL::Name());
592 // RegionTimer reg(tall);
593
594 // static Timer t1("ngbem - elementmatrix, part1 " + KERNEL::Name());
595
596 // t1.Start();
597 matrix = 0.;
598 // t1.Stop();
599
600 Vec<3> x,y,nx,ny;
601 typedef decltype(kernel.Evaluate (x,y,nx,ny)) KERNEL_COMPS_T;
602
603
604 // common code for same panel, common edge, common vertex
605 auto Integrate4D = [&] (const IntegrationRule & irx,
606 const IntegrationRule & iry,
607 const FiniteElement & feli,
608 const FiniteElement & felj,
609 const ElementTransformation & trafoi,
610 const ElementTransformation & trafoj,
611 FlatMatrix<value_type> elmat,
612 LocalHeap & lh)
613 {
614 HeapReset hr(lh);
615 SIMD_IntegrationRule simd_irx(irx);
616 SIMD_IntegrationRule simd_iry(iry);
617
618 SIMD_MappedIntegrationRule<2,3> mirx(simd_irx, trafoi, lh);
619 SIMD_MappedIntegrationRule<2,3> miry(simd_iry, trafoj, lh);
620
621 FlatMatrix<SIMD<double>> mshapesi(feli.GetNDof()*test_evaluator->Dim(), mirx.Size(), lh);
622 FlatMatrix<SIMD<value_type>> mshapesi_kern(feli.GetNDof(), mirx.Size(), lh);
623 FlatMatrix<SIMD<double>> mshapesj(felj.GetNDof()*trial_evaluator->Dim(), miry.Size(), lh);
624
625 // mshapesi = 0.;
626 // mshapesj = 0.;
627
628 IntRange test_range = test_evaluator->UsedDofs(feli);
629 IntRange trial_range = trial_evaluator->UsedDofs(felj);
630 test_evaluator->CalcMatrix(feli, mirx, mshapesi); // only used are set for compound fe !!!
631 trial_evaluator->CalcMatrix(felj, miry, mshapesj);
632
633 FlatVector<Vec<KERNEL_COMPS_T::SIZE, SIMD<value_type>>> kernel_values(mirx.Size(), lh);
634 for (int k2 = 0; k2 < mirx.Size(); k2++)
635 {
636 Vec<3,SIMD<double>> x = mirx[k2].Point();
637 Vec<3,SIMD<double>> y = miry[k2].Point();
638 Vec<3,SIMD<double>> nx = mirx[k2].GetNV();
639 Vec<3,SIMD<double>> ny = miry[k2].GetNV();
640 kernel_values(k2) = mirx[k2].GetMeasure()*miry[k2].GetMeasure()*simd_irx[k2].Weight() *

Callers

nothing calls this directly

Calls 15

GetEdgesFunction · 0.85
GetMeshAccessMethod · 0.80
PointMethod · 0.80
GetMeasureMethod · 0.80
VerticesMethod · 0.80
ContainsMethod · 0.80
AddABtFunction · 0.50
IntegrationPointClass · 0.50
TransFunction · 0.50
EvaluateMethod · 0.45
GetNDofMethod · 0.45
DimMethod · 0.45

Tested by

no test coverage detected