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

Function Visualize

comp/gridfunction.cpp:381–466  ·  view source on GitHub ↗

void GridFunction :: Visualize(const string & given_name)

Source from the content-addressed store, hash-verified

379
380 // void GridFunction :: Visualize(const string & given_name)
381 void Visualize(shared_ptr<GridFunction> gf, const string & given_name)
382 {
383 // if (!visual) return;
384
385 /*
386 for (int i = 0; i < compgfs.Size(); i++)
387 {
388 stringstream child_name;
389 child_name << given_name << "_" << i+1;
390 compgfs[i] -> Visualize (child_name.str());
391 }
392 */
393
394
395 auto fespace = gf->GetFESpace();
396 auto ma = fespace->GetMeshAccess();
397
398 shared_ptr<DifferentialOperator> eval_2d, eval_3d;
399 if (ma->GetDimension() == 2)
400 {
401 eval_2d = fespace->GetEvaluator(VOL);
402 }
403 else
404 {
405 eval_3d = fespace->GetEvaluator(VOL);
406 eval_2d = fespace->GetEvaluator(BND);
407 }
408
409 if (eval_2d || eval_3d)
410 {
411 netgen::SolutionData * vis = new VisualizeCoefficientFunction (ma, gf);
412 Ng_SolutionData soldata;
413 Ng_InitSolutionData (&soldata);
414
415 soldata.name = given_name;
416 soldata.data = 0;
417 soldata.components = gf -> Dimension();
418 if (gf->IsComplex()) soldata.components *= 2;
419 soldata.iscomplex = gf -> IsComplex();
420 soldata.draw_surface = eval_2d != nullptr;
421 soldata.draw_volume = eval_3d != nullptr;
422
423 soldata.dist = 1;
424 soldata.soltype = NG_SOLUTION_VIRTUAL_FUNCTION;
425 soldata.solclass = vis;
426 Ng_SetSolutionData (&soldata);
427 }
428
429
430 /*
431 shared_ptr<BilinearFormIntegrator> bfi2d, bfi3d;
432
433 if (ma->GetDimension() == 2)
434 {
435 bfi2d = fespace->GetIntegrator(VOL);
436 }
437 else
438 {

Callers 2

S_GridFunctionMethod · 0.85

Calls 5

GetFESpaceMethod · 0.80
GetMeshAccessMethod · 0.80
GetDimensionMethod · 0.45
DimensionMethod · 0.45
IsComplexMethod · 0.45

Tested by

no test coverage detected