Skip to content
Snippets Groups Projects
Commit 067b0969 authored by René Fritze's avatar René Fritze Committed by René Milk
Browse files

[py] bind default_config for provider fac

parent f189852e
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ status = 1a3bcab04b011a5d6e44f9983cae6ff89fa695e8 bin (heads/master)
26cc8cb4161a3a51002ab2a81b8c81d2c951ee79 dune-testtools (heads/dune_xt)
+e5097dbc6210df6a5e934a17af2043c75477ec31 dune-xt-common (heads/py_mpi)
17b4d7e9e16feada2b5409f7af5ac2d304b27df0 dune-xt-functions (heads/master)
+9a94ef959b385ad39b3cfbe6df91c2da25a26d04 dune-xt-grid (heads/mpi_factory)
+5d4057a6e72803ce42401723f20c5eb1ea725268 dune-xt-grid (heads/mpi_factory)
4bad9ce8823aacf0b9de3295ad17039a02833844 dune-xt-la (heads/master)
+96b95d4b844d2b65b13352a9c65db1b77588a8a3 pylrbms (heads/master)
37f7861dd9b8fd00cc28fc6c80d2b005567e8a0d pymor (0.1.0-3239-g37f7861d)
......@@ -100,7 +100,7 @@ commit = 17b4d7e9e16feada2b5409f7af5ac2d304b27df0
[submodule.dune-xt-grid]
remote = https://github.com/dune-community/dune-xt-grid.git
status = 2424627f0ad5de7e4aaa5e7f48bc2a02414d95a1 .vcsetup (heads/master)
commit = 9a94ef959b385ad39b3cfbe6df91c2da25a26d04
commit = 5d4057a6e72803ce42401723f20c5eb1ea725268
[submodule.dune-xt-la]
remote = https://github.com/dune-community/dune-xt-la.git
......
......@@ -34,4 +34,5 @@ def make_walker(gridprovider, level = 0):
return factory(gridprovider, level)
except:
continue
raise TypeError('no matching walker for gridview {}'.format(gridprovider.__class__))
\ No newline at end of file
raise TypeError('no matching walker for gridview {}'.format(gridprovider.__class__))
......@@ -32,11 +32,18 @@ namespace Grid {
template <class G>
pybind11::class_<GridProvider<G, Grid::none_t>> bind_GridProvider(pybind11::module& m, const std::string& grid_id)
void bind_GridProvider(pybind11::module& m, const std::string& grid_id)
{
namespace py = pybind11;
using namespace pybind11::literals;
typedef GridProviderFactory<G> F;
const std::string fac_id = std::string("GridProviderFactory__" + grid_id);
py::class_<F> fac(m, fac_id.c_str(), fac_id.c_str());
fac.def_static("available", &F::available);
fac.def_static("default_config", &F::default_config);
typedef GridProvider<G, Grid::none_t> C;
py::class_<C> c(m, std::string("GridProvider__" + grid_id).c_str(), std::string("GridProvider__" + grid_id).c_str());
......@@ -61,14 +68,11 @@ pybind11::class_<GridProvider<G, Grid::none_t>> bind_GridProvider(pybind11::modu
});
c.def_property_readonly("grid_type", [grid_id](const C& /*self*/) { return grid_id; });
c.def_property_readonly("dim", [](const C& /*self*/) { return C::dimDomain; });
return c;
} // ... bind_GridProvider(...)
template <class G>
pybind11::class_<GridProvider<G, DD::SubdomainGrid<G>>> bind_DdSubdomainsGridProvider(pybind11::module& m,
const std::string& grid_id)
void bind_DdSubdomainsGridProvider(pybind11::module& m, const std::string& grid_id)
{
namespace py = pybind11;
using namespace pybind11::literals;
......@@ -128,8 +132,6 @@ pybind11::class_<GridProvider<G, DD::SubdomainGrid<G>>> bind_DdSubdomainsGridPro
return result;
},
"subdomain"_a);
return c;
} // ... bind_DdSubdomainsGridProvider(...)
......
from dune.xt._provider import *
def default_options_cube_grid(type_str):
factory = 'GridProviderFactory__{}'.format(type_str)
try:
fac = globals()[factory]
except KeyError:
raise TypeError('no GridProviderFactory available for Type {}'.format(type_str))
return fac.default_config('xt.grid.gridprovider.cube')
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