Understanding FEM_MeshRegion

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Understanding FEM_MeshRegion

Post by balrobs »

Playing with the FEM_MeshRegion command I saw a strange behaviour (bug?)
Steps to replicate:
  1. draw an outer Draft_Rectangle -> Rectangle
  2. draw an inner Draft_Rectangle -> Rectangle001
  3. select Rectangle and Rectangle001 and use Part_BooleanFragments to create -> BooleanFragments
  4. select BooleanFragments and use Part_CompoundFilter to create -> CompoundFilter
  5. create a FEM_Analysis container -> Analysis
  6. select CompoundFilter and use FEM_GmshFromShape to create -> FEMMeshGmsh
  7. select FEMMeshGmsh and use FEM_MeshRegion, set a max element size (i.e. 100mm) and add one edge of Rectange001
The mesh refinement happens as expected at the selected edge
Screenshot_01.png
Screenshot_01.png (48.39 KiB) Viewed 875 times
Now change the steps slightly:
  1. draw an outer Draft_Rectangle -> Rectangle002
  2. draw four Draft_Lines to create the inner rectange -> Line, Line001, Line002, Line003
  3. select Rectangle002, Line, Line001, Line002 and Line003 and use Part_BooleanFragments to create -> BooleanFragments001
  4. select BooleanFragments001 and use Part_CompoundFilter to create -> CompoundFilter001
  5. select CompoundFilter001 and use FEM_GmshFromShape to create -> FEMMeshGmsh001
  6. select FEMMeshGmsh001 and use FEM_MeshRegion, set a max element size (i.e. 100mm) and add one edge of the inner rectangle (i.e. Line002)
As you can see the mesh refinement now happens not for the selected edge :?:
Screenshot_02.png
Screenshot_02.png (35.23 KiB) Viewed 875 times
Here my FreeCAD info and my test file:

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.27518 (Git)
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: German/Germany (de_DE)
Attachments
meshRegion_test.FCStd
(67.68 KiB) Downloaded 19 times
Last edited by balrobs on Tue Apr 12, 2022 8:26 am, edited 1 time in total.
user1234
Veteran
Posts: 3502
Joined: Mon Jul 11, 2016 5:08 pm

Re: [Bug?] FEM_MeshRegion

Post by user1234 »

balrobs wrote: Mon Apr 11, 2022 2:00 pm Here my FreeCAD info
Which gmsh version are you using?

The question is, if the second is valid. It have 7 wires.

0.png
0.png (267.96 KiB) Viewed 826 times

Generally, gmsh need between i mesh region and a second defined region (also the default values), an extra empty region (3rd face in your case) for the transition.

1.png
1.png (280.77 KiB) Viewed 826 times

meshRegion_test_edit.FCStd
(29.22 KiB) Downloaded 25 times


Greetings
user1234
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Bug?] FEM_MeshRegion

Post by balrobs »

Thanks user1234 for your answer :D
user1234 wrote: Mon Apr 11, 2022 5:22 pm Which gmsh version are you using?
4.9.3
user1234 wrote: Mon Apr 11, 2022 5:22 pm Generally, gmsh need between i mesh region and a second defined region (also the default values), an extra empty region (3rd face in your case) for the transition.
OK, now I start better understanding how mesh region works.
May I then ask you please if you know a way to create a mesh refinement around an edge or point geometry for a 2d mesh without first creating geometry regions in the model but controling both mesh size and refinement extension within the refinement object?
Something like this:
mesh_refinement_around_line_and_point.JPG
mesh_refinement_around_line_and_point.JPG (250.38 KiB) Viewed 766 times
Hope my request makes sense
Kind regards
balrobs
user1234
Veteran
Posts: 3502
Joined: Mon Jul 11, 2016 5:08 pm

Re: [Bug?] FEM_MeshRegion

Post by user1234 »

balrobs wrote: Tue Apr 12, 2022 9:05 am Something like this
I tried to archive that in more ways, but nothing works for me. Also the mesh region is sometimes pretty mysterious to me. Maybe someone other have a proper answer. Sorry.

Greetings
user1234
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Bug?] FEM_MeshRegion

Post by balrobs »

user1234 wrote: Tue Apr 12, 2022 1:52 pm I tried to archive that in more ways, but nothing works for me. Also the mesh region is sometimes pretty mysterious to me. Maybe someone other have a proper answer. Sorry.
Nevertheless, thank you very much :D
Basically I'm able to achieve my goal with Gsmh scripting but can't figure out how to do it in FreeCAD :cry:

Code: Select all

lc = 0.5;
Point(1) = {0.0, 0.0, 0.0, lc};
Point(2) = {5.0, 0.0, 0.0, lc};
Point(3) = {5.0, 5.0, 0.0, lc};
Point(4) = {0.0, 5.0, 0.0, lc};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Curve Loop(1) = {1, 2, 3, 4};
Plane Surface(1) = {1};
lc2 = 0.02;
Point(5) = {4.0, 4.0, 0.0, lc2};
Point{5} In Surface{1};
lc3 = 0.05;
Point(6) = {1.0, 1.0, 0.0, lc3};
Point(7) = {2.0, 4.0, 0.0, lc3};
Line(5) = {6, 7};
Line{5} In Surface{1};
gmsh.jpg
gmsh.jpg (147 KiB) Viewed 700 times
Post Reply