Skip to content

Commit

Permalink
Merge branch 'master' into cabana_lb
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs authored Sep 10, 2024
2 parents f6bcb5a + 4d673de commit 0ae3c00
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 69 deletions.
43 changes: 23 additions & 20 deletions src/inputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <system.h>
#include <types.h>

#include <array>
#include <fstream>
#include <vector>

Expand Down Expand Up @@ -149,53 +150,55 @@ template <class t_System>
class InputFile
{
private:
bool timestepflag; // input timestep?
bool timestepflag = false; // input timestep?
public:
InputCL commandline;
t_System *system;

bool _print_rank;
int units_style;
int lattice_style;
double lattice_constant, lattice_offset_x, lattice_offset_y,
lattice_offset_z;

// defaults match ExaMiniMD LJ example
int units_style = UNITS_LJ;
int lattice_style = LATTICE_FCC;
double lattice_constant = 0.8442, lattice_offset_x = 0.0,
lattice_offset_y = 0.0, lattice_offset_z = 0.0;
int lattice_nx, lattice_ny, lattice_nz;
int box[6];
std::array<int, 6> box = { 0, 40, 0, 40, 0, 40 };

char *data_file;
int data_file_type;

std::string output_file;
std::string error_file;

double temperature_target;
int temperature_seed;
double temperature_target = 1.4;
int temperature_seed = 87287;

int integrator_type;
int nsteps;
int integrator_type = INTEGRATOR_NVE;
int nsteps = 100;

int binning_type;
int binning_type = BINNING_LINKEDCELL;

int comm_type;
int comm_exchange_rate;
int comm_type = COMM_MPI;
int comm_exchange_rate = 20;
double comm_ghost_cutoff;

int force_type;
int force_type = FORCE_LJ;
int force_iteration_type;
int force_neigh_parallel_type;

T_F_FLOAT force_cutoff;
T_F_FLOAT force_cutoff = 2.5;
std::vector<std::vector<std::string>> force_coeff_lines;

T_F_FLOAT neighbor_skin;
int neighbor_type;
T_INT max_neigh_guess;
T_F_FLOAT neighbor_skin = 0.0;
int neighbor_type = NEIGH_VERLET_2D;
T_INT max_neigh_guess = 50;

int layout_type;
int nnp_layout_type;

int thermo_rate, dumpbinary_rate, correctness_rate;
bool dumpbinaryflag, correctnessflag;
int thermo_rate = 10, dumpbinary_rate = 0, correctness_rate = 0;
bool dumpbinaryflag = false, correctnessflag = false;
char *dumpbinary_path, *reference_path, *correctness_file;
std::string input_data_file;
std::string output_data_file;
Expand Down
45 changes: 0 additions & 45 deletions src/inputFile_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include <property_temperature.h>

#include <algorithm>
#include <iostream>
#include <regex>

std::vector<std::string> split( const std::string &line )
Expand All @@ -72,59 +71,15 @@ InputFile<t_System>::InputFile( InputCL commandline_, t_System *system_ )
: commandline( commandline_ )
, system( system_ )
{
comm_type = COMM_MPI;
integrator_type = INTEGRATOR_NVE;
neighbor_type = NEIGH_VERLET_2D;
force_type = FORCE_LJ;
binning_type = BINNING_LINKEDCELL;

neighbor_type = commandline.neighbor_type;
force_iteration_type = commandline.force_iteration_type;
force_neigh_parallel_type = commandline.force_neigh_parallel_type;

output_file = commandline.output_file;
error_file = commandline.error_file;

// set defaults (matches ExaMiniMD LJ example)

nsteps = 0;

thermo_rate = 0;
dumpbinary_rate = 0;
correctness_rate = 0;
vtk_rate = 0;
dumpbinaryflag = false;
correctnessflag = false;
timestepflag = false;

lattice_offset_x = 0.0;
lattice_offset_y = 0.0;
lattice_offset_z = 0.0;
box[0] = 0;
box[2] = 0;
box[4] = 0;
box[1] = 40;
box[3] = 40;
box[5] = 40;

units_style = UNITS_LJ;
lattice_style = LATTICE_FCC;
lattice_constant = 0.8442;

temperature_target = 1.4;
temperature_seed = 87287;

nsteps = 100;
thermo_rate = 10;

neighbor_skin = 0.3;
neighbor_skin = 0.0; // for metal and real units
max_neigh_guess = 50;
comm_exchange_rate = 20;
comm_ghost_cutoff = std::pow( ( 4.0 / lattice_constant ), ( 1.0 / 3.0 ) ) *
20.0; // 20 lattice constants

force_cutoff = 2.5;
}

template <class t_System>
Expand Down
4 changes: 0 additions & 4 deletions src/integrator_nve_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ void Integrator<t_System>::initial_integrate( t_System *system )
f = system->f;
type = system->type;

[[maybe_unused]] static int step = 1;
Kokkos::parallel_for( "IntegratorNVE::initial_integrate",
t_policy_initial( 0, system->N_local ), *this );
step++;
}

template <class t_System>
Expand All @@ -80,10 +78,8 @@ void Integrator<t_System>::final_integrate( t_System *system )
f = system->f;
type = system->type;

[[maybe_unused]] static int step = 1;
Kokkos::parallel_for( "IntegratorNVE::final_integrate",
t_policy_final( 0, system->N_local ), *this );
step++;
}

template <class t_System>
Expand Down

0 comments on commit 0ae3c00

Please sign in to comment.