Skip to content

Commit

Permalink
Phi & Force: Expose to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Aug 16, 2022
1 parent 33c9558 commit db90b99
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/python/ImpactX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,24 @@ void init_ImpactX(py::module& m)
"rho",
[](ImpactX & ix, int const lev) { return &ix.m_rho.at(lev); },
py::arg("lev"),
py::return_value_policy::reference_internal
py::return_value_policy::reference_internal,
"charge density per level"
)
.def(
"phi",
[](ImpactX & ix, int const lev) { return &ix.m_phi.at(lev); },
py::arg("lev"),
py::return_value_policy::reference_internal,
"scalar potential per level"
)
.def(
"space_charge_force",
[](ImpactX & ix, int const lev, std::string const comp) {
return &ix.m_space_charge_force.at(lev).at(comp);
},
py::arg("lev"), py::arg("comp"),
py::return_value_policy::reference_internal,
"space charge force (vector: x,y,z) per level"
)
.def_readwrite("lattice",
&ImpactX::m_lattice,
Expand Down

0 comments on commit db90b99

Please sign in to comment.