Skip to content
Snippets Groups Projects
Commit bae4b7b9 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[python|grid.boundaryinfo] add some bindings

parent dab8f1fb
No related branches found
No related tags found
2 merge requests!20Update bindings,!11WIP: Update bindings
...@@ -45,22 +45,30 @@ public: ...@@ -45,22 +45,30 @@ public:
const auto gridname = XT::Grid::bindings::grid_name<typename GP::GridType>::value(); const auto gridname = XT::Grid::bindings::grid_name<typename GP::GridType>::value();
try { // guard since we might not be the first to do so for this grid/intersection try { // guard since we might not be the first to do so for this grid/intersection
std::string postfix{layer_names[layer] + "_layer_" + gridname}; m.def("available_boundary_infos",
m.def((std::string("available_boundary_infos_on_") + postfix).c_str(),
[](const GP& /*grid_provider*/) { return XT::Grid::BoundaryInfoFactory<I>::available(); }, [](const GP& /*grid_provider*/) { return XT::Grid::BoundaryInfoFactory<I>::available(); },
"grid_provider"_a); "grid_provider"_a);
m.def((std::string("default_boundary_info_config_on_") + postfix).c_str(), m.def("default_boundary_info_config_on_",
[](const GP& /*grid_provider*/, const std::string& type) { [](const GP& /*grid_provider*/, const std::string& type) {
return XT::Grid::BoundaryInfoFactory<I>::default_config(type); return XT::Grid::BoundaryInfoFactory<I>::default_config(type);
}, },
"grid_provider"_a, "grid_provider"_a,
"type"_a); "type"_a);
m.def((std::string("make_boundary_info_on_") + postfix).c_str(), m.def("make_boundary_info_on_",
[](const GP& /*grid_provider*/, const Common::Configuration& cfg) { [](const GP& /*grid_provider*/, const Common::Configuration& cfg) {
return XT::Grid::BoundaryInfoFactory<I>::create(cfg).release(); return XT::Grid::BoundaryInfoFactory<I>::create(cfg).release();
}, },
"grid_provider"_a, "grid_provider"_a,
"cfg"_a); "cfg"_a);
std::string postfix{layer_names[layer] + "_layer_" + gridname};
m.def((std::string("available_boundary_infos_on_") + postfix).c_str(),
[]() { return XT::Grid::BoundaryInfoFactory<I>::available(); });
m.def((std::string("default_boundary_info_config_on_") + postfix).c_str(),
[](const std::string& type) { return XT::Grid::BoundaryInfoFactory<I>::default_config(type); },
"type"_a);
m.def((std::string("make_boundary_info_on_") + postfix).c_str(),
[](const Common::Configuration& cfg) { return XT::Grid::BoundaryInfoFactory<I>::create(cfg).release(); },
"cfg"_a);
} catch (std::runtime_error&) { } catch (std::runtime_error&) {
} }
} // ... bind(...) } // ... bind(...)
......
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