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

Function GenerateWireframeData

comp/webgui.cpp:198–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198vector<string> GenerateWireframeData( shared_ptr<MeshAccess> ma,
199 shared_ptr<CoefficientFunction> cf,
200 int order) {
201 // generate wireframe data
202 LocalHeapMem<100000> lh("webgui_wireframe_data");
203 auto vb = ma->GetDimension() == 3 ? BND : VOL;
204 Array<double> surface_data;
205 auto comps = cf->Dimension();
206 for (auto elnr : Range(ma->GetNElements(2))) {
207 HeapReset hr(lh);
208
209 auto el = ma->GetElement({vb, elnr});
210 auto ir = GetWireframePoints(el.GetType(), order);
211 auto &trafo = ma->GetTrafo(el, lh);
212 BaseMappedIntegrationRule &mir = trafo(ir, lh);
213 FlatMatrix<> values(ir.Size(), comps, lh);
214 cf->Evaluate(mir, values);
215 surface_data.Append(
216 FlatArray<double>(values.AsVector().Size(), values.Data()));
217 }
218 auto nip = order+1;
219 auto nseg = surface_data.Size() / nip / comps;
220 FlatTensor<3, double> data(nseg, nip, comps, surface_data.Data());
221 return MapBernstein(data, ET_SEGM, order, cf->Dimension());
222}
223
224vector<string> GenerateEdgeData( shared_ptr<MeshAccess> ma,
225 shared_ptr<CoefficientFunction> cf,

Callers 1

GenerateWebguiDataFunction · 0.85

Calls 11

GetWireframePointsFunction · 0.85
MapBernsteinFunction · 0.85
RangeFunction · 0.50
GetDimensionMethod · 0.45
DimensionMethod · 0.45
GetTypeMethod · 0.45
SizeMethod · 0.45
EvaluateMethod · 0.45
AppendMethod · 0.45
AsVectorMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected