Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def simulate_pendulum(self):
ext.addObject("DistanceMapping", name="distanceMapping", topology="@../edge_container")
ext.addObject("UniformConstraint", template="Vec1d", iterative=True)

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.animate(root, 0.0001)

return root
Expand Down
2 changes: 1 addition & 1 deletion bindings/Modules/tests/SofaDeformable/SpringForceField.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Test(unittest.TestCase):
def setUp(self) -> None:
self.root = Sofa.Core.Node()
create_scene(self.root)
Sofa.Simulation.init(self.root)
Sofa.Simulation.initRoot(self.root)

def tearDown(self) -> None:
Sofa.Simulation.unload(self.root)
Expand Down
2 changes: 1 addition & 1 deletion bindings/Modules/tests/SofaLinearSolver/matrix_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def simulate_beam(self, linear_solver_template):
root.addObject('FixedConstraint', indices="@box.indices")
root.addObject('HexahedronFEMForceField', name="FEM", youngModulus="4000", poissonRatio="0.3", method="large")

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.animate(root, 0.0001)

return root
Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
n.addChild("Node2")
n.addObject("MechanicalObject", name="dofs")

Sofa.Simulation.init(n)
Sofa.Simulation.initRoot(n)
Sofa.Simulation.print(n)

"""
Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node_doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static auto Class =
# Add a mechanical component to MyNode
n.addObject("MechanicalObject", name="dofs")

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.print(root)

The child nodes, components and parents can be accessed using generator attributes.
Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/src/SofaPython3/Sofa/Core/Submodule_Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ PYBIND11_MODULE(Core, core)
# Add a mechanical component to MyNode
n.addObject("MechanicalObject", name="dofs")

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.print(root)

)doc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static auto Class =
SofaRuntime.importPlugin("SofaComponentAll")

n = Sofa.Core.Node("MyNode")
Sofa.Simulation.init(n)
Sofa.Simulation.initRoot(n)
Sofa.Simulation.print(n)
)";
static auto print =
Expand Down
6 changes: 3 additions & 3 deletions bindings/Sofa/tests/Core/BaseData.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_DataAsContainerNumpyArray_testIsDirtyOnDoubleAccess_(self):
root.addObject("PointSetTopologyContainer", points=[[0, 0, 0], [1, 0, 0]])
modifier = root.addObject("PointSetTopologyModifier")
mo = root.addObject("MechanicalObject")
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

modifier.addPoints(10, True)
self.assertEqual(len(mo.position), 12)
Expand All @@ -269,7 +269,7 @@ def test_DataAsContainerNumpyArray_testIsDirtyOnDoubleWriteAccess_(self):
root.addObject("PointSetTopologyContainer", points=[[0, 0, 0], [1, 0, 0]])
modifier = root.addObject("PointSetTopologyModifier")
mo = root.addObject("MechanicalObject")
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

modifier.addPoints(10, True)
with mo.position.writeable() as w:
Expand All @@ -283,7 +283,7 @@ def test_DataAsContainerNumpyArray_(self):
root = create_scene("rootNode")
v = numpy.array([[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3]])
c = root.addObject("MechanicalObject", name="t", position=v.tolist())
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

numpy.testing.assert_array_equal(c.position.array(), v)

Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/tests/Core/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_events(self):

self.assertTrue( hasattr(controller, "iterations") )

Sofa.Simulation.init(node)
Sofa.Simulation.initRoot(node)
for i in range(10):
Sofa.Simulation.animate(node, 0.01)

Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/tests/Core/Events.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_events(self):
node.addObject("BlockGaussSeidelConstraintSolver", name="constraintSolver")
controller = node.addObject( MyController() )

Sofa.Simulation.init(node)
Sofa.Simulation.initRoot(node)
for i in range(10):
Sofa.Simulation.animate(node, 0.01)

Expand Down
8 changes: 4 additions & 4 deletions bindings/Sofa/tests/Core/ForceField.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_0_explicit(self):
use_iterative_solver=False)

# do some steps here
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

for i in range(0, 100):
Sofa.Simulation.animate(root, root.dt.value)
Expand All @@ -80,7 +80,7 @@ def test_1_implicit_iterative(self):
root = rssffScene(use_implicit_scheme=True, use_iterative_solver=True)

# do some steps here
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

for i in range(0, 100):
Sofa.Simulation.animate(root, root.dt.value)
Expand All @@ -93,7 +93,7 @@ def test_2_implicit_direct(self):
root = rssffScene(use_implicit_scheme=True, use_iterative_solver=False)

# do some steps here
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

for i in range(0, 100):
Sofa.Simulation.animate(root, root.dt.value)
Expand Down Expand Up @@ -127,7 +127,7 @@ def simulate_beam(linear_solver_template):
root.addObject('FixedConstraint', indices="@box.indices")
root.addObject('HexahedronFEMForceField', name="FEM", youngModulus="4000", poissonRatio="0.3", method="large")

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.animate(root, 0.0001)

return root
Expand Down
2 changes: 1 addition & 1 deletion bindings/Sofa/tests/Core/Mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def simulate_beam(linear_solver_template):
root.addObject('FixedConstraint', indices="@box.indices")
root.addObject('HexahedronFEMForceField', name="FEM", youngModulus="4000", poissonRatio="0.3", method="large")

Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.animate(root, 0.0001)

return root
Expand Down
8 changes: 4 additions & 4 deletions docs/sphinx/source/content/UsingThePlugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Within a python3 interpreter, your simulation requires more than only the ``crea
createScene(root)

# Once defined, initialization of the scene graph
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

# Run as many simulation steps (here 10 steps are computed)
for iteration in range(10):
Expand Down Expand Up @@ -219,7 +219,7 @@ By structuring your scripts this way, you get the advantage to have a script loa
createScene(root)

# Once defined, initialization of the scene graph
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

# Launch the GUI (imgui is now by default, to use Qt please refer to the example "basic-useQtGui.py")
import SofaImGui
Expand Down Expand Up @@ -429,7 +429,7 @@ Here is the entire code of the scene :
createScene(root)

# Once defined, initialization of the scene graph
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

# Launch the GUI (imgui is now by default, to use Qt please refer to the example "basic-useQtGui.py")
Sofa.Gui.GUIManager.Init("myscene", "imgui")
Expand Down Expand Up @@ -596,7 +596,7 @@ In the same way, Data can be modified (write access) using the ``.value`` access
createScene(root)

# Once defined, initialization of the scene graph
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)

# Run the simulation for 10 steps
for iteration in range(10):
Expand Down
2 changes: 1 addition & 1 deletion examples/access_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main():
mu = .1
root = Sofa.Core.Node("root")
createScene(root, dt=1e-4, m=m, g=g, mu=mu, L=1000)
Sofa.Simulation.init(root)
Sofa.Simulation.initRoot(root)
Sofa.Simulation.animate(root, root.dt.value)

Ks, Us = [], []
Expand Down
Loading