As far as I know only by the use of the clipping plane tool. But you never know there might be some never used method inside FEM API like the NodeSet tool we encountered just a few days ago. Here you can see all implemented Python methods for the mesh view provider. https://github.com/FreeCAD/FreeCAD/blob ... MeshPy.xml may be you could use this ... https://github.com/FreeCAD/FreeCAD/blob ... Py.xml#L57joha2 wrote:Edit2: Is there any possibility to draw only certain elements (i.e. to switch "off" the others in the ViewObject)?
Fenics as Solver
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Fenics as Solver
Re: Fenics as Solver
Hi bernd,
yeah I searched the ViewObjects methods and variables for an appropriate function, but I didn't find something. I know the following request is a huge amount of work, but I will ask you anyway : Is it possible to add this functionality at the C++ code level to the FemMesh object?
yeah I searched the ViewObjects methods and variables for an appropriate function, but I didn't find something. I know the following request is a huge amount of work, but I will ask you anyway : Is it possible to add this functionality at the C++ code level to the FemMesh object?
Re: Fenics as Solver
Extending the mesh view provider to allow such stuff is for sure on my TODO. But this will not happen soon (implemented by me, may be some other will give it a try). There are other things which I'm not able to use other tools like GMSH for. Thus I will implement them first.joha2 wrote:Hi bernd,
yeah I searched the ViewObjects methods and variables for an appropriate function, but I didn't find something. I know the following request is a huge amount of work, but I will ask you anyway : Is it possible to add this functionality at the C++ code level to the FemMesh object?
BTW: What I do at the moment is use GMSH for all kind of display tools in the regard of a FEM mesh.
Re: Fenics as Solver
So you export the mesh into a format readable by GMSH and do the visualization there? I thought about using GMSH either, but from my first impression the GMSH gui behaves strange Although GMSH would be my next choice after FreeCAD to generate a FEM mesh.bernd wrote: BTW: What I do at the moment is use GMSH for all kind of display tools in the regard of a FEM mesh.
Re: Fenics as Solver
If I need some tools which are not available in FreeCAD at the moment like elementface numbers and node numbers. Both needs work araounds in FreeCAD. In GMSH it is just an checkbox and all nodes or elementfaces have numbers. As exchange format I use unv or med.joha2 wrote:So you export the mesh into a format readable by GMSH and do the visualization there? I thought about using GMSH either, but from my first impression the GMSH gui behaves strange Although GMSH would be my next choice after FreeCAD to generate a FEM mesh.bernd wrote: BTW: What I do at the moment is use GMSH for all kind of display tools in the regard of a FEM mesh.
bernd
Re: Fenics as Solver
Hey bernd,
I just coded a mesh export for Fenics for a new format (.xdmf, which is state of the art) in a macro and I saw that there is a lot of stuff to be done which is the same like for the .xml. Other stuff is very different, though. For the implementation in the source tree I would like to separate the import/export stuff for those two file formats (and also the helper functions) into different files. Is there some best practice way to do this (file naming, necessary sub directories, ...)?
My suggestion would something like:
importFenicsXML.py
exportFenicsXML.py
importFenicsXDMF.py
exportFenicsXDMF.py
FEMfenicsMeshHelpers.py
Edit: I saw that netgen and gmsh mesh objects have different interfaces. Is it possible to unify the interfaces in some sense to make exports and imports more easy?
Best wishes
Johannes
I just coded a mesh export for Fenics for a new format (.xdmf, which is state of the art) in a macro and I saw that there is a lot of stuff to be done which is the same like for the .xml. Other stuff is very different, though. For the implementation in the source tree I would like to separate the import/export stuff for those two file formats (and also the helper functions) into different files. Is there some best practice way to do this (file naming, necessary sub directories, ...)?
My suggestion would something like:
importFenicsXML.py
exportFenicsXML.py
importFenicsXDMF.py
exportFenicsXDMF.py
FEMfenicsMeshHelpers.py
Edit: I saw that netgen and gmsh mesh objects have different interfaces. Is it possible to unify the interfaces in some sense to make exports and imports more easy?
Best wishes
Johannes
Re: Fenics as Solver
sounds good to me.joha2 wrote: My suggestion would something like:
importFenicsXML.py
exportFenicsXML.py
importFenicsXDMF.py
exportFenicsXDMF.py
Are the helpers really Fenics specific? there is a module for import / export helpers already. see importToolsFem.py https://github.com/FreeCAD/FreeCAD/blob ... oolsFem.pyjoha2 wrote:FEMfenicsMeshHelpers.py
What do you mean with this ? They have different interfaces in sense of getting the mesh, but for export import the data model behind is important. They both are based on the same FemMesh class object. It should not make a difference on export. On import you would not create either of them because you would just create a Fem.FemMesh() .joha2 wrote:Edit: I saw that netgen and gmsh mesh objects have different interfaces.
bernd
Re: Fenics as Solver
Should I put these into another sub directory or should they stay at the import/export file location?bernd wrote: sounds good to me.
Some of them are, some are not. OK, I will first check whether there are Fenics specific helpers. If not I will implement the helpers into the file you mentioned.bernd wrote: Are the helpers really Fenics specific?
To be more specific: For the Fenics export, I asked the FreeCAD object whether the geometric elements are second order.bernd wrote: What do you mean with this ? They have different interfaces in sense of getting the mesh, but for export import the data model behind is important. They both are based on the same FemMesh class object. It should not make a difference on export. On import you would not create either of them because you would just create a Fem.FemMesh() .
bernd
For netgen this is a boolean variable and for gmsh it is string ('1st', '2nd'). So from your answer I take away, that it is bad practise to rely code functionality on the underlying FreeCAD object?
Best wishes and thanks for your fast answer
Johannes
Re: Fenics as Solver
No, not another sub directory, just src/Mod/Fem/*.pyjoha2 wrote:Should I put these into another sub directory or should they stay at the import/export file location?bernd wrote: sounds good to me.
These both properties are passed to the mesher to create first order or second order FEM mesh, they do not say anything about the order of the mesh which has been passed back from the mesher ! BTW What would you do if the mesh is non of both! See attached file with simple either first order and second order femmesh ...joha2 wrote:To be more specific: For the Fenics export, I asked the FreeCAD object whether the geometric elements are second order.bernd wrote: What do you mean with this ? They have different interfaces in sense of getting the mesh, but for export import the data model behind is important. They both are based on the same FemMesh class object. It should not make a difference on export. On import you would not create either of them because you would just create a Fem.FemMesh() .
bernd
For netgen this is a boolean variable and for gmsh it is string ('1st', '2nd'). So from your answer I take away, that it is bad practise to rely code functionality on the underlying FreeCAD object?
- Attachments
-
- simple_femmesh_class.fcstd
- (5.1 KiB) Downloaded 37 times
Re: Fenics as Solver
Ah I see your point . Thanks for the file! So in principal I have to check for the second order elements to be sure whether there is a second order mesh or not.
Best wishes Johannes
Best wishes Johannes