FEMoctave, a simple Finite Element package

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

FEMoctave, a simple Finite Element package

Andreas Stahel-6
Dear Octave users

After a long hiatus (2005) a new version of the FEMoctave package is
available.
It might be useful to learn or teach FEM.

Find the documentation at
https://web.sha1.bfh.science/FEMoctave/doc/FEMdoc.pdf
and the source for the package at
https://web.sha1.bfh.science/FEMoctave2.0.1.tgz

To install on a UNIX read the README.TXT. For other operations systems
modify the Makefile.

With best regards

Andreas Stahel

--
Andreas Stahel
Mathematics, BFH-TI  E-Mail: Andreas.Stahel@[ANTI-SPAM]bfh.ch
Quellgasse 21        HuCE, Institute for Human Centered Engineering
CH-2502 Biel         WWW:   https://web.sha1.bfh.science
Switzerland          Phone: ++41 +32 32 16 258


Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element package

nrjank
Administrator
> To install on a UNIX read the README.TXT. For other operations systems
> modify the Makefile.


I'm actually quite intrigued by this, but mainly operate in a windows environment. From your  README:

"To install this package proceed as follow (on a UNIX system). It is possible to install the package on Win but do not ask me how to
proceed."

Looking at your unix installation instructions, could this be converted into an octave package such that built in pkg manage could handle installation/compilation? Then depending on what's involved, it may get to a broader audience.


Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element package

nrjank
Administrator
On Fri, May 15, 2020, 1:34 AM Andreas Stahel <[hidden email]> wrote:
Dear Nicholas

Thank you for the feedback. And yes, you are absolutely right.
It is possible to make a packa out of it. I tried but could not figure
aout the details.
And testing is impossible, as I have no Win* or Mac system.
The compilations steps are rather small for FEMoctave.

Please always keep the help list cc'd. thankfully octave is a community maintained project. It's possible someone on the list could help with turning it into a package. Most people running windows likely don't have to build tools to perform even "small" compilation steps, so packaging this might be the only way to get it to most of those users.  



Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element package --> reply to help list

Nicklas Karlsson
> >
> > Yes if remember to press button reply all but it seems common here many do
> > not so it might be a good idea to change on server.
> >
>
> what server? This is an email list. Are you using the nabble archive
> interface? I don't think that's under control of anyone involved in the
> project.  I think, though, that it has a reply to list option.

Read this http://david.woodhou.se/reply-to-list.html and think they concluded reply to all is the best solution though it is easy to forget.

Regards Nicklas Karlssong


Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element package --> reply to help list

nrjank
Administrator
>Read this http://david.woodhou.se/reply-to-list.html and think they concluded reply to all is the best solution though it is easy to forget.

Interesting read. In any case, on this list as long as you include the list in the reply in some way. Someone might be able to help you turn femoctave into a package so people like me can give it a try. :)



Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element package

marco atzeri-2
In reply to this post by nrjank
On 14.05.2020 21:20, Nicholas Jankowski wrote:

>  > To install on a UNIX read the README.TXT. For other operations systems
>  > modify the Makefile.
>
>
> I'm actually quite intrigued by this, but mainly operate in a windows
> environment. From your  README:
>
> "To install this package proceed as follow (on a UNIX system). It is
> possible to install the package on Win but do not ask me how to
> proceed."
>
> Looking at your unix installation instructions, could this be converted
> into an octave package such that built in pkg manage could handle
> installation/compilation? Then depending on what's involved, it may get
> to a broader audience.
>
>

it builds fine under Cygwin and octave 5.2.0 with minimimal
modification of the Makefile.

I guess the conversion to a Octave package should be easy,
I will look on this.

Andreas,

one issue on the PDF documentation, as I tested the first example on
page 8 LaplaceRectangle.m

the APOSTROPHE are wrong ones:

      xlabel(’x’); ylabel(’y’);
should be
      xlabel('x'); ylabel('y');

that is annoying for "copy and paste" of examples


Regards
Marco



Reply | Threaded
Open this post in threaded view
|

FEMoctave, a simple Finite Element code, now as Octave package

Andreas Stahel-6
In reply to this post by Andreas Stahel-6
Dear Octave users

with the generous help by Carlo de Falco and Marco Atzeri the
FEMoctave code and documentation is converted to an Octave package.

It can be installed within Octave by
pkg install https://github.com/AndreasStahel/FEMoctave/archive/v2.0.3.tar.gz

Observe that documentation and demo codes are in a sub-directory doc of
the installation. To find the location on your system use
pkg load femoctave
which BVP2D

Documentation and codes are also on GitHub at
https://github.com/AndreasStahel/FEMoctave

With best regards

Andreas Stahel

--
Andreas Stahel
Mathematics, BFH-TI  E-Mail: Andreas.Stahel@[ANTI-SPAM]bfh.ch
Quellgasse 21        HuCE, Institute for Human Centered Engineering
CH-2502 Biel         WWW:   https://web.sha1.bfh.science
Switzerland          Phone: ++41 +32 32 16 258



Reply | Threaded
Open this post in threaded view
|

