From 183b30abd7d66d66bbe4d577c9ffdc844b533ea3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 30 Mar 2021 18:30:22 -0400 Subject: [PATCH] use strmatch() consistently to detect respa and verlet runstyles with optional suffix --- src/BODY/fix_wall_body_polygon.cpp | 2 +- src/BODY/fix_wall_body_polyhedron.cpp | 2 +- src/CLASS2/pair_lj_class2.cpp | 4 ++-- src/CLASS2/pair_lj_class2_coul_long.cpp | 4 ++-- src/GPU/fix_gpu.cpp | 2 +- src/GPU/fix_nh_gpu.cpp | 2 +- src/GPU/fix_nve_gpu.cpp | 2 +- src/GPU/pppm_gpu.cpp | 2 +- src/GRANULAR/fix_freeze.cpp | 2 +- src/GRANULAR/fix_wall_gran.cpp | 4 ++-- src/KOKKOS/fix_setforce_kokkos.cpp | 2 +- src/KOKKOS/fix_shake_kokkos.cpp | 2 +- src/KOKKOS/pair_buck_coul_cut_kokkos.cpp | 2 +- src/KOKKOS/pair_buck_coul_long_kokkos.cpp | 2 +- src/KOKKOS/pair_buck_kokkos.cpp | 2 +- src/KOKKOS/pair_coul_long_kokkos.cpp | 2 +- src/KOKKOS/pair_hybrid_kokkos.cpp | 2 +- .../pair_lj_charmm_coul_charmm_implicit_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_class2_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_expand_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_gromacs_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_sdk_kokkos.cpp | 2 +- src/KOKKOS/pair_morse_kokkos.cpp | 2 +- src/KOKKOS/pair_yukawa_kokkos.cpp | 2 +- src/KOKKOS/pair_zbl_kokkos.cpp | 2 +- src/KSPACE/pair_buck_long_coul_long.cpp | 4 ++-- src/KSPACE/pair_lj_charmmfsw_coul_long.cpp | 4 ++-- src/KSPACE/pair_lj_long_coul_long.cpp | 4 ++-- src/MANYBODY/fix_qeq_comb.cpp | 2 +- src/MC/fix_bond_break.cpp | 2 +- src/MC/fix_bond_create.cpp | 2 +- src/MISC/fix_efield.cpp | 4 ++-- src/MISC/fix_gld.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 4 ++-- src/MISC/fix_orient_fcc.cpp | 4 ++-- src/MISC/fix_ttm.cpp | 2 +- src/MOLECULE/dihedral_charmm.cpp | 2 +- src/MOLECULE/dihedral_charmmfsw.cpp | 2 +- src/POEMS/fix_poems.cpp | 2 +- src/QEQ/fix_qeq_dynamic.cpp | 2 +- src/QEQ/fix_qeq_fire.cpp | 2 +- src/QEQ/fix_qeq_point.cpp | 2 +- src/QEQ/fix_qeq_shielded.cpp | 2 +- src/QEQ/fix_qeq_slater.cpp | 2 +- src/RIGID/fix_rigid.cpp | 2 +- src/RIGID/fix_rigid_small.cpp | 2 +- src/RIGID/fix_shake.cpp | 4 ++-- src/SPIN/fix_precession_spin.cpp | 4 ++-- src/USER-BOCS/fix_bocs.cpp | 4 ++-- src/USER-COLVARS/fix_colvars.cpp | 4 ++-- src/USER-DRUDE/fix_langevin_drude.cpp | 2 +- src/USER-DRUDE/fix_tgnh_drude.cpp | 4 ++-- src/USER-EFF/fix_nve_eff.cpp | 2 +- src/USER-FEP/fix_adapt_fep.cpp | 2 +- src/USER-INTEL/fix_nh_intel.cpp | 2 +- src/USER-LB/fix_lb_viscous.cpp | 4 ++-- src/USER-MANIFOLD/fix_manifoldforce.cpp | 2 +- src/USER-MISC/fix_addtorque.cpp | 4 ++-- src/USER-MISC/fix_electron_stopping_fit.cpp | 2 +- src/USER-MISC/fix_ffl.cpp | 4 ++-- src/USER-MISC/fix_filter_corotate.cpp | 2 +- src/USER-MISC/fix_flow_gauss.cpp | 4 ++-- src/USER-MISC/fix_gle.cpp | 4 ++-- src/USER-MISC/fix_grem.cpp | 4 ++-- src/USER-MISC/fix_imd.cpp | 2 +- src/USER-MISC/fix_npt_cauchy.cpp | 4 ++-- src/USER-MISC/fix_nvk.cpp | 2 +- src/USER-MISC/fix_orient_eco.cpp | 4 ++-- src/USER-MISC/fix_pafi.cpp | 4 ++-- src/USER-MISC/fix_rhok.cpp | 4 ++-- src/USER-MISC/fix_smd.cpp | 10 +++++----- src/USER-MISC/fix_ti_spring.cpp | 4 ++-- src/USER-MISC/fix_ttm_mod.cpp | 2 +- src/USER-MISC/fix_wall_region_ees.cpp | 4 ++-- src/USER-MISC/pair_lj_expand_coul_long.cpp | 4 ++-- src/USER-OMP/fix_omp.cpp | 5 ++--- src/USER-OMP/fix_qeq_comb_omp.cpp | 2 +- src/USER-QMMM/fix_qmmm.cpp | 2 +- src/USER-QTB/fix_qtb.cpp | 4 ++-- src/USER-REAXC/fix_qeq_reax.cpp | 2 +- src/USER-SMD/fix_smd_setvel.cpp | 2 +- src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp | 4 ++-- src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp | 4 ++-- src/fix_adapt.cpp | 2 +- src/fix_aveforce.cpp | 4 ++-- src/fix_drag.cpp | 4 ++-- src/fix_dt_reset.cpp | 2 +- src/fix_enforce2d.cpp | 2 +- src/fix_gravity.cpp | 4 ++-- src/fix_indent.cpp | 4 ++-- src/fix_langevin.cpp | 4 ++-- src/fix_lineforce.cpp | 2 +- src/fix_move.cpp | 2 +- src/fix_nh.cpp | 4 ++-- src/fix_numdiff.cpp | 4 ++-- src/fix_nve_limit.cpp | 2 +- src/fix_nve_noforce.cpp | 2 +- src/fix_planeforce.cpp | 2 +- src/fix_restrain.cpp | 4 ++-- src/fix_setforce.cpp | 4 ++-- src/fix_spring.cpp | 4 ++-- src/fix_spring_chunk.cpp | 4 ++-- src/fix_spring_rg.cpp | 4 ++-- src/fix_spring_self.cpp | 4 ++-- src/fix_store_force.cpp | 4 ++-- src/fix_viscous.cpp | 4 ++-- src/fix_wall.cpp | 4 ++-- src/fix_wall_region.cpp | 4 ++-- src/neighbor.cpp | 2 +- src/pair_hybrid.cpp | 2 +- src/pair_lj96_cut.cpp | 4 ++-- src/pair_mie_cut.cpp | 4 ++-- src/run.cpp | 2 +- 123 files changed, 177 insertions(+), 178 deletions(-) diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 63df8d2a5c..027c0dbd5a 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -195,7 +195,7 @@ void FixWallBodyPolygon::init() void FixWallBodyPolygon::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); } diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 45edf28c98..acfafaefbe 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -202,7 +202,7 @@ void FixWallBodyPolyhedron::init() void FixWallBodyPolyhedron::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); } diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index 3727b17493..23b0be7396 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -491,7 +491,7 @@ void PairLJClass2::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -506,7 +506,7 @@ void PairLJClass2::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 8b4a6bd732..9bebae15c8 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -671,7 +671,7 @@ void PairLJClass2CoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -688,7 +688,7 @@ void PairLJClass2CoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 9fc3e67e5c..66a3e85941 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -297,7 +297,7 @@ void FixGPU::setup(int vflag) error->all(FLERR, "Cannot use neigh_modify exclude with GPU neighbor builds"); - if (strstr(update->integrate_style,"verlet")) post_force(vflag); + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { // In setup only, all forces calculated on GPU are put in the outer level ((Respa *) update->integrate)->copy_flevel_f(_nlevels_respa-1); diff --git a/src/GPU/fix_nh_gpu.cpp b/src/GPU/fix_nh_gpu.cpp index 8b57289a50..c41099c6d2 100644 --- a/src/GPU/fix_nh_gpu.cpp +++ b/src/GPU/fix_nh_gpu.cpp @@ -63,7 +63,7 @@ FixNHGPU::~FixNHGPU() void FixNHGPU::setup(int vflag) { FixNH::setup(vflag); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) _respa_on = 1; else _respa_on = 0; diff --git a/src/GPU/fix_nve_gpu.cpp b/src/GPU/fix_nve_gpu.cpp index c3dd5b6ae2..9c6705deac 100644 --- a/src/GPU/fix_nve_gpu.cpp +++ b/src/GPU/fix_nve_gpu.cpp @@ -52,7 +52,7 @@ FixNVEGPU::~FixNVEGPU() void FixNVEGPU::setup(int vflag) { FixNVE::setup(vflag); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) _respa_on = 1; else _respa_on = 0; diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 61d0144b73..d6a827354c 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -149,7 +149,7 @@ void PPPMGPU::init() // GPU precision specific init bool respa_value=false; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) respa_value=true; if (order>8) diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp index a343683b03..6a16bbb1f6 100644 --- a/src/GRANULAR/fix_freeze.cpp +++ b/src/GRANULAR/fix_freeze.cpp @@ -69,7 +69,7 @@ void FixFreeze::init() void FixFreeze::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { int nlevels_respa = ((Respa *) update->integrate)->nlevels; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index d18b72aa65..5e8d568b7a 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -464,7 +464,7 @@ void FixWallGran::init() dt = update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; // check for FixRigid so can extract rigid body masses @@ -511,7 +511,7 @@ void FixWallGran::init() void FixWallGran::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 81de089960..30899bf402 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -67,7 +67,7 @@ void FixSetForceKokkos::init() { FixSetForce::init(); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) error->all(FLERR,"Cannot (yet) use respa with Kokkos"); } diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 97a2932415..253c7ee7e0 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -156,7 +156,7 @@ void FixShakeKokkos::init() { FixShake::init(); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) error->all(FLERR,"Cannot yet use respa with Kokkos"); if (rattle) diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index 1b6139a61a..975c191c3d 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -285,7 +285,7 @@ void PairBuckCoulCutKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index 771258f18b..2812abb026 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -447,7 +447,7 @@ void PairBuckCoulLongKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index bc25a26ded..b51bde119c 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -205,7 +205,7 @@ void PairBuckKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index affdf76ab0..4075108823 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -405,7 +405,7 @@ void PairCoulLongKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index 540a6a368a..5ef2edf1b6 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -90,7 +90,7 @@ void PairHybridKokkos::compute(int eflag, int vflag) Respa *respa = nullptr; respaflag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { respa = (Respa *) update->integrate; if (respa->nhybrid_styles > 0) respaflag = 1; } diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index b8fcc04b00..a0abce1510 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -450,7 +450,7 @@ void PairLJCharmmCoulCharmmImplicitKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index 8391338037..f683204d9d 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -451,7 +451,7 @@ void PairLJCharmmCoulCharmmKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index b54e5c96c9..7f9876a76f 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -459,7 +459,7 @@ void PairLJCharmmCoulLongKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index 281f29405f..36a15da628 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -287,7 +287,7 @@ void PairLJClass2CoulCutKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index de7b04159a..031d025544 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -442,7 +442,7 @@ void PairLJClass2CoulLongKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index 12b0c02421..cef3c1f8d8 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -223,7 +223,7 @@ void PairLJClass2Kokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index e2bf45c00a..636a72b5e1 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -278,7 +278,7 @@ void PairLJCutCoulCutKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 29eacfa774..8b4e189442 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -307,7 +307,7 @@ void PairLJCutCoulDebyeKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index 31380d88a8..cbeb0ab70a 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -300,7 +300,7 @@ void PairLJCutCoulDSFKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index 4270238c71..244acc644a 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -440,7 +440,7 @@ void PairLJCutCoulLongKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index 2a900dac7a..bffb921490 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -217,7 +217,7 @@ void PairLJCutKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index 3e6e955f02..d351f2d5fc 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -227,7 +227,7 @@ void PairLJExpandKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index ca59ec9d01..fa4a3ca06d 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -436,7 +436,7 @@ void PairLJGromacsCoulGromacsKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index c7bcacc778..58fe845b71 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -272,7 +272,7 @@ void PairLJGromacsKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index b752225902..f8f1fa87cc 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -255,7 +255,7 @@ void PairLJSDKKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index bab19c2f44..74c2934510 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -234,7 +234,7 @@ void PairMorseKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 39e604c9aa..123b0a2d84 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -107,7 +107,7 @@ void PairYukawaKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index a530b66ee0..954c2edf26 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -81,7 +81,7 @@ void PairZBLKokkos::init_style() // error if rRESPA with inner levels - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index c2c46f359b..f392179152 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -248,7 +248,7 @@ void PairBuckLongCoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; @@ -264,7 +264,7 @@ void PairBuckLongCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 459eac1687..ea48f0676f 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -740,7 +740,7 @@ void PairLJCharmmfswCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -779,7 +779,7 @@ void PairLJCharmmfswCoulLong::init_style() // set & error check interior rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) { cut_respa = ((Respa *) update->integrate)->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 2b34cf7f1b..da3b3c19e0 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -242,7 +242,7 @@ void PairLJLongCoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; @@ -258,7 +258,7 @@ void PairLJLongCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 7c2d18fc13..910db90822 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -138,7 +138,7 @@ void FixQEQComb::init() void FixQEQComb::setup(int vflag) { firstflag = 1; - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 56da69a7bc..8974b9039f 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -143,7 +143,7 @@ int FixBondBreak::setmask() void FixBondBreak::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; // enable angle/dihedral/improper breaking if any defined diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index c8c0af3a3e..634837595b 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -232,7 +232,7 @@ int FixBondCreate::setmask() void FixBondCreate::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; // check cutoff for iatomtype,jatomtype diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 1181f554cf..5eb3caf5ea 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -209,7 +209,7 @@ void FixEfield::init() update->whichflag == 2 && estyle == NONE) error->all(FLERR,"Must use variable energy with fix efield"); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -219,7 +219,7 @@ void FixEfield::init() void FixEfield::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 3f6c3da258..d0ad26c740 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -206,7 +206,7 @@ void FixGLD::init() dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; } diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index 4c6693f729..520940f2f0 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -202,7 +202,7 @@ int FixOrientBCC::setmask() void FixOrientBCC::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -228,7 +228,7 @@ void FixOrientBCC::init_list(int /*id*/, NeighList *ptr) void FixOrientBCC::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index a59e412fde..c94e91a0b5 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -200,7 +200,7 @@ int FixOrientFCC::setmask() void FixOrientFCC::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -226,7 +226,7 @@ void FixOrientFCC::init_list(int /*id*/, NeighList *ptr) void FixOrientFCC::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 4658c0c943..da71d736c2 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -207,7 +207,7 @@ void FixTTM::init() for (int iznode = 0; iznode < nznodes; iznode++) net_energy_transfer_all[ixnode][iynode][iznode] = 0; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index cc60dbec2b..d56c875744 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -368,7 +368,7 @@ void DihedralCharmm::coeff(int narg, char **arg) void DihedralCharmm::init_style() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { Respa *r = (Respa *) update->integrate; if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral)) error->all(FLERR,"Dihedral style charmm must be set to same" diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 1164e93f18..09372f67ac 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -386,7 +386,7 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) void DihedralCharmmfsw::init_style() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { Respa *r = (Respa *) update->integrate; if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral)) error->all(FLERR,"Dihedral style charmmfsw must be set to same" diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index bb74e90850..3d5b3697f7 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -389,7 +389,7 @@ void FixPOEMS::init() // rRESPA info - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { step_respa = ((Respa *) update->integrate)->step; nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/QEQ/fix_qeq_dynamic.cpp b/src/QEQ/fix_qeq_dynamic.cpp index 2bd63b718d..b06bde223b 100644 --- a/src/QEQ/fix_qeq_dynamic.cpp +++ b/src/QEQ/fix_qeq_dynamic.cpp @@ -78,7 +78,7 @@ void FixQEqDynamic::init() error->warning(FLERR,"Fix qeq/dynamic tolerance may be too small" " for damped dynamics"); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 6e51c906bc..b33a7745e0 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -91,7 +91,7 @@ void FixQEqFire::init() error->warning(FLERR,"Fix qeq/fire tolerance may be too small" " for damped fires"); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; comb = (PairComb *) force->pair_match("comb",1); diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index f112c4859f..3d71135ae1 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -57,7 +57,7 @@ void FixQEqPoint::init() int ntypes = atom->ntypes; memory->create(shld,ntypes+1,ntypes+1,"qeq:shielding"); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index decfe69ccc..356a747ed3 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -68,7 +68,7 @@ void FixQEqShielded::init() error->all(FLERR,"Invalid param file for fix qeq/shielded"); } - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 5cab1f1979..9b90f78d7a 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -79,7 +79,7 @@ void FixQEqSlater::init() error->all(FLERR,"Invalid param file for fix qeq/slater"); } - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index c211e0e4ca..a8a0e1409f 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -750,7 +750,7 @@ void FixRigid::init() dtf = 0.5 * update->dt * force->ftm2v; dtq = 0.5 * update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; // setup rigid bodies, using current atom info. if reinitflag is not set, diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index bdc7330d6d..b7e0a1b2ac 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -600,7 +600,7 @@ void FixRigidSmall::init() dtf = 0.5 * update->dt * force->ftm2v; dtq = 0.5 * update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; } diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index adef291ed9..390fe88309 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -456,7 +456,7 @@ void FixShake::setup(int vflag) // set respa to 0 if verlet is used and to 1 otherwise - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) respa = 0; else respa = 1; @@ -2956,7 +2956,7 @@ void FixShake::unpack_forward_comm(int n, int first, double *buf) void FixShake::reset_dt() { - if (strstr(update->integrate_style,"verlet")) { + if (utils::strmatch(update->integrate_style,"^verlet")) { dtv = update->dt; if (rattle) dtfsq = 0.5 * update->dt * update->dt * force->ftm2v; else dtfsq = update->dt * update->dt * force->ftm2v; diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 70ea7e1a09..17b9d3eb22 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -186,7 +186,7 @@ void FixPrecessionSpin::init() k1ch = k1c/hbar; k2ch = k2c/hbar; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -225,7 +225,7 @@ void FixPrecessionSpin::init() void FixPrecessionSpin::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 60fb03cdf8..bd217e60a8 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -590,7 +590,7 @@ void FixBocs::init() if (force->kspace) kspace_flag = 1; else kspace_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; dto = 0.5*step_respa[0]; @@ -1850,7 +1850,7 @@ void FixBocs::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dto = 0.5*step_respa[0]; if (pstat_flag) diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 74972a8076..a1b992059e 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -412,7 +412,7 @@ void FixColvars::init() if ((me == 0) && (update->whichflag == 2)) error->warning(FLERR,"Using fix colvars with minimization"); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -680,7 +680,7 @@ void FixColvars::setup(int vflag) proxy->setup(); // initialize forces - if (strstr(update->integrate_style,"verlet") || (update->whichflag == 2)) + if (utils::strmatch(update->integrate_style,"^verlet") || (update->whichflag == 2)) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index 2dabec3a30..44d2556b61 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -156,7 +156,7 @@ void FixLangevinDrude::init() void FixLangevinDrude::setup(int /*vflag*/) { - if (!strstr(update->integrate_style,"verlet")) + if (!utils::strmatch(update->integrate_style,"^verlet")) error->all(FLERR,"RESPA style not compatible with fix langevin/drude"); if (!comm->ghost_velocity) error->all(FLERR,"fix langevin/drude requires ghost velocities. Use comm_modify vel yes"); diff --git a/src/USER-DRUDE/fix_tgnh_drude.cpp b/src/USER-DRUDE/fix_tgnh_drude.cpp index 49a4061878..d8bf1d76f9 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.cpp +++ b/src/USER-DRUDE/fix_tgnh_drude.cpp @@ -671,7 +671,7 @@ void FixTGNHDrude::init() if (force->kspace) kspace_flag = 1; else kspace_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; dto = 0.5*step_respa[0]; @@ -1593,7 +1593,7 @@ void FixTGNHDrude::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dto = 0.5*step_respa[0]; } diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp index 58acdcc258..bfdd85df49 100644 --- a/src/USER-EFF/fix_nve_eff.cpp +++ b/src/USER-EFF/fix_nve_eff.cpp @@ -58,7 +58,7 @@ void FixNVEEff::init() dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; } diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index c8a65539b4..7f17179087 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -356,7 +356,7 @@ void FixAdaptFEP::init() fix_chg = (FixStore *) modify->fix[ifix]; } - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/USER-INTEL/fix_nh_intel.cpp b/src/USER-INTEL/fix_nh_intel.cpp index 19245cccbf..6105892041 100644 --- a/src/USER-INTEL/fix_nh_intel.cpp +++ b/src/USER-INTEL/fix_nh_intel.cpp @@ -317,7 +317,7 @@ void FixNHIntel::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dto = 0.5*step_respa[0]; if (pstat_flag) diff --git a/src/USER-LB/fix_lb_viscous.cpp b/src/USER-LB/fix_lb_viscous.cpp index 08a0a10356..a13fea3a1a 100644 --- a/src/USER-LB/fix_lb_viscous.cpp +++ b/src/USER-LB/fix_lb_viscous.cpp @@ -79,7 +79,7 @@ int FixLbViscous::setmask() void FixLbViscous::init() { - if (strcmp(update->integrate_style,"respa") == 0) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -88,7 +88,7 @@ void FixLbViscous::init() void FixLbViscous::setup(int vflag) { - if (strstr(update->integrate_style,"verlet") != nullptr) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 26d209e7a9..b48decddba 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -120,7 +120,7 @@ void FixManifoldForce::init() void FixManifoldForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { int nlevels_respa = ((Respa *) update->integrate)->nlevels; diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index b19f51a10b..59f2560e0b 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -130,7 +130,7 @@ void FixAddTorque::init() varflag = EQUAL; else varflag = CONSTANT; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -140,7 +140,7 @@ void FixAddTorque::init() void FixAddTorque::setup(int vflag) { - if (strcmp(update->integrate_style,"verlet") == 0) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/USER-MISC/fix_electron_stopping_fit.cpp b/src/USER-MISC/fix_electron_stopping_fit.cpp index 2d9034aaef..8768ed5f3d 100644 --- a/src/USER-MISC/fix_electron_stopping_fit.cpp +++ b/src/USER-MISC/fix_electron_stopping_fit.cpp @@ -140,7 +140,7 @@ void FixElectronStoppingFit::init() void FixElectronStoppingFit::setup(int vflag) { - if (strcmp(update->integrate_style,"verlet") == 0) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index eb9f033afc..6dfa9eb2ca 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -156,7 +156,7 @@ void FixFFL::init() { } } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; } @@ -178,7 +178,7 @@ void FixFFL::init_ffl() { /* ---------------------------------------------------------------------- */ void FixFFL::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 38b22c1189..6e6dce84a7 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -277,7 +277,7 @@ void FixFilterCorotate::init() // could have changed locations in fix list since created // set ptrs to rRESPA variables - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; } else error->all(FLERR,"Fix filter/corotate requires rRESPA!"); diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index 3c913f8039..9e6a2c0174 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -123,7 +123,7 @@ void FixFlowGauss::init() { //if respa level specified by fix_modify, then override default (outermost) //if specified level too high, set to max level - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); @@ -146,7 +146,7 @@ void FixFlowGauss::setup(int vflag) if (mTot <= 0.0) error->all(FLERR,"Invalid group mass in fix flow/gauss"); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index a83ab0f9ce..8a7459b79d 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -416,7 +416,7 @@ void FixGLE::init() } } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; } @@ -502,7 +502,7 @@ void FixGLE::init_gles() void FixGLE::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index 64c7e4a6b7..e036eff205 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -200,10 +200,10 @@ void FixGrem::init() void FixGrem::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) error->all(FLERR,"Run style 'respa' is not supported"); } diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 8796de289e..f9591db4d3 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -601,7 +601,7 @@ int FixIMD::setmask() /* ---------------------------------------------------------------------- */ void FixIMD::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; return; diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 37d6e5286b..802cabea67 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -765,7 +765,7 @@ void FixNPTCauchy::init() if (force->kspace) kspace_flag = 1; else kspace_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; dto = 0.5*step_respa[0]; @@ -1752,7 +1752,7 @@ void FixNPTCauchy::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dto = 0.5*step_respa[0]; if (pstat_flag) diff --git a/src/USER-MISC/fix_nvk.cpp b/src/USER-MISC/fix_nvk.cpp index d21f4efe4e..ef6c390f95 100644 --- a/src/USER-MISC/fix_nvk.cpp +++ b/src/USER-MISC/fix_nvk.cpp @@ -59,7 +59,7 @@ void FixNVK::init() dtv = update->dt; dtf = 0.5 * update->dt; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { error->all(FLERR,"Fix nvk not yet enabled for RESPA"); step_respa = ((Respa *) update->integrate)->step; } diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 3d6db4cd4f..56da3cd6a1 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -177,7 +177,7 @@ void FixOrientECO::init() { MPI_Bcast(&norm_fac, 1, MPI_DOUBLE, 0, world); MPI_Bcast(&inv_norm_fac, 1, MPI_DOUBLE, 0, world); - if (strstr(update->integrate_style, "respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } @@ -201,7 +201,7 @@ void FixOrientECO::init_list(int /* id */, NeighList *ptr) { /* ---------------------------------------------------------------------- */ void FixOrientECO::setup(int vflag) { - if (strstr(update->integrate_style, "verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp index c2ad62d7d0..7d5216f540 100644 --- a/src/USER-MISC/fix_pafi.cpp +++ b/src/USER-MISC/fix_pafi.cpp @@ -180,7 +180,7 @@ void FixPAFI::init() error->all(FLERR,"Compute for fix pafi must have 9 fields per atom"); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { step_respa = ((Respa *) update->integrate)->step; // nve nlevels_respa = ((Respa *) update->integrate)->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); @@ -191,7 +191,7 @@ void FixPAFI::init() void FixPAFI::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index f546b9a814..18e1ed195f 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -95,7 +95,7 @@ int FixRhok::setmask() void FixRhok::init() { // RESPA boilerplate - if (strcmp( update->integrate_style, "respa" ) == 0) + if (utils::strmatch(update->integrate_style,"^respa")) mNLevelsRESPA = ((Respa *) update->integrate)->nlevels; // Count the number of affected particles @@ -117,7 +117,7 @@ void FixRhok::init() // Initial application of the fix to a system (when doing MD) void FixRhok::setup( int inVFlag ) { - if (strcmp( update->integrate_style, "verlet" ) == 0) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force( inVFlag ); else { diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index 8ea1beac71..bc8ede4a17 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -159,7 +159,7 @@ void FixSMD::init() zn = dz/r_old; } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -169,7 +169,7 @@ void FixSMD::init() void FixSMD::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); @@ -190,7 +190,7 @@ void FixSMD::post_force(int vflag) else smd_couple(); if (styleflag & SMD_CVEL) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) r_old += v_smd * update->dt; else r_old += v_smd * ((Respa *) update->integrate)->step[ilevel_respa]; @@ -205,7 +205,7 @@ void FixSMD::smd_tether() group->xcm(igroup,masstotal,xcm); double dt = update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dt = ((Respa *) update->integrate)->step[ilevel_respa]; // fx,fy,fz = components of k * (r-r0) @@ -311,7 +311,7 @@ void FixSMD::smd_couple() group->xcm(igroup2,masstotal2,xcm2); double dt = update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dt = ((Respa *) update->integrate)->step[ilevel_respa]; // renormalize direction of spring diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 766b9df5eb..1d6079d4d6 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -141,7 +141,7 @@ int FixTISpring::setmask() void FixTISpring::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -149,7 +149,7 @@ void FixTISpring::init() void FixTISpring::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index 7056ad6a00..d4023b6011 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -230,7 +230,7 @@ void FixTTMMod::init() for (int iznode = 0; iznode < nznodes; iznode++) net_energy_transfer_all[ixnode][iynode][iznode] = 0; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 51e0af9dc4..8a79b73034 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -118,7 +118,7 @@ void FixWallRegionEES::init() offset = 0; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -126,7 +126,7 @@ void FixWallRegionEES::init() void FixWallRegionEES::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index f49d181e0f..84eb86aaa8 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -690,7 +690,7 @@ void PairLJExpandCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -707,7 +707,7 @@ void PairLJExpandCoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 23671f4c7e..678df7c22a 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -203,9 +203,8 @@ void FixOMP::init() thr[i]->_timer_active=-1; } - if ((strstr(update->integrate_style,"respa") != nullptr) - && (strstr(update->integrate_style,"respa/omp") == nullptr)) - error->all(FLERR,"Need to use respa/omp for r-RESPA with /omp styles"); + if (!utils::strmatch(update->integrate_style,"^respa/omp")) + error->all(FLERR,"Must use respa/omp for r-RESPA with /omp styles"); if (force->pair && force->pair->compute_flag) _pair_compute_flag = true; else _pair_compute_flag = false; diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index aceff62ebc..6844729e92 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -58,7 +58,7 @@ void FixQEQCombOMP::init() error->all(FLERR,"Must use pair_style comb or " "comb/omp with fix qeq/comb/omp"); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index 6689ebdb9d..fab658f8f2 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -651,7 +651,7 @@ void FixQMMM::exchange_forces() void FixQMMM::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) error->all(FLERR,"Fix qmmm does not currently support r-RESPA"); if (do_init) { diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index e4e645a1bb..a4f6e8678f 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -216,7 +216,7 @@ void FixQTB::init() } // respa - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -225,7 +225,7 @@ void FixQTB::init() ------------------------------------------------------------------------- */ void FixQTB::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 44088043f0..3109950ff2 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -370,7 +370,7 @@ void FixQEqReax::init() init_shielding(); init_taper(); - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index 471159ea53..312deb4d19 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -208,7 +208,7 @@ void FixSMDSetVel::init() { /* ---------------------------------------------------------------------- */ void FixSMDSetVel::setup(int vflag) { - if (strstr(update->integrate_style, "verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else error->all(FLERR,"Fix smd/setvel does not support RESPA"); diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index 556d303d30..c1bf0a308d 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -338,7 +338,7 @@ void PairLJSwitch3CoulGaussLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -355,7 +355,7 @@ void PairLJSwitch3CoulGaussLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index 47ddf8c7ad..187778bb66 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -340,7 +340,7 @@ void PairMM3Switch3CoulGaussLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -357,7 +357,7 @@ void PairMM3Switch3CoulGaussLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index c09b6481f6..51fdb16d5d 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -462,7 +462,7 @@ void FixAdapt::init() fix_chg = (FixStore *) modify->fix[ifix]; } - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 5ce50aafea..867643499a 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -155,7 +155,7 @@ void FixAveForce::init() if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL) varflag = EQUAL; else varflag = CONSTANT; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; @@ -166,7 +166,7 @@ void FixAveForce::init() void FixAveForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp index 40b8af7f9a..03209ce729 100644 --- a/src/fix_drag.cpp +++ b/src/fix_drag.cpp @@ -69,7 +69,7 @@ int FixDrag::setmask() void FixDrag::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -79,7 +79,7 @@ void FixDrag::init() void FixDrag::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index 336911e8c7..34cecc45de 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -112,7 +112,7 @@ void FixDtReset::init() // set rRESPA flag respaflag = 0; - if (strstr(update->integrate_style,"respa")) respaflag = 1; + if (utils::strmatch(update->integrate_style,"^respa")) respaflag = 1; // check for DCD or XTC dumps diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index c1b8285a4b..1284a9b78c 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -90,7 +90,7 @@ void FixEnforce2D::init() void FixEnforce2D::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { int nlevels_respa = ((Respa *) update->integrate)->nlevels; diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 194f5731bc..8c6baab1ee 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -181,7 +181,7 @@ int FixGravity::setmask() void FixGravity::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -243,7 +243,7 @@ void FixGravity::init() void FixGravity::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index 48355446d1..d2a7ba0d2a 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -153,7 +153,7 @@ void FixIndent::init() error->all(FLERR,"Variable for fix indent is not equal style"); } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -163,7 +163,7 @@ void FixIndent::init() void FixIndent::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 66da7a9633..bf9d5cad23 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -310,7 +310,7 @@ void FixLangevin::init() if (temperature && temperature->tempbias) tbiasflag = BIAS; else tbiasflag = NOBIAS; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; if (utils::strmatch(update->integrate_style,"^respa") && gjfflag) @@ -367,7 +367,7 @@ void FixLangevin::setup(int vflag) } } } - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index 9582d8db51..6a77442ea4 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -59,7 +59,7 @@ int FixLineForce::setmask() void FixLineForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { int nlevels_respa = ((Respa *) update->integrate)->nlevels; diff --git a/src/fix_move.cpp b/src/fix_move.cpp index e37fe52cc9..6b640cd747 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -433,7 +433,7 @@ void FixMove::init() if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); else velocity = nullptr; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 120aeeb7de..d95763f06b 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -728,7 +728,7 @@ void FixNH::init() if (force->kspace) kspace_flag = 1; else kspace_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; dto = 0.5*step_respa[0]; @@ -1722,7 +1722,7 @@ void FixNH::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) dto = 0.5*step_respa[0]; if (pstat_flag) diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 10926ec440..495e196749 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -120,7 +120,7 @@ void FixNumDiff::init() if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; else kspace_compute_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -130,7 +130,7 @@ void FixNumDiff::init() void FixNumDiff::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index 7ee0e6f80e..58db5e25d9 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -66,7 +66,7 @@ void FixNVELimit::init() vlimitsq = (xlimit/dtv) * (xlimit/dtv); ncount = 0; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; // warn if using fix shake, which will lead to invalid constraint forces diff --git a/src/fix_nve_noforce.cpp b/src/fix_nve_noforce.cpp index 3a9c1c6442..61528a0024 100644 --- a/src/fix_nve_noforce.cpp +++ b/src/fix_nve_noforce.cpp @@ -47,7 +47,7 @@ void FixNVENoforce::init() { dtv = update->dt; - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) step_respa = ((Respa *) update->integrate)->step; } diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index cc0b43054a..783d26ac9e 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -59,7 +59,7 @@ int FixPlaneForce::setmask() void FixPlaneForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { int nlevels_respa = ((Respa *) update->integrate)->nlevels; diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 82e91c8289..ff61703c1a 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -185,7 +185,7 @@ int FixRestrain::setmask() void FixRestrain::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -195,7 +195,7 @@ void FixRestrain::init() void FixRestrain::setup(int vflag) { - if (strcmp(update->integrate_style,"verlet") == 0) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 7d41b428c9..d59d091f42 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -166,7 +166,7 @@ void FixSetForce::init() varflag = EQUAL; else varflag = CONSTANT; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { nlevels_respa = ((Respa *) update->integrate)->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; @@ -192,7 +192,7 @@ void FixSetForce::init() void FixSetForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 89d569fc8b..200d9f072a 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -128,7 +128,7 @@ void FixSpring::init() masstotal = group->mass(igroup); if (styleflag == COUPLE) masstotal2 = group->mass(igroup2); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -138,7 +138,7 @@ void FixSpring::init() void FixSpring::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index 8eb35e74aa..a007aabefc 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -112,7 +112,7 @@ void FixSpringChunk::init() if (strcmp(idchunk,ccom->idchunk) != 0) error->all(FLERR,"Fix spring chunk chunkID not same as comID chunkID"); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -122,7 +122,7 @@ void FixSpringChunk::init() void FixSpringChunk::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index cabdc4b11f..58249bbd2d 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -77,7 +77,7 @@ void FixSpringRG::init() rg0_flag = 0; } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -87,7 +87,7 @@ void FixSpringRG::init() void FixSpringRG::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 7a22cbd3f8..9f649faec0 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -120,7 +120,7 @@ int FixSpringSelf::setmask() void FixSpringSelf::init() { - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -130,7 +130,7 @@ void FixSpringSelf::init() void FixSpringSelf::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 460422aee9..1541294f6c 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -68,7 +68,7 @@ int FixStoreForce::setmask() void FixStoreForce::init() { - if (strstr(update->integrate_style,"respa")) + if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; } @@ -76,7 +76,7 @@ void FixStoreForce::init() void FixStoreForce::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index 7bdac6aeaf..0c7d682ae2 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -80,7 +80,7 @@ void FixViscous::init() { int max_respa = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = max_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,max_respa); } @@ -90,7 +90,7 @@ void FixViscous::init() void FixViscous::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 677085854c..280ce848c6 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -263,7 +263,7 @@ void FixWall::init() for (int m = 0; m < nwall; m++) precompute(m); - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -273,7 +273,7 @@ void FixWall::init() void FixWall::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) { + if (utils::strmatch(update->integrate_style,"^verlet")) { if (!fldflag) post_force(vflag); } else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 7e30fe2361..e5c9167ce4 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -187,7 +187,7 @@ void FixWallRegion::init() offset = coeff3*r4inv*r4inv*rinv - coeff4*r2inv*rinv; } - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { ilevel_respa = ((Respa *) update->integrate)->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -197,7 +197,7 @@ void FixWallRegion::init() void FixWallRegion::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 68fa3ca96e..fb0a244cc0 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -319,7 +319,7 @@ void Neighbor::init() // rRESPA cutoffs int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 377364b8e5..c7b6048139 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -114,7 +114,7 @@ void PairHybrid::compute(int eflag, int vflag) Respa *respa = nullptr; respaflag = 0; - if (strstr(update->integrate_style,"respa")) { + if (utils::strmatch(update->integrate_style,"^respa")) { respa = (Respa *) update->integrate; if (respa->nhybrid_styles > 0) respaflag = 1; } diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index b68d595098..65f2d40e00 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -490,7 +490,7 @@ void PairLJ96Cut::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -505,7 +505,7 @@ void PairLJ96Cut::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 043ad3aeaa..503ed60d1b 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -499,7 +499,7 @@ void PairMIECut::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -514,7 +514,7 @@ void PairMIECut::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = nullptr; diff --git a/src/run.cpp b/src/run.cpp index fedf020d9d..c503e174ff 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -134,7 +134,7 @@ void Run::command(int narg, char **arg) error->all(FLERR,"Run command stop value is before end of run"); } - if (!preflag && strstr(update->integrate_style,"respa")) + if (!preflag && utils::strmatch(update->integrate_style,"^respa")) error->all(FLERR,"Run flag 'pre no' not compatible with r-RESPA"); // if nevery, make copies of arg strings that are commands