[Getdp] User defined source

Kubicek Bernhard Bernhard.Kubicek at arsenal.ac.at
Tue Jan 2 14:15:21 CET 2007


Hi,
and sorry for the delayed answer.

The answer to question one I will write into the wiki, so all can have it.

For your second question, the answer is the following:
For some of my calculations, I load a scalar field into GetDP, basically by seperating preprocessing and solving, and patching the preprocessing file. This is better explained in this email:
http://www.geuz.org/pipermail/getdp/2006/000886.html
This basically could also performed with using any, but at least one, programming language. 

In fact, I spend a couple of hours playing around with ReadSolution as well, but not for feeding external fields into GetDP.
In some cases, one wants to calculate multiple times on the same geometry, with very little varing parameters (e.g. conductivity). Then, the solver convergence (maybe) could be improved, by initialising with the "old" solution of the varied parameters. I did not find any effects in this context with ReadSolution->Generate->Solve. However, by using ReadSolution, GenerateJac, SolveJac it indeed did work, iirc. Still, there were two problems:
One can be solved by patching sparsekit's solver parameters in the sourcecode of GetDP, see
http://www.geuz.org/pipermail/getdp/2006/000853.html
The issue was that even if one had a reasonable first guess, the convergence test only depended on the relative residual, instead of the abolute one. So the solver would iterate the same amount of time, of course obtaining better and better absolute precission at each run, while the relative residuals always started with 1.

The other problem was that one needed an initial result file, which one could _not_ create useing a second resolution. The only solution was to use commenting to switch between the inital and continued calculations, which was not very practical, Something like:
> //ReadSolution;GenerateJac;SolveJac;SaveSolution;
> InitSolution;GenerateJac;SolveJac;SaveSolution;
This could possibly be simplified by being able to specify filenames with the ReadSolution/SaveSolution commands e.g. 
> ReadSolution[SYSTEM_C,"old.res"]; Solve... ; SaveSolution[SYSTEM_C,">new.res"];
The command line parameters allow only a single result file name.


For feeding external fields, I did not try ReadSolution lately, as my prime goal at the moment is to use the partioned GetDP/PETSC preprocessor files.

Honestly, I think its nothing to be ashamed of to not being able to read the GetDP source code. Even after years of C/C++, one might find GetDP quite involved, i.E. the usage of lex/yacc. Doxygen for commenting is another thing one could personally favour, especially because of the automatically generated call graphs, and inlined, hyperlinked and highlighted code). This things do not matter, if only a closed community (having good communication) is intended to develop, but for outsiders, it adds an additional layer of difficulties. 
Still, GetDP is a great tool, and it is quite generous that the developers provide source code and contact posibilities.
Big thanks to them for that.

I hope you dont mind if I repost this whole message to the GetDP mailing list.

Nice greetings, 
Bernhard 

-----Ursprüngliche Nachricht-----
Von: Olivier Castany [mailto:castany at quatramaran.ens.fr] 
Gesendet: Mittwoch, 20. Dezember 2006 11:06
An: Kubicek Bernhard
Betreff: Re: [Getdp] User defined source


Hello,

first of all, I thank you for the work you have done for GetDP, 
especially for the wiki.

Your examples (especially Avalanche2d) helped me to build a good GetDP 
program.

I have a few questions :

- about Avalanche2d, I now understand the programming, but I don't 
understand the physics and the equations behind. Could you explain them 
a bit more (or write the physical problem which is being solved ? ) 
Personnaly, I understand you deal with some charges which can move, but 
I see that their density "n" increases in the process ! What is 
happening ?

- have you succeeded in using the ReadSolution command ? (in the mailing 
list, you advised that this function was in the source code) I would be 
interested to use it (however, I don't know much about C programming and 
I am a bit lost in the code).

Have a nice day,

-- 
Olivier C.