-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Missing commit of this source file, ooops.
- Loading branch information
Martin D. Weinberg
committed
Dec 25, 2024
1 parent
4fb9894
commit 4ec255e
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <DiskDensityFunc.H> | ||
|
||
namespace py = pybind11; // Convenience | ||
|
||
|
||
DiskDensityFunc::DiskDensityFunc(const std::string& modulename) | ||
{ | ||
py::initialize_interpreter(); | ||
|
||
disk_density = | ||
py::reinterpret_borrow<py::function> | ||
( py::module::import(modulename.c_str()).attr("disk_density") ); | ||
} | ||
|
||
DiskDensityFunc::~DiskDensityFunc() | ||
{ | ||
py::finalize_interpreter(); | ||
} | ||
|
||
double DiskDensityFunc::operator() (double R, double z, double phi) | ||
{ | ||
return disk_density(R, z, phi).cast<double>(); | ||
} |