Home › Forum › SOFA › Using SOFA › [SOLVED] exporting forcefields
Tagged: export, Forcefield
- This topic has 12 replies, 2 voices, and was last updated 8 years, 8 months ago by Hugo.
-
AuthorPosts
-
18 December 2015 at 15:59 #5170ZahraBlocked
How can I export forcefields?
Thanks in advance,
Zahra
18 December 2015 at 17:38 #5173HugoKeymasterDear Zahra,
What do you mean exactly by export forcefields ?
If you want to export a specific field (real value per node) you can still use one of the exporter (such as VTKExporter). The VTKExporter has additional output fields that you can connect (@) to the variable you want to export: pointsDataFields and cellsDataFields.
Is that what you need ?Cheers,
Hugo
25 January 2016 at 18:06 #5385HugoKeymasterDear Zahra,
Did you succeed to export the data you wanted?
Best regards,
Hugo
26 January 2016 at 10:59 #5386ZahraBlockedDear Hugo,
Thank you for following up and Sorry for the late reply, other problems distracted me for a while.
No I am still looking for it. What I mean by force field is the force that is applied to each node. I think it is the same force I can see in the run window by checking forcefields. Using VTK exporter and choosing PointsDataFields gives me the positions of the nodes and not the forces, or maybe I still do not know how to use it correctly for my purpose.
Best regards,
Zahra26 January 2016 at 13:31 #5387HugoKeymasterHi Zahra,
No problem for the delay, I just wanted to make sure you get the answer you need.
For what you are looking for, there is two ways:
- Link in the scene the “PointsDataFields” to the “force” data in the MechanicalObject of your object. The “force” data stores ALL accumulated forces applied on the body.
- Otherwise, create a specific data storing the forces in your own Forcefield. This data will thus be available in the scene and you will be able to link it in the scene with the “PointsDataFields”.
Let me know if you succeed in your simulation.
Best regards,Hugo
15 February 2016 at 11:36 #5677ZahraBlockedDear Hugo,
Thank you for your kind reply.
I link the “PointsDataFields” in VTKExporter to the “force” data in my MechanicalObject by this command: “@MechObj.force”. But VTKExporter again exports the positions and not the forces.
Do I use a true procedure or Should I make any other changes?Thank you.
Zahra15 February 2016 at 16:17 #5679HugoKeymasterDear Zahra,
The data “PointsDataFields” is a string. Therefore, the “@” should not be used. Try without the “@” before the data: use only PointsDataFields=”MechObj.force”, this should work.
Cheers,
Hugo
19 February 2016 at 10:36 #5844ZahraBlockedDear Hugo,
Thank you for your help. I think something is wrong in my scene. When I apply your suggestion, it is unsaved when I reopen the VTKExporter. I should put a time to figure out the problem. I will let you know as soon as I succeed.
Best,
Zahra19 February 2016 at 11:22 #5846HugoKeymasterHi Zahra,
You can send me your scene if you want me to test it.
(if it doesn’t require a specific plugin)Cheers,
Hugo
19 February 2016 at 11:51 #5848ZahraBlockedDear Hugo,
I have sent it to your email. The subject is “exporting forcefields”.
Thank you very much.Zahra
22 February 2016 at 08:51 #5858HugoKeymasterDear @zahra,
It’s now working for me. I had to activate the XML format to make it work. Here is how it looks like:
<VTKExporter name="vTKExporter" pointsDataFields="MechObj.force" filename="test" XMLformat="1" edges="0" triangles="0" exportEveryNumberOfSteps="0" exportAtBegin="1" exportAtEnd="1" />
Let me know if this works for you too.
Cheers,
Hugo
23 February 2016 at 15:53 #5901ZahraBlockedDear Hugo,
In SOFA modeler I did these changes but the problem existed. Then I add pointsDataFields=”MechObj.force” directly in the file of the scene and now it works. Thanks a lot for your kind help.
Best,
Zahra
23 February 2016 at 16:21 #5902HugoKeymasterDear Zahra,
You’re very welcome.
Enjoy SOFA,Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.