Skip to content

Commit

Permalink
Add basic support for group command
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Oct 7, 2024
1 parent 3a7c1e1 commit d1be7d1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/inputFile_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ void InputFile<t_System>::check_lammps_command( std::string line,
}
if ( keyword.compare( "region" ) == 0 )
{
// FIXME-group: multiple regions support required
// auto region_id = words.at(1);
if ( words.at( 2 ).compare( "block" ) == 0 )
{
known = true;
Expand All @@ -252,7 +254,7 @@ void InputFile<t_System>::check_lammps_command( std::string line,
box[5] = std::stoi( words.at( 8 ) );
if ( ( box[0] != 0 ) || ( box[2] != 0 ) || ( box[4] != 0 ) )
log_err( err, "LAMMPS-Command: region only allows for boxes "
"with 0,0,0 offset in CabanaMD" );
"with 0,0,0 offset in CabanaMD" ); // FIXME-group
lattice_nx = box[1];
lattice_ny = box[3];
lattice_nz = box[5];
Expand Down Expand Up @@ -485,6 +487,19 @@ void InputFile<t_System>::check_lammps_command( std::string line,
"commandline --force-iteration" );
}
}
if ( keyword.compare( "group" ) == 0 )
{
// supported version:
// group GROUP-ID region REGION-ID
known = true;
[[maybe_unused]] auto group_id = words.at(1);
if ( words.at( 2 ) != "region" )
{
log_err( err, "LAMMPS-Command: 'group' command can only be "
"used with 'region' in CabanaMD" );
}
[[ maybe_unused]] auto region_id = words.at(3);
}

if ( !known )
{
Expand Down

0 comments on commit d1be7d1

Please sign in to comment.