I just split "write_geo()" into several subfunction, so "write_geo()" is just a skeleton, otherwise, it write_geo is too long. That kind of spliting is half done by you in 2017, I further moved out a big piece of code into "write_group()", I did not touch any substantial business logic flow.bernd wrote: ↑Tue Sep 03, 2019 4:13 pm the get_group_data and write_group needs to be reviewed: https://github.com/berndhahnebach/FreeC ... 9R342-R661 ATM I have no idea why all this group code has changed and I have not tested your implementations. Would be good if you could give some feedback what is happening and what is your indentation.
Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
git commit 8eadf5b just set in FEM pref to beside FCStd file
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
ahh ok for your export to work this would not be needed. It is just for better coding style. I agree it should be moved out and make the write_geo() smaller, but this should go into a separate commit and not in the same commit as the new export feature. I may have a look.qingfeng.xia wrote: ↑Fri Sep 06, 2019 7:48 amI just split "write_geo()" into several subfunction, so "write_geo()" is just a skeleton, otherwise, it write_geo is too long. That kind of spliting is half done by you in 2017, I further moved out a big piece of code into "write_group()", I did not touch any substantial business logic flow.bernd wrote: ↑Tue Sep 03, 2019 4:13 pm the get_group_data and write_group needs to be reviewed: https://github.com/berndhahnebach/FreeC ... 9R342-R661 ATM I have no idea why all this group code has changed and I have not tested your implementations. Would be good if you could give some feedback what is happening and what is your indentation.
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
still ... have a look at https://github.com/berndhahnebach/FreeC ... gmshexport in commit https://github.com/berndhahnebach/FreeC ... c334acfaf7
your group code differs quite a lot from master group code. Would you give some hints ... ?
your group code differs quite a lot from master group code. Would you give some hints ... ?
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
sure, I will give you a short report/summary today.bernd wrote: ↑Sat Sep 07, 2019 9:12 pm still ... have a look at https://github.com/berndhahnebach/FreeC ... gmshexport in commit https://github.com/berndhahnebach/FreeC ... c334acfaf7
your group code differs quite a lot from master group code. Would you give some hints ... ?
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
I copy/restore write_group_data() and get_group_data() from latest official master. All my previous modification has gone into this get_constraint() and write_constraint(), I needs them for OpenFOAM and Fenicsbernd wrote: ↑Sat Sep 07, 2019 9:12 pm still ... have a look at https://github.com/berndhahnebach/FreeC ... gmshexport in commit https://github.com/berndhahnebach/FreeC ... c334acfaf7
your group code differs quite a lot from master group code. Would you give some hints ... ?
`femtools.get_analysis_group_elements()` may serve to export mesh associating boundary condition, but it does not work for C++ class
Code: Select all
#femtools.get_analysis_group_elements()
# some C++ Constraints have a not used References Property
# it is set to Hidden in ReadOnly and PropertyEditor
In write_group()
sources of groups:
1. FemMeshGroup: identifier of geometry for mesh exporing
2. femtools.get_analysis_group_elements()
3. self.constraint_objects, which is not yet merged in `get_group_data() or femtools.get_analysis_group_elements()`,
Code: Select all
# I sugggest we need to keep track of self.volume_group_number, self.face_group_number
def write_contraints(self, geo):
# export boundary and subdomain meshesing
# TODO: renamed to self.volume_group_number, face_group_number,
# to cooprarate write_group()
boundaries = 0 # count the boundary(2D surface) with boundary condition information
domains = 0 # count the calculation domains or body contraints, i.e. solid for 3D a simulation
# these 2 counts is useful to report, also some solver like Fenics need interior domain exported
Code: Select all
def get_constraint_data(self):
# group from C++ class FemConstraint objects of analysis object
self.constraint_objects = OrderedDict()
if self.analysis:
print(' collect constraint group for analysis object')
for m in self.analysis.Group:
if m.isDerivedFrom("Fem::Constraint"):
if len(m.References):
self.constraint_objects[m.Name] = list(m.References[0][1])
else:
FreeCAD.Console.PrintWarning('Constraint object `{}` has empty References'.format(m.Label))
print("self.constraint_objects = ", self.constraint_objects)
else:
print(' No anlysis is provided to get FemCconstraint group')
Code: Select all
def write_constraint():
boundaries = 0 # count the boundary(2D surface) with boundary condition information
domains = 0 # count the calculation domains, i.e. solid for 3D a simulation
# these 2 counts is useful to report, also some solver like Fenics need a default
...
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
great!
Would you provide a branch with all your new updates?
Would you provide a branch with all your new updates?
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
I splitted your branch into two branches since it consists of two changes:
https://github.com/berndhahnebach/FreeC ... gmshexport only has the gmsh mesh export. I would like to get this into master ASAP
https://github.com/berndhahnebach/FreeC ... gmshgroups the group changes, to be fixed after the export is merged.
Would you give the export a try if it still works for you as expected?
cheers bernd
https://github.com/berndhahnebach/FreeC ... gmshexport only has the gmsh mesh export. I would like to get this into master ASAP
https://github.com/berndhahnebach/FreeC ... gmshgroups the group changes, to be fixed after the export is merged.
Would you give the export a try if it still works for you as expected?
cheers bernd
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
@qingfeng.xia:
Would you try the exports?
any updates? Would be good if we could get this into master? Do you have a branch for this? My latest branch is https://github.com/berndhahnebach/FreeC ... gmshexport First we should only get the export into master, than the groups code.
One questions:
What is the method export_fenics_mesh for? It is not called from everywhere? Is it related to the fenics modules?
https://github.com/berndhahnebach/FreeC ... #L128-L165
Would you try the exports?
any updates? Would be good if we could get this into master? Do you have a branch for this? My latest branch is https://github.com/berndhahnebach/FreeC ... gmshexport First we should only get the export into master, than the groups code.
One questions:
What is the method export_fenics_mesh for? It is not called from everywhere? Is it related to the fenics modules?
https://github.com/berndhahnebach/FreeC ... #L128-L165
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Feature: add extra FemMesh mesh file export format, potentially usable by other solvers
I will have a look, it may take time to restart on that branch, as fem_gmsh have evolved a lot since then.
For fenics_ mesh, it was too outdated, should be removed.
For fenics_ mesh, it was too outdated, should be removed.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd