A graphical representation for convergence
Posted: 15 Aug 2011, 12:20
Hi All,
I'm usually launching ElmerSolver from the command line. This means that I can see only text and it is
harder to understand the convergence progress. Is there an easy/elegant way to get the graphical
representation for the convergence like in ElmerGUI? Meanwhile, I will post my solution, in case
someone is interested:
ElmerSolver is outputting a lot of useful information when it is launched from command line, for example:
the stdbuf -oL is to avoid buffering (http://www.pixelbeat.org/programming/stdio_buffering/),
because we need a stream.
now, this can be piped in to feedGnuplot (https://github.com/dkogan/feedgnuplot)
et voilĂ , there you have it!
Cheers,
Eelis
I'm usually launching ElmerSolver from the command line. This means that I can see only text and it is
harder to understand the convergence progress. Is there an easy/elegant way to get the graphical
representation for the convergence like in ElmerGUI? Meanwhile, I will post my solution, in case
someone is interested:
ElmerSolver is outputting a lot of useful information when it is launched from command line, for example:
From this we only want the relative change, which can be easily parsed with for example "awk":MAIN:
MAIN: -------------------------------------
MAIN: Time: 1/20 0.10000000000000001
MAIN: -------------------------------------
MAIN:
Varname:magnfdens
axisCurrSolve: Nonlinear iteration no. 1 of max. 4
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.64550053E-04 2.0000000 ) :: test
axisCurrSolve: Result Norm : 6.45500526565041675E-005
axisCurrSolve: Relative Change : 2.0000000000000000
axisCurrSolve: Nonlinear iteration no. 2 of max. 4
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.80950724E-03 1.7045958 ) :: test
axisCurrSolve: Result Norm : 8.09507235507350600E-004
axisCurrSolve: Relative Change : 1.7045957809374008
axisCurrSolve: Nonlinear iteration no. 3 of max. 4
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.23644080E-03 1.0957838 ) :: test
axisCurrSolve: Result Norm : 2.36440800450868409E-004
axisCurrSolve: Relative Change : 1.0957837585716805
axisCurrSolve: Nonlinear iteration no. 4 of max. 4
ComputeChange: NS (ITER=4) (NRM,RELC): ( 0.31561966E-02 1.7212307 ) :: test
axisCurrSolve: Result Norm : 3.15619663799652107E-003
axisCurrSolve: Relative Change : 1.7212306888188165
Code: Select all
$ ElmerSolver | stdbuf -oL awk '/ Relative / { print $5}'
2.0000000000000000
1.7045957809374008
1.0957837585716805
1.7212306888188165
1.9595103488742003
0.19755711729703090
0.11431966114014758
because we need a stream.
now, this can be piped in to feedGnuplot (https://github.com/dkogan/feedgnuplot)
Code: Select all
$ ElmerSolver | stdbuf -oL awk '/ Relative / { print $5 }' | feedGnuplot --stream --extracmds 'set logscale y' --lines
Cheers,
Eelis