@@ -76,38 +76,17 @@ void registerDirichletValues(pybind11::handle scope, pybind11::class_<DirichletV
76
76
cls.def_property_readonly (" fixedDOFsize" , &DirichletValues::fixedDOFsize);
77
77
cls.def (" isConstrained" , [](DirichletValues& self, std::size_t i) -> bool { return self.isConstrained (i); });
78
78
79
- cls.def (" fixIthDOF" , [](DirichletValues& self, const MultiIndex& i) { self.fixIthDOF (i); });
80
-
81
- auto fixBoundaryDOFs_ = [](DirichletValues& self,
82
- const std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int )>& f) {
83
- auto lambda = [&](BackendType& vec, const MultiIndex& indexGlobal) {
84
- // we explicitly only allow flat indices
85
- f (vec.vector (), indexGlobal[0 ]);
86
- };
87
- self.fixBoundaryDOFs (lambda);
88
- };
89
-
90
- auto fixBoundaryDOFsUsingLocalView_ =
91
- [](DirichletValues& self,
92
- const std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&)>& f) {
93
-
94
- };
79
+ cls.def (" fixIthDOF" , [](DirichletValues& self, std::size_t i) { self.fixIthDOF (MultiIndex (std::array{i})); });
95
80
96
- auto fixBoundaryDOFsUsingLocalViewAndIntersection_ =
97
- [](DirichletValues& self,
98
- const std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&, const Intersection&)>& f) {
99
-
100
- } ;
81
+ using FixBoundaryDOFsWithGlobalIndexFunction = std::function< void (Eigen::Ref<Eigen::VectorX< bool >>, int )>;
82
+ using FixBoundaryDOFsWithLocalViewFunction =
83
+ std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&)>;
84
+ using FixBoundaryDOFsWithIntersectionFunction =
85
+ std::function< void (Eigen::Ref<Eigen::VectorX< bool >>, int , LocalViewWrapper&, const Intersection&)> ;
101
86
102
87
cls.def (
103
88
" fixBoundaryDOFs" ,
104
89
[&](DirichletValues& self, const pybind11::function& functor) {
105
- using FixBoundaryDOFsWithGlobalIndexFunction = std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int )>;
106
- using FixBoundaryDOFsWithLocalViewFunction =
107
- std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&)>;
108
- using FixBoundaryDOFsWithIntersectionFunction =
109
- std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&, const Intersection&)>;
110
-
111
90
// Disambiguate by number of arguments, as casting doesn't properly work with functions
112
91
pybind11::module inspect_module = pybind11::module::import (" inspect" );
113
92
pybind11::object result = inspect_module.attr (" signature" )(functor).attr (" parameters" );
@@ -145,12 +124,6 @@ void registerDirichletValues(pybind11::handle scope, pybind11::class_<DirichletV
145
124
146
125
auto fixBoundaryDOFsOfSubSpaceBasis_ = [&]<typename SSB>(DirichletValues& self, const pybind11::function& functor,
147
126
const SSB& ssb) {
148
- using FixBoundaryDOFsWithGlobalIndexFunction = std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int )>;
149
- using FixBoundaryDOFsWithLocalViewFunction =
150
- std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&)>;
151
- using FixBoundaryDOFsWithIntersectionFunction =
152
- std::function<void (Eigen::Ref<Eigen::VectorX<bool >>, int , LocalViewWrapper&, const Intersection&)>;
153
-
154
127
// Disambiguate by number of arguments, as casting doesn't properly work with functions
155
128
pybind11::module inspect_module = pybind11::module::import (" inspect" );
156
129
pybind11::object result = inspect_module.attr (" signature" )(functor).attr (" parameters" );
0 commit comments