Mesh Settings

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Mesh Settings

Post by saso »

Just a thought, did you try if it works for just point (area, line, point) ? :roll:
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Mesh Settings

Post by HoWil »

bernd wrote:
bernd wrote:
sgrogan wrote:@bernd how do I make a FEM meshed cube with a square, triangle, circle on visible faces. Each meshed differently than the default cube. I'm behind on the Boolean fragment stuff.
See attaches file, but it did not work. See attached scree. I'll have a look.
Found the culprit. It is the compound. But it is something not that easy to fix. One problem are the exported node numbers from FreeCAD. But even if the node numbers are al right GMSH has problems if the shape is a Compound. The Solid or CompSolid has to be extracted from the Compound (BTW all booleans return Compounds: see viewtopic.php?t=16773) Best way to extract the Solid or CompSolid ist to use CompoundFilter from lattice2 workbench. Attached Screen and file ... I had to change the mesh region element size to add the file. Screen is made with 0.2

geometry_on_faces4.fcstd
screen.jpg
I tried to use PartDesingNext to achieve something similar and did partly fail. I created a sketch on top of a box and tested three different approaches of combining the box with the sketch:
* BooleanFragments of Sketch and box
* BooleanFragments of a Facebinder of the Sketch and box
* XOR of Sketch and box

for all three I get a solid as expected, with a circular face on the top face of the box. But i struggle to mesh this solids with a separate mesh-region setting for the circle (Face7 of boolean-fragments). Instead a finer mesh is created at a vertex of the solid.

Is this related to the problems reported above (wrong numbers of the compound between FC and Gmsh)?
Attachments
FC_mesh_faces_v1p0.fcstd
The FC file unsing a shapebinder.
(130.47 KiB) Downloaded 46 times
Screenshot from 2016-12-17 22-22-33.png
Screenshot from 2016-12-17 22-22-33.png (212.12 KiB) Viewed 2570 times
Screenshot from 2016-12-17 22-11-43.png
Screenshot from 2016-12-17 22-11-43.png (111.13 KiB) Viewed 2570 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Mesh Settings

Post by bernd »

HoWil wrote:Is this related to the problems reported above (wrong numbers of the compound between FC and Gmsh)?
yes, there are problems if a Compound is passed GMSH. Extract the Solid out of the Compound see my last post viewtopic.php?f=18&t=18780&start=40#p149467 for an explanation an how to do this. Attached screen and file:
FC_mesh_faces_bhb1.fcstd
(941.46 KiB) Downloaded 45 times
screen.jpg
screen.jpg (443.2 KiB) Viewed 2552 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Mesh Settings

Post by bernd »

the icon added:
meshregionicon.png
meshregionicon.png (6.75 KiB) Viewed 2550 times
added some messages and a pop up in the regard of compounds. From my point of view it is ready to make a PullRequest. Would be cool if some test would be made before I'm gone go for the PR.

I did some changes in the GMSH mesh object too. They all need to be recreated.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Mesh Settings

Post by bernd »

bernd wrote:
HoWil wrote:Is this related to the problems reported above (wrong numbers of the compound between FC and Gmsh)?
yes, there are problems if a Compound is passed GMSH. Extract the Solid out of the Compound see my last post viewtopic.php?f=18&t=18780&start=40#p149467 for an explanation an how to do this.
It is not the Compound it is the BooleanFragments Compound. The brep exported from a BooleanFragments Compound could be not the shape the user expects to be. If the CompoundFilter is used on a BooleanFragment and a Compound is made from this GMSH returns the expected result.

How to proceed? Be careful with passing a BooleanFragments Compound to GMSH mesh object. Use CompoundFilter on top of the BooleanFragment instead. We may should think about integrating the CompoundFileter in FreeCAD. I may have a look at this after merge into master. viewtopic.php?f=8&t=16773&start=10#p144537

attached the file. Try to change the shape to mesh from the mesh object. Use the Compound, the CompoundFilter and the BooleanFragments. See the differnent report errors and the different meshes (The BooldeanFragment returns a not expected mesh)
mesgregiontest7.fcstd
(962.12 KiB) Downloaded 43 times
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Mesh Settings

Post by HoWil »

I can't test this yet because I am on the way but I do have a short comment on the selection of inner solids from click or 'mouseover' and highlight the selected items as also discussed over here:
viewtopic.php?f=10&t=19072#p148870

For getting all elements below the cursor one can use:

Code: Select all

listObjects = FreeCADGui.ActiveDocument.ActiveView.getObjectsInfo((int(0),int(0))) # the two zeros are to my knowledge the coordinates in the drawing window, this can be replaces with coordinates from a click
print(listObjects)
For highlighting a element one can use for example:

Code: Select all

FreeCADGui.Selection.addSelection(FreeCAD.ActiveDocument.Pocket002,'Face6')
Sorry, I do not have the time to synthetize this a bit more but hope this is helpful.

ps.: You can easily test this with the 'Load a PartDesign example' from the FC-startpage and zoom the model until it fills the complete drawing window (so that the coordinates 0,0 will find a thing in the example above).
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Mesh Settings

Post by ulrich1a »

bernd wrote:the icon added:

meshregionicon.png
meshregionicon.png (6.75 KiB) Viewed 36 times
It looks like a png-Icon. A better scalability will be get with a svg-icon. Maybe agryson can help here?

Ulrich
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Mesh Settings

Post by bernd »

ulrich1a wrote:
bernd wrote:the icon added:
meshregionicon.png
meshregionicon.png (6.75 KiB) Viewed 36 times
It looks like a png-Icon. A better scalability will be get with a svg-icon.
I just added the png because an svg is not shown on the forum. See https://github.com/berndhahnebach/FreeC ... region.svg for the real svg
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Mesh Settings

Post by HoWil »

compiling again......
@bernd:
Can you please set the standard setting for the mesh region from 2mm to the standard-value 0mm of the overall gmsh-object.
I usually start testing with the 3D-beam example and there is the length of the beam 8000mm resulting in a forced-kill of FC. 8-)
EDIT:
I am not sure if there is a better setting for this.... 0mm results in only one element along the complete beam:
Screenshot from 2016-12-18 18-51-19.png
Screenshot from 2016-12-18 18-51-19.png (148.75 KiB) Viewed 2504 times
EDIT2:
0mm results in ....

Code: Select all

  The Part should have a pretty new FEM mesh!
Error   : Wrong mesh element size lc = 0 (lcmin = 0, lcmax = 1e+22)
Error   : Wrong mesh element size lc = 0 (lcmin = 0, lcmax = 1e+22)
Error   : Wrong mesh element size lc = 0 (lcmin = 0, lcmax = 1e+22)
Error   : Wrong mesh element size lc = 0 (lcmin = 0, lcmax = 1e+22)
Error   : Wrong mesh element size lc = 0 (lcmin = 0, lcmax = 1e+22)
..
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Mesh Settings

Post by HoWil »

bernd wrote: How to proceed? Be careful with passing a BooleanFragments Compound to GMSH mesh object. Use CompoundFilter on top of the BooleanFragment instead. We may should think about integrating the CompoundFileter in FreeCAD. I may have a look at this after merge into master. viewtopic.php?f=8&t=16773&start=10#p144537
The problems do in my test cases only happen when I select for instance a inner face in a 'Fusion' as long as I select only faces on the outside of the resulting body/solid everything works as expected.
Post Reply