iterative solver and ....

Numerical methods and mathematical models of Elmer
Post Reply
beautylife
Posts: 5
Joined: 21 Dec 2009, 19:28

iterative solver and ....

Post by beautylife »

Hi friends
It’s a new member to Elmer who wishes the best moments of life for you.
I’m working on a rare biological model which is not implemented in Elmer. furthermore there are obstacles that make writing the associated physical model as an Elmer solver impossible, but I wish to use Elmer’s utilities for solving the systems of equations resulted from my physical model.
I need an iterative solver which uses Biconjugate Gradient Stabilized algorithm with ILUn preconditioning strategy. I found in the solver manual that this option is supported by Elmer, but do you have any idea if one can extract the required parts of such a solver from Elmer’s source code and use it separately for solving his own equations?
Cheers, PT
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: iterative solver and ....

Post by raback »

Hi PT

Extracting these parts is possible if you just apply to the GPL license. This means that if you distribute the modified code you must distribute it under the same license (i.e. under GPL).

Extracting the code from Elmer might not be that trivial technically since the Krylov subspace methods are implemented in quite an abstract fashion in the hutiter library. It does not itself include the implementation of the preconditoner or the matrix-vector product. These are in Elmer implemented elsewhere and just pointer to the method is given. I presume that you will find much cleaner interfaces to similar functionalities in Hypre and PetSc, for example.

I wonder what is the technical reason why the equation cannot be implemented as an Elmer solver?

-Peter
beautylife
Posts: 5
Joined: 21 Dec 2009, 19:28

Re: iterative solver and ....

Post by beautylife »

Actually, the model is just a part of a bigger one which includes some other models as well. The interaction between models and the structure of defined variables (which is not compatible with Elmer) is just some reasons for the mentioned restriction.
Would you please give me more points about extracting my desired section? For example: what is the "the hutiter library"? Where can I find it? What do you mean by "elsewhere" in "These are in Elmer implemented elsewhere and just pointer to the method is given."? And how can one access this "elsewhere"?

Thanks a lot and happy new year, PT
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: iterative solver and ....

Post by raback »

Sorry for being a bit diffuse in the answer. The source code is available in
http://elmerfem.svn.sourceforge.net/vie ... fem/trunk/
and therein the hutiter library (written in C) is under subdirectory "hutiter".
This library is called from ElmerSolver the source code (written in Fortran) of which is under "fem". The essential stuff is in several modules. Look at files CRSMatrix.src (ILU) and IterSolve.src (calling of hutiter), for example.
beautylife wrote:What do you mean by "elsewhere" in "These are in Elmer implemented elsewhere and just pointer to the method is given."?
For example, in IterSolve.src there are in line 407:

Code: Select all

mvProc = AddrFunc( CRS_MatrixVectorProd )
and in line 513:

Code: Select all

CALL IterCall( iterProc, x, b, ipar, dpar, work, &
         mvProc, pcondProc, pcondrProc, dotProc, normProc, STOPC )
Happy new year
-Peter
beautylife
Posts: 5
Joined: 21 Dec 2009, 19:28

Re: iterative solver and ....

Post by beautylife »

Assume that someone wants to solve a system of equations with Umfpack for example. As I understood he must call subroutine “DirectSolver” in his program. There he will be referred to subroutine “Umfpack_SolveSystem”. In the current subroutine there are some lines starting with # symbol that I can’t understand their usage. An interface with 4 subroutine definitions is coming after. Then is the body of the subroutine and calling the interface subroutines.
One has what mentioned above available, along with the folder Elmer Source code\trunk\umfpack which contains C sources files and etc. he is familiar with FORTRAN but doesn’t know anything about C language. Is it possible for him to use the mentioned tools via a FORTRAN code for solving his system of equation? And if yes, How?
I know it’s not a normal kind of question, so I won’t complain if you don’t answer :) , but I’ll be grateful if you can help me.
Thanks, PT
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: iterative solver and ....

Post by raback »

Hi PT

Umfpack has also a Fortran interface so that would be the most natural way to incorporate it in your own fortran code.
See http://www.cise.ufl.edu/research/sparse/umfpack/. Of course you can mimic how things have been done in Elmer but there really isn't any need for using Elmer in between if you just want to solve a linear system.

-Peter
Post Reply