MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / setDiffusionCoefficientFunction

Method setDiffusionCoefficientFunction

src/adv_diff/AdvDiffHierarchyIntegrator.cpp:494–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492} // registerDiffusionCoefficientVariable
493
494void
495AdvDiffHierarchyIntegrator::setDiffusionCoefficientFunction(Pointer<SideVariable<NDIM, double>> D_var,
496 Pointer<IBTK::CartGridFunction> D_fcn)
497{
498#if !defined(NDEBUG)
499 TBOX_ASSERT(std::find(d_diffusion_coef_var.begin(), d_diffusion_coef_var.end(), D_var) !=
500 d_diffusion_coef_var.end());
501#endif
502 if (d_diffusion_coef_fcn[D_var])
503 {
504 const std::string& D_var_name = D_var->getName();
505 Pointer<CartGridFunctionSet> p_D_fcn = d_diffusion_coef_fcn[D_var];
506 if (!p_D_fcn)
507 {
508 pout << d_object_name << "::setDiffusionCoefficientFunction(): WARNING:\n"
509 << " diffusion coefficient function for diffusion coefficient "
510 "variable "
511 << D_var_name << " has already been set.\n"
512 << " functions will be evaluated in the order in which they were "
513 "registered "
514 "with "
515 "the solver\n"
516 << " when evaluating the source term value.\n";
517 p_D_fcn = new CartGridFunctionSet(d_object_name + "::" + D_var_name + "::diffusion_coef_function_set");
518 p_D_fcn->addFunction(d_diffusion_coef_fcn[D_var]);
519 }
520 p_D_fcn->addFunction(D_fcn);
521 }
522 else
523 {
524 d_diffusion_coef_fcn[D_var] = D_fcn;
525 }
526 return;
527} // setDiffusionCoefficientFunction
528
529Pointer<IBTK::CartGridFunction>
530AdvDiffHierarchyIntegrator::getDiffusionCoefficientFunction(Pointer<SideVariable<NDIM, double>> D_var) const

Callers

nothing calls this directly

Calls 3

addFunctionMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected