| 196 | } |
| 197 | |
| 198 | vector<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 | |
| 224 | vector<string> GenerateEdgeData( shared_ptr<MeshAccess> ma, |
| 225 | shared_ptr<CoefficientFunction> cf, |
no test coverage detected