Skip to content

Commit 13c98bd

Browse files
committed
Add support of the debug version of the integrate functions in the python bindings. Fix clang warnings
1 parent f882dfd commit 13c98bd

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

bindings/python/src/Integrate.cxx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ static int integrateBehaviourData1(mgis::behaviour::BehaviourData& d,
2929
return s;
3030
} // end of integrateBehaviourData
3131

32+
static int integrateDebugBehaviourData1(mgis::behaviour::BehaviourData& d,
33+
const mgis::behaviour::Behaviour& b) {
34+
auto v = mgis::behaviour::make_view(d);
35+
const auto s = mgis::behaviour::integrate_debug(v, b);
36+
return s;
37+
} // end of integrateDebugBehaviourData
38+
3239
static int BehaviourDataView_executeInitializeFunction(
3340
mgis::behaviour::BehaviourDataView& v,
3441
const mgis::behaviour::Behaviour& b,
@@ -239,13 +246,32 @@ void declareIntegrate(pybind11::module_& m) {
239246
MultiThreadedBehaviourIntegrationResult (*integrate_ptr5)(
240247
mgis::ThreadPool&, MaterialDataManager&,
241248
const BehaviourIntegrationOptions&, const mgis::real) = integrate;
249+
int (*integrate_debug_ptr1)(BehaviourDataView&, const Behaviour&) = integrate_debug;
250+
int (*integrate_debug_ptr2)(MaterialDataManager&, const IntegrationType,
251+
const mgis::real, const mgis::size_type,
252+
const mgis::size_type) = integrate_debug;
253+
int (*integrate_debug_ptr3)(mgis::ThreadPool&, MaterialDataManager&,
254+
const IntegrationType, const mgis::real) = integrate_debug;
255+
BehaviourIntegrationResult (*integrate_debug_ptr4)(
256+
MaterialDataManager&, const BehaviourIntegrationOptions&,
257+
const mgis::real, const mgis::size_type, const mgis::size_type) =
258+
integrate_debug;
259+
MultiThreadedBehaviourIntegrationResult (*integrate_debug_ptr5)(
260+
mgis::ThreadPool&, MaterialDataManager&,
261+
const BehaviourIntegrationOptions&, const mgis::real) = integrate_debug;
242262

243263
m.def("integrate", &integrateBehaviourData1);
244264
m.def("integrate", integrate_ptr1);
245265
m.def("integrate", integrate_ptr2);
246266
m.def("integrate", integrate_ptr3);
247267
m.def("integrate", integrate_ptr4);
248268
m.def("integrate", integrate_ptr5);
269+
m.def("integrate_debug", &integrateDebugBehaviourData1);
270+
m.def("integrate_debug", integrate_debug_ptr1);
271+
m.def("integrate_debug", integrate_debug_ptr2);
272+
m.def("integrate_debug", integrate_debug_ptr3);
273+
m.def("integrate_debug", integrate_debug_ptr4);
274+
m.def("integrate_debug", integrate_debug_ptr5);
249275
m.def("executePostProcessing", BehaviourDataView_executePostProcessing);
250276
m.def("executePostProcessing", MaterialDataManager_executePostProcessing);
251277
m.def("executePostProcessing", MaterialDataManager_executePostProcessing2);

bindings/python/src/NumPySupport.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace mgis::python {
4141
return pybind11::array_t<double>(
4242
{v.size() / nc, nc}, /* Buffer dimensions */
4343
{nc * sizeof(double), sizeof(double)}, v.data(), pybind11::none());
44-
};
44+
} // end of wrapInNumPyArray
4545

4646
pybind11::array_t<double> wrapInNumPyArray(std::vector<double>& v,
4747
const size_type nc) {

bindings/python/src/State.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ void declareState(pybind11::module_& m) {
8787
m.def("setExternalStateVariable", State_setExternalStateVariable2,
8888
"set the value of an external state variable by offset");
8989

90-
} // end of declareState
90+
} // end of declareState

bindings/python/src/ThreadPool.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <pybind11/pybind11.h>
1616
#include "MGIS/ThreadPool.hxx"
1717

18+
void declareThreadPool(pybind11::module_&);
19+
1820
void declareThreadPool(pybind11::module_& m) {
1921
pybind11::class_<mgis::ThreadPool>(m, "ThreadPool")
2022
.def(pybind11::init<mgis::size_type>());

0 commit comments

Comments
 (0)