Felt in FEM Workbench

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Wed May 15, 2019 7:03 pm

To compile FreeCAD I use this script ... https://github.com/berndhahnebach/FreeC ... Qt5_Py3.sh

your way on debuging seam good to me.

Do you have a github where I can see your code? I might have an idea too where the problem is.
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Wed May 15, 2019 7:41 pm

bernd wrote:
Wed May 15, 2019 7:03 pm
To compile FreeCAD I use this script ... https://github.com/berndhahnebach/FreeC ... Qt5_Py3.sh
+1
That's a well written script.
I have a few doubts:

Code: Select all

sudo apt-get dist-upgrade -y
Why go for the dist-upgrade?
Also, whats the function of the y flag?

bernd wrote:
Wed May 15, 2019 7:03 pm
your way on debugging seam good to me.
s/seam/seems/
Thanks! :)

bernd wrote:
Wed May 15, 2019 7:03 pm
Do you have a github where I can see your code? I might have an idea too where the problem is.
Its here.
Though I haven't committed the latest changes.
I was planning to commit after getting the felt solver to execute properly.
Should I just commit the latest changes and push them?
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Wed May 15, 2019 9:05 pm

Sudhanshu wrote:
Wed May 15, 2019 6:55 pm
Investigating that, I got to know about the subprocess library of python which is used in tasks.py.
And it looks really interesting ;)
So now I will explore this, run the solver in python (outside of FreeCAD) and implement that tasks.py.
So I did the investigation and now I know the basics of subprocess.
Also, I was able to run felt solver using python with the following code:

Code: Select all

>>> p = subprocess.Popen(["felt","beam.flt"], cwd="/home/sudhanshu/Documents/Python/", stdout=subprocess.PIPE)
and print(p.communicate()[0]) would give me the output that I needed.

But now I am confused as to what we are doing in the tasks.py :?:
I completely understand this part:

Code: Select all

binary = '/usr/bin/felt'  # if something goes wrong the binary path could be set for debugging
        if binary is not None:
      	    self._process = subprocess.Popen(
                [binary, infile],
                cwd=self.directory,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE)
            self.signalAbort.add(self._process.terminate)
But what are we doing here:

Code: Select all

output = self._observeSolver(self._process)
Where is _observeSolver() defined and what is it doing with the subprocess.
Why are we later on deleting "output" without seemingly doing nothing with it?

And I think I better start writing comments for the code, which bring up the question why aren't there much comments in the file of FEM module?
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Thu May 16, 2019 12:09 pm

in the regard of the compile script. This runs for me on a vagrant box, means on a clean fresh debian buster, thus I upgrade the box to the latest version.You do not need this. The -y is to overcome the questions ask. "Do you really would like to install?" etc. With -y the script passes by all the questions.

Eventually, start the script, go and get yourself a caffee or a beer, enjoy the beer, come back to your computer aftet a while use fresh compiled FreeCAD :D

In the regard of comments, yes there should be more in FEM.
User avatar
hardeeprai
Posts: 164
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: Felt in FEM Workbench

Postby hardeeprai » Fri May 17, 2019 11:00 pm

Sudhanshu wrote:
Wed May 15, 2019 7:41 pm
Why go for the dist-upgrade?
Also, whats the function of the y flag?
Though "bernd" has answered. Assuming you to be hacker (on the basis of your approach/discussion/progress in this Forum), mine answer would have been:

Code: Select all

man apt-get
Of course, it would have missed his advise that give task to computer, in batch processing mode, and enjoy life. That is difference between GUI user who, (play with mouse, and computer keep engaging him) and a hacker, who wish to automate everything.

https://fossbytes.com/this-lazy-program ... f-his-job/
--
H.S.Rai