| 473 | |
| 474 | |
| 475 | shared_ptr<GridFunction> GridFunction :: |
| 476 | GetComponent (int compound_comp) |
| 477 | { |
| 478 | auto compfes = dynamic_pointer_cast<CompoundFESpace>(fespace); |
| 479 | if(compfes) |
| 480 | { |
| 481 | if (compound_comp >= compfes->GetNSpaces()) |
| 482 | throw Exception("GetComponent: compound_comp does not exist!"); |
| 483 | shared_ptr<GridFunction> sptr; |
| 484 | if(compgfs[compound_comp].expired()) |
| 485 | { |
| 486 | sptr = make_shared<ComponentGridFunction>(dynamic_pointer_cast<GridFunction>(this->shared_from_this()), |
| 487 | compound_comp); |
| 488 | compgfs[compound_comp] = sptr; |
| 489 | sptr->Update(); |
| 490 | } |
| 491 | else |
| 492 | sptr = compgfs[compound_comp].lock(); |
| 493 | return sptr; |
| 494 | } |
| 495 | throw Exception("GetComponent: Not a GridFunction on a Compound FESpace!"); |
| 496 | } |
| 497 | |
| 498 | shared_ptr<CoefficientFunction> |
| 499 | GridFunctionCoefficientFunction :: Primary () const |
nothing calls this directly
no test coverage detected