exchange en*alpha and en

This commit is contained in:
Ian Jauslin 2023-05-16 00:07:38 -04:00
parent 5ede4f1084
commit 949b3897c4
2 changed files with 7 additions and 5 deletions

View File

@ -27,8 +27,9 @@ The available commands are
* `enstrophy`: to compute the enstrophy and various other observables. This * `enstrophy`: to compute the enstrophy and various other observables. This
command prints command prints
```step_index time average(alpha) average(alpha*enstrophy) average(enstrophy) alpha alpha*enstrophy enstrophy``` ```step_index time average(alpha) average(enstrophy) average(alpha*enstrophy) alpha enstrophy alpha*enstrophy```
where the averages are running averages over `print_freq` steps. where the averages are running averages over `print_freq`. In addition, if
the algorithm has an adaptive step, an extra column is printed with `delta`.
* `uk`: to compute the Fourier transform of the solution. * `uk`: to compute the Fourier transform of the solution.

View File

@ -209,12 +209,13 @@ int enstrophy(
// print to stderr so user can follow along // print to stderr so user can follow along
if(algorithm==ALGORITHM_RKF45){ if(algorithm==ALGORITHM_RKF45){
fprintf(stderr,"% .8e % .8e % .8e % .8e % .8e % .8e % .8e % .8e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy, delta); fprintf(stderr,"% .8e % .8e % .8e % .8e % .8e % .8e % .8e % .8e\n",time, avg_a, avg_en, avg_en_x_a, alpha, enstrophy, alpha*enstrophy, delta);
printf("% .15e % .15e % .15e % .15e % .15e % .15e % .15e % .15e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy, delta);
} else { } else {
fprintf(stderr,"% .8e % .8e % .8e % .8e % .8e % .8e % .8e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy); fprintf(stderr,"% .8e % .8e % .8e % .8e % .8e % .8e % .8e\n",time, avg_a, avg_en, avg_en_x_a, alpha, enstrophy, alpha*enstrophy);
printf("% .15e % .15e % .15e % .15e % .15e % .15e % .15e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy);
} }
// print to stdout // print to stdout
printf("% .15e % .15e % .15e % .15e % .15e % .15e % .15e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy);
} }
// reset averages // reset averages