Forum Replies Created
-
AuthorPosts
-
mmabroukBlocked
Hi Markus,
I took a quick look to your code. It seems to me that the FixedConstraint is in the wrong node, it should be under the “cube” node, otherwise it won’t have access to the cube frames. In other words, you have right now is:
<cube>
</cube>
<n_endpoint>
</n_endpoint>While you should have
<cube><MechanicalObject><FixedConstraint>
</cube>I’m also a beginner with Sofa, so don’t take my word for it 🙂 Hope this helps.
Best,
MahmoudmmabroukBlockedIf you’re scripting using Python, you can use the onBeginAnimationStep(self, dt) function which gets called each simulation step and create the graph objects there.
Best,
MahmoudmmabroukBlockedIt seems my model works when I use the EulerImplicitSolver and CGLinearSolver instead of the CompliantImplicitSolver.
But other parts of my model are dependent on the Compliant module (I use for example DistanceMapping and UniformCompliance).
Is there a solution for this problem?mmabroukBlockedHello Hugo,
Thanks for your quick answer. I am struggling a bit working with the GearSpringForceField, especially the spring definition. Here are my issues:
1)I tried copying some stuff from the example, but it seems things are different since I am using the compliant solver:
subnode.createObject('CompliantImplicitSolver', name="timestep integration scheme", stabilization=0, warm_start=0, neglecting_compliance_forces_in_geometric_stiffness="0", constraint_forces="propagate")
For some reason, I cannot use the RigidRigidMapping with the compliant solver, but have to use the AssembledRigidRigidMapping. I am assuming they do the same thing?
2) I am not sure what is the correct Spring formatting. I looked into the code, and my understanding that it is:
BEGIN_SPRING mass_frame1 index_frame1 mass_frame2 index_frame2 AXIS unknown unknow ENDSPRING
I am not sure how to define the axis.. Is the rest of my understanding correct?3) Currently I neither see the springs in the GUI, nor do they extert any force, in fact, as soon as I move any atom/frame in my model, my model explodes.
Below is my code:
cn = parent_node.createChild("mesh") cn.createObject("MechanicalObject", template="Rigid3d", name="dofs", position=stools.dummyDofs(config.shape[0], "Rigid3d"), showObject="1", showObjectScale="2") source = "" for c in range(config.shape[0]): x = [0, 0, 0] source += "%s %s %s %s 0 0 0 0\n" % (c, x[0], x[1], x[2]) cn.createObject("AssembledRigidRigidMapping", template="Rigid3d,Rigid3d", name="mapscatomesh", source=source[:-1]) springs = " ".join(["BEGIN_SPRING 4 %s 5 %s AXIS 0 1 END_SPRING\n" % (i, i+1) for i in range(30)]) cn.createObject("GearSpringForceField", template="Rigid3d", name="spring", spring=springs)
Thanks for your help!
Yours,
Mahmoud13 October 2017 at 11:09 in reply to: [SOLVED] Error while Adding Compliance nodes in the simulation (Compliant module) #10073mmabroukBlockedHello Max,
That fixed the problem. Thank you!!
Yours,
Mahmoud12 October 2017 at 14:38 in reply to: [SOLVED] Visualizing DiagonalCompliance (Compliance Plugin) #10067mmabroukBlockedHello,
Thank you for your answers. I found a different solution. Since I actually only needed 1D compliance I ended up using the DistanceMapping and visualizing like done in the tutorials.
Yours,
Mahmoud -
AuthorPosts