Fenics as Solver

About the development of the FEM module/workbench.
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fenics as Solver

Postby bernd » Sun Mar 19, 2017 10:36 pm

joha2 wrote:Ah I see your point :mrgreen:. 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.
Yes. There is nothing in python AFAIK. If you gone write some def we could add it to FemMeshTools.py right under https://github.com/FreeCAD/FreeCAD/blob ... s.py#L1319
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fenics as Solver

Postby bernd » Sun Mar 19, 2017 10:39 pm

joha2
Posts: 69
Joined: Tue Oct 11, 2016 9:48 pm

Re: Fenics as Solver

Postby joha2 » Sat Mar 25, 2017 5:23 pm

After splitting the import/export code into several files I have the problem of open which was renamed to pyopen. If there is any import/export in the same file, I know that I have to substitute open by pyopen. But now the situation changed. The open is accessed in another name space/module. So it is still necessary to reference to pyopen? I think not, because the open command is only overwritten in the main import/export file.

Best wishes
Johannes
User avatar
bernd
Posts: 3924
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fenics as Solver

Postby bernd » Sat Mar 25, 2017 6:30 pm

check OpenSCAD workbench AFAIK they have splitted the import and export too.
joha2
Posts: 69
Joined: Tue Oct 11, 2016 9:48 pm

Re: Fenics as Solver

Postby joha2 » Sun Mar 26, 2017 8:27 am

Thanks for the hint! They just splitted import and export in different files and doubled the open -> pyopen redefinition in every file. My situation is a bit different; I used 4 files to write the code for import/export (xml and xdmf), but the main file which couples this code to FreeCAD stays the same and just imports those 4 files.

https://github.com/joha2/FreeCAD/blob/f ... icsMesh.py

In the other files, there is just the normal open used, see e.g. last lines of

https://github.com/joha2/FreeCAD/blob/f ... icsXDMF.py

Best wishes
Johannes
joha2
Posts: 69
Joined: Tue Oct 11, 2016 9:48 pm

Re: Fenics as Solver

Postby joha2 » Wed Mar 29, 2017 12:06 am

Heyhey bernd,

I opened a brandnew pull request for Fenics XDMF export to your Femdev branch :mrgreen:
I tested the code with several gmsh and netgen created meshes and it worked. (At least after import into Paraview. :-))

Best wishes
Johannes