Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODE solver in python #148

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

jnbrunet
Copy link
Contributor

This PR brings:

  • Bindings for BaseState
  • Bindings for VecId and MultiVecId
  • Bindings for ExecParams and MechanicalParams
  • Bindings for VectorOperations and MechanicalOperations (aka vop and mop)
  • Bindings for OdeSolver

It also provide an example on how a static solver can be fully implemented in python.

@hugtalbot
Copy link
Contributor

Cool PR Jean Nico, but manipulating multivecs from python should be carefully done. But I understand this is definitely needed to create new integration schemes

@jnbrunet
Copy link
Contributor Author

Can we merge this @hugtalbot ?

It is very useful to quickly try out new ODE formulations before implementing them in c++.

# Conflicts:
#	bindings/Modules/tests/main.cpp
@guparan
Copy link
Contributor

guparan commented Oct 25, 2021

Some unit tests are still failing here 😢

[ RUN      ] SofaPython3/Sofa.all_tests/67_Sofa_Core_BaseObject_test_slave_master
======================================================================
ERROR: test_slave_master (BaseObject.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "BaseObject.py", line 50, in test_slave_master
    c_master.addSlave(c_slave)
TypeError: addSlave(): incompatible function arguments. The following argument types are supported:
    1. (self: Sofa.Core.Object, arg0: Sofa.Core.Object) -> None

Invoked with: <Sofa.Core.BaseState object at 0x7fdea30fa450>, <Sofa.Core.BaseState object at 0x7fdea30fa3b0>

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
/home/runner/work/SofaPython3/SofaPython3/SofaPython3/bin/Bindings.Sofa.Tests.d/Core/BaseObject.py:0: Failure
Failed
[  FAILED  ] SofaPython3/Sofa.all_tests/67_Sofa_Core_BaseObject_test_slave_master, where GetParam() = /home/runner/work/SofaPython3/SofaPython3/SofaPython3/bin/Bindings.Sofa.Tests.d/Core/BaseObject.py with args {test_slave_master, } (1 ms)
[ RUN      ] SofaPython3/Sofa.all_tests/100_Sofa_Simulation_Node_test_getItem
======================================================================
ERROR: test_getItem (Node.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Node.py", line 173, in test_getItem
    self.assertEqual(object1["."].name, object1.name)
RuntimeError: return_value_policy = copy, but the object is non-copyable!

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
/home/runner/work/SofaPython3/SofaPython3/SofaPython3/bin/Bindings.Sofa.Tests.d/Simulation/Node.py:0: Failure
Failed
[  FAILED  ] SofaPython3/Sofa.all_tests/100_Sofa_Simulation_Node_test_getItem, where GetParam() = /home/runner/work/SofaPython3/SofaPython3/SofaPython3/bin/Bindings.Sofa.Tests.d/Simulation/Node.py with args {test_getItem, } (1 ms)

@jnbrunet
Copy link
Contributor Author

Crap, I'll try to fix it somewhere this week

@guparan guparan removed this from the v21.12 milestone Dec 15, 2021
@sofa-framework sofa-framework deleted a comment from 0936616132 May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants