View Issue Details

IDProjectCategoryView StatusLast Update
0003617FEM[FreeCAD] Bugpublic2019-01-14 18:37
ReporterberndhahnebachAssigned Toickby 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version[FreeCAD] 0.18 
Summary0003617: FEM, post processing, vtk mesh, it is not possible to create a vtk mesh with gaps
Descriptionhttps://forum.freecadweb.org/viewtopic.php?f=18&t=27105&start=70#p225490
Steps To Reproduce- open FEM 2D example
- select solver
- change "Beam Shell Result Output 3D" to true
- rerun analysis
- check Abs displacement colors in standard result object, they look fine.
- select the 3D solid result object
- create vtk pipe
- some error in report view is printed
- double click on the pipeline
- set mode "Surface wit edges"
- set field to "Displacement"
- set vector to "Magnitude"
- this does not look to be the right coloring ...

to reproduce by Python (tested with FreeCAD 0.18.15607) use:

# load 2D example file and set 3D output in solver
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever2D.FCStd')

doc.FEMMeshGmsh.ViewObject.Visibility = False
doc.CalculiXccxTools.BeamShellResultOutput3D = True
doc.recompute()
# run the analysis
import FemGui
FemGui.setActiveAnalysis(doc.Analysis)
from femtools import ccxtools
fea = ccxtools.FemToolsCcx()
fea.update_objects()
fea.purge_results()
fea.run()
doc.Result_mesh.ViewObject.Visibility = False
# create vtk result pipline
import ObjectsFem
ObjectsFem.makePostVtkResult(doc, doc.CalculiX_static_results)
doc.recompute()
doc.FEMVtkResult.ViewObject.DisplayMode = 'Surface with Edges'
doc.FEMVtkResult.ViewObject.Field = 'DisplacementVectors'
doc.FEMVtkResult.ViewObject.VectorMode = 'Magnitude'
TagsNo tags attached.

Relationships

related to 0002873 closedberndhahnebach FEM, mesh, unv writer, do not renumbering on file writing 

Activities

berndhahnebach

2018-09-26 21:25

developer   ~0011860

the code ... https://github.com/FreeCAD/FreeCAD/blob/a0ff629747d5d73567075821852a8cdaadcf51c5/src/Mod/Fem/App/FemVTKTools.cpp#L445-L462

berndhahnebach

2018-09-26 21:28

developer   ~0011861

Last edited: 2018-09-26 21:29

View 3 revisions

If the FreeCAD file is saved and reopened the problem could be even worse, because of 0002873. But both are totally independent!

ickby

2019-01-03 09:21

developer   ~0012363

Problem are the not continuous node ids in the freecad mesh. In general the FEM result property stores all results for the individual mesh nodes by index, assuming index==id. Hence Node 1 result is in result vector at position 1. However, when the node ids are not continuous in the freecad mesh, e.g. there are 3 nodes but ids are [0 1 5], that mapping does not work for VTK anymore. The reason is that in VTK node ids must be continuous, the example mesh would result in the following VTK nodes [0 1 2 3 4 5] with ids 2,3,4 existing but not used by any elements. Now with index==id the results would be assigned to ids [0 1 2] instead of [0 1 5], which results in the display error.

The solution is to remove the assumption index==id and use the correct note id for each result value:
https://github.com/ickby/FreeCAD_sf_master/commit/605edeecb2152130395177d0ae4828d6e1c4b12e

@berndhahnebach Could you do some regression testing with this fix?

wmayer

2019-01-14 18:37

administrator   ~0012431

https://github.com/FreeCAD/FreeCAD/commit/16435205d409353cb2a49ee65bf83031c06be4f8

Issue History

Date Modified Username Field Change
2018-09-25 21:30 berndhahnebach New Issue
2018-09-25 21:30 berndhahnebach Status new => confirmed
2018-09-26 21:25 berndhahnebach Note Added: 0011860
2018-09-26 21:28 berndhahnebach Note Added: 0011861
2018-09-26 21:28 berndhahnebach Note Edited: 0011861 View Revisions
2018-09-26 21:29 berndhahnebach Note Edited: 0011861 View Revisions
2019-01-03 09:21 ickby Note Added: 0012363
2019-01-11 06:21 berndhahnebach Steps to Reproduce Updated View Revisions
2019-01-11 06:58 berndhahnebach Steps to Reproduce Updated View Revisions
2019-01-11 06:59 berndhahnebach Steps to Reproduce Updated View Revisions
2019-01-14 15:43 wmayer Relationship added related to 0002873
2019-01-14 18:37 wmayer Assigned To => ickby
2019-01-14 18:37 wmayer Status confirmed => closed
2019-01-14 18:37 wmayer Resolution open => fixed
2019-01-14 18:37 wmayer Fixed in Version => 0.18
2019-01-14 18:37 wmayer Note Added: 0012431