Skip to content

Packages

Vedant Dhruv edited this page Dec 8, 2022 · 61 revisions

A brief intro to packages in KHARMA is provided here; if you're interested in the details, we expound on KHARMA's packages on this page.

Packages are Parthenon's way of introducing modularity in the code in the way of physics and features. Each package has its own namespace within which we define its local variables, global variables (via the params object, an instance of parthenon::Params), its functions, and its tasks.

Unless marked private, packages can access variables declared in other packages. The ability to share variables eliminates the need to save multiple copies of the same variable. Probably the best example of this is the fluid adiabatic index gamma declared in the GRMHD package, which can be pulled like,

auto gam = pmb->packages.Get("GRMHD")->Param<Real>("gamma");

Clone this wiki locally