Home › Forum › SOFA › Getting Started › [SOLVED] use_SOFA_in_batch_mode
Tagged: 64_bits, Linux_other, SOFA_other
- This topic has 4 replies, 2 voices, and was last updated 7 years, 10 months ago by ewpostek.
-
AuthorPosts
-
4 January 2017 at 01:27 #8259ewpostekBlocked
Hello Colleagues,
I reached the SOFA version without ogl.
Therefore, I can use only the program in batch mode,
for example:
ewpostek@tryton-ap:~/sofa_without_ogl_a/build/tmp_x$ ../bin/runSofa -g batch MultipleObjectsTwoCubes.scn
Computing 1000 iterations.
1000 iterations done in 0.378546 s ( 2641.69 FPS).
1000 iterations done in 0.378551 s ( 2641.65 FPS).
ewpostek@tryton-ap:~/sofa_without_ogl_a/build/tmp_x$Could you be so kind to explain me
how to
1) obtain files for visualisation
using any method – for example, for paraview, for gmsh,
or any other format
2) simply, how to print results to files, like
in a finite element code – stresses, strains, displacements, etc.
I can interpret them or transform them into a postprocessing
tool.thank you in advance,
ElekSOFA after commit #110
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 20144 January 2017 at 09:25 #8260HugoKeymasterHi Elek,
Nice to hear for the compilation.
About your points:1) you should use Exporters, like the VTK Exporter. Look at the component and its API. Otherwise, you can find some pages about it:
- in the doc,
- in the forum (especially reply #5858).
2) to export the whole MechanicalObject (DOF), you can use the ExportState. For the rest, you can use the first-mentioned VTKExporter and set your data as PointData. A data field “pointsDataFields” is available in the VTKExporter.
Hope this helps.
Hugo
11 January 2017 at 18:04 #8362ewpostekBlockedHi Hugo,
I still stay with the vtkexporter.
I took such an example. I guess I should
obtain the “dragon.obj” in vtk. However, I am getting nothing.
The file tstx.vtu is not opened as well.
Just ensure, I have the dragon.obj in the mesh dir.
It looks well with the paraview.<Node name=”root” dt=”0.01″ gravity=”0 -9.81 0″> <Mesh name=”mesh” filename=”mesh/dragon.obj” /> <MeshObjLoader name=”loader” filename=”mesh/dragon.obj” /> <MechanicalObject src=”@loader” template=”Vec3f” name=”mecha” /> <TetrahedronSetTopologyContainer src=”@loader” name=”topo” /> <VTKExporter filename=”tstx.vtu” listening=”true” edges=”0″ triangles=”1″ quads=”0″ tetras=”0″ pointsDataFields=”MechanicalObject.position” /> </Node>
I have used the pointsDataFields=”mecha.position”, as well.
The command
../bin/runSofa -g batch x.scnI was not successful with the #5858. However, the case above can
be quicker to explain.For this case, I use ubuntu stable version.
Could you help with it ?
best regards, Elek
11 January 2017 at 22:04 #8363HugoKeymasterHi Elek,
You are almost done, you just need to specify when the export should occur.
You need to set one of the data:- exportEveryNbSteps,
- exportAtBegin,
- or exportAtEnd
to true !
Have a look the the VTKExporter.cpp
Cheers,Hugo
13 January 2017 at 09:55 #8368ewpostekBlockedHi Hugo,
Thank you, works!
regards, Elek -
AuthorPosts
- You must be logged in to reply to this topic.