Where are the source code ?

General discussion about Elmer
Post Reply
special_20
Posts: 3
Joined: 07 Apr 2011, 21:22
Antispam: Yes

Where are the source code ?

Post by special_20 »

Hello all,

For my internship I have to use Elmer and for my work I have to modify the source codes. So I just installed Elmer using the Ubuntu package manager Synaptic but I can't find the source codes :?

Can you please tell me where are the source codes :?: :?:

Thank you ;)
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Where are the source code ?

Post by Juha »

HI,

the live source code is under the sourceforge svn server:

http://elmerfem.svn.sourceforge.net/vie ... fem/trunk/

hit the "download gnu tarball" at the bottom of the page, or alternatively use svn to
download the sources:

svn co http://elmerfem.svn.sourceforge.net/svn ... rfem/trunk elmer_src

Hope it helps, Juha
special_20
Posts: 3
Joined: 07 Apr 2011, 21:22
Antispam: Yes

Re: Where are the source code ?

Post by special_20 »

Sure it helps ;)

But this probably means that I'll have to uninstall my current version of Elmer and I'll have to install instead the version that I downloaded from svn if I want my modifications to be taken into account when I compile the code :?: :?:
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Where are the source code ?

Post by Juha »

Hi,

well, it depends on what you are doing. All the application solvers may be compiled separately using

Code: Select all

elmerf90 -o mySolver -cpp MySolver.f90
where the "mySolver.f90" might be a (modified) copy of any of the application solver source codes
in fem/src (usually you can take the .src file and rename it to .f90).

Then use

Code: Select all

Procedure = "mySolver" "mySolverSubroutineName"
in your .sif file instead of what was previously written there.

If you want to modify the base code, then sure, you'll have to compile and install ElmerSolver from
the sources. Again depending on what you do, compiling & installing the fem/ directory might be
enough.

Regards, Juha
hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

Re: Where are the source code ?

Post by hazelsct »

You can get the package source code using Synaptic. Go to Settings -> Repositories, click on Source Code and Close, then Reload. To get and compile the source package, install the dpkg-dev package, then go to the command line and do:

apt-get source elmerfem
cd elmerfem-*
dpkg-buildpackage -us -uc

It will probably tell you that you need to install some packages in order to compile. When you've installed them, run dpkg-buildpackage again, and it should create several .deb packages in the parent directory. Then at the command line do:

cd ..
dpkg -i elmer_*.deb elmer-common*.deb libelmersolver*.deb

and you'll replace the Ubuntu-compiled packages with your newly-compiled ones. You can always go back to the Ubuntu-compiled ones by marking them for reinstallation in Synaptic.
Post Reply