Skip to content

Commit 0559cc9

Browse files
bakpaulfredroy
andauthored
Apply changes from SOFA PR #6117 (#615)
* Apply changes from SOFA PR #6117 * Fix tests * Fix requiredPlugins * remomve s from IntegrationSchemes * fix timer scene * Fix new scenes * Fix newly introduced scenes * Fix name for hasIntegrationScheme * Fix typo --------- Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
1 parent c65c8d1 commit 0559cc9

38 files changed

Lines changed: 92 additions & 108 deletions

‎bindings/Modules/tests/SofaConstraintSolver/matrix_access.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ def simulate_pendulum(self):
1717
"Sofa.Component.Mapping.NonLinear",
1818
"Sofa.Component.Mapping.MappedMatrix",
1919
"Sofa.Component.Mass",
20-
"Sofa.Component.ODESolver.Backward",
20+
"Sofa.Component.IntegrationScheme.Backward",
2121
"Sofa.Component.Topology.Container.Dynamic"])
2222

2323
root.addObject("FreeMotionAnimationLoop", solveVelocityConstraintFirst=True)
2424
root.addObject("BlockGaussSeidelConstraintSolver", name="constraint_solver", tolerance=1e-9, maxIterations=1000)
2525
root.addObject("StringMeshCreator", name="loader", resolution="20")
2626

27-
root.addObject("EulerImplicitSolver")
27+
root.addObject("EulerImplicitIntegrationScheme")
2828
root.addObject("EigenSimplicialLLT")
2929
root.addObject("GenericConstraintCorrection")
3030

‎bindings/Modules/tests/SofaLinearSolver/matrix_access.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ def simulate_beam(self, linear_solver_template):
99

1010
loop = root.addObject('DefaultAnimationLoop')
1111

12-
root.addObject('RequiredPlugin', pluginName='Sofa.Component.ODESolver.Backward')
12+
root.addObject('RequiredPlugin', pluginName='Sofa.Component.IntegrationScheme.Backward')
1313
root.addObject('RequiredPlugin', pluginName='Sofa.Component.LinearSolver.Direct')
1414
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Engine.Select')
1515
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Constraint.Projective')
1616
root.addObject('RequiredPlugin', pluginName='Sofa.Component.SolidMechanics.FEM.Elastic')
1717
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Mass')
1818

19-
root.addObject('EulerImplicitSolver', rayleighStiffness="0.1", rayleighMass="0.1")
19+
root.addObject('EulerImplicitIntegrationScheme', rayleighStiffness="0.1", rayleighMass="0.1")
2020
linear_solver = root.addObject('SparseLDLSolver', name='linear_solver', template=linear_solver_template)
2121

2222
root.addObject('MechanicalObject', name="DoFs")

‎bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseComponent.cpp‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,6 @@
3434
#include <sofa/core/CollisionModel.h>
3535
#include <sofa/core/behavior/BaseMechanicalState.h>
3636
#include <sofa/core/behavior/BaseForceField.h>
37-
#include <sofa/core/behavior/BaseInteractionForceField.h>
38-
#include <sofa/core/behavior/BaseProjectiveConstraintSet.h>
39-
#include <sofa/core/behavior/BaseConstraintSet.h>
40-
#include <sofa/core/DataEngine.h>
41-
#include <sofa/core/topology/TopologicalMapping.h>
42-
#include <sofa/core/behavior/BaseMass.h>
43-
#include <sofa/core/behavior/OdeSolver.h>
44-
#include <sofa/core/behavior/ConstraintSolver.h>
45-
#include <sofa/core/behavior/BaseConstraintCorrection.h>
46-
#include <sofa/core/behavior/LinearSolver.h>
47-
#include <sofa/core/behavior/BaseAnimationLoop.h>
48-
#include <sofa/core/topology/BaseTopology.h>
49-
#include <sofa/core/loader/BaseLoader.h>
50-
#include <sofa/core/collision/CollisionAlgorithm.h>
51-
#include <sofa/core/collision/Pipeline.h>
52-
#include <sofa/core/collision/Intersection.h>
53-
#include <sofa/core/objectmodel/ConfigurationSetting.h>
5437
#include <sofa/core/ExecParams.h>
5538
#include <sofa/core/CategoryLibrary.h>
5639
#include <pybind11/stl.h>

‎bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ py::object getMechanicalState(Node *self)
629629
}
630630

631631

632-
py::object hasODESolver(Node *self)
632+
py::object hasIntegrationScheme(Node *self)
633633
{
634-
const bool hasODE = self->solver.size() > 0;
634+
const bool hasODE = self->integrationScheme.size() > 0;
635635
return py::cast(hasODE);
636636
}
637637

@@ -719,7 +719,7 @@ void moduleAddNode(py::module &m) {
719719
p.def("getAsACreateObjectParameter", &getLinkPath, sofapython3::doc::sofa::core::Node::getAsACreateObjectParameter);
720720
p.def("detachFromGraph", &Node::detachFromGraph, sofapython3::doc::sofa::core::Node::detachFromGraph);
721721
p.def("getMass", &getMass, sofapython3::doc::sofa::core::Node::getMass);
722-
p.def("hasODESolver", &hasODESolver, sofapython3::doc::sofa::core::Node::hasODESolver);
722+
p.def("hasIntegrationScheme", &hasIntegrationScheme, sofapython3::doc::sofa::core::Node::hasIntegrationScheme);
723723
p.def("getForceField", &getForceField, sofapython3::doc::sofa::core::Node::getForceField);
724724
p.def("getMechanicalState", &getMechanicalState, sofapython3::doc::sofa::core::Node::getMechanicalState);
725725
p.def("getMechanicalMapping", &getMechanicalMapping, sofapython3::doc::sofa::core::Node::getMechanicalMapping);

‎bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node_doc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ static auto getMechanicalState =
378378
Get the mechanical state of the node.
379379
)";
380380

381-
static auto hasODESolver =
381+
static auto hasIntegrationScheme =
382382
R"(
383-
Return true if the node includes an ODE Solver
383+
Return true if the node includes an integration scheme
384384
)";
385385

386386
static auto getMechanicalMapping =

‎bindings/Sofa/tests/Core/ForceField.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
def createIntegrationScheme(node, use_implicit_scheme):
1414
if use_implicit_scheme is True:
15-
node.addObject('EulerImplicitSolver', name='odeImplicitSolver',
15+
node.addObject('EulerImplicitIntegrationScheme', name='odeImplicitSolver',
1616
rayleighStiffness='0.1', rayleighMass='0.1')
1717
else:
18-
node.addObject('EulerExplicitSolver', name='odeExplicitSolver')
18+
node.addObject('EulerExplicitIntegrationScheme', name='odeExplicitSolver')
1919

2020

2121
def createSolver(node, use_iterative_solver):
@@ -44,7 +44,7 @@ def rssffScene(use_implicit_scheme=True, use_iterative_solver=True):
4444
node.addObject('DefaultAnimationLoop')
4545
node.addObject("RequiredPlugin", pluginName="Sofa.Component.StateContainer")
4646
node.addObject("RequiredPlugin", pluginName="Sofa.Component.LinearSolver")
47-
node.addObject("RequiredPlugin", pluginName="Sofa.Component.ODESolver")
47+
node.addObject("RequiredPlugin", pluginName="Sofa.Component.IntegrationScheme")
4848
node.addObject("RequiredPlugin", pluginName="Sofa.Component.Mass")
4949

5050
node.gravity = [0, -10, 0]
@@ -112,12 +112,12 @@ def simulate_beam(linear_solver_template):
112112
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Engine.Select')
113113
root.addObject('RequiredPlugin', pluginName='Sofa.Component.LinearSolver.Direct')
114114
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Mass')
115-
root.addObject('RequiredPlugin', pluginName='Sofa.Component.ODESolver.Backward')
115+
root.addObject('RequiredPlugin', pluginName='Sofa.Component.IntegrationScheme.Backward')
116116
root.addObject('RequiredPlugin', pluginName='Sofa.Component.SolidMechanics.FEM.Elastic')
117117
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')
118118
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Topology.Container.Grid')
119119

120-
root.addObject('EulerImplicitSolver', rayleighStiffness="0.1", rayleighMass="0.1")
120+
root.addObject('EulerImplicitIntegrationScheme', rayleighStiffness="0.1", rayleighMass="0.1")
121121
root.addObject('SparseLDLSolver', template=linear_solver_template)
122122

123123
root.addObject('MechanicalObject', name="DoFs")

‎bindings/Sofa/tests/Core/Mass.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ def simulate_beam(linear_solver_template):
1616
root.addObject('DefaultAnimationLoop')
1717

1818
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')
19-
root.addObject('RequiredPlugin', pluginName='Sofa.Component.ODESolver.Backward')
19+
root.addObject('RequiredPlugin', pluginName='Sofa.Component.IntegrationScheme.Backward')
2020
root.addObject('RequiredPlugin', pluginName='Sofa.Component.LinearSolver.Direct')
2121
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Engine.Select')
2222
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Constraint.Projective')
2323
root.addObject('RequiredPlugin', pluginName='Sofa.Component.SolidMechanics.FEM.Elastic')
2424
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Mass')
2525
root.addObject('RequiredPlugin', pluginName='Sofa.Component.Topology.Container.Grid')
2626

27-
root.addObject('EulerImplicitSolver', rayleighStiffness="0.1", rayleighMass="0.1")
27+
root.addObject('EulerImplicitIntegrationScheme', rayleighStiffness="0.1", rayleighMass="0.1")
2828
root.addObject('SparseLDLSolver', template=linear_solver_template)
2929

3030
root.addObject('MechanicalObject', name="DoFs")

‎docs/sphinx/source/content/FirstSteps.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,14 @@ We add properties to the sphere. First, we add a mass, then an object called 'Un
242242

243243
.. code-block:: python
244244
245-
SofaRuntime.importPlugin("Sofa.Component.ODESolver.Backward")
245+
SofaRuntime.importPlugin("Sofa.Component.IntegrationScheme.Backward")
246246
SofaRuntime.importPlugin("Sofa.Component.LinearSolver.Iterative")
247247
SofaRuntime.importPlugin("Sofa.Component.Mass")
248248
SofaRuntime.importPlugin("Sofa.Component.Constraint.Lagrangian.Correction")
249249
250250
# Creating the falling sphere object
251251
sphere = rootNode.addChild("sphere")
252-
sphere.addObject('EulerImplicitSolver', name='odesolver')
252+
sphere.addObject('EulerImplicitIntegrationScheme', name='odesolver')
253253
sphere.addObject('CGLinearSolver', name='Solver', iterations=25, tolerance=1e-05, threshold=1e-05)
254254
sphere.addObject('MechanicalObject', name="mstate", template="Rigid3", translation2=[0., 0., 0.], rotation2=[0., 0., 0.], showObjectScale=50)
255255
sphere.addObject('UniformMass', name="mass", vertexMass=[totalMass, volume, inertiaMatrix[:]])
@@ -425,7 +425,7 @@ Here is the entire code of the scene :
425425
confignode.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative", printLog=False)
426426
confignode.addObject('RequiredPlugin', name="Sofa.Component.Mapping.NonLinear", printLog=False)
427427
confignode.addObject('RequiredPlugin', name="Sofa.Component.Mass", printLog=False)
428-
confignode.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward", printLog=False)
428+
confignode.addObject('RequiredPlugin', name="Sofa.Component.IntegrationScheme.Backward", printLog=False)
429429
confignode.addObject('RequiredPlugin', name="Sofa.Component.StateContainer", printLog=False)
430430
confignode.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant", printLog=False)
431431
confignode.addObject('RequiredPlugin', name="Sofa.Component.Visual", printLog=False)
@@ -450,7 +450,7 @@ Here is the entire code of the scene :
450450
451451
452452
sphere = rootNode.addChild("sphere")
453-
sphere.addObject('EulerImplicitSolver', name='odesolver')
453+
sphere.addObject('EulerImplicitIntegrationScheme', name='odesolver')
454454
sphere.addObject('CGLinearSolver', name='Solver', iterations=25, tolerance=1e-05, threshold=1e-05)
455455
sphere.addObject('MechanicalObject', name="mstate", template="Rigid3", translation2=[0., 0., 0.], rotation2=[0., 0., 0.], showObjectScale=50)
456456
sphere.addObject('UniformMass', name="mass", vertexMass=[totalMass, volume, inertiaMatrix[:]])

‎docs/sphinx/source/content/UsingThePlugin.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ We add properties to the sphere. First, we add a mass, then an object called 'Un
301301
302302
# Creating the falling sphere object
303303
sphere = rootNode.addChild("sphere")
304-
sphere.addObject('EulerImplicitSolver', name='odesolver')
304+
sphere.addObject('EulerImplicitIntegrationScheme', name='odesolver')
305305
sphere.addObject('CGLinearSolver', name='Solver', iterations=25, tolerance=1e-05, threshold=1e-05)
306306
sphere.addObject('MechanicalObject', name="mstate", template="Rigid3", translation2=[0., 0., 0.], rotation2=[0., 0., 0.], showObjectScale=50)
307307
sphere.addObject('UniformMass', name="mass", vertexMass=[totalMass, volume, inertiaMatrix[:]])
@@ -462,7 +462,7 @@ Here is the entire code of the scene :
462462
confignode.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative", printLog=False)
463463
confignode.addObject('RequiredPlugin', name="Sofa.Component.Mapping.NonLinear", printLog=False)
464464
confignode.addObject('RequiredPlugin', name="Sofa.Component.Mass", printLog=False)
465-
confignode.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward", printLog=False)
465+
confignode.addObject('RequiredPlugin', name="Sofa.Component.IntegrationScheme.Backward", printLog=False)
466466
confignode.addObject('RequiredPlugin', name="Sofa.Component.StateContainer", printLog=False)
467467
confignode.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant", printLog=False)
468468
confignode.addObject('RequiredPlugin', name="Sofa.Component.Visual", printLog=False)
@@ -486,7 +486,7 @@ Here is the entire code of the scene :
486486
487487
488488
sphere = rootNode.addChild("sphere")
489-
sphere.addObject('EulerImplicitSolver', name='odesolver')
489+
sphere.addObject('EulerImplicitIntegrationScheme', name='odesolver')
490490
sphere.addObject('CGLinearSolver', name='Solver', iterations=25, tolerance=1e-05, threshold=1e-05)
491491
sphere.addObject('MechanicalObject', name="mstate", template="Rigid3", translation2=[0., 0., 0.], rotation2=[0., 0., 0.], showObjectScale=50)
492492
sphere.addObject('UniformMass', name="mass", vertexMass=[totalMass, volume, inertiaMatrix[:]])

‎examples/CCDIntersection.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def createScene(root_node):
2525
"Sofa.Component.Collision.Geometry", "Sofa.Component.Collision.Response.Contact",
2626
"Sofa.Component.Constraint.Lagrangian.Correction", "Sofa.Component.Constraint.Lagrangian.Solver",
2727
"Sofa.Component.IO.Mesh", "Sofa.Component.LinearSolver.Direct", "Sofa.Component.Mapping.Linear",
28-
"Sofa.Component.Mass", "Sofa.Component.ODESolver.Backward", "Sofa.Component.SolidMechanics.FEM.Elastic",
28+
"Sofa.Component.Mass", "Sofa.Component.IntegrationScheme.Backward", "Sofa.Component.SolidMechanics.FEM.Elastic",
2929
"Sofa.Component.StateContainer", "Sofa.Component.Topology.Container.Dynamic",
3030
"Sofa.Component.Topology.Container.Grid", "Sofa.Component.Topology.Mapping", "Sofa.Component.Visual",
3131
"Sofa.GL.Component.Rendering3D", "Sofa.Component.Engine.Select", "Sofa.GUI.Component"])
@@ -45,7 +45,7 @@ def createScene(root_node):
4545
#Liver mecha
4646
Liver = root_node.addChild('Liver')
4747

48-
Liver.addObject('EulerImplicitSolver')
48+
Liver.addObject('EulerImplicitIntegrationScheme')
4949
Liver.addObject('SparseLDLSolver', name="ldl", template="CompressedRowSparseMatrixMat3x3", parallelInverseProduct=True)
5050
Liver.addObject('MeshGmshLoader', name="meshLoader", filename="mesh/liver.msh", scale3d=[0.2, 0.2, 0.2], rotation=[0, 180, -45], translation=[15.2, -0.15, 0.14])
5151
Liver.addObject('TetrahedronSetTopologyContainer', name="Container", src='@meshLoader')
@@ -89,7 +89,7 @@ def createScene(root_node):
8989
#Plate mecha
9090
PlateMecha = root_node.addChild('PlateMecha')
9191

92-
PlateMecha.addObject('EulerImplicitSolver')
92+
PlateMecha.addObject('EulerImplicitIntegrationScheme')
9393
PlateMecha.addObject('SparseLDLSolver', name="ldl", template="CompressedRowSparseMatrixMat3x3", parallelInverseProduct=True)
9494
PlateMecha.addObject('TetrahedronSetTopologyContainer', name="Container", position="@../BeamDomainFromGridTopology/HexaTop.position", tetrahedra="@../BeamDomainFromGridTopology/TetraTopology/Container.tetrahedra")
9595
PlateMecha.addObject('TetrahedronSetTopologyModifier', name="Modifier")

0 commit comments

Comments
 (0)