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

Method GetTraceOperator

comp/l2hofespace.cpp:1960–2042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1958
1959
1960 shared_ptr<BaseMatrix> L2HighOrderFESpace ::
1961 GetTraceOperator (shared_ptr<FESpace> tracespace, bool avg) const
1962 {
1963 LocalHeap lh(1000000);
1964 Array<short> classnr(ma->GetNE());
1965 ma->IterateElements
1966 (VOL, lh, [&] (auto el, LocalHeap & llh)
1967 {
1968 classnr[el.Nr()] =
1969 SwitchET<ET_TRIG,ET_TET>
1970 (el.GetType(),
1971 [el] (auto et) { return ET_trait<et.ElementType()>::GetClassNr(el.Vertices()); });
1972 });
1973
1974 TableCreator<size_t> creator;
1975 for ( ; !creator.Done(); creator++)
1976 for (auto i : Range(classnr))
1977 creator.Add (classnr[i], i);
1978 Table<size_t> table = creator.MoveTable();
1979
1980 shared_ptr<BaseMatrix> sum;
1981
1982 // size_t ne = ma->GetNE();
1983
1984 shared_ptr<VVector<double>> cnt;
1985 if (avg)
1986 {
1987 cnt = make_shared<VVector<double>>(tracespace->GetNDof());
1988 *cnt = 0;
1989 }
1990
1991
1992 for (auto elclass_inds : table)
1993 {
1994 if (elclass_inds.Size() == 0) continue;
1995
1996 ElementId ei(VOL,elclass_inds[0]);
1997 auto & felx = GetFE (ei, lh);
1998 //auto & trafo = GetMeshAccess()->GetTrafo(ei, lh);
1999
2000 Matrix<> trace_op_x = GetTraceMatrix (felx);
2001
2002
2003 Table<DofId> xdofs(elclass_inds.Size(), felx.GetNDof()),
2004 ydofs(elclass_inds.Size(), trace_op_x.Height());
2005
2006 Array<DofId> dnumsx, dnumsy;
2007 for (auto i : Range(elclass_inds))
2008 {
2009 ElementId ei(VOL, elclass_inds[i]);
2010 GetDofNrs(ei, dnumsx);
2011 tracespace->GetDofNrs(ei, dnumsy);
2012 xdofs[i] = dnumsx;
2013 ydofs[i] = dnumsy;
2014
2015 if (avg)
2016 for (auto d : dnumsy)
2017 (*cnt)(d) += 1;

Callers

nothing calls this directly

Calls 12

GetTraceMatrixFunction · 0.85
VerticesMethod · 0.80
AddMethod · 0.80
GetDofNrsFunction · 0.70
RangeFunction · 0.50
NrMethod · 0.45
GetTypeMethod · 0.45
ElementTypeMethod · 0.45
GetNDofMethod · 0.45
SizeMethod · 0.45
HeightMethod · 0.45
GetDofNrsMethod · 0.45

Tested by

no test coverage detected