18 December 2015 at 15 h 59 min #5170
How can I export forcefields?
Thanks in advance,
Zahra18 December 2015 at 17 h 38 min #5173
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 ?
Hugo25 January 2016 at 18 h 06 min #5385
Did you succeed to export the data you wanted?
Hugo26 January 2016 at 10 h 59 min #5386
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.
Zahra26 January 2016 at 13 h 31 min #5387
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.
Hugo15 February 2016 at 11 h 36 min #5677
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?
Zahra15 February 2016 at 16 h 17 min #5679
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.
Hugo19 February 2016 at 10 h 36 min #5844
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.
Zahra19 February 2016 at 11 h 22 min #5846
You can send me your scene if you want me to test it.
(if it doesn’t require a specific plugin)
Hugo19 February 2016 at 11 h 51 min #5848
I have sent it to your email. The subject is “exporting forcefields”.
Thank you very much.
Zahra22 February 2016 at 8 h 51 min #5858
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.
Hugo23 February 2016 at 15 h 53 min #5901
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.
Zahra23 February 2016 at 16 h 21 min #5902
You’re very welcome.
- You must be logged in to reply to this topic.