problems with Elmer results back read

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

problems with Elmer results back read

Post by HoWil »

Hello,
The current problems with reading back the results from Elmer into FC are maybe related to some naming problems of the generated .vtk files.
Seems like now ElmerSolver produces "case_t0001.vtu" files instead of the origianlly hardcoded "case0001.vtu".
I posted a related question in the Elmer-FEM forum: http://www.elmerfem.org/forum/viewtopic.php?f=3&t=6963
If the elmer-devs do confirm the changes in the filename, then we should change the following....
Related code in FC from https://github.com/FreeCAD/FreeCAD/blob ... r/tasks.py

Code: Select all

class Results(run.Results):

    def run(self):
        if self.solver.ElmerResult is None:
            self._createResults()
        postPath = os.path.join(self.directory, "case0001.vtu")
        self.solver.ElmerResult.read(postPath)
        self.solver.ElmerResult.getLastPostObject().touch()
        self.solver.Document.recompute()

    def _createResults(self):
        self.solver.ElmerResult = self.analysis.Document.addObject(
            "Fem::FemPostPipeline", self.solver.Name + "Result")
        self.solver.ElmerResult.Label = self.solver.Label + "Result"
        self.analysis.addObject(self.solver.ElmerResult)
BR,
HoWil
qingfeng.xia
Posts: 227
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford UK/Shenzhen China
Contact:

Re: problems with Elmer results back read

Post by qingfeng.xia »

how about check both types of names in python code?
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
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: problems with Elmer results back read

Post by HoWil »

qingfeng.xia wrote: Sun Jan 26, 2020 3:59 pm how about check both types of names in python code?
Yes this is would be a short term solution. As long as we do not know if it will be changed again and why it was changed, i suggest to wait.
I hope we get some answers on the Elmer-forum tomorrow and than we can decide if we build in some 'intelligence' in finding the proper result (newest file starting with 'case' and ending with '.vtk'....) or if it just stays the way it is but with 't' instead of a '0' :D.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: problems with Elmer results back read

Post by bernd »

would you try latest FreeCAD?


qingfeng.xia wrote: Sun Jan 26, 2020 3:59 pm how about check both types of names in python code?
git commit 2edabee
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: problems with Elmer results back read

Post by HoWil »

Thx, will hopefully be able to try it today.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: problems with Elmer results back read

Post by HoWil »

As discussed here: http://www.elmerfem.org/forum/viewtopic ... 076#p22076
both cases for the .vtu file can happen but the new version is "case_t0001.vtu".
Since Bernd did already change the tasks.py to look for both cases (https://github.com/FreeCAD/FreeCAD/commit/2edabee) everything should be fine again.
I could test the changes made by Bernd and everything works as expected (after saving the file and doing a File->Revert). Nice!!!

@Bernd: Last small Question: Why is the 'SolverElmerOutput' not added to the Analysis-Object?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: problems with Elmer results back read

Post by bernd »

HoWil wrote: Mon Jan 27, 2020 7:37 pm @Bernd: Last small Question: Why is the 'SolverElmerOutput' not added to the Analysis-Object?
it is ... https://github.com/FreeCAD/FreeCAD/blob ... ks.py#L128 but this does not seam to work ... :(
Post Reply