another small update. It works on windows too.bernd wrote:small update to the macre the group mesh was created with:
https://gist.github.com/berndhahnebach/ ... 6df1c909bf
Better mesh last instead of mesh first?
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Better mesh last instead of mesh first?
Re: Better mesh last instead of mesh first?
The use of groupdata for speed up file writing for multibody material fem is in master 0.17.8584 (git commit 56b1530) An example can be downloaded here: http://www.b75.ch/download/multiple-mat ... mple.fcstd The mesh with group data needs 2.5 seconds on my laptop, the mesh without group data needs 270 seconds to write CalculiX input file. Be aware CalculiX itself takes quite some time too.
Re: Better mesh last instead of mesh first?
These are really good news.bernd wrote: The mesh with group data needs 2.5 seconds on my laptop, the mesh without group data needs 270 seconds to write CalculiX input file.
It sounds, like FreeCAD will make much more fun with real cases.
I need to check, what is needed to make pressure constraints fast as well.
Ulrich
Re: Better mesh last instead of mesh first?
The groups will be created for every reference shape if you use my GMSH macro. But they are used only for material solids. It's a bit more work to do to use the for constraint force and constraint pressure as these constraints do not work on element set but on the nodes directly. But try some speed tests. Most time consume is material multi body solid. The constraint pressure should be pretty fast.ulrich1a wrote:These are really good news.bernd wrote: The mesh with group data needs 2.5 seconds on my laptop, the mesh without group data needs 270 seconds to write CalculiX input file.
It sounds, like FreeCAD will make much more fun with real cases.
I need to check, what is needed to make pressure constraints fast as well.
Re: Better mesh last instead of mesh first?
This depends largely on the model. I am interested in stress in pressure vessels. There I have 1099 face elements and 52142 volumes. Writing this mesh takes 34 seconds on my machine and no gain from the element groups.bernd wrote:Most time consume is material multi body solid. The constraint pressure should be pretty fast
Due to my former analysis, the c++-code to get the node-list is one of bottlenecks. With a nodes-list already available, we need just to use this list instead of the internal call that calculates a long time in order to identify all needed nodes. An if-clause at the right place should give a performance advantage.
The other bottleneck may the python-code to calculate the face numbers. I will work on this one.
By the way, your macro does not work with the element sizes set to anything else than the default values. (At least at my system with a German setting.)
The following changes are needed: retrieving the numbers from the qt-user form should use the function value() instead of text()
I added also a str() in the code writing to the geo-file.
Code: Select all
def get_max_element_size(self):
# Max Element size
if self.element_size_max_dspin.text() == '0,00' or self.element_size_max_dspin.text() == '0.00':
self.clmax = '1e+22'
else:
#self.clmax = self.element_size_max_dspin.text()
self.clmax = self.element_size_max_dspin.value()
def get_min_element_size(self):
# Min Element size
if self.element_size_min_dspin.text() == '0,00' or self.element_size_min_dspin.text() == '0.00':
self.clmin = '0.0'
else:
#self.clmin = self.element_size_min_dspin.text()
self.clmin = self.element_size_min_dspin.value()
Code: Select all
geo.write("Mesh.CharacteristicLengthMax = " + str(self.clmax) + ";\n")
geo.write("Mesh.CharacteristicLengthMin = " + str(self.clmin) + ";\n")
Re: Better mesh last instead of mesh first?
Sure they only work on material solids at the moment.ulrich1a wrote:This depends largely on the model. I am interested in stress in pressure vessels. There I have 1099 face elements and 52142 volumes. Writing this mesh takes 34 seconds on my machine and no gain from the element groups.bernd wrote:Most time consume is material multi body solid. The constraint pressure should be pretty fast
OK, I will come up with something which uses the groups for pressure too. I'm curious how you will solve the face nomber in a fast way.ulrich1a wrote:Due to my former analysis, the c++-code to get the node-list is one of bottlenecks. With a nodes-list already available, we need just to use this list instead of the internal call that calculates a long time in order to identify all needed nodes. An if-clause at the right place should give a performance advantage.
The other bottleneck may the python-code to calculate the face numbers. I will work on this one.
I will adapt this.ulrich1a wrote:By the way, your macro does not work with the element sizes set to anything else than the default values. (At least at my system with a German setting.)
The following changes are needed: retrieving the numbers from the qt-user form should use the function value() instead of text()
I added also a str() in the code writing to the geo-file.
Bernd
Re: Better mesh last instead of mesh first?
Fixed, and a few minor improvements. Mostly prints. Would you give it a try?ulrich1a wrote:By the way, your macro does not work with the element sizes set to anything else than the default values. (At least at my system with a German setting.)
Re: Better mesh last instead of mesh first?
Setting the characteristic length does work now. The script does not find the shape for the simple case of only one MechanicalMaterial without references. So I changed it a little bit, in order to handle this case.bernd wrote:Would you give it a try?
The changed script is attached below. I used the following simple testcase: It seems I need a more sophisticated work flow for collaborative work. Is it possible to make pull requests on a gist?
Ulrich
- Attachments
-
- GMSH_Mesh_with_groups2.py.zip
- (5.32 KiB) Downloaded 36 times
Re: Better mesh last instead of mesh first?
Ahh yes, I never tested with the simplest of all, just one material ... I will have a look at your script.ulrich1a wrote:Setting the characteristic length does work now. The script does not find the shape for the simple case of only one MechanicalMaterial without references. So I changed it a little bit, in order to handle this case.bernd wrote:Would you give it a try?
The changed script is attached below. I used the following simple testcase: It seems I need a more sophisticated work flow for collaborative work. Is it possible to make pull requests on a gist?
In the regard of workflow and PullRequest to gist. i do not know. You can comment. How about this: https://github.com/berndhahnebach/FreeC ... mgmshgroup and https://github.com/berndhahnebach/FreeC ... ps.FCMacro
I just copied it to FEM source and made a branch in my repo. You should be able to make an Pull Request.
I have already been thinking what is the best way to get this into FreeCAD. The ideas is to move all helper methods from the Macro to FemMeshTools.py module in FEM. The Macro could be moved to a separate Tool in FEM. But we first need to get in working.
What do you think?
bernd
Re: Better mesh last instead of mesh first?
I did it slightly different How about this? https://github.com/berndhahnebach/FreeC ... ab09f74801ulrich1a wrote:The script does not find the shape for the simple case of only one MechanicalMaterial without references. So I changed it a little bit, in order to handle this case.
https://gist.github.com/berndhahnebach/ ... 6df1c909bf
or
https://github.com/berndhahnebach/FreeC ... ps.FCMacro