Hi everyone,
I'd like to write a slightly modified StatElecSolver. I downloaded the Elmer binaries (Windows XP workstation) and the source code of Elmer Solver (5.4.0). I made some changes (just adding some CALL Info(...)) to StatElecSolve.src so I could see whether it works. After compiling the source code and replacing the installed library with the compiled one I ran the solver but it crashed. The error seems to occur when the library tries to access the 'Variable' field in the 'Solver' structure for the first time (Potential => ...). Using the compiled version of Elmer Solver instead of the binary included in the installation package didn't prevent a crash either. Apparently the GetSolverParams() function is not used, which disagrees with the Solver Manual (section ‘Basic Programming’ – 'Writing a Solver').
What is wrong with the source code (or me)? Does anyone know how to fix this? I'd be happy about any advice.
Thanks a lot in advance.
Errors when using slightly modified solver libraries
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Errors when using slightly modified solver libraries
Hi
Modifiying just a solver (all those in Models Manual) is not that complicated. The following instructions for Windows will enable you to work with the up to date stuff, rather than some old tar ball. The Windows version includes a consistant gfortran solver so you do not need to install it.
-Peter
Modifiying just a solver (all those in Models Manual) is not that complicated. The following instructions for Windows will enable you to work with the up to date stuff, rather than some old tar ball. The Windows version includes a consistant gfortran solver so you do not need to install it.
- Download latest Windows binary from https://sourceforge.net/projects/elmerfem/ and install it
- Get the solver of interest from http://elmerfem.svn.sourceforge.net/vie ... k/fem/src/
- Copy the .src file with suffix .f90 to your case directory
- In ElmerGUI in "Run -> Compiler" open the .f90 and compile it OR in the command line say "elmerf90 MySolver.f90 -o MySolver.so"
- Change the solver path in the .sif file to include the root directory i.e. Procedure ="MySolver" ... -> Procedure ="./MySolver" ...
-Peter
Re: Errors when using slightly modified solver libraries
Thank you, everything works very well now.