Commit 38d5d4ab authored by David Deepwell's avatar David Deepwell

Update Version message

The SPINS version is now the first thing printed in a simulation.
Also fixed typo in writing the grid in BaseCase.cpp
parent b6c48e5a
......@@ -19,7 +19,11 @@ BaseCase::BaseCase(void)
if (master()) WriteCaseFileSource();
// Print version information
if (master()) { fprintf(stdout,"\nSPINS Version %d.%d.%d \n\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION); }
if (master()) {
fprintf(stdout,"-------------------------------------------\n");
fprintf(stdout,"\nSPINS Version %d.%d.%d \n\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
fprintf(stdout,"-------------------------------------------\n");
}
}
/* Implementation of non-abstract methods in BaseCase */
......@@ -234,17 +238,17 @@ void BaseCase::automatic_grid(double MinX, double MinY, double MinZ,
// Write grid/reader
grid = (*xx)(ii) + 0*jj + 0*kk;
write_grid(grid,"xgrid");
write_array(grid,"xgrid");
write_reader(grid,"xgrid",false);
if (size_y() > 1) {
grid = 0*ii + (*yy)(jj) + 0*kk;
write_grid(grid,"ygrid");
write_array(grid,"ygrid");
write_reader(grid,"ygrid",false);
}
grid = 0*ii + 0*jj + (*zz)(kk);
write_grid(grid,"zgrid");
write_array(grid,"zgrid");
write_reader(grid,"zgrid",false);
// Clean up
......
......@@ -482,8 +482,20 @@ int main(int argc, char ** argv) {
dt_max = 0.01;
}
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Vortex dipole problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -492,19 +504,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Initial velocity perturbation: %g\n",perturb);
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
......@@ -577,8 +577,20 @@ int main(int argc, char ** argv) {
dt_max = 0.5/sqrt(N2_max);
}
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Dam break problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -588,19 +600,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Approx. max buoyancy frequency squared: %g\n",N2_max);
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
......@@ -534,8 +534,20 @@ int main(int argc, char ** argv) {
dt_max = 0.5/sqrt(N2_max);
}
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Kelvin-Helmholtz billow problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -545,19 +557,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Approx. max buoyancy frequency squared: %g\n",N2_max);
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
......@@ -590,8 +590,20 @@ int main(int argc, char ** argv) {
dt_max = 0.5/buoyancy_freq;
}
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Internal wave generation problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -601,19 +613,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Approx. max buoyancy frequency squared: %g\n",pow(buoyancy_freq,2));
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
......@@ -682,8 +682,20 @@ int main(int argc, char ** argv) {
dt_max = 0.5/sqrt(N2_max);
}
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Dam break problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -693,19 +705,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Approx. max buoyancy frequency squared: %g\n",N2_max);
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
......@@ -645,8 +645,20 @@ int main(int argc, char ** argv) {
// Dynamic viscosity
mu = visco*rho_0;
/* ------------------ Initialize --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
/* ------------------ Print some parameters --------------------- */
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) {
fprintf(stdout,"Dam break problem\n");
fprintf(stdout,"Using a %f x %f x %f grid of %d x %d x %d points\n",Lx,Ly,Lz,Nx,Ny,Nz);
......@@ -655,19 +667,10 @@ int main(int argc, char ** argv) {
fprintf(stdout,"Initial velocity perturbation: %g\n",perturb);
fprintf(stdout,"Filter cutoff = %f, order = %f, strength = %f\n",f_cutoff,f_order,f_strength);
fprintf(stdout,"Max time step: %g\n",dt_max);
fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
}
/* ------------------ Do stuff --------------------- */
// Create an instance of the above class
userControl mycode;
// Create a flow-evolver that takes its settings from the above class
FluidEvolve<userControl> do_stuff(&mycode);
// Initialize
do_stuff.initialize();
compute_start_time = MPI_Wtime(); // beginning of simulation (after reading in data)
double startup_time = compute_start_time - real_start_time;
if (master()) fprintf(stdout,"Start-up time: %.6g s.\n",startup_time);
/* ------------------ Run --------------------- */
// Run until the end of time
do_stuff.do_run(final_time);
MPI_Finalize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment