Elmer Integration (GSoC) - Activity Log

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Elmer Integration (GSoC) - Activity Log

Post by yorik »

wmayer wrote: Wed Jun 07, 2017 12:11 pmI don't know if you need more but there is already a generic open function that will open a Python editor when opening a py file or script.
One more "thing that was in FreeCAD since the beginning but that I only discovered now" for my collection :D
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

Thanks for all the suggestions! For now i'm going to stick to implementing a EditorView that directly edits the "Text" property.
joha2 wrote: Wed Jun 07, 2017 6:02 am Is it possible to add for these type of tasks a new property (e.g. PropertySourceCode) which has a property editor with syntax highlighting? I think such a property could at least be useful for all the FEM guys who implement their own solver since they have to prepare a script file at some point in the solution process for communication with the solver.
Hmm, I think one way to implement this would be a PropertyItem that only shows a button which will open a full size EditorView? Don't know if that makes sense though. Maybe a hidden Text property and a doubleClicked method that opens the editor would be sufficient. The syntax highlighting part would have to be implemented separately in the editor anyway (doesn't matter which property type).
My GSoC Devlog: ceeli.github.io/gsoc
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

A new document object type TextDocument would be quite helpful. Maybe with a Text and a FileType property? Or does something like that already exist?
My GSoC Devlog: ceeli.github.io/gsoc
joha2
Posts: 303
Joined: Tue Oct 11, 2016 9:48 pm

Re: Elmer Integration (GSoC) - Activity Log

Post by joha2 »

@wmayer nice one! I was not aware that opening those files is so simple. @m42kus I also thought about such solutions, but since I am not experienced enough with the FreeCAD API I didn't know how to implement e.g. PropertyItems with just a button to do something. The other solution, you suggested is also interesting and I think both would be useful to all users who need a scripting interfaces besides the macros. Unfortunately I am not aware that these user defined document type, you mentioned, exists. :-(

Best wishes
Johannes
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

So, today I implemented the before mentioned TextDocument object as well as an editor which operates directly on the Text property of the TextDocument. There are no python bindings yet and I still need to test it a little.

I think i should handle that change seperately from the Elmer integration project? Maybe even make a separate topic to discuss it?
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Elmer Integration (GSoC) - Activity Log

Post by yorik »

m42kus wrote: Thu Jun 08, 2017 6:22 pmI think i should handle that change seperately from the Elmer integration project? Maybe even make a separate topic to discuss it?
If you added a new object type outside of FEM, it's always a good idea to separate that in another branch, and submit a pull request only for that. It makes it much easier for us to merge, and afterwards to find /identify issues, and it's cleaner when pull requests are either for core features only, or module-only.

If you wish to discuss that further, it could be in this thread or another, as you prefer!
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

Time for a new status update and I also have a new video to share :D

phpBB [video]


The video shows the TextDocument object together with the new TextDocumentEditorView MDIView widget. The SifFile is atm only a TextDocument which is by default initialized with the text shown in the video. I consider phase 1 to be finished now (excluding bug fixes of course). The code used to record the video above is avaliable at https://github.com/drhooves/FreeCAD.git elmer_integration. Feel free to test it and report in this thread. Feedback is very welcome :)

The implementation of the TextDocument is far from perfect but it works for the Elmer Integration project. I think that there would be much potential in a more general approach to text documents in FreeCAD. Im on holiday for the next three days but I will defenitely start a discussion about that after I'm home again.

I don't know jet how much I'm able to reply to comments the next days but as soon as im home I will do so at once ;)
My GSoC Devlog: ceeli.github.io/gsoc
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

My plan for next week
As I already said I will start a discussion about text documents in FreeCAD. That shouldn't take too much time though. Most of time time next week will go to fixing bugs and initiating the development of a sif-file-generation library, hopefully together with the guys behind https://github.com/physici/ElmerSalomeModule. They already showed some interest into doing so ;)
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Elmer Integration (GSoC) - Activity Log

Post by yorik »

m42kus wrote: Fri Jun 09, 2017 6:09 pmThe video shows the TextDocument object together with the new TextDocumentEditorView MDIView widget.
Excellent feature! You will certainly get hundreds of ideas of improvements, but it seems to me already pretty useful as it is.
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Elmer Integration (GSoC) - Activity Log

Post by m42kus »

Hi, sorry for the long delay since my last update. I was very busy with a project for university last week and couldn't get as much done as I hoped.

Anyway, this week I coded the sif file generator and also added support for the fixed and force constraint objects. The video below shows a run that solves the example 3D beam analysis with elmer.

phpBB [video]


As you may have noticed in the video I generated MeshGroups before solving the analysis. Right now this is required because of the way I export the mesh: export unv -> convert with ElmerGrid to native elmer format. Without groups I wouldn't be able to refer to the faces/body in the sif file.

There a feature in FemGmshTools that creates groups for each constraint, but as I can tell they way it does it is problematic: The native elmer mesh format only supports one name for each boundary element. And if two constraint objects refere to the same face FemGmshTools creates two names which can't possibly work for elmer.

There are other issues with meshing about which I'm going to write more tomorrow. It's going to include the problems that I see (for the Elmer Integration project as well as more general ones) and solution proposals I already thought and talked about a little with HoWil.

Edit: I'm going to rebase the code used for the video above tomorrow into the elmer_integration branch.
My GSoC Devlog: ceeli.github.io/gsoc
Post Reply