7 October 2021 at 10 h 46 min #20521
Hi SOFA community,
We are trying to simulate a bending of a frame like structure that is just a set of connected beams i.e. beam elements. I am using
BeamFEMForceFieldfor this. Something like show in the image below:
Part of the code that defines this:
mechanics.createObject("MechanicalObject", template="Rigid3d", name="DOFs", position=[ [2, 2, 22, 0, 0.41321628, 0, 0.91063291], # 0 [12.5, 2, 10, 0, 0.41321628, 0, 0.91063291], # 1 [23, 2, -2, 0, 0.41321628, 0, 0.91063291], [35, 9.5, 8, 0.30643331, -0.28450399, 0.35283288, 0.83705739], [48, 17, 18, 0.30643331, -0.28450399, 0.35283288, 0.83705739], [50, 9, 10, 0. , -0.64262055, 0. , 0.76618459]]) mechanics.createObject("BeamFEMForceField", name="FEM", radius=0.1, youngModulus=800000000, poissonRatio=0.2) mechanics.createObject("MeshTopology", name="lines", lines="0 1 1 2 2 3 3 4 4 5", position="@DOFs.position", drawEdges="1")
This works fine. But we also want to simulate a contact, thus we used the
CubeTopologyto generate the mesh for the collision model. Part of the code:
Visu.createObject("CubeTopology", nx="100", ny="3", nz="3", min="0 -0.02 -0.02", max="5 0.02 0.02") Visu.createObject("MechanicalObject") Visu.createObject("BeamLinearMapping", isMechanical="true") Visu.createObject("TriangleCollisionModel") Visu.createObject("LineCollisionModel") Visu.createObject("PointCollisionModel")
But then we get something like this:
My question. The collision model does not look good as there are some curvatures at the edges. I know that this is due to the orientation of the
DOFsat nodes (points). But my question is there some workaround this? How to generate a nice mesh to deal with this edge cases and follow the lines? Or is there some other way to generate a better mesh? Or maybe are there some ways to attach already generated mesh (for example we would use some other softwares to generate a mesh like
gmsh) to this Beam model (similar like it is done when importing mesh externally)? In short, how to generate a mesh model for this frame structure to follow nicely the lines and deal with this edge cases?
This is a part of our Master Student Project, and I would greatly appreciate for any help and suggestions!
Andrija7 October 2021 at 10 h 56 min #20547HugoKeymaster
- SOFA Consortium
Sorry it seems your CollisionModel image is not well loaded/referenced.
Could you post it again?
But I am not sure the mapping coming with the BeamFEMFF will allow this. We should soon release new codes for beams that could work for you.
Hugo8 October 2021 at 7 h 49 min #20554
Thank you for your fast reply. Yes sorry I don’t know why the images didn’t loaded.
Here are the images again:
If they don’t work again, here are the links:
The only workourn so far that I manage to find is not to use any mesh for the collision model but rather just lines and point of the beams, i.e. to use this:
Visu = mechanics.addChild('Visu') Visu.addObject("MechanicalObject") Visu.addObject("IdentityMapping") Visu.addObject("LineCollisionModel") Visu.addObject("PointCollisionModel", name="FloorPoint")
But still the problem remains if I want to use a
It is great to hear if you will somehow enable this in the next version 🙂 !
Thanks again for the help!!!
Andrija8 October 2021 at 9 h 00 min #20564HugoKeymaster
- SOFA Consortium
It looks like the interpolation is just working fine. The third frame being aligned with the second frame, the interpolation between third and fourth seems logical.
Have you tried to change the orientation of this third frame so that its red (x) axis correspond to the derivative between frame 2 and 4 ?
Hugo8 October 2021 at 17 h 14 min #20566
Thank again for the help.
I am not sure what you meant exactly. To avoid confusion (from my side), here are the images where I marked the frames / beams:
Following this, yes it seems to me fine for the frame 1 and 2. The problem is when I go from frame 2 to frame 3, as you see there is an unwanted curvature in mesh for the collision model.
If we follow this numeration of frames, like I illustrated on the images, then I didn’t try what you suggested. I am not entirely sure how to do what you propose? In general I think I understand what you want to say, that by taking the derivative it should give the right orientation and then the mesh should be better. But don’t know how exactly to do this? To have a function that represents a line between the frame 2 and 4 (line through 2 points), then to find the derivative of this, which should give me the right orientation of frame 3?
Did I understood right?
- You must be logged in to reply to this topic.