Re: FEMoctave, a simple Finite Element code, now as Octave package

Jeffrey Layton
Thank you!


On Wed, May 20, 2020 at 12:18 PM Andreas Stahel <[hidden email]> wrote:
Dear Octave users

with the generous help by Carlo de Falco and Marco Atzeri the
FEMoctave code and documentation is converted to an Octave package.

It can be installed within Octave by
pkg install https://github.com/AndreasStahel/FEMoctave/archive/v2.0.3.tar.gz

Observe that documentation and demo codes are in a sub-directory doc of
the installation. To find the location on your system use
pkg load femoctave
which BVP2D

Documentation and codes are also on GitHub at
https://github.com/AndreasStahel/FEMoctave

With best regards

Andreas Stahel

--
Andreas Stahel
Mathematics, BFH-TI  E-Mail: Andreas.Stahel@[ANTI-SPAM]bfh.ch
Quellgasse 21        HuCE, Institute for Human Centered Engineering
CH-2502 Biel         WWW:   https://web.sha1.bfh.science
Switzerland          Phone: ++41 +32 32 16 258





Reply | Threaded
Open this post in threaded view
|

CPU usage by call of C++ code through system() on Linux

Andreas Stahel-6
In reply to this post by Andreas Stahel-6
Dear Octave Users

Maybe one of you can give me a hint on how to make my Octave code run faster.
Within a good size program (run time 40 sec) the command system() is used to call a C++ code.
The C++ code uses pthreads.
While the code is running htop show approximately 40% of load by the kernel on each CPU and 60% "normal" (user space?).

When running the same code in Matlab only the "normal"load shows and very little kernel load on the CPUs.
The computation time by Matlab is also only 60% of the time consumed by Octave (5.2.0)
The system is an Ubuntu 20.04 on a AMD Ryzen 3950X.

Any hints on what is slowing Octave down?

With best regards

Andreas
--
Andreas Stahel
Mathematics, BFH-TI  E-Mail: Andreas.Stahel@[ANTI-SPAM]bfh.ch
Quellgasse 21        HuCE, Institute for Human Centered Engineering
CH-2502 Biel         WWW:   https://web.sha1.bfh.science
Switzerland          Phone: ++41 +32 32 16 258


Reply | Threaded
Open this post in threaded view
|

Re: CPU usage by call of C++ code through system() on Linux

Nicklas Karlsson
> Dear Octave Users
>
> Maybe one of you can give me a hint on how to make my Octave code run faster.
> Within a good size program (run time 40 sec) the command system() is used to call a C++ code.
> The C++ code uses pthreads.

Operations on vectors may be much faster than loops. I have function reading a file, it executed slowly in Octave but as functions to read file are very similar to C I reimplemented and then it became much faster.

> When running the same code in Matlab only the "normal"load shows and very little kernel load on the CPUs.
> The computation time by Matlab is also only 60% of the time consumed by Octave (5.2.0)
> The system is an Ubuntu 20.04 on a AMD Ryzen 3950X.

Matlab is more expensive so I guess you get something for the money but it does not need to stay like this forever, you could figure out where the difference is?


Nicklas Karlsson


Reply | Threaded
Open this post in threaded view
|

Re: CPU usage by call of C++ code through system() on Linux

siko1056
In reply to this post by Andreas Stahel-6
On 6/26/20 1:17 AM, Andreas Stahel wrote:

> Dear Octave Users
>
> Maybe one of you can give me a hint on how to make my Octave code run
> faster.
> Within a good size program (run time 40 sec) the command system() is
> used to call a C++ code.
> The C++ code uses pthreads.
> While the code is running htop show approximately 40% of load by the
> kernel on each CPU and 60% "normal" (user space?).
>
> When running the same code in Matlab only the "normal"load shows and
> very little kernel load on the CPUs.
> The computation time by Matlab is also only 60% of the time consumed by
> Octave (5.2.0)
> The system is an Ubuntu 20.04 on a AMD Ryzen 3950X.
>
> Any hints on what is slowing Octave down?
>
> With best regards
>
> Andreas


Dear Andreas,

Maybe I do not understand your setup correctly.  You have a C++ code
using threads compiled to, e.g. "code.exe" (the suffix does not matter),
and an Octave script "benchmark.m" with somewhere the code line

   system ("code.exe")

First question is, do "benchmark.m" and "code.exe" interact with each
other?  Means, does "code.exe" compute something that "benchmark.m"
processes further by importing results?  What is the purpose of Octave
calling "code.exe"?  Benchmarking with tic-toc?

Second question, does "code.exe" (standalone, without Octave or Matlab)
or "benchmark.m" (called from Octave or Matlab) have a run time of 40
seconds?

Now to your observation.  When running "benchmark.m" in Octave and
Matlab you observe Octave is slower.  I do not understand how this is
related to the CPU "kernel" and "normal" usage?  What is the runtime of
"benchmark.m" in Matlab and Octave, respectively?  Do you complain not
all CPU cores are used?

Maybe it is best to give us (some) code to better understand the situation.

Kai