[Fixed] brick20 (hexa20) mesh gives other results than tet10

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

[Fixed] brick20 (hexa20) mesh gives other results than tet10

Postby bernd » Thu Feb 27, 2020 7:15 pm

problems ...

Attached the famous calculix cantlever with tet10 mesh and brick20 mesh. The brick20 for some reasons give more than double deflection which is surely wrong ...

tet10 = max def 87.31, z = -86.93
brick20 = max def 213.78, z = -212.18

something might be wrong in the inputfile ...

tet10-brick20.FCStd
(109.13 KiB) Downloaded 11 times
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Thu Feb 27, 2020 7:25 pm

OK tested with self weight and pressure constraint. Both work well. File attached.

Seams some problems with the node load calculations for CLOAD entry of force constraint for brick20 in calculix input file goes wrong. It will need some debugging ...

tet10-brick20_self_pressure.FCStd
(102.44 KiB) Downloaded 7 times
UR_
Posts: 1195
Joined: Tue Jan 03, 2017 8:42 pm

Re: brick20 mesh gives other results than tet10

Postby UR_ » Sat Feb 29, 2020 7:54 am

nodal force distribution, *CLOAD section, seems to be faulty.

Screenshot 003.png
Screenshot 003.png (40 KiB) Viewed 317 times

desired load is only about 9 MN


for load distribution
please see page 309 http://www.dhondt.de/ccx_2.16.pdf

Screenshot 004.png
Screenshot 004.png (21.02 KiB) Viewed 317 times
User avatar
ebrahim raeyat
Posts: 349
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: brick20 mesh gives other results than tet10

Postby ebrahim raeyat » Sun Mar 01, 2020 2:42 pm

bernd wrote:
Thu Feb 27, 2020 7:25 pm
OK tested with self weight and pressure constraint. Both work well. File attached.

Seams some problems with the node load calculations for CLOAD entry of force constraint for brick20 in calculix input file goes wrong. It will need some debugging ...


tet10-brick20_self_pressure.FCStd
I also analyse this model with opensees with 20NodeBrick element and give -212.8, i use your .inp file for creating model.
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 7:52 pm

attached cantilever wit one brick20 ...

Code: Select all

hugo@Ahorn:~/Documents/dev/freecad/freecadbhb_dev/build$ ./bin/FreeCAD
FreeCAD 0.19, Libs: 0.19R19765 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

connect failed: Datei oder Verzeichnis nicht gefunden
Selected working directory doesn't exist.
References: empty in SolidMaterial, SolidMaterial
References: Face in FemConstraintFixed, FemConstraintFixed
References: Face in FemConstraintForce, FemConstraintForce
Check prerequisites.
Check prerequisites.
References: empty in SolidMaterial, SolidMaterial
Start writing CalculiX input file
Write ccx input file to: /tmp/fcfem_72hxtqe0/canti_one_brick20/CalculiXccxTools/MyMesh.inp
FemConstraintFixed:
    Type: Fem::ConstraintFixed, Name: FemConstraintFixed
    ReferenceShape ... Type: Face, Object name: Box, Object label: Cube, Element name: Face1
FemConstraintForce:
    Type: Fem::ConstraintForce, Name: FemConstraintForce
    ReferenceShape ... Type: Face, Object name: Box, Object label: Cube, Element name: Face2
  No face data in finite volume element mesh. FreeCAD uses getccxVolumesByFace() to retrieve the volume elements of the ref_face.
Unexpected error when writing CalculiX input file: <class 'IndexError'>
Traceback (most recent call last):
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femguiobjects/_ViewProviderFemSolverCalculix.py", line 345, in write_input_file_handler
    self.fea.write_inp_file()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femtools/ccxtools.py", line 368, in write_inp_file
    self.inp_file_name = inp_writer.write_calculix_input_file()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femsolver/calculix/writer.py", line 87, in write_calculix_input_file
    self.write_calculix_one_input_file()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femsolver/calculix/writer.py", line 173, in write_calculix_one_input_file
    self.write_constraints_force(inpfile)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femsolver/calculix/writer.py", line 1120, in write_constraints_force
    self.get_constraints_force_nodeloads()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femsolver/writerbase.py", line 272, in get_constraints_force_nodeloads
    self.femnodes_mesh, frc_obj
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1106, in get_force_obj_face_nodeload_table
    face_table = get_ref_facenodes_table(femmesh, femelement_table, ref_face)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1233, in get_ref_facenodes_table
    face_table = build_mesh_faces_of_volume_elements(face_table, femelement_table)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1554, in build_mesh_faces_of_volume_elements
    face_nodes.append(femelement_table[veID][i])
