simulation.cc autoformatting
This commit is contained in:
@@ -29,11 +29,11 @@
|
||||
#include "config_loader.h"
|
||||
#include "core/errchk.h"
|
||||
#include "core/math_utils.h"
|
||||
#include "model/host_forcing.h"
|
||||
#include "model/host_memory.h"
|
||||
#include "model/host_timestep.h"
|
||||
#include "model/model_reduce.h"
|
||||
#include "model/model_rk3.h"
|
||||
#include "model/host_forcing.h"
|
||||
#include "timer_hires.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -61,7 +61,6 @@ print_diagnostics(const AcMesh& mesh, const int& step, const AcReal& dt)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// Write all setting info into a separate ascii file. This is done to guarantee
|
||||
// that we have the data specifi information in the thing, even though in
|
||||
// principle these things are in the astaroth.conf.
|
||||
@@ -204,7 +203,7 @@ run_simulation(void)
|
||||
load_config(&mesh_info);
|
||||
|
||||
AcMesh* mesh = acmesh_create(mesh_info);
|
||||
//TODO: This need to be possible to define in astaroth.conf
|
||||
// TODO: This need to be possible to define in astaroth.conf
|
||||
acmesh_init_to(INIT_TYPE_GAUSSIAN_RADIAL_EXPL, mesh);
|
||||
|
||||
acInit(mesh_info);
|
||||
@@ -238,16 +237,16 @@ run_simulation(void)
|
||||
AcReal bin_save_t = mesh_info.real_params[AC_bin_save_t];
|
||||
AcReal bin_crit_t = bin_save_t;
|
||||
|
||||
//Forcing properties
|
||||
// Forcing properties
|
||||
AcReal relhel = mesh_info.real_params[AC_relhel];
|
||||
AcReal magnitude = mesh_info.real_params[AC_forcing_magnitude];
|
||||
AcReal kmin = mesh_info.real_params[AC_kmin];
|
||||
AcReal kmax = mesh_info.real_params[AC_kmax];
|
||||
|
||||
AcReal kaver = (kmax - kmin)/AcReal(2.0);
|
||||
AcReal kaver = (kmax - kmin) / AcReal(2.0);
|
||||
|
||||
/* initialize random seed: */
|
||||
srand (312256655);
|
||||
srand(312256655);
|
||||
|
||||
/* Step the simulation */
|
||||
for (int i = 1; i < max_steps; ++i) {
|
||||
@@ -255,20 +254,21 @@ run_simulation(void)
|
||||
const AcReal dt = host_timestep(umax, mesh_info);
|
||||
|
||||
#if LFORCING
|
||||
//Generate a forcing vector before canculating an integration step.
|
||||
// Generate a forcing vector before canculating an integration step.
|
||||
|
||||
// Generate forcing wave vector k_force
|
||||
AcReal3 k_force;
|
||||
k_force = helical_forcing_k_generator(kmax, kmin);
|
||||
|
||||
//Randomize the phase
|
||||
AcReal phase = AcReal(2.0)*AcReal(M_PI)*get_random_number_01();
|
||||
// Randomize the phase
|
||||
AcReal phase = AcReal(2.0) * AcReal(M_PI) * get_random_number_01();
|
||||
|
||||
// Generate e for k. Needed for the sake of isotrophy.
|
||||
AcReal3 e_force;
|
||||
if ((k_force.y == 0.0) && (k_force.z == 0.0)) {
|
||||
e_force = (AcReal3){0.0, 1.0, 0.0};
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_force = (AcReal3){1.0, 0.0, 0.0};
|
||||
}
|
||||
helical_forcing_e_generator(&e_force, k_force);
|
||||
|
Reference in New Issue
Block a user