From 949b3897c49dd9104b401a16bd424ea0d9fef988 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Tue, 16 May 2023 00:07:38 -0400 Subject: [PATCH] exchange en*alpha and en --- README.md | 5 +++-- src/navier-stokes.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ba664a9..8e866ae 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,9 @@ The available commands are * `enstrophy`: to compute the enstrophy and various other observables. This command prints - ```step_index time average(alpha) average(alpha*enstrophy) average(enstrophy) alpha alpha*enstrophy enstrophy``` - where the averages are running averages over `print_freq` steps. + ```step_index time average(alpha) average(enstrophy) average(alpha*enstrophy) alpha enstrophy alpha*enstrophy``` + 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. diff --git a/src/navier-stokes.c b/src/navier-stokes.c index 12a2944..705a302 100644 --- a/src/navier-stokes.c +++ b/src/navier-stokes.c @@ -209,12 +209,13 @@ int enstrophy( // print to stderr so user can follow along 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 { - 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 - printf("% .15e % .15e % .15e % .15e % .15e % .15e % .15e\n",time, avg_a, avg_en_x_a, avg_en, alpha, alpha*enstrophy, enstrophy); } // reset averages