diff --git a/input/in.lj b/input/in.lj index 20198eb..eb8c76e 100644 --- a/input/in.lj +++ b/input/in.lj @@ -23,4 +23,4 @@ thermo 10 dump dmpvtk all vtk 10 dump%_*.vtu -run 100 +run 30 diff --git a/src/inputCL.cpp b/src/inputCL.cpp index df96366..9f0bf50 100644 --- a/src/inputCL.cpp +++ b/src/inputCL.cpp @@ -48,6 +48,7 @@ #include +#include #include #include #include @@ -116,8 +117,12 @@ void InputCL::read_args( int argc, char *argv[] ) " (N = positive integer)\n", " (PATH = location of ", "directory)\n" ); - log( std::cout, " --sparse : " - "create a vacuum for an unbalanced system\n" ); + log( std::cout, + " --vacuum [N]: Create a vacuum for " + "an unbalanced system, enlarging the simulation " + "box N times\n" + " (N = floating-point " + "multiplier, must be bigger than 1.0)\n" ); } // Read Lammps input deck @@ -235,9 +240,14 @@ void InputCL::read_args( int argc, char *argv[] ) i += 3; } - else if ( ( strcmp( argv[i], "--sparse" ) == 0 ) ) + else if ( ( strcmp( argv[i], "--vacuum" ) == 0 ) ) { - sparse = true; + vacuum = true; + vacuum_rate = std::atof( argv[i + 1] ); + if ( vacuum_rate < 1.0 ) + log_err( std::cout, + "Vacuum rate smaller than 1.0 not allowed." ); + i += 2; } else if ( ( strstr( argv[i], "--kokkos-" ) == NULL ) ) diff --git a/src/inputCL.h b/src/inputCL.h index 15a2c64..b161bf0 100644 --- a/src/inputCL.h +++ b/src/inputCL.h @@ -63,7 +63,8 @@ class InputCL int layout_type; int nnp_layout_type; int device_type; - bool sparse = false; + bool vacuum = false; + double vacuum_rate = 1.0; int dumpbinary_rate, correctness_rate; bool dumpbinaryflag, correctnessflag; diff --git a/src/inputFile_impl.h b/src/inputFile_impl.h index 9213a71..4023615 100644 --- a/src/inputFile_impl.h +++ b/src/inputFile_impl.h @@ -512,12 +512,12 @@ void InputFile::create_lattice( Comm *comm ) T_X_FLOAT max_z = lattice_constant * lattice_nz; std::array global_low = { 0.0, 0.0, 0.0 }; std::array global_high = { max_x, max_y, max_z }; - if ( commandline.sparse ) + if ( commandline.vacuum ) { // Create a vacuum for an unbalanced system. - global_high[0] *= 2; - global_high[1] *= 2; - global_high[2] *= 2; + global_high[0] *= commandline.vacuum_rate; + global_high[1] *= commandline.vacuum_rate; + global_high[2] *= commandline.vacuum_rate; } system->create_domain( global_low, global_high, comm_ghost_cutoff ); s = *system;