Home › Forum › SOFA › Using SOFA › [SOLVED] printing_with_VTKExporter
Tagged: 32_bits, Linux_ubuntu, SOFA_1608
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by Hugo.
-
AuthorPosts
-
7 February 2017 at 23:21 #8519ewpostekBlocked
Hello Colleagues,
I do attempt to print forces from the example:
StandardTetrahedralFEMForceField.scn (from the directory Components).
Therefore, I checked the action of the vtkexporter
that was placed in the three possible places.
However, I can get only displacements.
For the second case, counting from the top, I obtain
the dofs.force field but all the forces are zeros
(impossible).Could anyone help with it ?
thank you,
Elek<?xml version="1.0" ?> <Node name="root" dt="0.3" showBoundingTree="0" gravity="0 0 -0.0"> <CollisionPipeline verbose="0" name="CollisionPipeline" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" name="collision response" /> <DiscreteIntersection /> <Node name="MeshTopology"> <TetrahedronSetTopologyContainer name="Container1" fileTopology="mesh/cylinder.msh" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" /> <MechanicalObject name="dofs" /> <Node name="FastTetrahedronCorotationalForceField"> <CGLinearSolver iterations="500" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <StaticSolver applyIncrementFactor="1" /> <TetrahedronSetTopologyContainer name="Container2" /> <TetrahedronSetGeometryAlgorithms drawEdges="1" drawColorEdges="0 1 0" name="GeomAlgo" /> <SimpleTesselatedTetraTopologicalMapping input="@Container1" output="@Container2" /> <MechanicalObject translation="0 0 0" /> <MeshMatrixMass name="mass" lumping="1" printMass="0" massDensity="10000" /> <BoxROI box="-1.2 -1.2 -0.01 1.2 1.2 0.01" drawBoxes="1" name="fixedPlane2" /> <FixedConstraint indices="@fixedPlane2.indices" /> <BoxROI box="-1.2 -1.2 0.99 1.2 1.2 1.01" drawBoxes="1" name="pressurePlane2" /> <ConstantForceField points="@pressurePlane2.indices" totalForce="0.001 0 -0.01" /> <StandardTetrahedralFEMForceField materialName="NeoHookean" ParameterSet="0.454545 0.4166667" /> <VTKExporter name="vTKExporter" listening="true" pointsDataFields="dofs.force" filename="test_2a" edges="1" triangles="1" quads="1" tetras="1" hexas="1" exportEveryNumberOfSteps="1" /> </Node> <VTKExporter name="vTKExporter" listening="true" pointsDataFields="dofs.force" filename="test_2a" edges="1" triangles="1" quads="1" tetras="1" hexas="1" exportEveryNumberOfSteps="1" /> </Node> <VTKExporter name="vTKExporter" listening="true" pointsDataFields="dofs.force" filename="test_2a" edges="1" triangles="1" quads="1" tetras="1" hexas="1" exportEveryNumberOfSteps="1" /> </Node>
8 February 2017 at 09:08 #8520HugoKeymasterHi Elek,
The data “pointDataField” should indeed be the one for saving additional data. But why did you use 3 VTKExporters ? Using only the second one should work (using the path pointsDataFields=”dofs.force”) and removing the two others:
... <ConstantForceField points="@pressurePlane2.indices" totalForce="0.001 0 -0.01" /> <StandardTetrahedralFEMForceField materialName="NeoHookean" ParameterSet="0.454545 0.4166667" /> </Node> <VTKExporter name="vTKExporter" listening="true" pointsDataFields="dofs.force" filename="test_2a" edges="1" triangles="1" quads="1" tetras="1" hexas="1" exportEveryNumberOfSteps="1" /> </Node> </Node>
Another trick, could be to export the position with one VTKExporter and to export the forces using a second VTKExporter where position=”dofs.force”.
Hope this helps.
Hugo
8 February 2017 at 10:06 #8522ewpostekBlockedHi Hugo,
The problem is that when putting the
vtkExporter at the second place (correctly) I do not
obtain neither displacements (deformed structure)
nor forces.
The files from the step one or step 10 are the same.
I run the example in the interactive mode. It gives
the deformation.There are zeros the the end
<VTKFile type=”UnstructuredGrid” version=”0.1″ byte_order=”BigEndian”> <UnstructuredGrid> <Piece NumberOfPoints=”510″ NumberOfCells=”10589″> <PointData> <DataArray type=”Float64″ Name=”force” NumberOfComponents=”3″ format=”ascii”> 0 0 0 0 0 0 0 0 0
I applied different combinations of the parameters but
it gave me the same result.I see that the vtkExporter should not
be put on the place “one” because the mechanical
object is defined above the node <Node name=”FastTetrahedronCorotationalForceField”>
(I believe ?).However, “experimentally”, while putting the vtkExporter at the position “one”
I have got a deformation. However, it’s true I do
not know if this is right (correct).
Morover, there is the error:[WARNING] [VTKExporter] VTKExporter : error while fetching data field 'force' of object 'dofs', check object name
best, Elek
8 February 2017 at 19:21 #8529HugoKeymasterHi Elek,
Sorry I read your scene file too fast.
Some things were not making sense: your MechanicalObject was missing a name (so you can’t recover its data), and the way you load the topology was wrong.Here is a suggestion:
<?xml version="1.0" ?> <Node name="root" dt="0.3" showBoundingTree="0" gravity="0 0 -0.0"> <CollisionPipeline verbose="0" name="CollisionPipeline" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" name="collision response" /> <DiscreteIntersection /> <Node name="MeshTopology"> <MeshGmshLoader name="GmshLoader" filename="mesh/cylinder.msh" createSubelements="true" /> <TetrahedronSetTopologyContainer name="Container1" src="@GmshLoader" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <MechanicalObject template="Vec3d" name="dofs" /> <Node name="FastTetrahedronCorotationalForceField"> <CGLinearSolver iterations="500" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <StaticSolver applyIncrementFactor="1" /> <TetrahedronSetTopologyContainer name="Container2" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" drawEdges="1" drawColorEdges="0 1 0" name="GeomAlgo" /> <SimpleTesselatedTetraTopologicalMapping input="@Container1" output="@Container2" /> <MechanicalObject template="Vec3d" name="mecaDOFs" translation="0 0 0" /> <MeshMatrixMass name="mass" lumping="1" printMass="0" massDensity="10000" /> <StandardTetrahedralFEMForceField materialName="NeoHookean" ParameterSet="0.454545 0.4166667" /> <BoxROI template="Vec3d" box="-1.2 -1.2 -0.01 1.2 1.2 0.01" drawBoxes="1" name="fixedPlane2" /> <BoxROI template="Vec3d" box="-1.2 -1.2 0.99 1.2 1.2 1.01" drawBoxes="1" name="pressurePlane2" /> <FixedConstraint indices="@fixedPlane2.indices" /> <ConstantForceField points="@pressurePlane2.indices" totalForce="0.001 0 -0.01" /> <VTKExporter name="vTKExporter" listening="true" position="mecaDOFs.position" pointsDataFields="mecaDOFs.force" filename="test_2a" edges="1" triangles="1" quads="1" tetras="1" exportEveryNumberOfSteps="1" /> </Node> </Node> </Node>
This is working for me.
Best,Hugo
9 February 2017 at 08:02 #8530ewpostekBlockedHi Hugo,
Thank you very much for the template.
I obtained the displacements and forces in the test2a(_n).vtu files.
There is only one surprising comment from the program:eligiusz@eligiusz-laptop:~/tmp_stable_sofa/tmp_exa/stan_t1$ /home/eligiusz/tmp_stable_sofa/sofa/v16.08/build/bin/runSofa -g batch -n 3 x2_hg.scn
[WARNING] [VTKExporter] File test_2a NOT FOUND in :/home/eligiusz/tmp_stable_sofa/sofa/v16.08/src/examples:/home/eligiusz/tmp_stable_sofa/sofa/v16.08/src/share
File test_2a NOT FOUND in :/home/eligiusz/tmp_stable_sofa/sofa/v16.08/src/examples:/home/eligiusz/tmp_stable_sofa/sofa/v16.08/src/share
Could not read value for data field position: mecaDOFs.position
The model is NeoHookean
Computing 3 iterations.
3 iterations done in 3.32091 s ( 0.903368 FPS).
3 iterations done in 3.32091 s ( 0.903366 FPS).
eligiusz@eligiusz-laptop:~/tmp_stable_sofa/tmp_exa/stan_t1$thank you,
Elek9 February 2017 at 09:18 #8531HugoKeymasterYes it seems the link on position is not working well.
Maybe due to the fact the exporter already finds the MechanicalObject.
I will look at it.Still I set the topic as solved since you achieved to recover your vtk files.
Cheers,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.