IndexError: tuple index out of range
hugo@Ahorn:~/Documents/dev/freecad/freecadbhb_dev/build$ 


OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19765 (Git)
Build type: Unknown
Branch: femtmp
Hash: b322969752ed41c53e29e371c612d9341f19c6e0
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)


canti_one_brick20.FCStd
(12.94 KiB) Downloaded 7 times
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 8:08 pm

Code: Select all

from femmesh import meshtools

doc = App.ActiveDocument
femmesh = doc.MyMesh.FemMesh
frc_obj=doc.FemConstraintForce

femelement_table = meshtools.get_femelement_table(femmesh)
femnodes_mesh = femmesh.Nodes
meshtools.get_force_obj_face_nodeload_table(femmesh, femelement_table, femnodes_mesh, frc_obj)
code to get the error by Python ...

Code: Select all

>>> 
>>> from femmesh import meshtools
>>> 
>>> doc = App.ActiveDocument
>>> femmesh = doc.MyMesh.FemMesh
>>> frc_obj=doc.FemConstraintForce
>>> 
>>> femelement_table = meshtools.get_femelement_table(femmesh)
>>> femnodes_mesh = femmesh.Nodes
>>> meshtools.get_force_obj_face_nodeload_table(femmesh, femelement_table, femnodes_mesh, frc_obj)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1106, in get_force_obj_face_nodeload_table
    face_table = get_ref_facenodes_table(femmesh, femelement_table, ref_face)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1233, in get_ref_facenodes_table
    face_table = build_mesh_faces_of_volume_elements(face_table, femelement_table)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1554, in build_mesh_faces_of_volume_elements
    face_nodes.append(femelement_table[veID][i])
IndexError: tuple index out of range
>>> 
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 8:20 pm

next step ...

Code: Select all

from femmesh import meshtools

doc = App.ActiveDocument
femmesh = doc.MyMesh.FemMesh
femelement_table = meshtools.get_femelement_table(femmesh)
ref_face = doc.Shape.Shape
meshtools.get_ref_facenodes_table(femmesh, femelement_table, ref_face)

Code: Select all

>>> 
>>> from femmesh import meshtools
>>> 
>>> doc = App.ActiveDocument
>>> femmesh = doc.MyMesh.FemMesh
>>> femelement_table = meshtools.get_femelement_table(femmesh)
>>> ref_face = doc.Shape.Shape
>>> meshtools.get_ref_facenodes_table(femmesh, femelement_table, ref_face)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1233, in get_ref_facenodes_table
    face_table = build_mesh_faces_of_volume_elements(face_table, femelement_table)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1554, in build_mesh_faces_of_volume_elements
    face_nodes.append(femelement_table[veID][i])
IndexError: tuple index out of range
>>> 

brick20_cload_problem.FCStd
(9.09 KiB) Downloaded 6 times
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 8:35 pm

next step ... file from last post

Code: Select all

from femmesh import meshtools
femelement_table = meshtools.get_femelement_table(App.ActiveDocument.MyMesh.FemMesh)
face_table = {1: [12, 11, 9, 10, 15, 13, 16, 14]}
meshtools.build_mesh_faces_of_volume_elements(face_table, femelement_table)

Code: Select all

>>> 
>>> from femmesh import meshtools
>>> femelement_table = meshtools.get_femelement_table(App.ActiveDocument.MyMesh.FemMesh)
>>> face_table = {1: [12, 11, 9, 10, 15, 13, 16, 14]}
>>> meshtools.build_mesh_faces_of_volume_elements(face_table, femelement_table)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femmesh/meshtools.py", line 1554, in build_mesh_faces_of_volume_elements
    face_nodes.append(femelement_table[veID][i])
IndexError: tuple index out of range
>>> 
report logging

Code: Select all

VolElement: 1
  --> (3, 4, 12, 11, 2, 1, 9, 10, 7, 20, 15, 19, 5, 17, 13, 18, 6, 8, 16, 14)
  --> [12, 11, 9, 10, 15, 13, 16, 14]
  --> [3, 4, 7, 8, 11, 15, 19, 20]
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 9:06 pm

damn code formating :twisted:

https://github.com/FreeCAD/FreeCAD/comm ... 6eff1R1539

never less it was worth to do all the code formatting ...
User avatar
bernd
Posts: 10826
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: brick20 mesh gives other results than tet10

Postby bernd » Sun Mar 01, 2020 9:10 pm