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

Function SetValues

comp/postproc.cpp:390–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388
389 template <class SCAL>
390 void SetValues (shared_ptr<CoefficientFunction> coef,
391 GridFunction & u,
392 VorB vb,
393 const Region * reg,
394 DifferentialOperator * diffop,
395 LocalHeap & clh,
396 bool dualdiffop = false, bool use_simd = true, int mdcomp = 0,
397 optional<shared_ptr<BitArray>> definedonelements = nullopt,
398 int bonus_intorder = 0)
399 {
400 static Timer sv("timer setvalues"); RegionTimer r(sv);
401
402 auto fes = u.GetFESpace();
403 shared_ptr<MeshAccess> ma = fes->GetMeshAccess();
404 int dim = fes->GetDimension();
405 BaseStatusHandler::PushStatus("setvalues");
406
407 Array<int> cnti(fes->GetNDof());
408 cnti = 0;
409
410 if (dualdiffop)
411 {
412 if (!fes->GetAdditionalEvaluators().Used("dual"))
413 throw Exception(string("Dual diffop does not exist for ") + fes->GetClassName() + string("!"));
414
415 if (!diffop)
416 { diffop = fes->GetAdditionalEvaluators()["dual"].get(); }
417 else if ( diffop != fes->GetAdditionalEvaluators()["dual"].get() )
418 { throw Exception("diffop has to be nullptr or dual diffop!"); }
419
420 /** Trial-Proxy **/
421 if (!fes->GetEvaluator(vb))
422 throw Exception(fes->GetClassName()+string(" does not have an evaluator for ")+ToString(vb)+string("!"));
423 auto single_evaluator = fes->GetEvaluator(vb);
424 if (dynamic_pointer_cast<BlockDifferentialOperator>(single_evaluator))
425 single_evaluator = dynamic_pointer_cast<BlockDifferentialOperator>(single_evaluator)->BaseDiffOp();
426 auto trial = make_shared<ProxyFunction>(fes, false, false, single_evaluator,
427 nullptr, nullptr, nullptr, nullptr, nullptr);
428
429 /** Test-Proxy (dual) **/
430 auto dual_evaluator = fes->GetAdditionalEvaluators()["dual"];
431 auto single_dual_evaluator = fes->GetAdditionalEvaluators()["dual"];
432
433 for (VorB avb = VOL; avb < vb; avb++) {
434 dual_evaluator = dual_evaluator->GetTrace();
435 single_dual_evaluator = single_dual_evaluator->GetTrace();
436 if ( dual_evaluator == nullptr )
437 { throw Exception(fes->GetClassName() + string(" has no dual trace operator for vb = ") + \
438 to_string(avb) + string(" -> ") + to_string(avb + 1) + string("!")); }
439 }
440 if (dynamic_pointer_cast<BlockDifferentialOperator>(dual_evaluator))
441 single_dual_evaluator = dynamic_pointer_cast<BlockDifferentialOperator>(dual_evaluator)->BaseDiffOp();
442 auto dual = make_shared<ProxyFunction>(fes, true, false, single_dual_evaluator,
443 nullptr, nullptr, nullptr, nullptr, nullptr);
444 /** Set up integrators - may need integrators for multiple node-types **/
445 Array<shared_ptr<BilinearFormIntegrator>> bli;
446 Array<shared_ptr<BilinearFormIntegrator>> single_bli;
447 for (auto element_vb : fes->GetDualShapeNodes(vb)) {

Callers 1

Calls 15

ToStringFunction · 0.85
IsRegularDofFunction · 0.85
IMClass · 0.85
FindCacheCFFunction · 0.85
PrecomputeCacheCFFunction · 0.85
LapackInverseFunction · 0.85
GetFESpaceMethod · 0.80
GetMeshAccessMethod · 0.80
FacetTypeMethod · 0.80
TransformVecMethod · 0.80
DimFluxMethod · 0.80
ApplyBTransMethod · 0.80

Tested by

no test coverage detected