Skip to content
Snippets Groups Projects
Commit 1ef643a9 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Move python initialisation to a separate function

parent 97303e05
No related branches found
No related tags found
No related merge requests found
......@@ -176,20 +176,23 @@ initStateUpdater(Config::state_model model,
}
}
template <class FunctionMap> void initPython(FunctionMap &functions) {
Python::start();
Python::run("import sys");
Python::run("sys.path.append('" srcdir "')");
Python::import("one-body-sample")
.get("Functions")
.toC<typename FunctionMap::Base>(functions);
}
int main(int argc, char *argv[]) {
try {
typedef SharedPointerMap<std::string, Dune::VirtualFunction<double, double>>
FunctionMap;
FunctionMap functions;
{
Python::start();
Python::run("import sys");
Python::run("sys.path.append('" srcdir "')");
Python::import("one-body-sample").get("Functions").toC<FunctionMap::Base>(
functions);
}
initPython(functions);
Dune::ParameterTree parset;
Dune::ParameterTreeParser::readINITree(srcdir "/one-body-sample.parset",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment