From 335d42f019bc3cb1aab42ea881d4e078cd0b3641 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Wed, 2 Dec 2026 11:28:17 +0100 Subject: [PATCH 1/2] Update scenes with StaticEquilibrium --- examples/advanced_timer.py | 6 +++--- examples/source-terms/example-quadrature-rules.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/advanced_timer.py b/examples/advanced_timer.py index 0dd21378..43f32f02 100644 --- a/examples/advanced_timer.py +++ b/examples/advanced_timer.py @@ -57,7 +57,8 @@ def createScene(root): ]) # AnimationLoop - root.addObject('DefaultAnimationLoop') + root.addObject('NewtonRaphson' , maxNbIterationsNewton=5, + maxNbIterationsLineSearch=1, alwaysAdvanceNewton=True) # Visual style root.addObject('VisualStyle', displayFlags='showBehaviorModels showForceFields') @@ -70,8 +71,7 @@ def createScene(root): # Create our mechanical node with root.addChild("meca") as meca: - meca.addObject("StaticEquilibriumIntegrationScheme", maxNbIterationsNewton=5, - maxNbIterationsLineSearch=1, alwaysAdvanceNewton=True) + meca.addObject("StaticEquilibriumIntegrationScheme") meca.addObject("CGLinearSolver", iterations=25, tolerance=1e-5, threshold=1e-5) meca.addObject('MechanicalObject', name='mo', position='@../grid.position') diff --git a/examples/source-terms/example-quadrature-rules.py b/examples/source-terms/example-quadrature-rules.py index 05259f5d..f6f8bd92 100644 --- a/examples/source-terms/example-quadrature-rules.py +++ b/examples/source-terms/example-quadrature-rules.py @@ -100,7 +100,7 @@ def createScene(root): "Sofa.GL.Component.Rendering2D", ]) - root.addObject("DefaultAnimationLoop") + root.addObject("NewtonRaphson", maxNbIterationsNewton="1", residualThreshold="1e-16") root.addObject("VisualStyle", displayFlags="showBehaviorModels showVisualModels showWireframe") with root.addChild("Labels") as labels: @@ -138,7 +138,7 @@ def createScene(root): def addQuadratureDegreeNode(name, quadrature_degree, showColor, edgeColor): # Starts at rest, loaded by the manufactured body force, integrated with the given quadrature degree. with quadratureDegrees.addChild(name) as node: - node.addObject("StaticEquilibriumIntegrationScheme", maxNbIterationsNewton="1", residualThreshold="1e-16") + node.addObject("StaticEquilibriumIntegrationScheme") node.addObject("SparseLDLSolver", name="linear_solver", template="CompressedRowSparseMatrixd") node.addObject("MechanicalObject", name="dofs", template="Vec2", src="@../grid", showObject="true", drawMode="1", showObjectScale="0.005", showColor=showColor) From c2f8645fc9af19b3ff07dc020aedb3559926b57e Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Wed, 2 Dec 2026 17:44:20 +0100 Subject: [PATCH 2/2] Fix scene --- examples/advanced_timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/advanced_timer.py b/examples/advanced_timer.py index 43f32f02..a26a95e4 100644 --- a/examples/advanced_timer.py +++ b/examples/advanced_timer.py @@ -58,7 +58,7 @@ def createScene(root): # AnimationLoop root.addObject('NewtonRaphson' , maxNbIterationsNewton=5, - maxNbIterationsLineSearch=1, alwaysAdvanceNewton=True) + maxNbIterationsLineSearch=1, alwaysAdvanceTime=True) # Visual style root.addObject('VisualStyle', displayFlags='showBehaviorModels showForceFields')