11#include <dune/python/common/typeregistry.hh>
12#include <dune/python/pybind11/eigen.h>
13#include <dune/python/pybind11/pybind11.h>
14#include <dune/python/pybind11/stl.h>
15#include <dune/python/pybind11/stl_bind.h>
22#define MAKE_ASSEMBLER_REGISTERY_FUNCTION(name) \
44 template <class Assembler, class... options> \
45 void register##name(pybind11::handle scope, pybind11::class_<Assembler, options...> cls) { \
46 using pybind11::operator""_a; \
47 using FEContainer = typename Assembler::FEContainer; \
48 using Basis = typename Assembler::Basis; \
49 using DirichletValuesType = typename Assembler::DirichletValuesType; \
50 using FERequirementType = typename Assembler::FERequirementType; \
51 pybind11::module m = pybind11::module::import("ikarus"); \
52 cls.def(pybind11::init([](const pybind11::list& fes, const DirichletValuesType& dirichletValues) { \
56 FEContainer fesV = fes.template cast<FEContainer>(); \
57 return new Assembler(std::move(fesV), dirichletValues); \
59 pybind11::keep_alive<1, 3>()); \
66 [](Assembler& self, const FERequirementType& req) -> std::remove_cvref_t<decltype(self.getMatrix(req))> { \
67 return self.getMatrix(req); \
69 pybind11::return_value_policy::copy); \
72 [](Assembler& self, const FERequirementType& req) \
73 -> std::remove_cvref_t<decltype(self.getReducedMatrix(req))> { return self.getReducedMatrix(req); }, \
74 pybind11::return_value_policy::copy); \
76 "getVector", [](Assembler& self, const FERequirementType& req) { return self.getVector(req); }, \
77 pybind11::return_value_policy::reference); \
79 "getScalar", [](Assembler& self, const FERequirementType& req) { return self.getScalar(req); }, \
80 pybind11::return_value_policy::copy); \
82 "getReducedVector", [](Assembler& self, const FERequirementType& req) { return self.getReducedVector(req); }, \
83 pybind11::return_value_policy::reference); \
86 [](Assembler& self, Eigen::Ref<const Eigen::VectorXd> redVec) { return self.createFullVector(redVec); }, \
87 pybind11::return_value_policy::move); \
89 "reducedSize", [](Assembler& self) { return self.reducedSize(); }, pybind11::return_value_policy::copy); \
Definition of the LinearElastic class for finite element mechanics computations.
#define MAKE_ASSEMBLER_REGISTERY_FUNCTION(name)
Definition: flatassembler.hh:22
Definition: flatassembler.hh:20
SparseFlatAssembler assembles matrix quantities using a flat basis Indexing strategy....
Definition: simpleassemblers.hh:271
DenseFlatAssembler assembles matrix quantities using a flat basis Indexing strategy....
Definition: simpleassemblers.hh:379
Wrapper around Dune-functions global basis.