From 96d8d12a88161c0d13d641accbaf64bdc15b8706 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Aug 2020 19:32:03 -0400 Subject: [PATCH] replace calls to force->*numeric() with the corresponding utils::*numeric() this also removes the now obsolete functions from Force --- src/ASPHERE/pair_gayberne.cpp | 26 ++-- src/ASPHERE/pair_line_lj.cpp | 14 +- src/ASPHERE/pair_resquared.cpp | 20 +-- src/ASPHERE/pair_tri_lj.cpp | 8 +- src/BODY/body_nparticle.cpp | 4 +- src/BODY/body_rounded_polygon.cpp | 4 +- src/BODY/body_rounded_polyhedron.cpp | 4 +- src/BODY/compute_body_local.cpp | 2 +- src/BODY/fix_wall_body_polygon.cpp | 20 +-- src/BODY/fix_wall_body_polyhedron.cpp | 22 +-- src/BODY/pair_body_nparticle.cpp | 8 +- src/BODY/pair_body_rounded_polygon.cpp | 14 +- src/BODY/pair_body_rounded_polyhedron.cpp | 14 +- src/CLASS2/angle_class2.cpp | 22 +-- src/CLASS2/bond_class2.cpp | 8 +- src/CLASS2/dihedral_class2.cpp | 64 ++++---- src/CLASS2/improper_class2.cpp | 16 +- src/CLASS2/pair_lj_class2.cpp | 8 +- src/CLASS2/pair_lj_class2_coul_cut.cpp | 12 +- src/CLASS2/pair_lj_class2_coul_long.cpp | 10 +- src/COLLOID/pair_brownian.cpp | 22 +-- src/COLLOID/pair_colloid.cpp | 12 +- src/COLLOID/pair_lubricate.cpp | 18 +-- src/COLLOID/pair_lubricateU.cpp | 18 +-- src/COLLOID/pair_lubricateU_poly.cpp | 14 +- src/DIPOLE/pair_lj_cut_dipole_cut.cpp | 12 +- src/DIPOLE/pair_lj_cut_dipole_long.cpp | 10 +- src/DIPOLE/pair_lj_long_dipole_long.cpp | 10 +- src/GPU/fix_gpu.cpp | 14 +- src/GRANULAR/fix_pour.cpp | 48 +++--- src/GRANULAR/fix_wall_gran.cpp | 84 +++++------ src/GRANULAR/pair_gran_hertz_history.cpp | 12 +- src/GRANULAR/pair_gran_hooke_history.cpp | 12 +- src/GRANULAR/pair_granular.cpp | 56 +++---- src/KOKKOS/kokkos.cpp | 2 +- src/KOKKOS/pair_coul_debye_kokkos.cpp | 4 +- src/KOKKOS/pair_hybrid_overlay_kokkos.cpp | 2 +- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 6 +- src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 2 +- src/KOKKOS/pair_table_kokkos.cpp | 2 +- src/KOKKOS/pair_table_rx_kokkos.cpp | 4 +- src/KOKKOS/pppm_kokkos.cpp | 2 +- src/KSPACE/ewald.cpp | 2 +- src/KSPACE/ewald_disp.cpp | 2 +- src/KSPACE/fix_tune_kspace.cpp | 2 +- src/KSPACE/msm.cpp | 2 +- src/KSPACE/msm_cg.cpp | 2 +- src/KSPACE/pair_born_coul_long.cpp | 16 +- src/KSPACE/pair_buck_coul_long.cpp | 12 +- src/KSPACE/pair_buck_long_coul_long.cpp | 12 +- src/KSPACE/pair_coul_long.cpp | 2 +- src/KSPACE/pair_lj_charmm_coul_long.cpp | 14 +- src/KSPACE/pair_lj_charmmfsw_coul_long.cpp | 14 +- src/KSPACE/pair_lj_cut_coul_long.cpp | 10 +- src/KSPACE/pair_lj_cut_tip4p_long.cpp | 14 +- src/KSPACE/pair_lj_long_coul_long.cpp | 10 +- src/KSPACE/pair_lj_long_tip4p_long.cpp | 14 +- src/KSPACE/pair_tip4p_long.cpp | 12 +- src/KSPACE/pppm.cpp | 2 +- src/KSPACE/pppm_cg.cpp | 2 +- src/KSPACE/pppm_disp.cpp | 2 +- src/MANYBODY/fix_qeq_comb.cpp | 4 +- src/MANYBODY/pair_airebo.cpp | 8 +- src/MANYBODY/pair_atm.cpp | 6 +- src/MANYBODY/pair_vashishta_table.cpp | 4 +- src/MC/fix_atom_swap.cpp | 12 +- src/MC/fix_bond_break.cpp | 10 +- src/MC/fix_bond_create.cpp | 32 ++-- src/MC/fix_bond_swap.cpp | 8 +- src/MC/fix_gcmc.cpp | 42 +++--- src/MC/fix_tfmc.cpp | 12 +- src/MC/fix_widom.cpp | 14 +- src/MC/pair_dsmc.cpp | 16 +- src/MISC/dump_xtc.cpp | 6 +- src/MISC/fix_deposit.cpp | 64 ++++---- src/MISC/fix_efield.cpp | 6 +- src/MISC/fix_evaporate.cpp | 6 +- src/MISC/fix_gld.cpp | 12 +- src/MISC/fix_oneway.cpp | 2 +- src/MISC/fix_orient_bcc.cpp | 12 +- src/MISC/fix_orient_fcc.cpp | 12 +- src/MISC/fix_thermal_conductivity.cpp | 6 +- src/MISC/fix_ttm.cpp | 22 +-- src/MISC/fix_viscosity.cpp | 8 +- src/MISC/pair_nm_cut.cpp | 12 +- src/MISC/pair_nm_cut_coul_cut.cpp | 16 +- src/MISC/pair_nm_cut_coul_long.cpp | 14 +- src/MOLECULE/angle_charmm.cpp | 8 +- src/MOLECULE/angle_cosine.cpp | 2 +- src/MOLECULE/angle_cosine_periodic.cpp | 6 +- src/MOLECULE/angle_cosine_squared.cpp | 4 +- src/MOLECULE/angle_harmonic.cpp | 4 +- src/MOLECULE/angle_table.cpp | 2 +- src/MOLECULE/bond_fene.cpp | 8 +- src/MOLECULE/bond_fene_expand.cpp | 10 +- src/MOLECULE/bond_gromos.cpp | 4 +- src/MOLECULE/bond_harmonic.cpp | 4 +- src/MOLECULE/bond_morse.cpp | 6 +- src/MOLECULE/bond_nonlinear.cpp | 6 +- src/MOLECULE/bond_quartic.cpp | 10 +- src/MOLECULE/bond_table.cpp | 2 +- src/MOLECULE/dihedral_charmm.cpp | 8 +- src/MOLECULE/dihedral_charmmfsw.cpp | 8 +- src/MOLECULE/dihedral_harmonic.cpp | 6 +- src/MOLECULE/dihedral_helix.cpp | 6 +- src/MOLECULE/dihedral_multi_harmonic.cpp | 10 +- src/MOLECULE/dihedral_opls.cpp | 8 +- src/MOLECULE/improper_cvff.cpp | 6 +- src/MOLECULE/improper_harmonic.cpp | 4 +- src/MOLECULE/improper_umbrella.cpp | 4 +- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 20 +-- src/MOLECULE/pair_hbond_dreiding_morse.cpp | 14 +- src/MOLECULE/pair_lj_charmm_coul_charmm.cpp | 16 +- .../pair_lj_charmmfsw_coul_charmmfsh.cpp | 14 +- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 20 +-- src/MOLECULE/pair_tip4p_cut.cpp | 12 +- src/MSCG/fix_mscg.cpp | 2 +- src/PERI/pair_peri_eps.cpp | 12 +- src/PERI/pair_peri_lps.cpp | 10 +- src/PERI/pair_peri_pmb.cpp | 8 +- src/PERI/pair_peri_ves.cpp | 14 +- src/PYTHON/fix_python_invoke.cpp | 2 +- src/PYTHON/pair_python.cpp | 2 +- src/PYTHON/python_impl.cpp | 8 +- src/QEQ/fix_qeq.cpp | 18 +-- src/REPLICA/compute_event_displace.cpp | 2 +- src/REPLICA/fix_hyper_global.cpp | 8 +- src/REPLICA/fix_hyper_local.cpp | 20 +-- src/REPLICA/fix_neb.cpp | 12 +- src/REPLICA/hyper.cpp | 14 +- src/REPLICA/neb.cpp | 10 +- src/REPLICA/prd.cpp | 22 +-- src/REPLICA/tad.cpp | 32 ++-- src/REPLICA/temper.cpp | 12 +- src/RIGID/fix_ehex.cpp | 4 +- src/RIGID/fix_rigid.cpp | 54 +++---- src/RIGID/fix_rigid_small.cpp | 52 +++---- src/RIGID/fix_shake.cpp | 14 +- src/SHOCK/fix_append_atoms.cpp | 26 ++-- src/SHOCK/fix_msst.cpp | 16 +- src/SHOCK/fix_nphug.cpp | 6 +- src/SHOCK/fix_wall_piston.cpp | 14 +- src/SNAP/compute_sna_atom.cpp | 4 +- src/SNAP/compute_snad_atom.cpp | 4 +- src/SNAP/compute_snap.cpp | 4 +- src/SNAP/compute_snav_atom.cpp | 4 +- src/SPIN/fix_langevin_spin.cpp | 6 +- src/SPIN/fix_neb_spin.cpp | 2 +- src/SPIN/fix_precession_spin.cpp | 38 ++--- src/SPIN/min_spin.cpp | 4 +- src/SPIN/min_spin_cg.cpp | 2 +- src/SPIN/min_spin_lbfgs.cpp | 2 +- src/SPIN/neb_spin.cpp | 10 +- src/SPIN/pair_spin_dipole_cut.cpp | 4 +- src/SPIN/pair_spin_dipole_long.cpp | 4 +- src/SPIN/pair_spin_dmi.cpp | 12 +- src/SPIN/pair_spin_exchange.cpp | 10 +- src/SPIN/pair_spin_magelec.cpp | 12 +- src/SPIN/pair_spin_neel.cpp | 16 +- src/SRD/fix_srd.cpp | 20 +-- src/SRD/fix_wall_srd.cpp | 2 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 12 +- src/USER-BOCS/fix_bocs.cpp | 28 ++-- src/USER-CGDNA/bond_oxdna_fene.cpp | 6 +- src/USER-CGDNA/fix_nve_dotc_langevin.cpp | 10 +- src/USER-CGDNA/pair_oxdna2_coaxstk.cpp | 38 ++--- src/USER-CGDNA/pair_oxdna2_dh.cpp | 6 +- src/USER-CGDNA/pair_oxdna_coaxstk.cpp | 42 +++--- src/USER-CGDNA/pair_oxdna_excv.cpp | 18 +-- src/USER-CGDNA/pair_oxdna_hbond.cpp | 48 +++--- src/USER-CGDNA/pair_oxdna_stk.cpp | 42 +++--- src/USER-CGDNA/pair_oxdna_xstk.cpp | 46 +++--- src/USER-CGDNA/pair_oxrna2_stk.cpp | 48 +++--- src/USER-CGDNA/pair_oxrna2_xstk.cpp | 40 ++--- src/USER-CGSDK/angle_sdk.cpp | 8 +- src/USER-CGSDK/pair_lj_sdk.cpp | 8 +- src/USER-CGSDK/pair_lj_sdk_coul_long.cpp | 10 +- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 10 +- src/USER-DPD/fix_eos_cv.cpp | 2 +- src/USER-DPD/fix_eos_table.cpp | 2 +- src/USER-DPD/fix_eos_table_rx.cpp | 2 +- src/USER-DPD/pair_dpd_fdt.cpp | 12 +- src/USER-DPD/pair_dpd_fdt_energy.cpp | 12 +- src/USER-DPD/pair_exp6_rx.cpp | 12 +- src/USER-DPD/pair_multi_lucy.cpp | 4 +- src/USER-DPD/pair_multi_lucy_rx.cpp | 4 +- src/USER-DPD/pair_table_rx.cpp | 4 +- src/USER-DRUDE/fix_langevin_drude.cpp | 12 +- src/USER-DRUDE/pair_lj_cut_thole_long.cpp | 16 +- src/USER-DRUDE/pair_thole.cpp | 10 +- src/USER-EFF/fix_temp_rescale_eff.cpp | 10 +- src/USER-EFF/pair_eff_cut.cpp | 24 +-- src/USER-FEP/compute_fep.cpp | 2 +- src/USER-FEP/fix_adapt_fep.cpp | 2 +- src/USER-FEP/pair_coul_cut_soft.cpp | 10 +- src/USER-FEP/pair_coul_long_soft.cpp | 8 +- .../pair_lj_charmm_coul_long_soft.cpp | 22 +-- src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp | 20 +-- .../pair_lj_class2_coul_long_soft.cpp | 18 +-- src/USER-FEP/pair_lj_class2_soft.cpp | 14 +- src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp | 20 +-- src/USER-FEP/pair_lj_cut_coul_long_soft.cpp | 18 +-- src/USER-FEP/pair_lj_cut_soft.cpp | 14 +- src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp | 20 +-- src/USER-FEP/pair_morse_soft.cpp | 16 +- src/USER-FEP/pair_tip4p_long_soft.cpp | 16 +- src/USER-H5MD/dump_h5md.cpp | 2 +- src/USER-INTEL/fix_intel.cpp | 6 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 10 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 8 +- src/USER-MESODPD/compute_tdpd_cc_atom.cpp | 2 +- src/USER-MESODPD/fix_edpd_source.cpp | 24 +-- src/USER-MESODPD/fix_mvv_dpd.cpp | 2 +- src/USER-MESODPD/fix_mvv_edpd.cpp | 2 +- src/USER-MESODPD/fix_mvv_tdpd.cpp | 2 +- src/USER-MESODPD/fix_tdpd_source.cpp | 26 ++-- src/USER-MESODPD/pair_edpd.cpp | 22 +-- src/USER-MESODPD/pair_mdpd.cpp | 16 +- src/USER-MESODPD/pair_mdpd_rhosum.cpp | 2 +- src/USER-MESODPD/pair_tdpd.cpp | 22 +-- src/USER-MESONT/pair_mesont_tpm.cpp | 8 +- src/USER-MISC/angle_cosine_shift.cpp | 4 +- src/USER-MISC/angle_cosine_shift_exp.cpp | 6 +- src/USER-MISC/angle_dipole.cpp | 4 +- src/USER-MISC/angle_fourier.cpp | 8 +- src/USER-MISC/angle_fourier_simple.cpp | 6 +- src/USER-MISC/angle_quartic.cpp | 8 +- src/USER-MISC/bond_harmonic_shift.cpp | 6 +- src/USER-MISC/bond_harmonic_shift_cut.cpp | 6 +- src/USER-MISC/bond_special.cpp | 4 +- src/USER-MISC/compute_cnp_atom.cpp | 2 +- src/USER-MISC/compute_entropy_atom.cpp | 6 +- src/USER-MISC/compute_hma.cpp | 2 +- src/USER-MISC/compute_pressure_cylinder.cpp | 8 +- src/USER-MISC/compute_stress_mop.cpp | 2 +- src/USER-MISC/compute_stress_mop_profile.cpp | 4 +- src/USER-MISC/dihedral_cosine_shift_exp.cpp | 6 +- src/USER-MISC/dihedral_fourier.cpp | 8 +- src/USER-MISC/dihedral_nharmonic.cpp | 4 +- src/USER-MISC/dihedral_quadratic.cpp | 4 +- src/USER-MISC/dihedral_spherical.cpp | 22 +-- src/USER-MISC/dihedral_table.cpp | 2 +- src/USER-MISC/dihedral_table_cut.cpp | 8 +- src/USER-MISC/fix_accelerate_cos.cpp | 2 +- src/USER-MISC/fix_addtorque.cpp | 6 +- src/USER-MISC/fix_ave_correlate_long.cpp | 12 +- src/USER-MISC/fix_electron_stopping.cpp | 6 +- src/USER-MISC/fix_ffl.cpp | 13 +- src/USER-MISC/fix_filter_corotate.cpp | 8 +- src/USER-MISC/fix_flow_gauss.cpp | 2 +- src/USER-MISC/fix_gle.cpp | 10 +- src/USER-MISC/fix_grem.cpp | 6 +- src/USER-MISC/fix_imd.cpp | 6 +- src/USER-MISC/fix_ipi.cpp | 2 +- src/USER-MISC/fix_momentum_chunk.cpp | 8 +- src/USER-MISC/fix_npt_cauchy.cpp | 82 +++++----- src/USER-MISC/fix_orient_eco.cpp | 6 +- src/USER-MISC/fix_propel_self.cpp | 4 +- src/USER-MISC/fix_rhok.cpp | 10 +- src/USER-MISC/fix_smd.cpp | 22 +-- src/USER-MISC/fix_srp.cpp | 4 +- src/USER-MISC/fix_ti_spring.cpp | 8 +- src/USER-MISC/fix_ttm_mod.cpp | 10 +- src/USER-MISC/fix_wall_reflect_stochastic.cpp | 12 +- src/USER-MISC/fix_wall_region_ees.cpp | 6 +- src/USER-MISC/improper_cossq.cpp | 4 +- src/USER-MISC/improper_distance.cpp | 4 +- src/USER-MISC/improper_fourier.cpp | 10 +- src/USER-MISC/improper_ring.cpp | 4 +- src/USER-MISC/pair_buck_mdf.cpp | 14 +- src/USER-MISC/pair_cosine_squared.cpp | 10 +- src/USER-MISC/pair_coul_diel.cpp | 10 +- src/USER-MISC/pair_coul_shield.cpp | 8 +- src/USER-MISC/pair_coul_slater_cut.cpp | 4 +- src/USER-MISC/pair_coul_slater_long.cpp | 4 +- src/USER-MISC/pair_e3b.cpp | 26 ++-- src/USER-MISC/pair_gauss_cut.cpp | 10 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 4 +- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 4 +- src/USER-MISC/pair_kolmogorov_crespi_z.cpp | 2 +- src/USER-MISC/pair_lebedeva_z.cpp | 2 +- src/USER-MISC/pair_lennard_mdf.cpp | 12 +- src/USER-MISC/pair_list.cpp | 18 +-- src/USER-MISC/pair_lj_expand_coul_long.cpp | 12 +- src/USER-MISC/pair_lj_mdf.cpp | 12 +- src/USER-MISC/pair_lj_sf_dipole_sf.cpp | 14 +- src/USER-MISC/pair_momb.cpp | 18 +-- src/USER-MISC/pair_morse_smooth_linear.cpp | 10 +- src/USER-MISC/pair_srp.cpp | 10 +- src/USER-MISC/temper_grem.cpp | 12 +- src/USER-MISC/temper_npt.cpp | 14 +- src/USER-MOFFF/angle_class2_p6.cpp | 26 ++-- src/USER-MOFFF/angle_cosine_buck6d.cpp | 6 +- .../improper_inversion_harmonic.cpp | 4 +- src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp | 18 +-- .../pair_buck6d_coul_gauss_long.cpp | 20 +-- src/USER-NETCDF/dump_netcdf.cpp | 2 +- src/USER-NETCDF/dump_netcdf_mpiio.cpp | 2 +- src/USER-OMP/fix_omp.cpp | 2 +- src/USER-OMP/msm_cg_omp.cpp | 2 +- src/USER-PHONON/dynamical_matrix.cpp | 2 +- src/USER-PHONON/fix_phonon.cpp | 28 ++-- src/USER-PHONON/third_order.cpp | 2 +- src/USER-PTM/compute_ptm_atom.cpp | 2 +- src/USER-QTB/fix_qbmsst.cpp | 26 ++-- src/USER-QTB/fix_qtb.cpp | 10 +- src/USER-QUIP/pair_quip.cpp | 2 +- src/USER-REACTION/fix_bond_react.cpp | 14 +- src/USER-REAXC/fix_qeq_reax.cpp | 8 +- src/USER-REAXC/fix_reaxc_bonds.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 6 +- src/USER-SCAFACOS/scafacos.cpp | 2 +- src/USER-SDPD/fix_meso_move.cpp | 28 ++-- .../pair_sdpd_taitwater_isothermal.cpp | 12 +- src/USER-SMD/fix_smd_integrate_tlsph.cpp | 2 +- src/USER-SMD/fix_smd_integrate_ulsph.cpp | 8 +- .../fix_smd_move_triangulated_surface.cpp | 28 ++-- src/USER-SMD/fix_smd_setvel.cpp | 6 +- src/USER-SMD/fix_smd_wall_surface.cpp | 12 +- src/USER-SMD/pair_smd_hertz.cpp | 2 +- src/USER-SMD/pair_smd_tlsph.cpp | 82 +++++----- .../pair_smd_triangulated_surface.cpp | 2 +- src/USER-SMD/pair_smd_ulsph.cpp | 36 ++--- src/USER-SPH/pair_sph_heatconduction.cpp | 4 +- src/USER-SPH/pair_sph_idealgas.cpp | 4 +- src/USER-SPH/pair_sph_lj.cpp | 4 +- src/USER-SPH/pair_sph_rhosum.cpp | 4 +- src/USER-SPH/pair_sph_taitwater.cpp | 8 +- src/USER-SPH/pair_sph_taitwater_morris.cpp | 8 +- src/USER-UEF/fix_nh_uef.cpp | 8 +- src/USER-VTK/dump_vtk.cpp | 2 +- src/USER-YAFF/angle_cross.cpp | 12 +- src/USER-YAFF/angle_mm3.cpp | 4 +- src/USER-YAFF/bond_mm3.cpp | 4 +- src/USER-YAFF/improper_distharm.cpp | 4 +- src/USER-YAFF/improper_sqdistharm.cpp | 4 +- .../pair_lj_switch3_coulgauss_long.cpp | 16 +- .../pair_mm3_switch3_coulgauss_long.cpp | 16 +- src/VORONOI/compute_voronoi_atom.cpp | 6 +- src/angle_zero.cpp | 2 +- src/atom.cpp | 14 +- src/balance.cpp | 12 +- src/bond.cpp | 12 +- src/bond_zero.cpp | 2 +- src/change_box.cpp | 14 +- src/comm.cpp | 22 +-- src/compute.cpp | 2 +- src/compute_adf.cpp | 10 +- src/compute_aggregate_atom.cpp | 2 +- src/compute_centro_atom.cpp | 2 +- src/compute_chunk_atom.cpp | 32 ++-- src/compute_cluster_atom.cpp | 2 +- src/compute_cna_atom.cpp | 2 +- src/compute_coord_atom.cpp | 4 +- src/compute_hexorder_atom.cpp | 6 +- src/compute_orientorder_atom.cpp | 12 +- src/compute_pair.cpp | 2 +- src/compute_pressure.cpp | 2 +- src/compute_rdf.cpp | 4 +- src/compute_slice.cpp | 6 +- src/compute_temp_chunk.cpp | 4 +- src/compute_temp_partial.cpp | 6 +- src/compute_temp_profile.cpp | 30 ++-- src/compute_temp_ramp.cpp | 24 +-- src/create_atoms.cpp | 34 ++--- src/create_bonds.cpp | 40 ++--- src/create_box.cpp | 20 +-- src/delete_atoms.cpp | 6 +- src/displace_atoms.cpp | 48 +++--- src/dump.cpp | 14 +- src/dump_custom.cpp | 6 +- src/dump_image.cpp | 66 +++++---- src/dump_local.cpp | 2 +- src/dump_movie.cpp | 4 +- src/fix.cpp | 2 +- src/fix_adapt.cpp | 4 +- src/fix_addforce.cpp | 6 +- src/fix_ave_atom.cpp | 6 +- src/fix_ave_chunk.cpp | 12 +- src/fix_ave_correlate.cpp | 10 +- src/fix_ave_histo.cpp | 16 +- src/fix_ave_time.cpp | 12 +- src/fix_aveforce.cpp | 6 +- src/fix_balance.cpp | 8 +- src/fix_box_relax.cpp | 28 ++-- src/fix_controller.cpp | 12 +- src/fix_deform.cpp | 36 ++--- src/fix_drag.cpp | 10 +- src/fix_dt_reset.cpp | 10 +- src/fix_external.cpp | 6 +- src/fix_gravity.cpp | 14 +- src/fix_group.cpp | 2 +- src/fix_halt.cpp | 4 +- src/fix_heat.cpp | 4 +- src/fix_indent.cpp | 26 ++-- src/fix_langevin.cpp | 14 +- src/fix_lineforce.cpp | 6 +- src/fix_momentum.cpp | 8 +- src/fix_move.cpp | 28 ++-- src/fix_neigh_history.cpp | 2 +- src/fix_nh.cpp | 82 +++++----- src/fix_numdiff.cpp | 4 +- src/fix_nve_limit.cpp | 2 +- src/fix_planeforce.cpp | 6 +- src/fix_press_berendsen.cpp | 32 ++-- src/fix_print.cpp | 2 +- src/fix_read_restart.cpp | 4 +- src/fix_recenter.cpp | 6 +- src/fix_respa.cpp | 2 +- src/fix_restrain.cpp | 56 +++---- src/fix_setforce.cpp | 6 +- src/fix_spring.cpp | 20 +-- src/fix_spring_chunk.cpp | 2 +- src/fix_spring_rg.cpp | 4 +- src/fix_spring_self.cpp | 2 +- src/fix_store.cpp | 8 +- src/fix_store_state.cpp | 2 +- src/fix_temp_berendsen.cpp | 6 +- src/fix_temp_csld.cpp | 8 +- src/fix_temp_csvr.cpp | 8 +- src/fix_temp_rescale.cpp | 10 +- src/fix_tmd.cpp | 4 +- src/fix_vector.cpp | 2 +- src/fix_viscous.cpp | 6 +- src/fix_wall.cpp | 10 +- src/fix_wall_reflect.cpp | 2 +- src/fix_wall_region.cpp | 14 +- src/force.cpp | 116 ++------------- src/force.h | 4 - src/group.cpp | 12 +- src/image.cpp | 14 +- src/imbalance_group.cpp | 4 +- src/imbalance_neigh.cpp | 2 +- src/imbalance_time.cpp | 2 +- src/input.cpp | 8 +- src/kspace.cpp | 26 ++-- src/lattice.cpp | 46 +++--- src/min.cpp | 18 +-- src/minimize.cpp | 8 +- src/molecule.cpp | 22 +-- src/neighbor.cpp | 16 +- src/output.cpp | 8 +- src/pair.cpp | 22 +-- src/pair_beck.cpp | 14 +- src/pair_born.cpp | 14 +- src/pair_born_coul_dsf.cpp | 18 +-- src/pair_born_coul_wolf.cpp | 18 +-- src/pair_buck.cpp | 10 +- src/pair_buck_coul_cut.cpp | 14 +- src/pair_coul_cut.cpp | 4 +- src/pair_coul_debye.cpp | 4 +- src/pair_coul_dsf.cpp | 4 +- src/pair_coul_streitz.cpp | 4 +- src/pair_coul_wolf.cpp | 4 +- src/pair_dpd.cpp | 12 +- src/pair_dpd_tstat.cpp | 12 +- src/pair_gauss.cpp | 8 +- src/pair_hybrid.cpp | 10 +- src/pair_hybrid_overlay.cpp | 2 +- src/pair_lj96_cut.cpp | 8 +- src/pair_lj_cubic.cpp | 4 +- src/pair_lj_cut.cpp | 8 +- src/pair_lj_cut_coul_cut.cpp | 12 +- src/pair_lj_cut_coul_debye.cpp | 6 +- src/pair_lj_cut_coul_dsf.cpp | 12 +- src/pair_lj_cut_coul_wolf.cpp | 12 +- src/pair_lj_expand.cpp | 10 +- src/pair_lj_gromacs.cpp | 12 +- src/pair_lj_gromacs_coul_gromacs.cpp | 12 +- src/pair_lj_smooth.cpp | 12 +- src/pair_lj_smooth_linear.cpp | 8 +- src/pair_mie_cut.cpp | 12 +- src/pair_morse.cpp | 10 +- src/pair_soft.cpp | 6 +- src/pair_table.cpp | 4 +- src/pair_ufm.cpp | 8 +- src/pair_yukawa.cpp | 8 +- src/pair_zbl.cpp | 8 +- src/pair_zero.cpp | 4 +- src/pointers.h | 2 + src/read_data.cpp | 44 +++--- src/read_dump.cpp | 4 +- src/reader_xyz.cpp | 2 +- src/region.cpp | 14 +- src/region_block.cpp | 12 +- src/region_cone.cpp | 36 ++--- src/region_cylinder.cpp | 26 ++-- src/region_intersect.cpp | 2 +- src/region_plane.cpp | 12 +- src/region_prism.cpp | 18 +-- src/region_sphere.cpp | 8 +- src/region_union.cpp | 2 +- src/replicate.cpp | 6 +- src/rerun.cpp | 12 +- src/respa.cpp | 32 ++-- src/run.cpp | 8 +- src/set.cpp | 140 +++++++++--------- src/thermo.cpp | 2 +- src/timer.cpp | 2 +- src/universe.cpp | 2 +- src/update.cpp | 2 +- src/variable.cpp | 14 +- src/velocity.cpp | 36 ++--- src/write_restart.cpp | 4 +- 506 files changed, 3042 insertions(+), 3135 deletions(-) diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 1c63ddbb5d..064e365dc1 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -268,10 +268,10 @@ void PairGayBerne::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - gamma = force->numeric(FLERR,arg[0]); - upsilon = force->numeric(FLERR,arg[1])/2.0; - mu = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); + gamma = utils::numeric(FLERR,arg[0],false,lmp); + upsilon = utils::numeric(FLERR,arg[1],false,lmp)/2.0; + mu = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); // reset cutoffs that have been explicitly set @@ -297,17 +297,17 @@ void PairGayBerne::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double eia_one = force->numeric(FLERR,arg[4]); - double eib_one = force->numeric(FLERR,arg[5]); - double eic_one = force->numeric(FLERR,arg[6]); - double eja_one = force->numeric(FLERR,arg[7]); - double ejb_one = force->numeric(FLERR,arg[8]); - double ejc_one = force->numeric(FLERR,arg[9]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double eia_one = utils::numeric(FLERR,arg[4],false,lmp); + double eib_one = utils::numeric(FLERR,arg[5],false,lmp); + double eic_one = utils::numeric(FLERR,arg[6],false,lmp); + double eja_one = utils::numeric(FLERR,arg[7],false,lmp); + double ejb_one = utils::numeric(FLERR,arg[8],false,lmp); + double ejc_one = utils::numeric(FLERR,arg[9],false,lmp); double cut_one = cut_global; - if (narg == 11) cut_one = force->numeric(FLERR,arg[10]); + if (narg == 11) cut_one = utils::numeric(FLERR,arg[10],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index 48b35e4cd1..a1c6477542 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -345,7 +345,7 @@ void PairLineLJ::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -371,14 +371,14 @@ void PairLineLJ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double size_itype = force->numeric(FLERR,arg[2]); - double size_jtype = force->numeric(FLERR,arg[3]); - double epsilon_one = force->numeric(FLERR,arg[4]); - double sigma_one = force->numeric(FLERR,arg[5]); - double cutsub_one = force->numeric(FLERR,arg[6]); + double size_itype = utils::numeric(FLERR,arg[2],false,lmp); + double size_jtype = utils::numeric(FLERR,arg[3],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[4],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[5],false,lmp); + double cutsub_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 4e653e4838..a25addaba4 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -243,7 +243,7 @@ void PairRESquared::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -269,17 +269,17 @@ void PairRESquared::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double eia_one = force->numeric(FLERR,arg[4]); - double eib_one = force->numeric(FLERR,arg[5]); - double eic_one = force->numeric(FLERR,arg[6]); - double eja_one = force->numeric(FLERR,arg[7]); - double ejb_one = force->numeric(FLERR,arg[8]); - double ejc_one = force->numeric(FLERR,arg[9]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double eia_one = utils::numeric(FLERR,arg[4],false,lmp); + double eib_one = utils::numeric(FLERR,arg[5],false,lmp); + double eic_one = utils::numeric(FLERR,arg[6],false,lmp); + double eja_one = utils::numeric(FLERR,arg[7],false,lmp); + double ejb_one = utils::numeric(FLERR,arg[8],false,lmp); + double ejc_one = utils::numeric(FLERR,arg[9],false,lmp); double cut_one = cut_global; - if (narg == 11) cut_one = force->numeric(FLERR,arg[10]); + if (narg == 11) cut_one = utils::numeric(FLERR,arg[10],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index d71cc0b7a9..0f840dadf3 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -416,7 +416,7 @@ void PairTriLJ::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -442,11 +442,11 @@ void PairTriLJ::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index 73a85386bd..a99c025e1f 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -35,8 +35,8 @@ BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) : { if (narg != 3) error->all(FLERR,"Invalid body nparticle command"); - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body nparticle command"); diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index d8ac81b2e6..349ad957c2 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -46,8 +46,8 @@ BodyRoundedPolygon::BodyRoundedPolygon(LAMMPS *lmp, int narg, char **arg) : // nmin and nmax are minimum and maximum number of vertices - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body rounded/polygon command"); diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index b6646cc116..cb84517b6f 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -44,8 +44,8 @@ BodyRoundedPolyhedron::BodyRoundedPolyhedron(LAMMPS *lmp, int narg, char **arg) // nmin and nmax are minimum and maximum number of vertices - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body rounded/polyhedron command"); diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index c12502df42..915407db92 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -47,7 +47,7 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg],"type") == 0) which[nvalues++] = TYPE; else { which[nvalues] = INDEX; - index[nvalues] = force->inumeric(FLERR,arg[iarg]) - 1; + index[nvalues] = utils::inumeric(FLERR,arg[iarg],false,lmp) - 1; nvalues++; } } diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index e51476de60..ccfd37bbb2 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -62,11 +62,11 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : // wall/particle coefficients - kn = force->numeric(FLERR,arg[3]); + kn = utils::numeric(FLERR,arg[3],false,lmp); - c_n = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) c_t = 0.5 * c_n; - else c_t = force->numeric(FLERR,arg[5]); + else c_t = utils::numeric(FLERR,arg[5],false,lmp); if (kn < 0.0 || c_n < 0.0 || c_t < 0.0) error->all(FLERR,"Illegal fix wall/body/polygon command"); @@ -78,23 +78,23 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zcylinder") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = ZCYLINDER; lo = hi = 0.0; - cylradius = force->numeric(FLERR,arg[iarg+1]); + cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } @@ -109,8 +109,8 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/body/polygon command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else error->all(FLERR,"Illegal fix wall/body/polygon command"); diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 42c62de436..161f8d6d6d 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -62,11 +62,11 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) // wall/particle coefficients - kn = force->numeric(FLERR,arg[3]); + kn = utils::numeric(FLERR,arg[3],false,lmp); - c_n = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) c_t = 0.5 * c_n; - else c_t = force->numeric(FLERR,arg[5]); + else c_t = utils::numeric(FLERR,arg[5],false,lmp); if (kn < 0.0 || c_n < 0.0 || c_t < 0.0) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); @@ -78,25 +78,25 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = ZPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } @@ -111,8 +111,8 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/body/polyhedron command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else error->all(FLERR,"Illegal fix wall/body/polyhedron command"); diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index f2b1fa77f9..b3333d4715 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -363,7 +363,7 @@ void PairBodyNparticle::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -389,11 +389,11 @@ void PairBodyNparticle::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index 7e213eba1c..9687c28613 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -366,11 +366,11 @@ void PairBodyRoundedPolygon::settings(int narg, char **arg) { if (narg < 5) error->all(FLERR,"Illegal pair_style command"); - c_n = force->numeric(FLERR,arg[0]); - c_t = force->numeric(FLERR,arg[1]); - mu = force->numeric(FLERR,arg[2]); - delta_ua = force->numeric(FLERR,arg[3]); - cut_inner = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[0],false,lmp); + c_t = utils::numeric(FLERR,arg[1],false,lmp); + mu = utils::numeric(FLERR,arg[2],false,lmp); + delta_ua = utils::numeric(FLERR,arg[3],false,lmp); + cut_inner = utils::numeric(FLERR,arg[4],false,lmp); if (delta_ua < 0) delta_ua = 1; } @@ -389,8 +389,8 @@ void PairBodyRoundedPolygon::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double k_n_one = force->numeric(FLERR,arg[2]); - double k_na_one = force->numeric(FLERR,arg[3]); + double k_n_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_na_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index d3e92ab2f6..dfefc318af 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -344,11 +344,11 @@ void PairBodyRoundedPolyhedron::settings(int narg, char **arg) { if (narg < 5) error->all(FLERR,"Illegal pair_style command"); - c_n = force->numeric(FLERR,arg[0]); - c_t = force->numeric(FLERR,arg[1]); - mu = force->numeric(FLERR,arg[2]); - A_ua = force->numeric(FLERR,arg[3]); - cut_inner = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[0],false,lmp); + c_t = utils::numeric(FLERR,arg[1],false,lmp); + mu = utils::numeric(FLERR,arg[2],false,lmp); + A_ua = utils::numeric(FLERR,arg[3],false,lmp); + cut_inner = utils::numeric(FLERR,arg[4],false,lmp); if (A_ua < 0) A_ua = 1; } @@ -367,8 +367,8 @@ void PairBodyRoundedPolyhedron::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double k_n_one = force->numeric(FLERR,arg[2]); - double k_na_one = force->numeric(FLERR,arg[3]); + double k_n_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_na_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index 79d71b2ee4..431479b489 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -280,9 +280,9 @@ void AngleClass2::coeff(int narg, char **arg) if (strcmp(arg[1],"bb") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double bb_k_one = force->numeric(FLERR,arg[2]); - double bb_r1_one = force->numeric(FLERR,arg[3]); - double bb_r2_one = force->numeric(FLERR,arg[4]); + double bb_k_one = utils::numeric(FLERR,arg[2],false,lmp); + double bb_r1_one = utils::numeric(FLERR,arg[3],false,lmp); + double bb_r2_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb_k[i] = bb_k_one; @@ -295,10 +295,10 @@ void AngleClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"ba") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients"); - double ba_k1_one = force->numeric(FLERR,arg[2]); - double ba_k2_one = force->numeric(FLERR,arg[3]); - double ba_r1_one = force->numeric(FLERR,arg[4]); - double ba_r2_one = force->numeric(FLERR,arg[5]); + double ba_k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double ba_k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double ba_r1_one = utils::numeric(FLERR,arg[4],false,lmp); + double ba_r2_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { ba_k1[i] = ba_k1_one; @@ -312,10 +312,10 @@ void AngleClass2::coeff(int narg, char **arg) } else { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index d6b802a11a..2cd63eafcb 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -136,10 +136,10 @@ void BondClass2::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double r0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double r0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index e08661a480..44d4902e4a 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -646,10 +646,10 @@ void DihedralClass2::coeff(int narg, char **arg) if (strcmp(arg[1],"mbt") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_one = force->numeric(FLERR,arg[2]); - double f2_one = force->numeric(FLERR,arg[3]); - double f3_one = force->numeric(FLERR,arg[4]); - double r0_one = force->numeric(FLERR,arg[5]); + double f1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_one = utils::numeric(FLERR,arg[4],false,lmp); + double r0_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { mbt_f1[i] = f1_one; @@ -664,14 +664,14 @@ void DihedralClass2::coeff(int narg, char **arg) if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_1_one = force->numeric(FLERR,arg[2]); - double f2_1_one = force->numeric(FLERR,arg[3]); - double f3_1_one = force->numeric(FLERR,arg[4]); - double f1_2_one = force->numeric(FLERR,arg[5]); - double f2_2_one = force->numeric(FLERR,arg[6]); - double f3_2_one = force->numeric(FLERR,arg[7]); - double r0_1_one = force->numeric(FLERR,arg[8]); - double r0_2_one = force->numeric(FLERR,arg[9]); + double f1_1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[5],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double r0_1_one = utils::numeric(FLERR,arg[8],false,lmp); + double r0_2_one = utils::numeric(FLERR,arg[9],false,lmp); for (int i = ilo; i <= ihi; i++) { ebt_f1_1[i] = f1_1_one; @@ -690,14 +690,14 @@ void DihedralClass2::coeff(int narg, char **arg) if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_1_one = force->numeric(FLERR,arg[2]); - double f2_1_one = force->numeric(FLERR,arg[3]); - double f3_1_one = force->numeric(FLERR,arg[4]); - double f1_2_one = force->numeric(FLERR,arg[5]); - double f2_2_one = force->numeric(FLERR,arg[6]); - double f3_2_one = force->numeric(FLERR,arg[7]); - double theta0_1_one = force->numeric(FLERR,arg[8]); - double theta0_2_one = force->numeric(FLERR,arg[9]); + double f1_1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[5],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[8],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[9],false,lmp); // convert theta0's from degrees to radians @@ -717,9 +717,9 @@ void DihedralClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"aat") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k_one = force->numeric(FLERR,arg[2]); - double theta0_1_one = force->numeric(FLERR,arg[3]); - double theta0_2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0's from degrees to radians @@ -734,9 +734,9 @@ void DihedralClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"bb13") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k_one = force->numeric(FLERR,arg[2]); - double r10_one = force->numeric(FLERR,arg[3]); - double r30_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double r10_one = utils::numeric(FLERR,arg[3],false,lmp); + double r30_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb13t_k[i] = k_one; @@ -749,12 +749,12 @@ void DihedralClass2::coeff(int narg, char **arg) } else { if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k1_one = force->numeric(FLERR,arg[1]); - double phi1_one = force->numeric(FLERR,arg[2]); - double k2_one = force->numeric(FLERR,arg[3]); - double phi2_one = force->numeric(FLERR,arg[4]); - double k3_one = force->numeric(FLERR,arg[5]); - double phi3_one = force->numeric(FLERR,arg[6]); + double k1_one = utils::numeric(FLERR,arg[1],false,lmp); + double phi1_one = utils::numeric(FLERR,arg[2],false,lmp); + double k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double phi2_one = utils::numeric(FLERR,arg[4],false,lmp); + double k3_one = utils::numeric(FLERR,arg[5],false,lmp); + double phi3_one = utils::numeric(FLERR,arg[6],false,lmp); // convert phi's from degrees to radians diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index d150a5b7b4..662459abb7 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -530,12 +530,12 @@ void ImproperClass2::coeff(int narg, char **arg) if (strcmp(arg[1],"aa") == 0) { if (narg != 8) error->all(FLERR,"Incorrect args for improper coefficients"); - double k1_one = force->numeric(FLERR,arg[2]); - double k2_one = force->numeric(FLERR,arg[3]); - double k3_one = force->numeric(FLERR,arg[4]); - double theta0_1_one = force->numeric(FLERR,arg[5]); - double theta0_2_one = force->numeric(FLERR,arg[6]); - double theta0_3_one = force->numeric(FLERR,arg[7]); + double k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double k3_one = utils::numeric(FLERR,arg[4],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[5],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double theta0_3_one = utils::numeric(FLERR,arg[7],false,lmp); // convert theta0's from degrees to radians @@ -553,8 +553,8 @@ void ImproperClass2::coeff(int narg, char **arg) } else { if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients"); - double k0_one = force->numeric(FLERR,arg[1]); - double chi0_one = force->numeric(FLERR,arg[2]); + double k0_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi0 from degrees to radians diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index bdd922bce6..96b035f83b 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -435,7 +435,7 @@ void PairLJClass2::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -460,11 +460,11 @@ void PairLJClass2::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index da5732c9bd..9aca9f048a 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -194,9 +194,9 @@ void PairLJClass2CoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -226,13 +226,13 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index c8487e8c1d..5c7c107d02 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -607,9 +607,9 @@ void PairLJClass2CoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -636,11 +636,11 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index 46ec5c9d2f..d7b2dba14a 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -370,18 +370,18 @@ void PairBrownian::settings(int narg, char **arg) { if (narg != 7 && narg != 9) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - flagfld = force->inumeric(FLERR,arg[2]); - cut_inner_global = force->numeric(FLERR,arg[3]); - cut_global = force->numeric(FLERR,arg[4]); - t_target = force->numeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + flagfld = utils::inumeric(FLERR,arg[2],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[3],false,lmp); + cut_global = utils::numeric(FLERR,arg[4],false,lmp); + t_target = utils::numeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); flagHI = flagVF = 1; if (narg == 9) { - flagHI = force->inumeric(FLERR,arg[7]); - flagVF = force->inumeric(FLERR,arg[8]); + flagHI = utils::inumeric(FLERR,arg[7],false,lmp); + flagVF = utils::inumeric(FLERR,arg[8],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -426,8 +426,8 @@ void PairBrownian::coeff(int narg, char **arg) double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index e97684dcd1..7552d123c3 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -246,7 +246,7 @@ void PairColloid::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -272,13 +272,13 @@ void PairColloid::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a12_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double d1_one = force->numeric(FLERR,arg[4]); - double d2_one = force->numeric(FLERR,arg[5]); + double a12_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double d1_one = utils::numeric(FLERR,arg[4],false,lmp); + double d2_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); if (d1_one < 0.0 || d2_one < 0.0) error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff"); diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 59b3fd2909..4f2a4455a3 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -459,16 +459,16 @@ void PairLubricate::settings(int narg, char **arg) { if (narg != 5 && narg != 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - flagfld = force->inumeric(FLERR,arg[2]); - cut_inner_global = force->numeric(FLERR,arg[3]); - cut_global = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + flagfld = utils::inumeric(FLERR,arg[2],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[3],false,lmp); + cut_global = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; if (narg == 7) { - flagHI = force->inumeric(FLERR,arg[5]); - flagVF = force->inumeric(FLERR,arg[6]); + flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + flagVF = utils::inumeric(FLERR,arg[6],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -507,8 +507,8 @@ void PairLubricate::coeff(int narg, char **arg) double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index 0a003cd0ab..4fb1611660 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -1679,16 +1679,16 @@ void PairLubricateU::settings(int narg, char **arg) { if (narg != 5 && narg != 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - cut_inner_global = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); - gdot = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); + gdot = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; if (narg == 7) { - flagHI = force->inumeric(FLERR,arg[5]); - flagVF = force->inumeric(FLERR,arg[6]); + flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + flagVF = utils::inumeric(FLERR,arg[6],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -1740,8 +1740,8 @@ void PairLubricateU::coeff(int narg, char **arg) double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 6b6727172d..7fd847671e 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1077,15 +1077,15 @@ void PairLubricateUPoly::settings(int narg, char **arg) { if (narg < 5 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - cut_inner_global = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); - gdot = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); + gdot = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; - if (narg >= 6) flagHI = force->inumeric(FLERR,arg[5]); - if (narg == 7) flagVF = force->inumeric(FLERR,arg[6]); + if (narg >= 6) flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + if (narg == 7) flagVF = utils::inumeric(FLERR,arg[6],false,lmp); if (flaglog == 1 && flagHI == 0) { error->warning(FLERR,"Cannot include log terms without 1/r terms; " diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index bd68a9445a..8f91420043 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -298,9 +298,9 @@ void PairLJCutDipoleCut::settings(int narg, char **arg) if (strcmp(update->unit_style,"electron") == 0) error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -329,13 +329,13 @@ void PairLJCutDipoleCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index 5d78d9bfd3..73aa628296 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -348,9 +348,9 @@ void PairLJCutDipoleLong::settings(int narg, char **arg) if (narg < 1 || narg > 2) error->all(FLERR,"Incorrect args in pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -376,11 +376,11 @@ void PairLJCutDipoleLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index 27af0b7ff4..f7c8251e79 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -90,10 +90,10 @@ void PairLJLongDipoleLong::settings(int narg, char **arg) if (!((ewald_order^ewald_off)&(1<<3))) error->all(FLERR, "Coulombic cut not supported in pair_style lj/long/dipole/long"); - cut_lj_global = force->numeric(FLERR,*(arg++)); + cut_lj_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && (ewald_order==74)) error->all(FLERR,"Only one cut-off allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*(arg++)); + if (narg == 4) cut_coul = utils::numeric(FLERR,*(arg++),false,lmp); else cut_coul = cut_lj_global; if (allocated) { // reset explicit cuts @@ -194,11 +194,11 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index ecde8ea093..0552d23cdb 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -138,27 +138,27 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - binsize = force->numeric(FLERR,arg[iarg+1]); + binsize = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (binsize <= 0.0) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"split") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - _particle_split = force->numeric(FLERR,arg[iarg+1]); + _particle_split = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (_particle_split == 0.0 || _particle_split > 1.0) error->all(FLERR,"Illegal package GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"gpuID") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal package gpu command"); - first_gpu = force->inumeric(FLERR,arg[iarg+1]); - last_gpu = force->inumeric(FLERR,arg[iarg+2]); + first_gpu = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + last_gpu = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tpa") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - threads_per_atom = force->inumeric(FLERR,arg[iarg+1]); + threads_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nthreads") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - nthreads = force->inumeric(FLERR,arg[iarg+1]); + nthreads = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nthreads < 1) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"device") == 0) { @@ -167,7 +167,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"blocksize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - block_pair = force->inumeric(FLERR,arg[iarg+1]); + block_pair = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal package gpu command"); } diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 73b42b9653..879f48e023 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -65,9 +65,9 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : // required args - ninsert = force->inumeric(FLERR,arg[3]); - ntype = force->inumeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + ninsert = utils::inumeric(FLERR,arg[3],false,lmp); + ntype = utils::inumeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix pour command"); @@ -930,9 +930,9 @@ void FixPour::options(int narg, char **arg) } else if (strcmp(arg[iarg],"molfrac") == 0) { if (mode != MOLECULE) error->all(FLERR,"Illegal fix pour command"); if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix pour command"); - molfrac[0] = force->numeric(FLERR,arg[iarg+1]); + molfrac[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); for (int i = 1; i < nmol; i++) - molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]); + molfrac[i] = molfrac[i-1] + utils::numeric(FLERR,arg[iarg+i+1],false,lmp); if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON) error->all(FLERR,"Illegal fix pour command"); molfrac[nmol-1] = 1.0; @@ -973,21 +973,21 @@ void FixPour::options(int narg, char **arg) if (strcmp(arg[iarg+1],"one") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = ONE; - radius_one = 0.5 * force->numeric(FLERR,arg[iarg+2]); + radius_one = 0.5 * utils::numeric(FLERR,arg[iarg+2],false,lmp); radius_max = radius_one; iarg += 3; } else if (strcmp(arg[iarg+1],"range") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = RANGE; - radius_lo = 0.5 * force->numeric(FLERR,arg[iarg+2]); - radius_hi = 0.5 * force->numeric(FLERR,arg[iarg+3]); + radius_lo = 0.5 * utils::numeric(FLERR,arg[iarg+2],false,lmp); + radius_hi = 0.5 * utils::numeric(FLERR,arg[iarg+3],false,lmp); if (radius_lo > radius_hi) error->all(FLERR,"Illegal fix pour command"); radius_max = radius_hi; iarg += 4; } else if (strcmp(arg[iarg+1],"poly") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = POLY; - npoly = force->inumeric(FLERR,arg[iarg+2]); + npoly = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (npoly <= 0) error->all(FLERR,"Illegal fix pour command"); if (iarg+3 + 2*npoly > narg) error->all(FLERR,"Illegal fix pour command"); @@ -996,8 +996,8 @@ void FixPour::options(int narg, char **arg) iarg += 3; radius_max = 0.0; for (int i = 0; i < npoly; i++) { - radius_poly[i] = 0.5 * force->numeric(FLERR,arg[iarg++]); - frac_poly[i] = force->numeric(FLERR,arg[iarg++]); + radius_poly[i] = 0.5 * utils::numeric(FLERR,arg[iarg++],false,lmp); + frac_poly[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); if (radius_poly[i] <= 0.0 || frac_poly[i] < 0.0) error->all(FLERR,"Illegal fix pour command"); radius_max = MAX(radius_max,radius_poly[i]); @@ -1010,35 +1010,35 @@ void FixPour::options(int narg, char **arg) } else if (strcmp(arg[iarg],"dens") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); - density_lo = force->numeric(FLERR,arg[iarg+1]); - density_hi = force->numeric(FLERR,arg[iarg+2]); + density_lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + density_hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (density_lo > density_hi) error->all(FLERR,"Illegal fix pour command"); iarg += 3; } else if (strcmp(arg[iarg],"vol") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); - volfrac = force->numeric(FLERR,arg[iarg+1]); - maxattempt = force->inumeric(FLERR,arg[iarg+2]); + volfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); + maxattempt = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"rate") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command"); - rate = force->numeric(FLERR,arg[iarg+1]); + rate = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"vel") == 0) { if (domain->dimension == 3) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); - vylo = force->numeric(FLERR,arg[iarg+3]); - vyhi = force->numeric(FLERR,arg[iarg+4]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + vylo = utils::numeric(FLERR,arg[iarg+3],false,lmp); + vyhi = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (vxlo > vxhi || vylo > vyhi) error->all(FLERR,"Illegal fix pour command"); - vz = force->numeric(FLERR,arg[iarg+5]); + vz = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); - vy = force->numeric(FLERR,arg[iarg+3]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + vy = utils::numeric(FLERR,arg[iarg+3],false,lmp); vz = 0.0; if (vxlo > vxhi) error->all(FLERR,"Illegal fix pour command"); iarg += 4; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index d7cbf0362a..9ec76b88f1 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -93,16 +93,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : size_history = 3; if (narg < 11) error->all(FLERR,"Illegal fix wall/gran command"); - kn = force->numeric(FLERR,arg[4]); + kn = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[5]); + else kt = utils::numeric(FLERR,arg[5],false,lmp); - gamman = force->numeric(FLERR,arg[6]); + gamman = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[7]); + else gammat = utils::numeric(FLERR,arg[7],false,lmp); - xmu = force->numeric(FLERR,arg[8]); - int dampflag = force->inumeric(FLERR,arg[9]); + xmu = utils::numeric(FLERR,arg[8],false,lmp); + int dampflag = utils::inumeric(FLERR,arg[9],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || @@ -127,8 +127,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hooke option"); normal_model = NORMAL_HOOKE; - normal_coeffs[0] = force->numeric(FLERR,arg[iarg+1]); //kn - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping + normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping iarg += 3; } else if (strcmp(arg[iarg], "hertz") == 0) { int num_coeffs = 2; @@ -136,8 +136,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = NORMAL_HERTZ; - normal_coeffs[0] = force->numeric(FLERR,arg[iarg+1]); //kn - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping + normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping iarg += num_coeffs+1; } else if (strcmp(arg[iarg], "hertz/material") == 0) { int num_coeffs = 3; @@ -145,9 +145,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = HERTZ_MATERIAL; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; iarg += num_coeffs+1; @@ -156,24 +156,24 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = DMT; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; - normal_coeffs[3] = force->numeric(FLERR,arg[iarg+4]); //cohesion + normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion iarg += 5; } else if (strcmp(arg[iarg], "jkr") == 0) { if (iarg + 4 >= narg) error->all(FLERR,"Illegal wall/gran command, " "not enough parameters provided for JKR option"); normal_model = JKR; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; - normal_coeffs[3] = force->numeric(FLERR,arg[iarg+4]); //cohesion + normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion iarg += 5; } else if (strcmp(arg[iarg], "damping") == 0) { if (iarg+1 >= narg) @@ -205,8 +205,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : tangential_model = TANGENTIAL_NOHISTORY; tangential_coeffs[0] = 0; // gammat and friction coeff - tangential_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); - tangential_coeffs[2] = force->numeric(FLERR,arg[iarg+3]); + tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || (strcmp(arg[iarg+1], "mindlin") == 0) || @@ -230,12 +230,12 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } tangential_coeffs[0] = Emod/4*(2-poiss)*(1+poiss); } else { - tangential_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); //kt + tangential_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt } tangential_history = 1; // gammat and friction coeff - tangential_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); - tangential_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); + tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -254,9 +254,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : roll_model = ROLL_SDS; roll_history = 1; // kR, gammaR, rolling friction coeff - roll_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); - roll_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); - roll_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); + roll_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + roll_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + roll_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal wall/gran command, " @@ -278,9 +278,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : "not enough parameters provided for twist model"); twist_model = TWIST_SDS; twist_history = 1; - twist_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); //kt - twist_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); //gammat - twist_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); //friction coeff. + twist_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt + twist_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); //gammat + twist_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //friction coeff. iarg += 5; } else { error->all(FLERR, "Illegal wall/gran command, " @@ -309,31 +309,31 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = ZPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zcylinder") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = ZCYLINDER; lo = hi = 0.0; - cylradius = force->numeric(FLERR,arg[iarg+1]); + cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); @@ -357,8 +357,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/gran command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else if (strcmp(arg[iarg],"shear") == 0) { @@ -367,7 +367,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/gran command"); - vshear = force->numeric(FLERR,arg[iarg+2]); + vshear = utils::numeric(FLERR,arg[iarg+2],false,lmp); wshear = 1; iarg += 3; } else if (strcmp(arg[iarg],"contacts") == 0) { diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index 4a362c0928..89230f26bf 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -279,16 +279,16 @@ void PairGranHertzHistory::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - kn = force->numeric(FLERR,arg[0]); + kn = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[1]); + else kt = utils::numeric(FLERR,arg[1],false,lmp); - gamman = force->numeric(FLERR,arg[2]); + gamman = utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[3]); + else gammat = utils::numeric(FLERR,arg[3],false,lmp); - xmu = force->numeric(FLERR,arg[4]); - dampflag = force->inumeric(FLERR,arg[5]); + xmu = utils::numeric(FLERR,arg[4],false,lmp); + dampflag = utils::inumeric(FLERR,arg[5],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 04f1cb0a95..a8cd808411 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -358,16 +358,16 @@ void PairGranHookeHistory::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - kn = force->numeric(FLERR,arg[0]); + kn = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[1]); + else kt = utils::numeric(FLERR,arg[1],false,lmp); - gamman = force->numeric(FLERR,arg[2]); + gamman = utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[3]); + else gammat = utils::numeric(FLERR,arg[3],false,lmp); - xmu = force->numeric(FLERR,arg[4]); - dampflag = force->inumeric(FLERR,arg[5]); + xmu = utils::numeric(FLERR,arg[4],false,lmp); + dampflag = utils::inumeric(FLERR,arg[5],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index b677c7711d..88a9fe36f0 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -753,7 +753,7 @@ void PairGranular::allocate() void PairGranular::settings(int narg, char **arg) { if (narg == 1) { - cutoff_global = force->numeric(FLERR,arg[0]); + cutoff_global = utils::numeric(FLERR,arg[0],false,lmp); } else { cutoff_global = -1; // will be set based on particle sizes, model choice } @@ -800,35 +800,35 @@ void PairGranular::coeff(int narg, char **arg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hooke option"); normal_model_one = HOOKE; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // kn - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping iarg += 3; } else if (strcmp(arg[iarg], "hertz") == 0) { if (iarg + 2 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz option"); normal_model_one = HERTZ; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // kn - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping iarg += 3; } else if (strcmp(arg[iarg], "hertz/material") == 0) { if (iarg + 3 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz/material option"); normal_model_one = HERTZ_MATERIAL; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio iarg += 4; } else if (strcmp(arg[iarg], "dmt") == 0) { if (iarg + 4 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz option"); normal_model_one = DMT; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio - normal_coeffs_one[3] = force->numeric(FLERR,arg[iarg+4]); // cohesion + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio + normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion iarg += 5; } else if (strcmp(arg[iarg], "jkr") == 0) { if (iarg + 4 >= narg) @@ -836,10 +836,10 @@ void PairGranular::coeff(int narg, char **arg) "not enough parameters provided for JKR option"); beyond_contact = 1; normal_model_one = JKR; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio - normal_coeffs_one[3] = force->numeric(FLERR,arg[iarg+4]); // cohesion + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio + normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion iarg += 5; } else if (strcmp(arg[iarg], "damping") == 0) { if (iarg+1 >= narg) @@ -871,8 +871,8 @@ void PairGranular::coeff(int narg, char **arg) tangential_model_one = TANGENTIAL_NOHISTORY; tangential_coeffs_one[0] = 0; // gammat and friction coeff - tangential_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); - tangential_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); + tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || (strcmp(arg[iarg+1], "mindlin") == 0) || @@ -905,11 +905,11 @@ void PairGranular::coeff(int narg, char **arg) } tangential_coeffs_one[0] = -1; } else { - tangential_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); // kt + tangential_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // kt } // gammat and friction coeff - tangential_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - tangential_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -928,9 +928,9 @@ void PairGranular::coeff(int narg, char **arg) roll_model_one = ROLL_SDS; roll_history = 1; // kR and gammaR and rolling friction coeff - roll_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); - roll_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - roll_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + roll_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + roll_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + roll_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -953,9 +953,9 @@ void PairGranular::coeff(int narg, char **arg) twist_model_one = TWIST_SDS; twist_history = 1; // kt and gammat and friction coeff - twist_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); - twist_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - twist_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + twist_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + twist_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + twist_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -964,7 +964,7 @@ void PairGranular::coeff(int narg, char **arg) } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - cutoff_one = force->numeric(FLERR,arg[iarg+1]); + cutoff_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR, "Illegal pair coeff command"); } diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 7e3a4ba68a..b5e6174528 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -324,7 +324,7 @@ void KokkosLMP::accelerator(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); - binsize = force->numeric(FLERR,arg[iarg+1]); + binsize = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"newton") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index a97d1dbe13..e3326f3056 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -226,8 +226,8 @@ void PairCoulDebyeKokkos::settings(int narg, char **arg) { if (narg > 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp index a051b7bf4d..1f2ad404bb 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp @@ -53,7 +53,7 @@ void PairHybridOverlayKokkos::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 2f31b180d7..05e0d15dbf 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -277,10 +277,10 @@ void PairLJCutCoulDebyeKokkos::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[2]); + else cut_coul_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that were previously set from data file diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index 5fbc465c76..c4e1ae38cb 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -953,7 +953,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index 86845c72fe..b5b59dc456 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -428,7 +428,7 @@ void PairTableKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 28b3a0d12d..26aa4373cc 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -971,7 +971,7 @@ void PairTableRXKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -1063,7 +1063,7 @@ void PairTableRXKokkos::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index e71e5d6d53..2eea527947 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -144,7 +144,7 @@ template void PPPMKokkos::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/kk command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index efb35d42b8..4aa95318db 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -71,7 +71,7 @@ void Ewald::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index b40e3cd34b..b616b2ae5d 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -69,7 +69,7 @@ EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp), void EwaldDisp::settings(int narg, char **arg) { if (narg!=1) error->all(FLERR,"Illegal kspace_style ewald/n command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 8a7d49091a..45c8a35971 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -64,7 +64,7 @@ FixTuneKspace::FixTuneKspace(LAMMPS *lmp, int narg, char **arg) : // parse arguments - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix tune/kspace command"); // set up reneighboring diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 973302a054..00bdac53db 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -108,7 +108,7 @@ MSM::MSM(LAMMPS *lmp) void MSM::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style msm command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index 8236f93c9c..79d33b869d 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -58,7 +58,7 @@ void MSMCG::settings(int narg, char **arg) MSM::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,lmp)); else smallq = SMALLQ; } diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp index 3c1391ed94..4742e4c48c 100644 --- a/src/KSPACE/pair_born_coul_long.cpp +++ b/src/KSPACE/pair_born_coul_long.cpp @@ -240,9 +240,9 @@ void PairBornCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -267,15 +267,15 @@ void PairBornCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 92086812a0..f589dfaa90 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -240,9 +240,9 @@ void PairBuckCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -268,13 +268,13 @@ void PairBuckCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index dc4704569e..3552e8bb86 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -97,10 +97,10 @@ void PairBuckLongCoulLong::settings(int narg, char **arg) if (!((ewald_order^ewald_off) & (1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style buck/long/coul/coul"); - cut_buck_global = force->numeric(FLERR,*(arg++)); + cut_buck_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && ((ewald_order & 0x42) == 0x42)) error->all(FLERR,"Only one cutoff allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*arg); + if (narg == 4) cut_coul = utils::numeric(FLERR,*arg,false,lmp); else cut_coul = cut_buck_global; if (allocated) { @@ -203,12 +203,12 @@ void PairBuckLongCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,*(arg++),1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,*(arg++),1,atom->ntypes,jlo,jhi,error); - double buck_a_one = force->numeric(FLERR,*(arg++)); - double buck_rho_one = force->numeric(FLERR,*(arg++)); - double buck_c_one = force->numeric(FLERR,*(arg++)); + double buck_a_one = utils::numeric(FLERR,*(arg++),false,lmp); + double buck_rho_one = utils::numeric(FLERR,*(arg++),false,lmp); + double buck_c_one = utils::numeric(FLERR,*(arg++),false,lmp); double cut_buck_one = cut_buck_global; - if (narg == 6) cut_buck_one = force->numeric(FLERR,*(arg++)); + if (narg == 6) cut_buck_one = utils::numeric(FLERR,*(arg++),false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 2cee7a7994..60187ce901 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -199,7 +199,7 @@ void PairCoulLong::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_coul = force->numeric(FLERR,arg[0]); + cut_coul = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 4178660fff..ff52720a08 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -631,10 +631,10 @@ void PairLJCharmmCoulLong::settings(int narg, char **arg) { if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -650,13 +650,13 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index b1b86c7a4e..b10cdf2b08 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -682,10 +682,10 @@ void PairLJCharmmfswCoulLong::settings(int narg, char **arg) { if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -701,13 +701,13 @@ void PairLJCharmmfswCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index b998c9b8ef..ef25055a76 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -594,9 +594,9 @@ void PairLJCutCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -622,11 +622,11 @@ void PairLJCutCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index a4f115568f..426ec00e55 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -430,15 +430,15 @@ void PairLJCutTIP4PLong::settings(int narg, char **arg) { if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[5]); + cut_lj_global = utils::numeric(FLERR,arg[5],false,lmp); if (narg == 6) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[6]); + else cut_coul = utils::numeric(FLERR,arg[6],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index e226cc9912..7b7a065e22 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -97,10 +97,10 @@ void PairLJLongCoulLong::settings(int narg, char **arg) if (!((ewald_order^ewald_off) & (1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style lj/long/coul/long"); - cut_lj_global = force->numeric(FLERR,*(arg++)); + cut_lj_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && ((ewald_order & 0x42) == 0x42)) error->all(FLERR,"Only one cutoff allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*arg); + if (narg == 4) cut_coul = utils::numeric(FLERR,*arg,false,lmp); else cut_coul = cut_lj_global; if (allocated) { @@ -201,11 +201,11 @@ void PairLJLongCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index fa8c221382..c71fee8206 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -1445,16 +1445,16 @@ void PairLJLongTIP4PLong::settings(int narg, char **arg) if (!((ewald_order^ewald_off)&(1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style lj/long/tip4p/long"); - typeO = force->inumeric(FLERR,arg[1]); - typeH = force->inumeric(FLERR,arg[2]); - typeB = force->inumeric(FLERR,arg[3]); - typeA = force->inumeric(FLERR,arg[4]); - qdist = force->numeric(FLERR,arg[5]); + typeO = utils::inumeric(FLERR,arg[1],false,lmp); + typeH = utils::inumeric(FLERR,arg[2],false,lmp); + typeB = utils::inumeric(FLERR,arg[3],false,lmp); + typeA = utils::inumeric(FLERR,arg[4],false,lmp); + qdist = utils::numeric(FLERR,arg[5],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[6]); + cut_lj_global = utils::numeric(FLERR,arg[6],false,lmp); if (narg == 8) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[7]); + else cut_coul = utils::numeric(FLERR,arg[7],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index c3ec44b7eb..ee7d4fed1b 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -398,13 +398,13 @@ void PairTIP4PLong::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_coul = force->numeric(FLERR,arg[5]); + cut_coul = utils::numeric(FLERR,arg[5],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index e399727001..9ce8ded7dd 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -164,7 +164,7 @@ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), void PPPM::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index 392d19336a..fa5235d6eb 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -66,7 +66,7 @@ void PPPMCG::settings(int narg, char **arg) PPPM::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,lmp)); else smallq = SMALLQ; } diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index c81dcbf909..fba3f27938 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -228,7 +228,7 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), void PPPMDisp::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/disp command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 31d62f0645..b8bbba73da 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -49,8 +49,8 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), respa_level_support = 1; ilevel_respa = 0; - nevery = force->inumeric(FLERR,arg[3]); - precision = force->numeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + precision = utils::numeric(FLERR,arg[4],false,lmp); if (nevery <= 0 || precision <= 0.0) error->all(FLERR,"Illegal fix qeq/comb command"); diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 085905192e..6d783545f7 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -154,15 +154,15 @@ void PairAIREBO::settings(int narg, char **arg) if (narg != 1 && narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cutlj = force->numeric(FLERR,arg[0]); + cutlj = utils::numeric(FLERR,arg[0],false,lmp); if (narg >= 3) { - ljflag = force->inumeric(FLERR,arg[1]); - torflag = force->inumeric(FLERR,arg[2]); + ljflag = utils::inumeric(FLERR,arg[1],false,lmp); + torflag = utils::inumeric(FLERR,arg[2],false,lmp); } if (narg == 4) { sigcut = cutlj; - sigmin = force->numeric(FLERR,arg[3]); + sigmin = utils::numeric(FLERR,arg[3],false,lmp); sigwid = sigcut - sigmin; } diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index e10ebffb4f..60905fd2ff 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -210,8 +210,8 @@ void PairATM::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - cut_triple = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_triple = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- @@ -228,7 +228,7 @@ void PairATM::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); utils::bounds(FLERR,arg[2],1,atom->ntypes,klo,khi,error); - double nu_one = force->numeric(FLERR,arg[3]); + double nu_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index bf39183b9d..5e0c2c16f7 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -230,8 +230,8 @@ void PairVashishtaTable::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - ntable = force->inumeric(FLERR,arg[0]); - tabinner = force->numeric(FLERR,arg[1]); + ntable = utils::inumeric(FLERR,arg[0],false,lmp); + tabinner = utils::numeric(FLERR,arg[1],false,lmp); if (tabinner <= 0.0) error->all(FLERR,"Illegal inner cutoff for tabulation"); diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index 9a4a0b6a7f..53338f08dc 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -68,10 +68,10 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - ncycles = force->inumeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); - double temperature = force->numeric(FLERR,arg[6]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + ncycles = utils::inumeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); + double temperature = utils::numeric(FLERR,arg[6],false,lmp); beta = 1.0/(force->boltz*temperature); if (nevery <= 0) error->all(FLERR,"Illegal fix atom/swap command"); @@ -161,7 +161,7 @@ void FixAtomSwap::options(int narg, char **arg) while (iarg < narg) { if (isalpha(arg[iarg][0])) break; if (nswaptypes >= atom->ntypes) error->all(FLERR,"Illegal fix atom/swap command"); - type_list[nswaptypes] = force->numeric(FLERR,arg[iarg]); + type_list[nswaptypes] = utils::numeric(FLERR,arg[iarg],false,lmp); nswaptypes++; iarg++; } @@ -172,7 +172,7 @@ void FixAtomSwap::options(int narg, char **arg) if (isalpha(arg[iarg][0])) break; nmutypes++; if (nmutypes > atom->ntypes) error->all(FLERR,"Illegal fix atom/swap command"); - mu[nmutypes] = force->numeric(FLERR,arg[iarg]); + mu[nmutypes] = utils::numeric(FLERR,arg[iarg],false,lmp); iarg++; } } else error->all(FLERR,"Illegal fix atom/swap command"); diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 2e8200f751..833a071694 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -41,7 +41,7 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/break command"); force_reneighbor = 1; @@ -51,8 +51,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - btype = force->inumeric(FLERR,arg[4]); - cutoff = force->numeric(FLERR,arg[5]); + btype = utils::inumeric(FLERR,arg[4],false,lmp); + cutoff = utils::numeric(FLERR,arg[5],false,lmp); if (btype < 1 || btype > atom->nbondtypes) error->all(FLERR,"Invalid bond type in fix bond/break command"); @@ -69,8 +69,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"prob") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/break command"); - fraction = force->numeric(FLERR,arg[iarg+1]); - seed = force->inumeric(FLERR,arg[iarg+2]); + fraction = utils::numeric(FLERR,arg[iarg+1],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction < 0.0 || fraction > 1.0) error->all(FLERR,"Illegal fix bond/break command"); if (seed <= 0) error->all(FLERR,"Illegal fix bond/break command"); diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 9639832db9..9603fc1583 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -47,7 +47,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/create command"); force_reneighbor = 1; @@ -57,10 +57,10 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - iatomtype = force->inumeric(FLERR,arg[4]); - jatomtype = force->inumeric(FLERR,arg[5]); - double cutoff = force->numeric(FLERR,arg[6]); - btype = force->inumeric(FLERR,arg[7]); + iatomtype = utils::inumeric(FLERR,arg[4],false,lmp); + jatomtype = utils::inumeric(FLERR,arg[5],false,lmp); + double cutoff = utils::numeric(FLERR,arg[6],false,lmp); + btype = utils::inumeric(FLERR,arg[7],false,lmp); if (iatomtype < 1 || iatomtype > atom->ntypes || jatomtype < 1 || jatomtype > atom->ntypes) @@ -90,49 +90,49 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"iparam") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - imaxbond = force->inumeric(FLERR,arg[iarg+1]); - inewtype = force->inumeric(FLERR,arg[iarg+2]); + imaxbond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + inewtype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (imaxbond < 0) error->all(FLERR,"Illegal fix bond/create command"); if (inewtype < 1 || inewtype > atom->ntypes) error->all(FLERR,"Invalid atom type in fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"jparam") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - jmaxbond = force->inumeric(FLERR,arg[iarg+1]); - jnewtype = force->inumeric(FLERR,arg[iarg+2]); + jmaxbond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + jnewtype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (jmaxbond < 0) error->all(FLERR,"Illegal fix bond/create command"); if (jnewtype < 1 || jnewtype > atom->ntypes) error->all(FLERR,"Invalid atom type in fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"prob") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - fraction = force->numeric(FLERR,arg[iarg+1]); - seed = force->inumeric(FLERR,arg[iarg+2]); + fraction = utils::numeric(FLERR,arg[iarg+1],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction < 0.0 || fraction > 1.0) error->all(FLERR,"Illegal fix bond/create command"); if (seed <= 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"atype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - atype = force->inumeric(FLERR,arg[iarg+1]); + atype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"dtype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - dtype = force->inumeric(FLERR,arg[iarg+1]); + dtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (dtype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"itype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - itype = force->inumeric(FLERR,arg[iarg+1]); + itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (itype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"aconstrain") == 0 && strcmp(style,"bond/create/angle") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create/angle command"); - amin = force->numeric(FLERR,arg[iarg+1]); - amax = force->inumeric(FLERR,arg[iarg+2]); + amin = utils::numeric(FLERR,arg[iarg+1],false,lmp); + amax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (amin >= amax) error->all(FLERR,"Illegal fix bond/create/angle command"); if (amin < 0 || amin > 180) diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 8d3ff14f48..82b27d490f 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -59,7 +59,7 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : if (narg != 7) error->all(FLERR,"Illegal fix bond/swap command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/swap command"); force_reneighbor = 1; @@ -69,13 +69,13 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - fraction = force->numeric(FLERR,arg[4]); - double cutoff = force->numeric(FLERR,arg[5]); + fraction = utils::numeric(FLERR,arg[4],false,lmp); + double cutoff = utils::numeric(FLERR,arg[5],false,lmp); cutsq = cutoff*cutoff; // initialize Marsaglia RNG with processor-unique seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); random = new RanMars(lmp,seed + comm->me); // error check diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index f977f59c53..f286ab6807 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -87,14 +87,14 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - nexchanges = force->inumeric(FLERR,arg[4]); - nmcmoves = force->inumeric(FLERR,arg[5]); - ngcmc_type = force->inumeric(FLERR,arg[6]); - seed = force->inumeric(FLERR,arg[7]); - reservoir_temperature = force->numeric(FLERR,arg[8]); - chemical_potential = force->numeric(FLERR,arg[9]); - displace = force->numeric(FLERR,arg[10]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nexchanges = utils::inumeric(FLERR,arg[4],false,lmp); + nmcmoves = utils::inumeric(FLERR,arg[5],false,lmp); + ngcmc_type = utils::inumeric(FLERR,arg[6],false,lmp); + seed = utils::inumeric(FLERR,arg[7],false,lmp); + reservoir_temperature = utils::numeric(FLERR,arg[8],false,lmp); + chemical_potential = utils::numeric(FLERR,arg[9],false,lmp); + displace = utils::numeric(FLERR,arg[10],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix gcmc command"); if (nexchanges < 0) error->all(FLERR,"Illegal fix gcmc command"); @@ -287,9 +287,9 @@ void FixGCMC::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"mcmoves") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix gcmc command"); - patomtrans = force->numeric(FLERR,arg[iarg+1]); - pmoltrans = force->numeric(FLERR,arg[iarg+2]); - pmolrotate = force->numeric(FLERR,arg[iarg+3]); + patomtrans = utils::numeric(FLERR,arg[iarg+1],false,lmp); + pmoltrans = utils::numeric(FLERR,arg[iarg+2],false,lmp); + pmolrotate = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (patomtrans < 0 || pmoltrans < 0 || pmolrotate < 0) error->all(FLERR,"Illegal fix gcmc command"); pmctot = patomtrans + pmoltrans + pmolrotate; @@ -308,21 +308,21 @@ void FixGCMC::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"maxangle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - max_rotation_angle = force->numeric(FLERR,arg[iarg+1]); + max_rotation_angle = utils::numeric(FLERR,arg[iarg+1],false,lmp); max_rotation_angle *= MY_PI/180; iarg += 2; } else if (strcmp(arg[iarg],"pressure") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - pressure = force->numeric(FLERR,arg[iarg+1]); + pressure = utils::numeric(FLERR,arg[iarg+1],false,lmp); pressure_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"fugacity_coeff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - fugacity_coeff = force->numeric(FLERR,arg[iarg+1]); + fugacity_coeff = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - charge = force->numeric(FLERR,arg[iarg+1]); + charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"rigid") == 0) { @@ -369,7 +369,7 @@ void FixGCMC::options(int narg, char **arg) ngrouptypesmax*sizeof(char *), "fix_gcmc:grouptypestrings"); } - grouptypes[ngrouptypes] = force->inumeric(FLERR,arg[iarg+1]); + grouptypes[ngrouptypes] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); int n = strlen(arg[iarg+2]) + 1; grouptypestrings[ngrouptypes] = new char[n]; strcpy(grouptypestrings[ngrouptypes],arg[iarg+2]); @@ -377,25 +377,25 @@ void FixGCMC::options(int narg, char **arg) iarg += 3; } else if (strcmp(arg[iarg],"intra_energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - energy_intra = force->numeric(FLERR,arg[iarg+1]); + energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tfac_insert") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - tfac_insert = force->numeric(FLERR,arg[iarg+1]); + tfac_insert = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overlap_cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - double rtmp = force->numeric(FLERR,arg[iarg+1]); + double rtmp = utils::numeric(FLERR,arg[iarg+1],false,lmp); overlap_cutoffsq = rtmp*rtmp; overlap_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"min") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - min_ngas = force->numeric(FLERR,arg[iarg+1]); + min_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - max_ngas = force->numeric(FLERR,arg[iarg+1]); + max_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal fix gcmc command"); } diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index e57f1cdf4a..cf327dc2e1 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -44,9 +44,9 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : // although we are not doing MD, we would like to use tfMC as an MD "drop in" time_integrate = 1; - d_max = force->numeric(FLERR,arg[3]); - T_set = force->numeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + d_max = utils::numeric(FLERR,arg[3],false,lmp); + T_set = utils::numeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (d_max <= 0) error->all(FLERR,"Fix tfmc displacement length must be > 0"); if (T_set <= 0) error->all(FLERR,"Fix tfmc temperature must be > 0"); @@ -62,9 +62,9 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"com") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix tfmc command"); comflag = 1; - xflag = force->inumeric(FLERR,arg[iarg+1]); - yflag = force->inumeric(FLERR,arg[iarg+2]); - zflag = force->inumeric(FLERR,arg[iarg+3]); + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"rot") == 0) { if (iarg+1 > narg) error->all(FLERR,"Illegal fix tfmc command"); diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index af904bfe6a..7f6f7ae1bd 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -83,11 +83,11 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - ninsertions = force->inumeric(FLERR,arg[4]); - nwidom_type = force->inumeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); - insertion_temperature = force->numeric(FLERR,arg[7]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + ninsertions = utils::inumeric(FLERR,arg[4],false,lmp); + nwidom_type = utils::inumeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); + insertion_temperature = utils::numeric(FLERR,arg[7],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix Widom command"); if (ninsertions < 0) error->all(FLERR,"Illegal fix Widom command"); @@ -234,7 +234,7 @@ void FixWidom::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); - charge = force->numeric(FLERR,arg[iarg+1]); + charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"full_energy") == 0) { @@ -242,7 +242,7 @@ void FixWidom::options(int narg, char **arg) iarg += 1; } else if (strcmp(arg[iarg],"intra_energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); - energy_intra = force->numeric(FLERR,arg[iarg+1]); + energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal fix Widom command"); } diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index e6d2f4fe89..30c66a671f 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -209,12 +209,12 @@ void PairDSMC::settings(int narg, char **arg) if (narg != 6) error->all(FLERR,"Illegal pair_style command"); cut_global = 0.0; - max_cell_size = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); - weighting = force->numeric(FLERR,arg[2]); - T_ref = force->numeric(FLERR,arg[3]); - recompute_vsigmamax_stride = force->inumeric(FLERR,arg[4]); - vsigmamax_samples = force->inumeric(FLERR,arg[5]); + max_cell_size = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); + weighting = utils::numeric(FLERR,arg[2],false,lmp); + T_ref = utils::numeric(FLERR,arg[3],false,lmp); + recompute_vsigmamax_stride = utils::inumeric(FLERR,arg[4],false,lmp); + vsigmamax_samples = utils::inumeric(FLERR,arg[5],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -248,10 +248,10 @@ void PairDSMC::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double sigma_one = force->numeric(FLERR,arg[2]); + double sigma_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 022591839f..fbd56b9096 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -283,7 +283,7 @@ int DumpXTC::modify_param(int narg, char **arg) return 2; } else if (strcmp(arg[0],"precision") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - precision = force->numeric(FLERR,arg[1]); + precision = utils::numeric(FLERR,arg[1],false,lmp); if ((fabs(precision-10.0) > EPS) && (fabs(precision-100.0) > EPS) && (fabs(precision-1000.0) > EPS) && (fabs(precision-10000.0) > EPS) && (fabs(precision-100000.0) > EPS) && @@ -292,13 +292,13 @@ int DumpXTC::modify_param(int narg, char **arg) return 2; } else if (strcmp(arg[0],"sfactor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - sfactor = force->numeric(FLERR,arg[1]); + sfactor = utils::numeric(FLERR,arg[1],false,lmp); if (sfactor <= 0.0) error->all(FLERR,"Illegal dump_modify sfactor value (must be > 0.0)"); return 2; } else if (strcmp(arg[0],"tfactor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - tfactor = force->numeric(FLERR,arg[1]); + tfactor = utils::numeric(FLERR,arg[1],false,lmp); if (tfactor <= 0.0) error->all(FLERR,"Illegal dump_modify tfactor value (must be > 0.0)"); return 2; diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index 4d65457340..7d9766c57c 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -56,10 +56,10 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : // required args - ninsert = force->inumeric(FLERR,arg[3]); - ntype = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + ninsert = utils::inumeric(FLERR,arg[3],false,lmp); + ntype = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix deposit command"); @@ -712,9 +712,9 @@ void FixDeposit::options(int narg, char **arg) } else if (strcmp(arg[iarg],"molfrac") == 0) { if (mode != MOLECULE) error->all(FLERR,"Illegal fix deposit command"); if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix deposit command"); - molfrac[0] = force->numeric(FLERR,arg[iarg+1]); + molfrac[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); for (int i = 1; i < nmol; i++) - molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]); + molfrac[i] = molfrac[i-1] + utils::numeric(FLERR,arg[iarg+i+1],false,lmp); if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON) error->all(FLERR,"Illegal fix deposit command"); molfrac[nmol-1] = 1.0; @@ -747,54 +747,54 @@ void FixDeposit::options(int narg, char **arg) if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); globalflag = 1; localflag = 0; - lo = force->numeric(FLERR,arg[iarg+1]); - hi = force->numeric(FLERR,arg[iarg+2]); + lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"local") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); localflag = 1; globalflag = 0; - lo = force->numeric(FLERR,arg[iarg+1]); - hi = force->numeric(FLERR,arg[iarg+2]); - deltasq = force->numeric(FLERR,arg[iarg+3]) * - force->numeric(FLERR,arg[iarg+3]); + lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + deltasq = utils::numeric(FLERR,arg[iarg+3],false,lmp) * + utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"near") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); - nearsq = force->numeric(FLERR,arg[iarg+1]) * - force->numeric(FLERR,arg[iarg+1]); + nearsq = utils::numeric(FLERR,arg[iarg+1],false,lmp) * + utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"attempt") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); - maxattempt = force->inumeric(FLERR,arg[iarg+1]); + maxattempt = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"rate") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); rateflag = 1; - rate = force->numeric(FLERR,arg[iarg+1]); + rate = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"vx") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"vy") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vylo = force->numeric(FLERR,arg[iarg+1]); - vyhi = force->numeric(FLERR,arg[iarg+2]); + vylo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vyhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"vz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vzlo = force->numeric(FLERR,arg[iarg+1]); - vzhi = force->numeric(FLERR,arg[iarg+2]); + vzlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vzhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"orient") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); orientflag = 1; - rx = force->numeric(FLERR,arg[iarg+1]); - ry = force->numeric(FLERR,arg[iarg+2]); - rz = force->numeric(FLERR,arg[iarg+3]); + rx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ry = utils::numeric(FLERR,arg[iarg+2],false,lmp); + rz = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (domain->dimension == 2 && (rx != 0.0 || ry != 0.0)) error->all(FLERR,"Illegal fix deposit orient settings"); if (rx == 0.0 && ry == 0.0 && rz == 0.0) @@ -808,17 +808,17 @@ void FixDeposit::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"gaussian") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix deposit command"); - xmid = force->numeric(FLERR,arg[iarg+1]); - ymid = force->numeric(FLERR,arg[iarg+2]); - zmid = force->numeric(FLERR,arg[iarg+3]); - sigma = force->numeric(FLERR,arg[iarg+4]); + xmid = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ymid = utils::numeric(FLERR,arg[iarg+2],false,lmp); + zmid = utils::numeric(FLERR,arg[iarg+3],false,lmp); + sigma = utils::numeric(FLERR,arg[iarg+4],false,lmp); distflag = DIST_GAUSSIAN; iarg += 5; } else if (strcmp(arg[iarg],"target") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); - tx = force->numeric(FLERR,arg[iarg+1]); - ty = force->numeric(FLERR,arg[iarg+2]); - tz = force->numeric(FLERR,arg[iarg+3]); + tx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ty = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tz = utils::numeric(FLERR,arg[iarg+3],false,lmp); targetflag = 1; iarg += 4; } else error->all(FLERR,"Illegal fix deposit command"); diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 5a13b93b91..0dc0be4947 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -64,7 +64,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - ex = qe2f * force->numeric(FLERR,arg[3]); + ex = qe2f * utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } @@ -73,7 +73,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - ey = qe2f * force->numeric(FLERR,arg[4]); + ey = qe2f * utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } @@ -82,7 +82,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - ez = qe2f * force->numeric(FLERR,arg[5]); + ez = qe2f * utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index c7e7af9057..153de8851b 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -41,13 +41,13 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 0; - nevery = force->inumeric(FLERR,arg[3]); - nflux = force->inumeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nflux = utils::inumeric(FLERR,arg[4],false,lmp); iregion = domain->find_region(arg[5]); int n = strlen(arg[5]) + 1; idregion = new char[n]; strcpy(idregion,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); if (nevery <= 0 || nflux <= 0) error->all(FLERR,"Illegal fix evaporate command"); diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 0e4c61813b..c4ff1ebeba 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -55,16 +55,16 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : // 1 = Group ID (e.g., all) // 2 = gld (name of this fix) // 3 = t_start (Starting target temperature) - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); // 4 = t_stop (Stopping target temperature) - t_stop = force->numeric(FLERR,arg[4]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); // 5 = prony_terms (number of terms in Prony series) - prony_terms = force->inumeric(FLERR,arg[5]); + prony_terms = utils::inumeric(FLERR,arg[5],false,lmp); // 6 = seed (random seed) - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // 7 = series type if(strcmp(arg[7],"pprony") == 0) { @@ -99,8 +99,8 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : int iarg = narg_min; int icoeff = 0; while (iarg < narg && icoeff < prony_terms) { - double pc = force->numeric(FLERR,arg[iarg]); - double ptau = force->numeric(FLERR,arg[iarg+1]); + double pc = utils::numeric(FLERR,arg[iarg],false,lmp); + double ptau = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (pc < 0) error->all(FLERR,"Fix gld c coefficients must be >= 0"); diff --git a/src/MISC/fix_oneway.cpp b/src/MISC/fix_oneway.cpp index 68a27b68be..d2bef7cb9b 100644 --- a/src/MISC/fix_oneway.cpp +++ b/src/MISC/fix_oneway.cpp @@ -38,7 +38,7 @@ FixOneWay::FixOneWay(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (narg < 6) error->all(FLERR,"Illegal fix oneway command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 1) error->all(FLERR,"Illegal fix oneway command"); int len = strlen(arg[4]); diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index 8548ee04cf..3141f6496c 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -78,12 +78,12 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - nstats = force->inumeric(FLERR,arg[3]); - direction_of_motion = force->inumeric(FLERR,arg[4]); - a = force->numeric(FLERR,arg[5]); - Vxi = force->numeric(FLERR,arg[6]); - uxif_low = force->numeric(FLERR,arg[7]); - uxif_high = force->numeric(FLERR,arg[8]); + nstats = utils::inumeric(FLERR,arg[3],false,lmp); + direction_of_motion = utils::inumeric(FLERR,arg[4],false,lmp); + a = utils::numeric(FLERR,arg[5],false,lmp); + Vxi = utils::numeric(FLERR,arg[6],false,lmp); + uxif_low = utils::numeric(FLERR,arg[7],false,lmp); + uxif_high = utils::numeric(FLERR,arg[8],false,lmp); if (direction_of_motion == 0) { int n = strlen(arg[9]) + 1; diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index 97c545d189..bcba14c355 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -76,12 +76,12 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - nstats = force->inumeric(FLERR,arg[3]); - direction_of_motion = force->inumeric(FLERR,arg[4]); - a = force->numeric(FLERR,arg[5]); - Vxi = force->numeric(FLERR,arg[6]); - uxif_low = force->numeric(FLERR,arg[7]); - uxif_high = force->numeric(FLERR,arg[8]); + nstats = utils::inumeric(FLERR,arg[3],false,lmp); + direction_of_motion = utils::inumeric(FLERR,arg[4],false,lmp); + a = utils::numeric(FLERR,arg[5],false,lmp); + Vxi = utils::numeric(FLERR,arg[6],false,lmp); + uxif_low = utils::numeric(FLERR,arg[7],false,lmp); + uxif_high = utils::numeric(FLERR,arg[8],false,lmp); if (direction_of_motion == 0) { int n = strlen(arg[9]) + 1; diff --git a/src/MISC/fix_thermal_conductivity.cpp b/src/MISC/fix_thermal_conductivity.cpp index d0add6fecb..7eec60be8b 100644 --- a/src/MISC/fix_thermal_conductivity.cpp +++ b/src/MISC/fix_thermal_conductivity.cpp @@ -41,7 +41,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix thermal/conductivity command"); scalar_flag = 1; @@ -53,7 +53,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, else if (strcmp(arg[4],"z") == 0) edim = 2; else error->all(FLERR,"Illegal fix thermal/conductivity command"); - nbin = force->inumeric(FLERR,arg[5]); + nbin = utils::inumeric(FLERR,arg[5],false,lmp); if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix thermal/conductivity command"); @@ -66,7 +66,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, if (strcmp(arg[iarg],"swap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix thermal/conductivity command"); - nswap = force->inumeric(FLERR,arg[iarg+1]); + nswap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nswap <= 0) error->all(FLERR, "Fix thermal/conductivity swap value must be positive"); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 896eb24b7c..24f988a76d 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -58,17 +58,17 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; restart_global = 1; - seed = force->inumeric(FLERR,arg[3]); - electronic_specific_heat = force->numeric(FLERR,arg[4]); - electronic_density = force->numeric(FLERR,arg[5]); - electronic_thermal_conductivity = force->numeric(FLERR,arg[6]); - gamma_p = force->numeric(FLERR,arg[7]); - gamma_s = force->numeric(FLERR,arg[8]); - v_0 = force->numeric(FLERR,arg[9]); - nxnodes = force->inumeric(FLERR,arg[10]); - nynodes = force->inumeric(FLERR,arg[11]); - nznodes = force->inumeric(FLERR,arg[12]); - nfileevery = force->inumeric(FLERR,arg[14]); + seed = utils::inumeric(FLERR,arg[3],false,lmp); + electronic_specific_heat = utils::numeric(FLERR,arg[4],false,lmp); + electronic_density = utils::numeric(FLERR,arg[5],false,lmp); + electronic_thermal_conductivity = utils::numeric(FLERR,arg[6],false,lmp); + gamma_p = utils::numeric(FLERR,arg[7],false,lmp); + gamma_s = utils::numeric(FLERR,arg[8],false,lmp); + v_0 = utils::numeric(FLERR,arg[9],false,lmp); + nxnodes = utils::inumeric(FLERR,arg[10],false,lmp); + nynodes = utils::inumeric(FLERR,arg[11],false,lmp); + nznodes = utils::inumeric(FLERR,arg[12],false,lmp); + nfileevery = utils::inumeric(FLERR,arg[14],false,lmp); if (nfileevery) { if (narg != 16) error->all(FLERR,"Illegal fix ttm command"); diff --git a/src/MISC/fix_viscosity.cpp b/src/MISC/fix_viscosity.cpp index d5a97cd4b0..b8c04132ea 100644 --- a/src/MISC/fix_viscosity.cpp +++ b/src/MISC/fix_viscosity.cpp @@ -43,7 +43,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix viscosity command"); scalar_flag = 1; @@ -60,7 +60,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[5],"z") == 0) pdim = 2; else error->all(FLERR,"Illegal fix viscosity command"); - nbin = force->inumeric(FLERR,arg[6]); + nbin = utils::inumeric(FLERR,arg[6],false,lmp); if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix viscosity command"); // optional keywords @@ -72,14 +72,14 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"swap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command"); - nswap = force->inumeric(FLERR,arg[iarg+1]); + nswap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nswap <= 0) error->all(FLERR,"Fix viscosity swap value must be positive"); iarg += 2; } else if (strcmp(arg[iarg],"vtarget") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command"); if (strcmp(arg[iarg+1],"INF") == 0) vtarget = BIG; - else vtarget = force->numeric(FLERR,arg[iarg+1]); + else vtarget = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (vtarget <= 0.0) error->all(FLERR,"Fix viscosity vtarget value must be positive"); iarg += 2; diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index 9cf6700656..e2e6f40857 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -179,7 +179,7 @@ void PairNMCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -205,13 +205,13 @@ void PairNMCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 39efd4a2d1..efc84f22b5 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -203,9 +203,9 @@ void PairNMCutCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -234,15 +234,15 @@ void PairNMCutCoulCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 7) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 8) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 7) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 8) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index 073cf59128..79b1ebae66 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -242,9 +242,9 @@ void PairNMCutCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -270,13 +270,13 @@ void PairNMCutCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 7) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 7) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp index ec46958c94..117056ac58 100644 --- a/src/MOLECULE/angle_charmm.cpp +++ b/src/MOLECULE/angle_charmm.cpp @@ -198,10 +198,10 @@ void AngleCharmm::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); - double k_ub_one = force->numeric(FLERR,arg[3]); - double r_ub_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_ub_one = utils::numeric(FLERR,arg[3],false,lmp); + double r_ub_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp index 81d94c680e..732843f412 100644 --- a/src/MOLECULE/angle_cosine.cpp +++ b/src/MOLECULE/angle_cosine.cpp @@ -158,7 +158,7 @@ void AngleCosine::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp index c771eb8e4b..2ec59bfb1e 100644 --- a/src/MOLECULE/angle_cosine_periodic.cpp +++ b/src/MOLECULE/angle_cosine_periodic.cpp @@ -203,9 +203,9 @@ void AngleCosinePeriodic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double c_one = force->numeric(FLERR,arg[1]); - int b_one = force->inumeric(FLERR,arg[2]); - int n_one = force->inumeric(FLERR,arg[3]); + double c_one = utils::numeric(FLERR,arg[1],false,lmp); + int b_one = utils::inumeric(FLERR,arg[2],false,lmp); + int n_one = utils::inumeric(FLERR,arg[3],false,lmp); if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients"); int count = 0; diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp index 4dc96a538b..ac276511a2 100644 --- a/src/MOLECULE/angle_cosine_squared.cpp +++ b/src/MOLECULE/angle_cosine_squared.cpp @@ -174,8 +174,8 @@ void AngleCosineSquared::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp index c7b917b4d3..02bab37a8a 100644 --- a/src/MOLECULE/angle_harmonic.cpp +++ b/src/MOLECULE/angle_harmonic.cpp @@ -174,8 +174,8 @@ void AngleHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index ed150da094..83e4485d48 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -190,7 +190,7 @@ void AngleTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in angle style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of angle table entries"); // delete old tables, since cannot just change settings diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index f853d038e4..9617894a9a 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -154,10 +154,10 @@ void BondFENE::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index d283a3553e..eec8c14872 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -161,11 +161,11 @@ void BondFENEExpand::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); - double shift_one = force->numeric(FLERR,arg[5]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); + double shift_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index dc8236221f..4e20a2711d 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -125,8 +125,8 @@ void BondGromos::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index b637b41eb4..773a4ee12a 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -126,8 +126,8 @@ void BondHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index e369099370..38d8d6a45f 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -128,9 +128,9 @@ void BondMorse::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double d0_one = force->numeric(FLERR,arg[1]); - double alpha_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); + double d0_one = utils::numeric(FLERR,arg[1],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index a111f9dcea..1733ffc670 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -125,9 +125,9 @@ void BondNonlinear::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double epsilon_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double lamda_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double lamda_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index 94b9ff70e5..c89ac552ae 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -203,11 +203,11 @@ void BondQuartic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double b1_one = force->numeric(FLERR,arg[2]); - double b2_one = force->numeric(FLERR,arg[3]); - double rc_one = force->numeric(FLERR,arg[4]); - double u0_one = force->numeric(FLERR,arg[5]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double b1_one = utils::numeric(FLERR,arg[2],false,lmp); + double b2_one = utils::numeric(FLERR,arg[3],false,lmp); + double rc_one = utils::numeric(FLERR,arg[4],false,lmp); + double u0_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 20d83ddd3b..2724d4f20c 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -142,7 +142,7 @@ void BondTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in bond style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of bond table entries"); // delete old tables, since cannot just change settings diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index f30ad6cf34..71c9f586a3 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -336,10 +336,10 @@ void DihedralCharmm::coeff(int narg, char **arg) // arbitrary phase angle shift could be allowed, but would break // backwards compatibility and is probably not needed - double k_one = force->numeric(FLERR,arg[1]); - int multiplicity_one = force->inumeric(FLERR,arg[2]); - int shift_one = force->inumeric(FLERR,arg[3]); - double weight_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp); + int shift_one = utils::inumeric(FLERR,arg[3],false,lmp); + double weight_one = utils::numeric(FLERR,arg[4],false,lmp); if (multiplicity_one < 0) error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients"); diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 13b2b0c205..d4956b42bd 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -354,10 +354,10 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) // arbitrary phase angle shift could be allowed, but would break // backwards compatibility and is probably not needed - double k_one = force->numeric(FLERR,arg[1]); - int multiplicity_one = force->inumeric(FLERR,arg[2]); - int shift_one = force->inumeric(FLERR,arg[3]); - double weight_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp); + int shift_one = utils::inumeric(FLERR,arg[3],false,lmp); + double weight_one = utils::numeric(FLERR,arg[4],false,lmp); if (multiplicity_one < 0) error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients"); diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index cdf580e4e4..403bafd23e 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -276,9 +276,9 @@ void DihedralHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - int sign_one = force->inumeric(FLERR,arg[2]); - int multiplicity_one = force->inumeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int sign_one = utils::inumeric(FLERR,arg[2],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[3],false,lmp); // require sign = +/- 1 for backwards compatibility // arbitrary phase angle shift could be allowed, but would break diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index bc723bc3b2..ce31a12ed3 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -287,9 +287,9 @@ void DihedralHelix::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double aphi_one = force->numeric(FLERR,arg[1]); - double bphi_one = force->numeric(FLERR,arg[2]); - double cphi_one = force->numeric(FLERR,arg[3]); + double aphi_one = utils::numeric(FLERR,arg[1],false,lmp); + double bphi_one = utils::numeric(FLERR,arg[2],false,lmp); + double cphi_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index 143222de5e..a3c76b91ee 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -277,11 +277,11 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double a1_one = force->numeric(FLERR,arg[1]); - double a2_one = force->numeric(FLERR,arg[2]); - double a3_one = force->numeric(FLERR,arg[3]); - double a4_one = force->numeric(FLERR,arg[4]); - double a5_one = force->numeric(FLERR,arg[5]); + double a1_one = utils::numeric(FLERR,arg[1],false,lmp); + double a2_one = utils::numeric(FLERR,arg[2],false,lmp); + double a3_one = utils::numeric(FLERR,arg[3],false,lmp); + double a4_one = utils::numeric(FLERR,arg[4],false,lmp); + double a5_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index cbdad9228f..151986ca3f 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -290,10 +290,10 @@ void DihedralOPLS::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k1_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double k1_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // store 1/2 factor with prefactor diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 75f97907ef..d819642bb1 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -298,9 +298,9 @@ void ImproperCvff::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - int sign_one = force->inumeric(FLERR,arg[2]); - int multiplicity_one = force->inumeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int sign_one = utils::inumeric(FLERR,arg[2],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index 2742bfe91a..2af1126876 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -240,8 +240,8 @@ void ImproperHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 2ca37d208d..1f2da63486 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -278,8 +278,8 @@ void ImproperUmbrella::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double w_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double w_one = utils::numeric(FLERR,arg[2],false,lmp); // convert w0 from degrees to radians diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index ca2c91c1a2..69ea81a017 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -301,10 +301,10 @@ void PairHbondDreidingLJ::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - ap_global = force->inumeric(FLERR,arg[0]); - cut_inner_global = force->numeric(FLERR,arg[1]); - cut_outer_global = force->numeric(FLERR,arg[2]); - cut_angle_global = force->numeric(FLERR,arg[3]) * MY_PI/180.0; + ap_global = utils::inumeric(FLERR,arg[0],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[1],false,lmp); + cut_outer_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_angle_global = utils::numeric(FLERR,arg[3],false,lmp) * MY_PI/180.0; } /* ---------------------------------------------------------------------- @@ -327,21 +327,21 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg) else if (strcmp(arg[3],"j") == 0) donor_flag = 1; else error->all(FLERR,"Incorrect args for pair coefficients"); - double epsilon_one = force->numeric(FLERR,arg[4]); - double sigma_one = force->numeric(FLERR,arg[5]); + double epsilon_one = utils::numeric(FLERR,arg[4],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[5],false,lmp); int ap_one = ap_global; - if (narg > 6) ap_one = force->inumeric(FLERR,arg[6]); + if (narg > 6) ap_one = utils::inumeric(FLERR,arg[6],false,lmp); double cut_inner_one = cut_inner_global; double cut_outer_one = cut_outer_global; if (narg > 8) { - cut_inner_one = force->numeric(FLERR,arg[7]); - cut_outer_one = force->numeric(FLERR,arg[8]); + cut_inner_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_outer_one = utils::numeric(FLERR,arg[8],false,lmp); } if (cut_inner_one>cut_outer_one) error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff"); double cut_angle_one = cut_angle_global; - if (narg == 10) cut_angle_one = force->numeric(FLERR,arg[9]) * MY_PI/180.0; + if (narg == 10) cut_angle_one = utils::numeric(FLERR,arg[9],false,lmp) * MY_PI/180.0; // grow params array if necessary if (nparams == maxparam) { diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp index 6d2406de54..8d6dfc7d68 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp @@ -251,22 +251,22 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg) else if (strcmp(arg[3],"j") == 0) donor_flag = 1; else error->all(FLERR,"Incorrect args for pair coefficients"); - double d0_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); - double r0_one = force->numeric(FLERR,arg[6]); + double d0_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); + double r0_one = utils::numeric(FLERR,arg[6],false,lmp); int ap_one = ap_global; - if (narg > 7) ap_one = force->inumeric(FLERR,arg[7]); + if (narg > 7) ap_one = utils::inumeric(FLERR,arg[7],false,lmp); double cut_inner_one = cut_inner_global; double cut_outer_one = cut_outer_global; if (narg > 9) { - cut_inner_one = force->numeric(FLERR,arg[8]); - cut_outer_one = force->numeric(FLERR,arg[9]); + cut_inner_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_outer_one = utils::numeric(FLERR,arg[9],false,lmp); } if (cut_inner_one>cut_outer_one) error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff"); double cut_angle_one = cut_angle_global; - if (narg > 10) cut_angle_one = force->numeric(FLERR,arg[10]) * MY_PI/180.0; + if (narg > 10) cut_angle_one = utils::numeric(FLERR,arg[10],false,lmp) * MY_PI/180.0; // grow params array if necessary diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index e0d6f6b5d6..f09f9a483a 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -224,14 +224,14 @@ void PairLJCharmmCoulCharmm::settings(int narg, char **arg) if (narg != 2 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul_inner = cut_lj_inner; cut_coul = cut_lj; } else { - cut_coul_inner = force->numeric(FLERR,arg[2]); - cut_coul = force->numeric(FLERR,arg[3]); + cut_coul_inner = utils::numeric(FLERR,arg[2],false,lmp); + cut_coul = utils::numeric(FLERR,arg[3],false,lmp); } } @@ -249,13 +249,13 @@ void PairLJCharmmCoulCharmm::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index 6710be9549..e646392e0e 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -250,12 +250,12 @@ void PairLJCharmmfswCoulCharmmfsh::settings(int narg, char **arg) if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul = cut_lj; } else { - cut_coul = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } } @@ -273,13 +273,13 @@ void PairLJCharmmfswCoulCharmmfsh::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 6d1626606f..b23195086c 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -425,15 +425,15 @@ void PairLJCutTIP4PCut::settings(int narg, char **arg) { if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[5]); + cut_lj_global = utils::numeric(FLERR,arg[5],false,lmp); if (narg == 6) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[6]); + else cut_coul = utils::numeric(FLERR,arg[6],false,lmp); cut_coulsq = cut_coul * cut_coul; cut_coulsqplus = (cut_coul + 2.0*qdist) * (cut_coul + 2.0*qdist); @@ -460,11 +460,11 @@ void PairLJCutTIP4PCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 889565e5ea..bea8acbcbc 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -373,12 +373,12 @@ void PairTIP4PCut::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); - cut_coul = force->numeric(FLERR,arg[5]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); + cut_coul = utils::numeric(FLERR,arg[5],false,lmp); cut_coulsq = cut_coul * cut_coul; cut_coulsqplus = (cut_coul + 2.0*qdist) * (cut_coul + 2.0*qdist); diff --git a/src/MSCG/fix_mscg.cpp b/src/MSCG/fix_mscg.cpp index caa9a528a7..9c9e415be5 100644 --- a/src/MSCG/fix_mscg.cpp +++ b/src/MSCG/fix_mscg.cpp @@ -43,7 +43,7 @@ FixMSCG::FixMSCG(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix mscg command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix mscg command"); me = comm->me; diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index c415b5b20f..5e3a514b61 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -453,12 +453,12 @@ void PairPeriEPS::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); - double myieldstress_one = force->numeric(FLERR,arg[7]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); + double myieldstress_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index bdea3bb719..e73e2eff67 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -381,11 +381,11 @@ void PairPeriLPS::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 9969a287eb..cf751885d6 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -314,10 +314,10 @@ void PairPeriPMB::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double kspring_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); - double s00_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); + double kspring_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); + double s00_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index 3d5ab00ef5..138584123a 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -429,13 +429,13 @@ void PairPeriVES::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); - double mlambdai_one = force->numeric(FLERR,arg[7]); - double mtaui_one = force->numeric(FLERR,arg[8]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); + double mlambdai_one = utils::numeric(FLERR,arg[7],false,lmp); + double mtaui_one = utils::numeric(FLERR,arg[8],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/PYTHON/fix_python_invoke.cpp b/src/PYTHON/fix_python_invoke.cpp index 57ea2e9148..767c22c496 100644 --- a/src/PYTHON/fix_python_invoke.cpp +++ b/src/PYTHON/fix_python_invoke.cpp @@ -34,7 +34,7 @@ FixPythonInvoke::FixPythonInvoke(LAMMPS *lmp, int narg, char **arg) : { if (narg != 6) error->all(FLERR,"Illegal fix python/invoke command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix python/invoke command"); // ensure Python interpreter is initialized diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 8fbb3e6f8b..d0650bcb51 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -233,7 +233,7 @@ void PairPython::settings(int narg, char **arg) if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index b1183677d4..b54abe28b0 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -148,7 +148,7 @@ void PythonImpl::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"input") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); - ninput = force->inumeric(FLERR,arg[iarg+1]); + ninput = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ninput < 0) error->all(FLERR,"Invalid python command"); iarg += 2; istr = new char*[ninput]; @@ -168,7 +168,7 @@ void PythonImpl::command(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); - length_longstr = force->inumeric(FLERR,arg[iarg+1]); + length_longstr = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (length_longstr <= 0) error->all(FLERR,"Invalid python command"); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { @@ -433,7 +433,7 @@ int PythonImpl::create_entry(char *name) strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); } else { pfuncs[ifunc].ivarflag[i] = 0; - pfuncs[ifunc].ivalue[i] = force->inumeric(FLERR,istr[i]); + pfuncs[ifunc].ivalue[i] = utils::inumeric(FLERR,istr[i],false,lmp); } } else if (type == 'f') { pfuncs[ifunc].itype[i] = DOUBLE; @@ -444,7 +444,7 @@ int PythonImpl::create_entry(char *name) strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); } else { pfuncs[ifunc].ivarflag[i] = 0; - pfuncs[ifunc].dvalue[i] = force->numeric(FLERR,istr[i]); + pfuncs[ifunc].dvalue[i] = utils::numeric(FLERR,istr[i],false,lmp); } } else if (type == 's') { pfuncs[ifunc].itype[i] = STRING; diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index d5a19f82fe..877d75734c 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -45,10 +45,10 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : { if (narg < 8) error->all(FLERR,"Illegal fix qeq command"); - nevery = force->inumeric(FLERR,arg[3]); - cutoff = force->numeric(FLERR,arg[4]); - tolerance = force->numeric(FLERR,arg[5]); - maxiter = force->inumeric(FLERR,arg[6]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + cutoff = utils::numeric(FLERR,arg[4],false,lmp); + tolerance = utils::numeric(FLERR,arg[5],false,lmp); + maxiter = utils::inumeric(FLERR,arg[6],false,lmp); // check for sane arguments if ((nevery <= 0) || (cutoff <= 0.0) || (tolerance <= 0.0) || (maxiter <= 0)) @@ -755,11 +755,11 @@ void FixQEq::read_file(char *file) utils::bounds(FLERR,words[0],1,ntypes,nlo,nhi,error); for (n=nlo; n <=nhi; ++n) { - chi[n] = force->numeric(FLERR,words[1]); - eta[n] = force->numeric(FLERR,words[2]); - gamma[n] = force->numeric(FLERR,words[3]); - zeta[n] = force->numeric(FLERR,words[4]); - zcore[n] = force->numeric(FLERR,words[5]); + chi[n] = utils::numeric(FLERR,words[1],false,lmp); + eta[n] = utils::numeric(FLERR,words[2],false,lmp); + gamma[n] = utils::numeric(FLERR,words[3],false,lmp); + zeta[n] = utils::numeric(FLERR,words[4],false,lmp); + zcore[n] = utils::numeric(FLERR,words[5],false,lmp); setflag[n] = 1; } } diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index a6abcce85d..e130f85f5f 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -40,7 +40,7 @@ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; extscalar = 0; - double displace_dist = force->numeric(FLERR,arg[3]); + double displace_dist = utils::numeric(FLERR,arg[3],false,lmp); if (displace_dist <= 0.0) error->all(FLERR,"Distance must be > 0 for compute event/displace"); displace_distsq = displace_dist * displace_dist; diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index bc5df921c6..16c37fcb77 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -56,10 +56,10 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; extvector = 0; - cutbond = force->numeric(FLERR,arg[3]); - qfactor = force->numeric(FLERR,arg[4]); - vmax = force->numeric(FLERR,arg[5]); - tequil = force->numeric(FLERR,arg[6]); + cutbond = utils::numeric(FLERR,arg[3],false,lmp); + qfactor = utils::numeric(FLERR,arg[4],false,lmp); + vmax = utils::numeric(FLERR,arg[5],false,lmp); + tequil = utils::numeric(FLERR,arg[6],false,lmp); if (cutbond < 0.0 || qfactor <= 0.0 || vmax < 0.0 || tequil <= 0.0) error->all(FLERR,"Illegal fix hyper/global command"); diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index d5311fc37d..9e3ce9b00d 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -75,13 +75,13 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; extvector = 0; - cutbond = force->numeric(FLERR,arg[3]); - qfactor = force->numeric(FLERR,arg[4]); - vmax = force->numeric(FLERR,arg[5]); - tequil = force->numeric(FLERR,arg[6]); - dcut = force->numeric(FLERR,arg[7]); - alpha_user = force->numeric(FLERR,arg[8]); - boost_target = force->numeric(FLERR,arg[9]); + cutbond = utils::numeric(FLERR,arg[3],false,lmp); + qfactor = utils::numeric(FLERR,arg[4],false,lmp); + vmax = utils::numeric(FLERR,arg[5],false,lmp); + tequil = utils::numeric(FLERR,arg[6],false,lmp); + dcut = utils::numeric(FLERR,arg[7],false,lmp); + alpha_user = utils::numeric(FLERR,arg[8],false,lmp); + boost_target = utils::numeric(FLERR,arg[9],false,lmp); if (cutbond < 0.0 || qfactor < 0.0 || vmax < 0.0 || tequil <= 0.0 || dcut <= 0.0 || alpha_user <= 0.0 || boost_target < 1.0) @@ -105,13 +105,13 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"bound") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix hyper/local command"); - boundfrac = force->numeric(FLERR,arg[iarg+1]); + boundfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (boundfrac < 0.0) boundflag = 0; else boundflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"reset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix hyper/local command"); - resetfreq = force->inumeric(FLERR,arg[iarg+1]); + resetfreq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (resetfreq < -1) error->all(FLERR,"Illegal fix hyper/local command"); iarg += 2; } else if (strcmp(arg[iarg],"check/ghost") == 0) { @@ -120,7 +120,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"check/bias") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix hyper/local command"); checkbias = 1; - checkbias_every = force->inumeric(FLERR,arg[iarg+1]); + checkbias_every = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"error") == 0) checkbias_flag = ERROR; else if (strcmp(arg[iarg+2],"warn") == 0) checkbias_flag = WARN; else if (strcmp(arg[iarg+2],"ignore") == 0) checkbias_flag = IGNORE; diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index b3af01fda4..93689eb7f9 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -56,7 +56,7 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix neb command"); - kspring = force->numeric(FLERR,arg[3]); + kspring = utils::numeric(FLERR,arg[3],false,lmp); if (kspring <= 0.0) error->all(FLERR,"Illegal fix neb command"); // optional params @@ -85,7 +85,7 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"perp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix neb command"); PerpSpring = true; - kspringPerp = force->numeric(FLERR,arg[iarg+1]); + kspringPerp = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (kspringPerp == 0.0) PerpSpring = false; if (kspringPerp < 0.0) error->all(FLERR,"Illegal fix neb command"); iarg += 2; @@ -94,22 +94,22 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : if (iarg+3 > narg) error->all(FLERR,"Illegal fix neb command"); if (strcmp(arg[iarg+1],"first") == 0) { FreeEndIni = true; - kspringIni = force->numeric(FLERR,arg[iarg+2]); + kspringIni = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last") == 0) { FreeEndFinal = true; FinalAndInterWithRespToEIni = false; FreeEndFinalWithRespToEIni = false; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last/efirst") == 0) { FreeEndFinal = false; FinalAndInterWithRespToEIni = false; FreeEndFinalWithRespToEIni = true; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last/efirst/middle") == 0) { FreeEndFinal = false; FinalAndInterWithRespToEIni = true; FreeEndFinalWithRespToEIni = true; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else error->all(FLERR,"Illegal fix neb command"); iarg += 3; diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 6a2891dee1..1e78326fbd 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -59,8 +59,8 @@ void Hyper::command(int narg, char **arg) if (narg < 4) error->all(FLERR,"Illegal hyper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); char *id_fix = new char[strlen(arg[2])+1]; strcpy(id_fix,arg[2]); @@ -459,10 +459,10 @@ void Hyper::options(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal hyper command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0) error->all(FLERR,"Illegal hyper command"); iarg += 5; @@ -478,7 +478,7 @@ void Hyper::options(int narg, char **arg) } else if (strcmp(arg[iarg],"rebond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal hyper command"); - rebond = force->inumeric(FLERR,arg[iarg+1]); + rebond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal hyper command"); diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 5a1f942815..34b5cf40fe 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -110,11 +110,11 @@ void NEB::command(int narg, char **arg) if (narg < 6) error->universe_all(FLERR,"Illegal NEB command"); - etol = force->numeric(FLERR,arg[0]); - ftol = force->numeric(FLERR,arg[1]); - n1steps = force->inumeric(FLERR,arg[2]); - n2steps = force->inumeric(FLERR,arg[3]); - nevery = force->inumeric(FLERR,arg[4]); + etol = utils::numeric(FLERR,arg[0],false,lmp); + ftol = utils::numeric(FLERR,arg[1],false,lmp); + n1steps = utils::inumeric(FLERR,arg[2],false,lmp); + n2steps = utils::inumeric(FLERR,arg[3],false,lmp); + nevery = utils::inumeric(FLERR,arg[4],false,lmp); // error checks diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 633fcefc80..796cf01681 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -74,15 +74,15 @@ void PRD::command(int narg, char **arg) // read as double so can cast to bigint - int nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); - n_dephase = force->inumeric(FLERR,arg[2]); - t_dephase = force->inumeric(FLERR,arg[3]); - t_corr = force->inumeric(FLERR,arg[4]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); + n_dephase = utils::inumeric(FLERR,arg[2],false,lmp); + t_dephase = utils::inumeric(FLERR,arg[3],false,lmp); + t_corr = utils::inumeric(FLERR,arg[4],false,lmp); char *id_compute = new char[strlen(arg[5])+1]; strcpy(id_compute,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); options(narg-7,&arg[7]); @@ -892,17 +892,17 @@ void PRD::options(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal prd command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0) error->all(FLERR,"Illegal prd command"); iarg += 5; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal prd command"); temp_flag = 1; - temp_dephase = force->numeric(FLERR,arg[iarg+1]); + temp_dephase = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (temp_dephase <= 0.0) error->all(FLERR,"Illegal prd command"); iarg += 2; diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index a629ee6b04..fba753d602 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -82,12 +82,12 @@ void TAD::command(int narg, char **arg) if (narg < 7) error->universe_all(FLERR,"Illegal tad command"); - nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); - templo = force->numeric(FLERR,arg[2]); - temphi = force->numeric(FLERR,arg[3]); - delta_conf = force->numeric(FLERR,arg[4]); - tmax = force->numeric(FLERR,arg[5]); + nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); + templo = utils::numeric(FLERR,arg[2],false,lmp); + temphi = utils::numeric(FLERR,arg[3],false,lmp); + delta_conf = utils::numeric(FLERR,arg[4],false,lmp); + tmax = utils::numeric(FLERR,arg[5],false,lmp); char *id_compute = new char[strlen(arg[6])+1]; strcpy(id_compute,arg[6]); @@ -592,10 +592,10 @@ void TAD::options(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal tad command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0 || maxeval < 0 || etol < 0.0 || ftol < 0.0 ) error->all(FLERR,"Illegal tad command"); @@ -603,11 +603,11 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal tad command"); - etol_neb = force->numeric(FLERR,arg[iarg+1]); - ftol_neb = force->numeric(FLERR,arg[iarg+2]); - n1steps_neb = force->inumeric(FLERR,arg[iarg+3]); - n2steps_neb = force->inumeric(FLERR,arg[iarg+4]); - nevery_neb = force->inumeric(FLERR,arg[iarg+5]); + etol_neb = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol_neb = utils::numeric(FLERR,arg[iarg+2],false,lmp); + n1steps_neb = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + n2steps_neb = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + nevery_neb = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (etol_neb < 0.0 || ftol_neb < 0.0 || n1steps_neb < 0 || n2steps_neb < 0 || nevery_neb < 0) error->all(FLERR,"Illegal tad command"); @@ -623,7 +623,7 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb_step") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal tad command"); - dt_neb = force->numeric(FLERR,arg[iarg+1]); + dt_neb = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dt_neb <= 0.0) error->all(FLERR,"Illegal tad command"); iarg += 2; diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index a4c67108d3..a7ad4c068b 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -67,9 +67,9 @@ void Temper::command(int narg, char **arg) if (narg != 6 && narg != 7) error->universe_all(FLERR,"Illegal temper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double temp = force->numeric(FLERR,arg[2]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double temp = utils::numeric(FLERR,arg[2],false,lmp); // ignore temper command, if walltime limit was already reached @@ -80,11 +80,11 @@ void Temper::command(int narg, char **arg) if (whichfix == modify->nfix) error->universe_all(FLERR,"Tempering fix ID is not defined"); - seed_swap = force->inumeric(FLERR,arg[4]); - seed_boltz = force->inumeric(FLERR,arg[5]); + seed_swap = utils::inumeric(FLERR,arg[4],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[5],false,lmp); my_set_temp = universe->iworld; - if (narg == 7) my_set_temp = force->inumeric(FLERR,arg[6]); + if (narg == 7) my_set_temp = utils::inumeric(FLERR,arg[6],false,lmp); if ((my_set_temp < 0) || (my_set_temp >= universe->nworlds)) error->universe_one(FLERR,"Illegal temperature index"); diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a5efc22d11..03119d304e 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -59,13 +59,13 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), // apply fix every nevery timesteps - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix ehex command"); // heat flux into the reservoir - heat_input = force->numeric(FLERR,arg[4]); + heat_input = utils::numeric(FLERR,arg[4],false,lmp); // optional args diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 6f73d98f5d..761b957292 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -226,7 +226,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"group") == 0) { if (narg < 5) error->all(FLERR,"Illegal fix rigid command"); rstyle = GROUP; - nbody = force->inumeric(FLERR,arg[4]); + nbody = utils::inumeric(FLERR,arg[4],false,lmp); if (nbody <= 0) error->all(FLERR,"Illegal fix rigid command"); if (narg < 5+nbody) error->all(FLERR,"Illegal fix rigid command"); iarg = 5+nbody; @@ -404,10 +404,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : strcmp(style,"rigid/omp") != 0 && strcmp(style,"rigid/nve/omp") != 0) error->all(FLERR,"Illegal fix rigid command"); langflag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); - seed = force->inumeric(FLERR,arg[iarg+4]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix rigid langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix rigid command"); @@ -418,9 +418,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/n.t")) error->all(FLERR,"Illegal fix rigid command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"iso") == 0) { @@ -428,10 +428,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -443,10 +443,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -458,9 +458,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; @@ -468,9 +468,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; @@ -478,9 +478,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; @@ -515,16 +515,16 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/n.t")) error->all(FLERR,"Illegal fix rigid command"); - t_chain = force->inumeric(FLERR,arg[iarg+1]); - t_iter = force->inumeric(FLERR,arg[iarg+2]); - t_order = force->inumeric(FLERR,arg[iarg+3]); + t_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + t_iter = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + t_order = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_chain = force->inumeric(FLERR,arg[iarg+1]); + p_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"infile") == 0) { diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index f12c53bf3a..01dd9e889e 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -210,10 +210,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : (strcmp(style,"rigid/nph/small") != 0)) error->all(FLERR,"Illegal fix rigid/small command"); langflag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); - seed = force->inumeric(FLERR,arg[iarg+4]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix rigid/small langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix rigid/small command"); @@ -252,9 +252,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/n.t/small")) error->all(FLERR,"Illegal fix rigid command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"iso") == 0) { @@ -262,10 +262,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (domain->dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -277,10 +277,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (domain->dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -292,9 +292,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; @@ -302,9 +302,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; @@ -312,9 +312,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; @@ -349,16 +349,16 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/n.t/small")) error->all(FLERR,"Illegal fix rigid/small command"); - t_chain = force->inumeric(FLERR,arg[iarg+1]); - t_iter = force->inumeric(FLERR,arg[iarg+2]); - t_order = force->inumeric(FLERR,arg[iarg+3]); + t_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + t_iter = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + t_order = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_chain = force->inumeric(FLERR,arg[iarg+1]); + p_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gravity") == 0) { diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index a216526528..d6603cd7b6 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -95,9 +95,9 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : if (narg < 8) error->all(FLERR,"Illegal fix shake command"); - tolerance = force->numeric(FLERR,arg[3]); - max_iter = force->inumeric(FLERR,arg[4]); - output_every = force->inumeric(FLERR,arg[5]); + tolerance = utils::numeric(FLERR,arg[3],false,lmp); + max_iter = utils::inumeric(FLERR,arg[4],false,lmp); + output_every = utils::inumeric(FLERR,arg[5],false,lmp); // parse SHAKE args for bond and angle types // will be used by find_clusters @@ -131,25 +131,25 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // read numeric args of b,a,t,m else if (mode == 'b') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nbondtypes) error->all(FLERR,"Invalid bond type index for fix shake"); bond_flag[i] = 1; } else if (mode == 'a') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nangletypes) error->all(FLERR,"Invalid angle type index for fix shake"); angle_flag[i] = 1; } else if (mode == 't') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->ntypes) error->all(FLERR,"Invalid atom type index for fix shake"); type_flag[i] = 1; } else if (mode == 'm') { - double massone = force->numeric(FLERR,arg[next]); + double massone = utils::numeric(FLERR,arg[next],false,lmp); if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix shake"); if (nmass == atom->ntypes) error->all(FLERR,"Too many masses for fix shake"); diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 1a6b128cd5..b5b586bc7f 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -114,7 +114,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Append boundary must be shrink/minimum"); } else if (strcmp(arg[iarg],"freq") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - freq = force->inumeric(FLERR,arg[iarg+1]); + freq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"spatial") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command"); @@ -123,7 +123,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : "Bad fix ID in fix append/atoms command"); spatflag = 1; int n = strlen(arg[iarg+1]); - spatlead = force->numeric(FLERR,arg[iarg+2]); + spatlead = utils::numeric(FLERR,arg[iarg+2],false,lmp); char *suffix = new char[n]; strcpy(suffix,&arg[iarg+1][2]); n = strlen(suffix) + 1; @@ -133,15 +133,15 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : iarg += 3; } else if (strcmp(arg[iarg],"basis") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - int ibasis = force->inumeric(FLERR,arg[iarg+1]); - int itype = force->inumeric(FLERR,arg[iarg+2]); + int ibasis = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int itype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Invalid basis setting in fix append/atoms command"); basistype[ibasis-1] = itype; iarg += 3; } else if (strcmp(arg[iarg],"size") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - size = force->numeric(FLERR,arg[iarg+1]); + size = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"units") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); @@ -152,20 +152,20 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"random") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix append/atoms command"); ranflag = 1; - ranx = force->numeric(FLERR,arg[iarg+1]); - rany = force->numeric(FLERR,arg[iarg+2]); - ranz = force->numeric(FLERR,arg[iarg+3]); - xseed = force->inumeric(FLERR,arg[iarg+4]); + ranx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + rany = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ranz = utils::numeric(FLERR,arg[iarg+3],false,lmp); + xseed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (xseed <= 0) error->all(FLERR,"Illegal fix append/atoms command"); randomx = new RanMars(lmp,xseed + comm->me); iarg += 5; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix append/atoms command"); tempflag = 1; - t_target = force->numeric(FLERR,arg[iarg+1]); - t_period = force->numeric(FLERR,arg[iarg+2]); - tseed = force->inumeric(FLERR,arg[iarg+3]); - t_extent = force->numeric(FLERR,arg[iarg+4]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tseed = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + t_extent = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (t_target <= 0) error->all(FLERR,"Illegal fix append/atoms command"); if (t_period <= 0) error->all(FLERR,"Illegal fix append/atoms command"); if (t_extent <= 0) error->all(FLERR,"Illegal fix append/atoms command"); diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index c9591e92ac..986b1323e8 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -90,7 +90,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : box_change |= BOX_CHANGE_Z; } else error->all(FLERR,"Illegal fix msst command"); - velocity = force->numeric(FLERR,arg[4]); + velocity = utils::numeric(FLERR,arg[4],false,lmp); if (velocity < 0) error->all(FLERR,"Illegal fix msst command"); // optional args @@ -99,30 +99,30 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - qmass = force->numeric(FLERR,arg[iarg+1]); + qmass = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mu") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - mu = force->numeric(FLERR,arg[iarg+1]); + mu = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"p0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - p0 = force->numeric(FLERR,arg[iarg+1]); + p0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); p0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"v0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - v0 = force->numeric(FLERR,arg[iarg+1]); + v0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); v0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"e0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - e0 = force->numeric(FLERR,arg[iarg+1]); + e0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); e0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"tscale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - tscale = force->numeric(FLERR,arg[iarg+1]); + tscale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (tscale < 0.0 || tscale > 1.0) error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1"); iarg += 2; @@ -134,7 +134,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"beta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - beta = force->numeric(FLERR,arg[iarg+1]); + beta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (beta < 0.0 || beta > 1.0) error->all(FLERR,"Illegal fix msst command"); iarg += 2; diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 8ad787d759..1179bb6b35 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -439,17 +439,17 @@ int FixNPHug::modify_param(int narg, char **arg) { if (strcmp(arg[0],"e0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - e0 = force->numeric(FLERR,arg[1]); + e0 = utils::numeric(FLERR,arg[1],false,lmp); e0_set = 1; return 2; } else if (strcmp(arg[0],"v0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - v0 = force->numeric(FLERR,arg[1]); + v0 = utils::numeric(FLERR,arg[1],false,lmp); v0_set = 1; return 2; } else if (strcmp(arg[0],"p0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - p0 = force->numeric(FLERR,arg[1]); + p0 = utils::numeric(FLERR,arg[1],false,lmp); p0_set = 1; return 2; } diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index 5a359d9f6f..a796c1a4b4 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -71,19 +71,19 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix wall/piston command only available at zlo"); else if (strcmp(arg[iarg],"vel") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/piston command"); - vz = force->numeric(FLERR,arg[iarg+1]); + vz = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"pos") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/piston command"); - z0 = force->numeric(FLERR,arg[iarg+1]); + z0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix wall/piston command"); tempflag = 1; - t_target = force->numeric(FLERR,arg[iarg+1]); - t_period = force->numeric(FLERR,arg[iarg+2]); - tseed = force->inumeric(FLERR,arg[iarg+3]); - t_extent = force->numeric(FLERR,arg[iarg+4]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tseed = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + t_extent = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (t_target <= 0) error->all(FLERR,"Illegal fix wall/piston command"); if (t_period <= 0) error->all(FLERR,"Illegal fix wall/piston command"); if (t_extent <= 0) error->all(FLERR,"Illegal fix wall/piston command"); @@ -94,7 +94,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : iarg += 5; } else if (strcmp(arg[iarg],"rough") == 0) { roughflag = 1; - roughdist = force->numeric(FLERR,arg[iarg+1]); + roughdist = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ramp") == 0) { rampflag = 1; diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 4a57f31ec3..1e85441d1f 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -114,9 +114,9 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute sna/atom command"); map[i+1] = jelem; diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index cd0c0cbc41..1376193070 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -112,9 +112,9 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute snad/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_snad_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snad/atom command"); map[i+1] = jelem; diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index 613fc1a862..eb18b7274e 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -118,9 +118,9 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute snap command"); chemflag = 1; memory->create(map,ntypes+1,"compute_snap:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snap command"); map[i+1] = jelem; diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index 2d33c35563..066fc56c11 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -107,9 +107,9 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snav/atom command"); map[i+1] = jelem; diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 6b9ad517bb..6df9dd4af2 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -53,9 +53,9 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; nevery = 1; - temp = force->numeric(FLERR,arg[3]); - alpha_t = force->numeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + temp = utils::numeric(FLERR,arg[3],false,lmp); + alpha_t = utils::numeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (alpha_t < 0.0) { error->all(FLERR,"Illegal langevin/spin command"); diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 5acbbf59e8..110cfb58d8 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -57,7 +57,7 @@ FixNEBSpin::FixNEBSpin(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix neb_spin command"); - kspring = force->numeric(FLERR,arg[3]); + kspring = utils::numeric(FLERR,arg[3],false,lmp); if (kspring <= 0.0) error->all(FLERR,"Illegal fix neb command"); // optional params diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index b788d27d05..9a33f0d61d 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -80,33 +80,33 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm if (strcmp(arg[iarg],"zeeman") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix precession/spin command"); zeeman_flag = 1; - H_field = force->numeric(FLERR,arg[iarg+1]); - nhx = force->numeric(FLERR,arg[iarg+2]); - nhy = force->numeric(FLERR,arg[iarg+3]); - nhz = force->numeric(FLERR,arg[iarg+4]); + H_field = utils::numeric(FLERR,arg[iarg+1],false,lmp); + nhx = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nhy = utils::numeric(FLERR,arg[iarg+3],false,lmp); + nhz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"anisotropy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix precession/spin command"); aniso_flag = 1; - Ka = force->numeric(FLERR,arg[iarg+1]); - nax = force->numeric(FLERR,arg[iarg+2]); - nay = force->numeric(FLERR,arg[iarg+3]); - naz = force->numeric(FLERR,arg[iarg+4]); + Ka = utils::numeric(FLERR,arg[iarg+1],false,lmp); + nax = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nay = utils::numeric(FLERR,arg[iarg+3],false,lmp); + naz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"cubic") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix precession/spin command"); cubic_flag = 1; - k1c = force->numeric(FLERR,arg[iarg+1]); - k2c = force->numeric(FLERR,arg[iarg+2]); - nc1x = force->numeric(FLERR,arg[iarg+3]); - nc1y = force->numeric(FLERR,arg[iarg+4]); - nc1z = force->numeric(FLERR,arg[iarg+5]); - nc2x = force->numeric(FLERR,arg[iarg+6]); - nc2y = force->numeric(FLERR,arg[iarg+7]); - nc2z = force->numeric(FLERR,arg[iarg+8]); - nc3x = force->numeric(FLERR,arg[iarg+9]); - nc3y = force->numeric(FLERR,arg[iarg+10]); - nc3z = force->numeric(FLERR,arg[iarg+11]); + k1c = utils::numeric(FLERR,arg[iarg+1],false,lmp); + k2c = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nc1x = utils::numeric(FLERR,arg[iarg+3],false,lmp); + nc1y = utils::numeric(FLERR,arg[iarg+4],false,lmp); + nc1z = utils::numeric(FLERR,arg[iarg+5],false,lmp); + nc2x = utils::numeric(FLERR,arg[iarg+6],false,lmp); + nc2y = utils::numeric(FLERR,arg[iarg+7],false,lmp); + nc2z = utils::numeric(FLERR,arg[iarg+8],false,lmp); + nc3x = utils::numeric(FLERR,arg[iarg+9],false,lmp); + nc3y = utils::numeric(FLERR,arg[iarg+10],false,lmp); + nc3z = utils::numeric(FLERR,arg[iarg+11],false,lmp); iarg += 12; } else error->all(FLERR,"Illegal precession/spin command"); } diff --git a/src/SPIN/min_spin.cpp b/src/SPIN/min_spin.cpp index f6a6b90891..df7fc71f8b 100644 --- a/src/SPIN/min_spin.cpp +++ b/src/SPIN/min_spin.cpp @@ -78,12 +78,12 @@ int MinSpin::modify_param(int narg, char **arg) { if (strcmp(arg[0],"alpha_damp") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); - alpha_damp = force->numeric(FLERR,arg[1]); + alpha_damp = utils::numeric(FLERR,arg[1],false,lmp); return 2; } if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index de1ef39f66..a658713d1b 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -148,7 +148,7 @@ int MinSpinCG::modify_param(int narg, char **arg) { if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix_modify command"); - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index df12782528..f92fc69e04 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -156,7 +156,7 @@ int MinSpinLBFGS::modify_param(int narg, char **arg) if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); double discrete_factor; - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); maxepsrot = MY_2PI / (10 * discrete_factor); return 2; } diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 168e288181..96808b7f10 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -94,11 +94,11 @@ void NEBSpin::command(int narg, char **arg) if (narg < 6) error->universe_all(FLERR,"Illegal NEBSpin command"); - etol = force->numeric(FLERR,arg[0]); - ttol = force->numeric(FLERR,arg[1]); - n1steps = force->inumeric(FLERR,arg[2]); - n2steps = force->inumeric(FLERR,arg[3]); - nevery = force->inumeric(FLERR,arg[4]); + etol = utils::numeric(FLERR,arg[0],false,lmp); + ttol = utils::numeric(FLERR,arg[1],false,lmp); + n1steps = utils::inumeric(FLERR,arg[2],false,lmp); + n2steps = utils::inumeric(FLERR,arg[3],false,lmp); + nevery = utils::inumeric(FLERR,arg[4],false,lmp); // error checks diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index 49e82a9d68..5573d914b7 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -76,7 +76,7 @@ void PairSpinDipoleCut::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_long_global = force->numeric(FLERR,arg[0]); + cut_spin_long_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -108,7 +108,7 @@ void PairSpinDipoleCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double spin_long_cut_one = force->numeric(FLERR,arg[2]); + double spin_long_cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/SPIN/pair_spin_dipole_long.cpp b/src/SPIN/pair_spin_dipole_long.cpp index bb27d8cadf..4188bb214c 100644 --- a/src/SPIN/pair_spin_dipole_long.cpp +++ b/src/SPIN/pair_spin_dipole_long.cpp @@ -81,7 +81,7 @@ void PairSpinDipoleLong::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_long_global = force->numeric(FLERR,arg[0]); + cut_spin_long_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -112,7 +112,7 @@ void PairSpinDipoleLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double spin_long_cut_one = force->numeric(FLERR,arg[2]); + double spin_long_cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index a5452ed739..b4b3fcb6f5 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -65,7 +65,7 @@ void PairSpinDmi::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_dmi_global = force->numeric(FLERR,arg[0]); + cut_spin_dmi_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -101,11 +101,11 @@ void PairSpinDmi::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double dm = (force->numeric(FLERR,arg[4])); - double dmx = force->numeric(FLERR,arg[5]); - double dmy = force->numeric(FLERR,arg[6]); - double dmz = force->numeric(FLERR,arg[7]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double dm = utils::numeric(FLERR,arg[4],false,lmp); + double dmx = utils::numeric(FLERR,arg[5],false,lmp); + double dmy = utils::numeric(FLERR,arg[6],false,lmp); + double dmz = utils::numeric(FLERR,arg[7],false,lmp); double inorm = 1.0/(dmx*dmx+dmy*dmy+dmz*dmz); dmx *= inorm; diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 30c6383bc6..b82dca3dcc 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -62,7 +62,7 @@ void PairSpinExchange::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_exchange_global = force->numeric(FLERR,arg[0]); + cut_spin_exchange_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -97,10 +97,10 @@ void PairSpinExchange::coeff(int narg, char **arg) // get exchange arguments from input command - const double rc = force->numeric(FLERR,arg[3]); - const double j1 = force->numeric(FLERR,arg[4]); - const double j2 = force->numeric(FLERR,arg[5]); - const double j3 = force->numeric(FLERR,arg[6]); + const double rc = utils::numeric(FLERR,arg[3],false,lmp); + const double j1 = utils::numeric(FLERR,arg[4],false,lmp); + const double j2 = utils::numeric(FLERR,arg[5],false,lmp); + const double j3 = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 9e1de9b1e7..50cd1fe54a 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -64,7 +64,7 @@ void PairSpinMagelec::settings(int narg, char **arg) PairSpin::settings(narg,arg); - cut_spin_magelec_global = force->numeric(FLERR,arg[0]); + cut_spin_magelec_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -98,11 +98,11 @@ void PairSpinMagelec::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double magelec = (force->numeric(FLERR,arg[4])); - double mex = force->numeric(FLERR,arg[5]); - double mey = force->numeric(FLERR,arg[6]); - double mez = force->numeric(FLERR,arg[7]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double magelec = utils::numeric(FLERR,arg[4],false,lmp); + double mex = utils::numeric(FLERR,arg[5],false,lmp); + double mey = utils::numeric(FLERR,arg[6],false,lmp); + double mez = utils::numeric(FLERR,arg[7],false,lmp); double inorm = 1.0/(mex*mex+mey*mey+mez*mez); mex *= inorm; diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 5aef34ad9d..4468e157b4 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -66,7 +66,7 @@ void PairSpinNeel::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_neel_global = force->numeric(FLERR,arg[0]); + cut_spin_neel_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -102,13 +102,13 @@ void PairSpinNeel::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double k1 = force->numeric(FLERR,arg[4]); - const double k2 = force->numeric(FLERR,arg[5]); - const double k3 = force->numeric(FLERR,arg[6]); - const double l1 = force->numeric(FLERR,arg[7]); - const double l2 = force->numeric(FLERR,arg[8]); - const double l3 = force->numeric(FLERR,arg[9]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double k1 = utils::numeric(FLERR,arg[4],false,lmp); + const double k2 = utils::numeric(FLERR,arg[5],false,lmp); + const double k3 = utils::numeric(FLERR,arg[6],false,lmp); + const double l1 = utils::numeric(FLERR,arg[7],false,lmp); + const double l2 = utils::numeric(FLERR,arg[8],false,lmp); + const double l3 = utils::numeric(FLERR,arg[9],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 8f15128399..ca0bdbac0a 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -94,15 +94,15 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), global_freq = 1; extvector = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); bigexist = 1; if (strcmp(arg[4],"NULL") == 0) bigexist = 0; else biggroup = group->find(arg[4]); - temperature_srd = force->numeric(FLERR,arg[5]); - gridsrd = force->numeric(FLERR,arg[6]); - int seed = force->inumeric(FLERR,arg[7]); + temperature_srd = utils::numeric(FLERR,arg[5],false,lmp); + gridsrd = utils::numeric(FLERR,arg[6],false,lmp); + int seed = utils::inumeric(FLERR,arg[7],false,lmp); // parse options @@ -125,7 +125,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), while (iarg < narg) { if (strcmp(arg[iarg],"lamda") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - lamda = force->numeric(FLERR,arg[iarg+1]); + lamda = utils::numeric(FLERR,arg[iarg+1],false,lmp); lamdaflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"collision") == 0) { @@ -155,22 +155,22 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), iarg += 2; } else if (strcmp(arg[iarg],"radius") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - radfactor = force->numeric(FLERR,arg[iarg+1]); + radfactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"bounce") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - maxbounceallow = force->inumeric(FLERR,arg[iarg+1]); + maxbounceallow = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"search") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - gridsearch = force->numeric(FLERR,arg[iarg+1]); + gridsearch = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cubic") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command"); if (strcmp(arg[iarg+1],"error") == 0) cubicflag = CUBIC_ERROR; else if (strcmp(arg[iarg+1],"warn") == 0) cubicflag = CUBIC_WARN; else error->all(FLERR,"Illegal fix srd command"); - cubictol = force->numeric(FLERR,arg[iarg+2]); + cubictol = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"shift") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command"); @@ -178,7 +178,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), else if (strcmp(arg[iarg+1],"yes") == 0) shiftuser = SHIFT_YES; else if (strcmp(arg[iarg+1],"possible") == 0) shiftuser = SHIFT_POSSIBLE; else error->all(FLERR,"Illegal fix srd command"); - shiftseed = force->inumeric(FLERR,arg[iarg+2]); + shiftseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tstat") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index ab113df28a..8b9ea6fb79 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -76,7 +76,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : strcpy(varstr[nwall],&arg[iarg+1][2]); } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } nwall++; diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index dc823661d8..4d812852db 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -407,7 +407,7 @@ void PairAWPMDCut::allocate() void PairAWPMDCut::settings(int narg, char **arg){ if (narg < 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); ermscale=1.; width_pbc=0.; @@ -427,21 +427,21 @@ void PairAWPMDCut::settings(int narg, char **arg){ i++; if(i>=narg) error->all(FLERR,"Setting 'fix' should be followed by a number in awpmd/cut"); - wpmd->w0=force->numeric(FLERR,arg[i]); + wpmd->w0=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"harm")){ wpmd->constraint=AWPMD::HARM; i++; if(i>=narg) error->all(FLERR,"Setting 'harm' should be followed by a number in awpmd/cut"); - wpmd->w0=force->numeric(FLERR,arg[i]); + wpmd->w0=utils::numeric(FLERR,arg[i],false,lmp); wpmd->set_harm_constr(wpmd->w0); } else if(!strcmp(arg[i],"pbc")){ i++; if(i>=narg) error->all(FLERR,"Setting 'pbc' should be followed by a number in awpmd/cut"); - width_pbc=force->numeric(FLERR,arg[i]); + width_pbc=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"relax")) wpmd->constraint=AWPMD::RELAX; @@ -449,7 +449,7 @@ void PairAWPMDCut::settings(int narg, char **arg){ i++; if(i>=narg) error->all(FLERR,"Setting 'ermscale' should be followed by a number in awpmd/cut"); - ermscale=force->numeric(FLERR,arg[i]); + ermscale=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"flex_press")) flexible_pressure_flag = 1; @@ -488,7 +488,7 @@ void PairAWPMDCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 7c2f75a8ce..838a708940 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -149,10 +149,10 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix bocs command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix bocs cannot be 0.0"); @@ -167,11 +167,11 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : p_match_flag = 1; pcouple = XYZ; p_start[0] = p_start[1] = p_start[2] = - force->numeric(FLERR,arg[iarg+1]); + utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[0] = p_stop[1] = p_stop[2] = - force->numeric(FLERR,arg[iarg+2]); + utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_flag[3] = p_flag[4] = p_flag[5] = 0; // MRD @@ -187,15 +187,15 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : " must be followed by: avg_vol n_mol n_pmatch_coeff"); } p_basis_type = 0; - vavg = force->numeric(FLERR,arg[iarg+1]); - N_mol = force->inumeric(FLERR,arg[iarg+2]); - N_p_match = force->inumeric(FLERR,arg[iarg+3]); + vavg = utils::numeric(FLERR,arg[iarg+1],false,lmp); + N_mol = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + N_p_match = utils::inumeric(FLERR,arg[iarg+3],false,lmp); p_match_coeffs = (double *) (calloc(N_p_match, sizeof(double)) ); iarg += 4; if (iarg + N_p_match > narg) error->all(FLERR,"Illegal fix bocs command. Missing coeffs."); for (int pmatchi = 0; pmatchi < N_p_match; pmatchi++) - p_match_coeffs[pmatchi] = force->numeric(FLERR,arg[iarg+pmatchi]); + p_match_coeffs[pmatchi] = utils::numeric(FLERR,arg[iarg+pmatchi],false,lmp); iarg += (N_p_match); } else if (strcmp(arg[iarg], "linear_spline") == 0 ) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. " @@ -217,14 +217,14 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : } // END NJD MRD } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -235,12 +235,12 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else { diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index afe73c397a..cc70f2fb31 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -304,9 +304,9 @@ void BondOxdnaFene::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double Delta_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double Delta_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; diff --git a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp index 59def4c812..66871fa64e 100644 --- a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp +++ b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp @@ -40,13 +40,13 @@ FixNVEDotcLangevin::FixNVEDotcLangevin(LAMMPS *lmp, int narg, char **arg) : { if (narg != 9) error->all(FLERR,"Illegal fix nve/dotc/langevin command"); - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix nve/dotc/langevin period must be > 0.0"); gamma = 1.0/t_period; - seed = force->inumeric(FLERR,arg[6]); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix nve/dotc/langevin command"); if (strcmp(arg[7],"angmom") == 0) { @@ -56,7 +56,7 @@ FixNVEDotcLangevin::FixNVEDotcLangevin(LAMMPS *lmp, int narg, char **arg) : Gamma = 0.0; } else { - ascale = force->numeric(FLERR,arg[8]); + ascale = utils::numeric(FLERR,arg[8],false,lmp); Gamma = gamma * ascale; } diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index be6287934f..32ee0ed145 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -578,30 +578,30 @@ void PairOxdna2Coaxstk::coeff(int narg, char **arg) double AA_cxst1_one, BB_cxst1_one; - k_cxst_one = force->numeric(FLERR,arg[2]); - cut_cxst_0_one = force->numeric(FLERR,arg[3]); - cut_cxst_c_one = force->numeric(FLERR,arg[4]); - cut_cxst_lo_one = force->numeric(FLERR,arg[5]); - cut_cxst_hi_one = force->numeric(FLERR,arg[6]); + k_cxst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_cxst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_cxst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_cxst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_cxst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_cxst1_one = force->numeric(FLERR,arg[7]); - theta_cxst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_cxst1_ast_one = force->numeric(FLERR,arg[9]); + a_cxst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_cxst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_cxst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_cxst4_one = force->numeric(FLERR,arg[10]); - theta_cxst4_0_one = force->numeric(FLERR,arg[11]); - dtheta_cxst4_ast_one = force->numeric(FLERR,arg[12]); + a_cxst4_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_cxst4_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_cxst4_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_cxst5_one = force->numeric(FLERR,arg[13]); - theta_cxst5_0_one = force->numeric(FLERR,arg[14]); - dtheta_cxst5_ast_one = force->numeric(FLERR,arg[15]); + a_cxst5_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_cxst5_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_cxst5_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_cxst6_one = force->numeric(FLERR,arg[16]); - theta_cxst6_0_one = force->numeric(FLERR,arg[17]); - dtheta_cxst6_ast_one = force->numeric(FLERR,arg[18]); + a_cxst6_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_cxst6_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_cxst6_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - AA_cxst1_one = force->numeric(FLERR,arg[19]); - BB_cxst1_one = force->numeric(FLERR,arg[20]); + AA_cxst1_one = utils::numeric(FLERR,arg[19],false,lmp); + BB_cxst1_one = utils::numeric(FLERR,arg[20],false,lmp); b_cxst_lo_one = 0.25 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one)/ (0.5 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one) - diff --git a/src/USER-CGDNA/pair_oxdna2_dh.cpp b/src/USER-CGDNA/pair_oxdna2_dh.cpp index 8cbe607197..04aaf82ccb 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxdna2_dh.cpp @@ -284,9 +284,9 @@ void PairOxdna2Dh::coeff(int narg, char **arg) double T, rhos_dh_one, qeff_dh_one; - T = force->numeric(FLERR,arg[2]); - rhos_dh_one = force->numeric(FLERR,arg[3]); - qeff_dh_one = force->numeric(FLERR,arg[4]); + T = utils::numeric(FLERR,arg[2],false,lmp); + rhos_dh_one = utils::numeric(FLERR,arg[3],false,lmp); + qeff_dh_one = utils::numeric(FLERR,arg[4],false,lmp); double lambda_dh_one, kappa_dh_one, qeff_dh_pf_one; double b_dh_one, cut_dh_ast_one, cut_dh_c_one; diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp index b54798e1da..87f58857bb 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp @@ -709,32 +709,32 @@ void PairOxdnaCoaxstk::coeff(int narg, char **arg) double a_cxst3p_one, cosphi_cxst3p_ast_one, b_cxst3p_one, cosphi_cxst3p_c_one; double a_cxst4p_one, cosphi_cxst4p_ast_one, b_cxst4p_one, cosphi_cxst4p_c_one; - k_cxst_one = force->numeric(FLERR,arg[2]); - cut_cxst_0_one = force->numeric(FLERR,arg[3]); - cut_cxst_c_one = force->numeric(FLERR,arg[4]); - cut_cxst_lo_one = force->numeric(FLERR,arg[5]); - cut_cxst_hi_one = force->numeric(FLERR,arg[6]); + k_cxst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_cxst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_cxst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_cxst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_cxst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_cxst1_one = force->numeric(FLERR,arg[7]); - theta_cxst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_cxst1_ast_one = force->numeric(FLERR,arg[9]); + a_cxst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_cxst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_cxst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_cxst4_one = force->numeric(FLERR,arg[10]); - theta_cxst4_0_one = force->numeric(FLERR,arg[11]); - dtheta_cxst4_ast_one = force->numeric(FLERR,arg[12]); + a_cxst4_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_cxst4_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_cxst4_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_cxst5_one = force->numeric(FLERR,arg[13]); - theta_cxst5_0_one = force->numeric(FLERR,arg[14]); - dtheta_cxst5_ast_one = force->numeric(FLERR,arg[15]); + a_cxst5_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_cxst5_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_cxst5_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_cxst6_one = force->numeric(FLERR,arg[16]); - theta_cxst6_0_one = force->numeric(FLERR,arg[17]); - dtheta_cxst6_ast_one = force->numeric(FLERR,arg[18]); + a_cxst6_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_cxst6_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_cxst6_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_cxst3p_one = force->numeric(FLERR,arg[19]); - cosphi_cxst3p_ast_one = force->numeric(FLERR,arg[20]); - a_cxst4p_one = force->numeric(FLERR,arg[21]); - cosphi_cxst4p_ast_one = force->numeric(FLERR,arg[22]); + a_cxst3p_one = utils::numeric(FLERR,arg[19],false,lmp); + cosphi_cxst3p_ast_one = utils::numeric(FLERR,arg[20],false,lmp); + a_cxst4p_one = utils::numeric(FLERR,arg[21],false,lmp); + cosphi_cxst4p_ast_one = utils::numeric(FLERR,arg[22],false,lmp); b_cxst_lo_one = 0.25 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one)/ (0.5 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one) - diff --git a/src/USER-CGDNA/pair_oxdna_excv.cpp b/src/USER-CGDNA/pair_oxdna_excv.cpp index c45dfdc036..22ed310003 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna_excv.cpp @@ -471,9 +471,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) // Excluded volume interaction // LJ parameters - epsilon_ss_one = force->numeric(FLERR,arg[2]); - sigma_ss_one = force->numeric(FLERR,arg[3]); - cut_ss_ast_one = force->numeric(FLERR,arg[4]); + epsilon_ss_one = utils::numeric(FLERR,arg[2],false,lmp); + sigma_ss_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_ss_ast_one = utils::numeric(FLERR,arg[4],false,lmp); // smoothing - determined through continuity and differentiability b_ss_one = 4.0/sigma_ss_one @@ -502,9 +502,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) count = 0; // LJ parameters - epsilon_sb_one = force->numeric(FLERR,arg[5]); - sigma_sb_one = force->numeric(FLERR,arg[6]); - cut_sb_ast_one = force->numeric(FLERR,arg[7]); + epsilon_sb_one = utils::numeric(FLERR,arg[5],false,lmp); + sigma_sb_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_sb_ast_one = utils::numeric(FLERR,arg[7],false,lmp); // smoothing - determined through continuity and differentiability b_sb_one = 4.0/sigma_sb_one @@ -533,9 +533,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) count = 0; // LJ parameters - epsilon_bb_one = force->numeric(FLERR,arg[8]); - sigma_bb_one = force->numeric(FLERR,arg[9]); - cut_bb_ast_one = force->numeric(FLERR,arg[10]); + epsilon_bb_one = utils::numeric(FLERR,arg[8],false,lmp); + sigma_bb_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_bb_ast_one = utils::numeric(FLERR,arg[10],false,lmp); // smoothing - determined through continuity and differentiability b_bb_one = 4.0/sigma_bb_one diff --git a/src/USER-CGDNA/pair_oxdna_hbond.cpp b/src/USER-CGDNA/pair_oxdna_hbond.cpp index f94be44e28..df952d0ff2 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.cpp +++ b/src/USER-CGDNA/pair_oxdna_hbond.cpp @@ -667,36 +667,36 @@ void PairOxdnaHbond::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - epsilon_hb_one = force->numeric(FLERR,arg[3]); - a_hb_one = force->numeric(FLERR,arg[4]); - cut_hb_0_one = force->numeric(FLERR,arg[5]); - cut_hb_c_one = force->numeric(FLERR,arg[6]); - cut_hb_lo_one = force->numeric(FLERR,arg[7]); - cut_hb_hi_one = force->numeric(FLERR,arg[8]); + epsilon_hb_one = utils::numeric(FLERR,arg[3],false,lmp); + a_hb_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_hb_0_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_hb_c_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_hb_lo_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_hb_hi_one = utils::numeric(FLERR,arg[8],false,lmp); - a_hb1_one = force->numeric(FLERR,arg[9]); - theta_hb1_0_one = force->numeric(FLERR,arg[10]); - dtheta_hb1_ast_one = force->numeric(FLERR,arg[11]); + a_hb1_one = utils::numeric(FLERR,arg[9],false,lmp); + theta_hb1_0_one = utils::numeric(FLERR,arg[10],false,lmp); + dtheta_hb1_ast_one = utils::numeric(FLERR,arg[11],false,lmp); - a_hb2_one = force->numeric(FLERR,arg[12]); - theta_hb2_0_one = force->numeric(FLERR,arg[13]); - dtheta_hb2_ast_one = force->numeric(FLERR,arg[14]); + a_hb2_one = utils::numeric(FLERR,arg[12],false,lmp); + theta_hb2_0_one = utils::numeric(FLERR,arg[13],false,lmp); + dtheta_hb2_ast_one = utils::numeric(FLERR,arg[14],false,lmp); - a_hb3_one = force->numeric(FLERR,arg[15]); - theta_hb3_0_one = force->numeric(FLERR,arg[16]); - dtheta_hb3_ast_one = force->numeric(FLERR,arg[17]); + a_hb3_one = utils::numeric(FLERR,arg[15],false,lmp); + theta_hb3_0_one = utils::numeric(FLERR,arg[16],false,lmp); + dtheta_hb3_ast_one = utils::numeric(FLERR,arg[17],false,lmp); - a_hb4_one = force->numeric(FLERR,arg[18]); - theta_hb4_0_one = force->numeric(FLERR,arg[19]); - dtheta_hb4_ast_one = force->numeric(FLERR,arg[20]); + a_hb4_one = utils::numeric(FLERR,arg[18],false,lmp); + theta_hb4_0_one = utils::numeric(FLERR,arg[19],false,lmp); + dtheta_hb4_ast_one = utils::numeric(FLERR,arg[20],false,lmp); - a_hb7_one = force->numeric(FLERR,arg[21]); - theta_hb7_0_one = force->numeric(FLERR,arg[22]); - dtheta_hb7_ast_one = force->numeric(FLERR,arg[23]); + a_hb7_one = utils::numeric(FLERR,arg[21],false,lmp); + theta_hb7_0_one = utils::numeric(FLERR,arg[22],false,lmp); + dtheta_hb7_ast_one = utils::numeric(FLERR,arg[23],false,lmp); - a_hb8_one = force->numeric(FLERR,arg[24]); - theta_hb8_0_one = force->numeric(FLERR,arg[25]); - dtheta_hb8_ast_one = force->numeric(FLERR,arg[26]); + a_hb8_one = utils::numeric(FLERR,arg[24],false,lmp); + theta_hb8_0_one = utils::numeric(FLERR,arg[25],false,lmp); + dtheta_hb8_ast_one = utils::numeric(FLERR,arg[26],false,lmp); b_hb_lo_one = 2*a_hb_one*exp(-a_hb_one*(cut_hb_lo_one-cut_hb_0_one))* 2*a_hb_one*exp(-a_hb_one*(cut_hb_lo_one-cut_hb_0_one))* diff --git a/src/USER-CGDNA/pair_oxdna_stk.cpp b/src/USER-CGDNA/pair_oxdna_stk.cpp index 2c01e253e8..fa9204ed86 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.cpp +++ b/src/USER-CGDNA/pair_oxdna_stk.cpp @@ -807,30 +807,30 @@ void PairOxdnaStk::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - T = force->numeric(FLERR,arg[3]); - xi_st_one = force->numeric(FLERR,arg[4]); - kappa_st_one = force->numeric(FLERR,arg[5]); + T = utils::numeric(FLERR,arg[3],false,lmp); + xi_st_one = utils::numeric(FLERR,arg[4],false,lmp); + kappa_st_one = utils::numeric(FLERR,arg[5],false,lmp); epsilon_st_one = stacking_strength(xi_st_one, kappa_st_one, T); - a_st_one = force->numeric(FLERR,arg[6]); - cut_st_0_one = force->numeric(FLERR,arg[7]); - cut_st_c_one = force->numeric(FLERR,arg[8]); - cut_st_lo_one = force->numeric(FLERR,arg[9]); - cut_st_hi_one = force->numeric(FLERR,arg[10]); + a_st_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_st_0_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_st_c_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_st_lo_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_st_hi_one = utils::numeric(FLERR,arg[10],false,lmp); - a_st4_one = force->numeric(FLERR,arg[11]); - theta_st4_0_one = force->numeric(FLERR,arg[12]); - dtheta_st4_ast_one = force->numeric(FLERR,arg[13]); - a_st5_one = force->numeric(FLERR,arg[14]); - theta_st5_0_one = force->numeric(FLERR,arg[15]); - dtheta_st5_ast_one = force->numeric(FLERR,arg[16]); - a_st6_one = force->numeric(FLERR,arg[17]); - theta_st6_0_one = force->numeric(FLERR,arg[18]); - dtheta_st6_ast_one = force->numeric(FLERR,arg[19]); - a_st1_one = force->numeric(FLERR,arg[20]); - cosphi_st1_ast_one = force->numeric(FLERR,arg[21]); - a_st2_one = force->numeric(FLERR,arg[22]); - cosphi_st2_ast_one = force->numeric(FLERR,arg[23]); + a_st4_one = utils::numeric(FLERR,arg[11],false,lmp); + theta_st4_0_one = utils::numeric(FLERR,arg[12],false,lmp); + dtheta_st4_ast_one = utils::numeric(FLERR,arg[13],false,lmp); + a_st5_one = utils::numeric(FLERR,arg[14],false,lmp); + theta_st5_0_one = utils::numeric(FLERR,arg[15],false,lmp); + dtheta_st5_ast_one = utils::numeric(FLERR,arg[16],false,lmp); + a_st6_one = utils::numeric(FLERR,arg[17],false,lmp); + theta_st6_0_one = utils::numeric(FLERR,arg[18],false,lmp); + dtheta_st6_ast_one = utils::numeric(FLERR,arg[19],false,lmp); + a_st1_one = utils::numeric(FLERR,arg[20],false,lmp); + cosphi_st1_ast_one = utils::numeric(FLERR,arg[21],false,lmp); + a_st2_one = utils::numeric(FLERR,arg[22],false,lmp); + cosphi_st2_ast_one = utils::numeric(FLERR,arg[23],false,lmp); b_st_lo_one = 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* diff --git a/src/USER-CGDNA/pair_oxdna_xstk.cpp b/src/USER-CGDNA/pair_oxdna_xstk.cpp index b1eaccdca2..7845451daf 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_xstk.cpp @@ -657,35 +657,35 @@ void PairOxdnaXstk::coeff(int narg, char **arg) double a_xst8_one, theta_xst8_0_one, dtheta_xst8_ast_one; double b_xst8_one, dtheta_xst8_c_one; - k_xst_one = force->numeric(FLERR,arg[2]); - cut_xst_0_one = force->numeric(FLERR,arg[3]); - cut_xst_c_one = force->numeric(FLERR,arg[4]); - cut_xst_lo_one = force->numeric(FLERR,arg[5]); - cut_xst_hi_one = force->numeric(FLERR,arg[6]); + k_xst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_xst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_xst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_xst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_xst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_xst1_one = force->numeric(FLERR,arg[7]); - theta_xst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_xst1_ast_one = force->numeric(FLERR,arg[9]); + a_xst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_xst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_xst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_xst2_one = force->numeric(FLERR,arg[10]); - theta_xst2_0_one = force->numeric(FLERR,arg[11]); - dtheta_xst2_ast_one = force->numeric(FLERR,arg[12]); + a_xst2_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_xst2_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_xst2_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_xst3_one = force->numeric(FLERR,arg[13]); - theta_xst3_0_one = force->numeric(FLERR,arg[14]); - dtheta_xst3_ast_one = force->numeric(FLERR,arg[15]); + a_xst3_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_xst3_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_xst3_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_xst4_one = force->numeric(FLERR,arg[16]); - theta_xst4_0_one = force->numeric(FLERR,arg[17]); - dtheta_xst4_ast_one = force->numeric(FLERR,arg[18]); + a_xst4_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_xst4_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_xst4_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_xst7_one = force->numeric(FLERR,arg[19]); - theta_xst7_0_one = force->numeric(FLERR,arg[20]); - dtheta_xst7_ast_one = force->numeric(FLERR,arg[21]); + a_xst7_one = utils::numeric(FLERR,arg[19],false,lmp); + theta_xst7_0_one = utils::numeric(FLERR,arg[20],false,lmp); + dtheta_xst7_ast_one = utils::numeric(FLERR,arg[21],false,lmp); - a_xst8_one = force->numeric(FLERR,arg[22]); - theta_xst8_0_one = force->numeric(FLERR,arg[23]); - dtheta_xst8_ast_one = force->numeric(FLERR,arg[24]); + a_xst8_one = utils::numeric(FLERR,arg[22],false,lmp); + theta_xst8_0_one = utils::numeric(FLERR,arg[23],false,lmp); + dtheta_xst8_ast_one = utils::numeric(FLERR,arg[24],false,lmp); b_xst_lo_one = 0.25 * (cut_xst_lo_one - cut_xst_0_one) * (cut_xst_lo_one - cut_xst_0_one)/ diff --git a/src/USER-CGDNA/pair_oxrna2_stk.cpp b/src/USER-CGDNA/pair_oxrna2_stk.cpp index 64dacd6c91..1b6c577a19 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_stk.cpp @@ -894,35 +894,35 @@ void PairOxrna2Stk::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - T = force->numeric(FLERR,arg[3]); - xi_st_one = force->numeric(FLERR,arg[4]); - kappa_st_one = force->numeric(FLERR,arg[5]); + T = utils::numeric(FLERR,arg[3],false,lmp); + xi_st_one = utils::numeric(FLERR,arg[4],false,lmp); + kappa_st_one = utils::numeric(FLERR,arg[5],false,lmp); epsilon_st_one = stacking_strength(xi_st_one, kappa_st_one, T); - a_st_one = force->numeric(FLERR,arg[6]); - cut_st_0_one = force->numeric(FLERR,arg[7]); - cut_st_c_one = force->numeric(FLERR,arg[8]); - cut_st_lo_one = force->numeric(FLERR,arg[9]); - cut_st_hi_one = force->numeric(FLERR,arg[10]); + a_st_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_st_0_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_st_c_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_st_lo_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_st_hi_one = utils::numeric(FLERR,arg[10],false,lmp); - a_st5_one = force->numeric(FLERR,arg[11]); - theta_st5_0_one = force->numeric(FLERR,arg[12]); - dtheta_st5_ast_one = force->numeric(FLERR,arg[13]); - a_st6_one = force->numeric(FLERR,arg[14]); - theta_st6_0_one = force->numeric(FLERR,arg[15]); - dtheta_st6_ast_one = force->numeric(FLERR,arg[16]); + a_st5_one = utils::numeric(FLERR,arg[11],false,lmp); + theta_st5_0_one = utils::numeric(FLERR,arg[12],false,lmp); + dtheta_st5_ast_one = utils::numeric(FLERR,arg[13],false,lmp); + a_st6_one = utils::numeric(FLERR,arg[14],false,lmp); + theta_st6_0_one = utils::numeric(FLERR,arg[15],false,lmp); + dtheta_st6_ast_one = utils::numeric(FLERR,arg[16],false,lmp); - a_st9_one = force->numeric(FLERR,arg[17]); - theta_st9_0_one = force->numeric(FLERR,arg[18]); - dtheta_st9_ast_one = force->numeric(FLERR,arg[19]); - a_st10_one = force->numeric(FLERR,arg[20]); - theta_st10_0_one = force->numeric(FLERR,arg[21]); - dtheta_st10_ast_one = force->numeric(FLERR,arg[22]); + a_st9_one = utils::numeric(FLERR,arg[17],false,lmp); + theta_st9_0_one = utils::numeric(FLERR,arg[18],false,lmp); + dtheta_st9_ast_one = utils::numeric(FLERR,arg[19],false,lmp); + a_st10_one = utils::numeric(FLERR,arg[20],false,lmp); + theta_st10_0_one = utils::numeric(FLERR,arg[21],false,lmp); + dtheta_st10_ast_one = utils::numeric(FLERR,arg[22],false,lmp); - a_st1_one = force->numeric(FLERR,arg[23]); - cosphi_st1_ast_one = force->numeric(FLERR,arg[24]); - a_st2_one = force->numeric(FLERR,arg[25]); - cosphi_st2_ast_one = force->numeric(FLERR,arg[26]); + a_st1_one = utils::numeric(FLERR,arg[23],false,lmp); + cosphi_st1_ast_one = utils::numeric(FLERR,arg[24],false,lmp); + a_st2_one = utils::numeric(FLERR,arg[25],false,lmp); + cosphi_st2_ast_one = utils::numeric(FLERR,arg[26],false,lmp); b_st_lo_one = 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.cpp b/src/USER-CGDNA/pair_oxrna2_xstk.cpp index 39a155c942..11c2f2b9b1 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_xstk.cpp @@ -604,31 +604,31 @@ void PairOxrna2Xstk::coeff(int narg, char **arg) double a_xst8_one, theta_xst8_0_one, dtheta_xst8_ast_one; double b_xst8_one, dtheta_xst8_c_one; - k_xst_one = force->numeric(FLERR,arg[2]); - cut_xst_0_one = force->numeric(FLERR,arg[3]); - cut_xst_c_one = force->numeric(FLERR,arg[4]); - cut_xst_lo_one = force->numeric(FLERR,arg[5]); - cut_xst_hi_one = force->numeric(FLERR,arg[6]); + k_xst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_xst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_xst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_xst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_xst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_xst1_one = force->numeric(FLERR,arg[7]); - theta_xst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_xst1_ast_one = force->numeric(FLERR,arg[9]); + a_xst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_xst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_xst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_xst2_one = force->numeric(FLERR,arg[10]); - theta_xst2_0_one = force->numeric(FLERR,arg[11]); - dtheta_xst2_ast_one = force->numeric(FLERR,arg[12]); + a_xst2_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_xst2_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_xst2_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_xst3_one = force->numeric(FLERR,arg[13]); - theta_xst3_0_one = force->numeric(FLERR,arg[14]); - dtheta_xst3_ast_one = force->numeric(FLERR,arg[15]); + a_xst3_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_xst3_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_xst3_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_xst7_one = force->numeric(FLERR,arg[16]); - theta_xst7_0_one = force->numeric(FLERR,arg[17]); - dtheta_xst7_ast_one = force->numeric(FLERR,arg[18]); + a_xst7_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_xst7_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_xst7_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_xst8_one = force->numeric(FLERR,arg[19]); - theta_xst8_0_one = force->numeric(FLERR,arg[20]); - dtheta_xst8_ast_one = force->numeric(FLERR,arg[21]); + a_xst8_one = utils::numeric(FLERR,arg[19],false,lmp); + theta_xst8_0_one = utils::numeric(FLERR,arg[20],false,lmp); + dtheta_xst8_ast_one = utils::numeric(FLERR,arg[21],false,lmp); b_xst_lo_one = 0.25 * (cut_xst_lo_one - cut_xst_0_one) * (cut_xst_lo_one - cut_xst_0_one)/ diff --git a/src/USER-CGSDK/angle_sdk.cpp b/src/USER-CGSDK/angle_sdk.cpp index 077a4a2eee..d535baeda5 100644 --- a/src/USER-CGSDK/angle_sdk.cpp +++ b/src/USER-CGSDK/angle_sdk.cpp @@ -243,8 +243,8 @@ void AngleSDK::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); double repscale_one=1.0; // backward compatibility with old cg/cmm style input: @@ -253,9 +253,9 @@ void AngleSDK::coeff(int narg, char **arg) // otherwise assume repscale 1.0, since we were using // epsilon to turn repulsion on or off. if (narg == 6) { - repscale_one = force->numeric(FLERR,arg[4]); + repscale_one = utils::numeric(FLERR,arg[4],false,lmp); if (repscale_one > 0.0) repscale_one = 1.0; - } else if (narg == 4) repscale_one = force->numeric(FLERR,arg[3]); + } else if (narg == 4) repscale_one = utils::numeric(FLERR,arg[3],false,lmp); else if (narg == 3) repscale_one = 1.0; else error->all(FLERR,"Incorrect args for angle coefficients"); diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index 7afa53be2e..cf478e85fb 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -234,7 +234,7 @@ void PairLJSDK::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -263,11 +263,11 @@ void PairLJSDK::coeff(int narg, char **arg) if (lj_type_one == LJ_NOT_SET) error->all(FLERR,"Cannot parse LJ type flag."); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index db2dabacaa..cd02c7f9e1 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -293,9 +293,9 @@ void PairLJSDKCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -325,11 +325,11 @@ void PairLJSDKCoulLong::coeff(int narg, char **arg) if (lj_type_one == LJ_NOT_SET) error->all(FLERR,"Cannot parse LJ type flag."); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 7ce2a93680..f9e071a0b3 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -324,7 +324,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : } else if (0 == strcmp(arg[argsdone], "output")) { out_name = strdup(arg[argsdone+1]); } else if (0 == strcmp(arg[argsdone], "seed")) { - rng_seed = force->inumeric(FLERR,arg[argsdone+1]); + rng_seed = utils::inumeric(FLERR,arg[argsdone+1],false,lmp); } else if (0 == strcmp(arg[argsdone], "unwrap")) { if (0 == strcmp(arg[argsdone+1], "yes")) { unwrap_flag = 1; diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index b6c00c2374..0a018338a4 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -48,9 +48,9 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -568,14 +568,14 @@ void FixSAEDVTK::options(int narg, char **arg) else error->all(FLERR,"Illegal fix saed/vtk command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix saed/vtk command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { overwrite = 1; diff --git a/src/USER-DPD/fix_eos_cv.cpp b/src/USER-DPD/fix_eos_cv.cpp index 5b25519a40..bd0e334ffc 100644 --- a/src/USER-DPD/fix_eos_cv.cpp +++ b/src/USER-DPD/fix_eos_cv.cpp @@ -29,7 +29,7 @@ FixEOScv::FixEOScv(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 4) error->all(FLERR,"Illegal fix eos/cv command"); - cvEOS = force->numeric(FLERR,arg[3]); + cvEOS = utils::numeric(FLERR,arg[3],false,lmp); if(cvEOS <= 0.0) error->all(FLERR,"EOS cv must be > 0.0"); nevery = 1; diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index dc6310ae42..04a619ac3d 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -41,7 +41,7 @@ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in fix eos/table"); - tablength = force->inumeric(FLERR,arg[5]); + tablength = utils::inumeric(FLERR,arg[5],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of eos/table entries"); ntables = 0; diff --git a/src/USER-DPD/fix_eos_table_rx.cpp b/src/USER-DPD/fix_eos_table_rx.cpp index d9641f2aab..d728f7e987 100644 --- a/src/USER-DPD/fix_eos_table_rx.cpp +++ b/src/USER-DPD/fix_eos_table_rx.cpp @@ -60,7 +60,7 @@ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in fix eos/table/rx"); - tablength = force->inumeric(FLERR,arg[5]); + tablength = utils::inumeric(FLERR,arg[5],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of eos/table/rx entries"); ntables = 0; diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index c6e7a78157..876d76a42f 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -249,9 +249,9 @@ void PairDPDfdt::settings(int narg, char **arg) // process keywords if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -282,13 +282,13 @@ void PairDPDfdt::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; a0_is_zero = (a0_one == 0.0); // Typical use with SSA is to set a0 to zero - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index cbebb1dc3a..3686bcb7e9 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -336,8 +336,8 @@ void PairDPDfdtEnergy::settings(int narg, char **arg) // process keywords if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); if (atom->dpd_flag != 1) error->all(FLERR,"pair_style dpd/fdt/energy requires atom_style with internal temperature and energies (e.g. dpd)"); @@ -370,16 +370,16 @@ void PairDPDfdtEnergy::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; double kappa_one, alpha_one; a0_is_zero = (a0_one == 0.0); // Typical use with SSA is to set a0 to zero - kappa_one = force->numeric(FLERR,arg[4]); + kappa_one = utils::numeric(FLERR,arg[4],false,lmp); alpha_one = sqrt(2.0*force->boltz*kappa_one); - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 3e27dafe98..4ba088201e 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -549,7 +549,7 @@ void PairExp6rx::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // optional keywords @@ -666,10 +666,10 @@ void PairExp6rx::coeff(int narg, char **arg) double cut_one = cut_global; if (strcmp(arg[5],"exponent") == 0){ scalingFlag = EXPONENT; - exponentR = force->numeric(FLERR,arg[6]); - exponentEpsilon = force->numeric(FLERR,arg[7]); + exponentR = utils::numeric(FLERR,arg[6],false,lmp); + exponentEpsilon = utils::numeric(FLERR,arg[7],false,lmp); if (narg > 9) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 9) cut_one = force->numeric(FLERR,arg[8]); + if (narg == 9) cut_one = utils::numeric(FLERR,arg[8],false,lmp); } else if (strcmp(arg[5],"polynomial") == 0){ scalingFlag = POLYNOMIAL; memory->create(coeffAlpha,6,"pair:coeffAlpha"); @@ -677,11 +677,11 @@ void PairExp6rx::coeff(int narg, char **arg) memory->create(coeffRm,6,"pair:coeffRm"); read_file2(arg[6]); if (narg > 8) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); } else if (strcmp(arg[5],"none") == 0){ scalingFlag = NONE; if (narg > 7) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); } else { error->all(FLERR,"Incorrect args for pair coefficients"); } diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 143f393492..f9074d5c05 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -240,7 +240,7 @@ void PairMultiLucy::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // delete old tables, since cannot just change settings @@ -282,7 +282,7 @@ void PairMultiLucy::coeff(int narg, char **arg) bcast_table(tb); // set table cutoff - if (narg == 5) tb->cut = force->numeric(FLERR,arg[4]); + if (narg == 5) tb->cut = utils::numeric(FLERR,arg[4],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index c8e733904c..a8e588fe01 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -329,7 +329,7 @@ void PairMultiLucyRX::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -398,7 +398,7 @@ void PairMultiLucyRX::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index 10790960bd..56c3e28c46 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -258,7 +258,7 @@ void PairTableRX::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -346,7 +346,7 @@ void PairTableRX::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index d413c31bd7..e865e9cd29 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -55,12 +55,12 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr_core,&arg[3][2]); tstyle_core = EQUAL; } else { - t_start_core = force->numeric(FLERR,arg[3]); + t_start_core = utils::numeric(FLERR,arg[3],false,lmp); t_target_core = t_start_core; tstyle_core = CONSTANT; } - t_period_core = force->numeric(FLERR,arg[4]); - int seed_core = force->inumeric(FLERR,arg[5]); + t_period_core = utils::numeric(FLERR,arg[4],false,lmp); + int seed_core = utils::inumeric(FLERR,arg[5],false,lmp); // drude temperature tstr_drude = NULL; @@ -70,12 +70,12 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr_drude,&arg[6][2]); tstyle_drude = EQUAL; } else { - t_start_drude = force->numeric(FLERR,arg[6]); + t_start_drude = utils::numeric(FLERR,arg[6],false,lmp); t_target_drude = t_start_drude; tstyle_drude = CONSTANT; } - t_period_drude = force->numeric(FLERR,arg[7]); - int seed_drude = force->inumeric(FLERR,arg[8]); + t_period_drude = utils::numeric(FLERR,arg[7],false,lmp); + int seed_drude = utils::inumeric(FLERR,arg[8],false,lmp); // error checks if (t_period_core <= 0.0) diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 76980bf105..875b4a9cba 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -291,10 +291,10 @@ void PairLJCutTholeLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - thole_global = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + thole_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -323,14 +323,14 @@ void PairLJCutTholeLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double polar_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double polar_one = utils::numeric(FLERR,arg[4],false,lmp); double thole_one = thole_global; - if (narg >=6) thole_one = force->numeric(FLERR,arg[5]); + if (narg >=6) thole_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 7) cut_lj_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_lj_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index df5fd1d92d..882fd047a9 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -192,8 +192,8 @@ void PairThole::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - thole_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + thole_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -222,11 +222,11 @@ void PairThole::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double polar_one = force->numeric(FLERR,arg[2]); + double polar_one = utils::numeric(FLERR,arg[2],false,lmp); double thole_one = thole_global; double cut_one = cut_global; - if (narg >=4) thole_one = force->numeric(FLERR,arg[3]); - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg >=4) thole_one = utils::numeric(FLERR,arg[3],false,lmp); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp index 4a8f4b0372..e2163990bd 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.cpp +++ b/src/USER-EFF/fix_temp_rescale_eff.cpp @@ -40,17 +40,17 @@ FixTempRescaleEff::FixTempRescaleEff(LAMMPS *lmp, int narg, char **arg) : { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale/eff command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale/eff command"); scalar_flag = 1; global_freq = nevery; extscalar = 1; - t_start = force->numeric(FLERR,arg[4]); - t_stop = force->numeric(FLERR,arg[5]); - t_window = force->numeric(FLERR,arg[6]); - fraction = force->numeric(FLERR,arg[7]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); + t_window = utils::numeric(FLERR,arg[6],false,lmp); + fraction = utils::numeric(FLERR,arg[7],false,lmp); // create a new compute temp/eff // id = fix-ID + temp, compute group = fix group diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index a2346f0167..b9b442ed2a 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -795,7 +795,7 @@ void PairEffCut::settings(int narg, char **arg) PAULI_CORE_D[14] = 0.0; PAULI_CORE_E[14] = 0.0; - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); limit_eradius_flag = 0; pressure_with_evirials_flag = 0; @@ -815,7 +815,7 @@ void PairEffCut::settings(int narg, char **arg) else if (strcmp(arg[iarg],"ecp") == 0) { iarg += 1; while (iarg < narg) { - atype = force->inumeric(FLERR,arg[iarg]); + atype = utils::inumeric(FLERR,arg[iarg],false,lmp); if (strcmp(arg[iarg+1],"C") == 0) ecp_type[atype] = 6; else if (strcmp(arg[iarg+1],"N") == 0) ecp_type[atype] = 7; else if (strcmp(arg[iarg+1],"O") == 0) ecp_type[atype] = 8; @@ -907,7 +907,7 @@ void PairEffCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -920,19 +920,19 @@ void PairEffCut::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); } else { int ecp; - ecp = force->inumeric(FLERR,arg[0]); + ecp = utils::inumeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"s") ==0) { - PAULI_CORE_A[ecp_type[ecp]] = force->numeric(FLERR,arg[2]); - PAULI_CORE_B[ecp_type[ecp]] = force->numeric(FLERR,arg[3]); - PAULI_CORE_C[ecp_type[ecp]] = force->numeric(FLERR,arg[4]); + PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); + PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); + PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); PAULI_CORE_D[ecp_type[ecp]] = 0.0; PAULI_CORE_E[ecp_type[ecp]] = 0.0; } else if (strcmp(arg[1],"p") ==0) { - PAULI_CORE_A[ecp_type[ecp]] = force->numeric(FLERR,arg[2]); - PAULI_CORE_B[ecp_type[ecp]] = force->numeric(FLERR,arg[3]); - PAULI_CORE_C[ecp_type[ecp]] = force->numeric(FLERR,arg[4]); - PAULI_CORE_D[ecp_type[ecp]] = force->numeric(FLERR,arg[5]); - PAULI_CORE_E[ecp_type[ecp]] = force->numeric(FLERR,arg[6]); + PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); + PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); + PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); + PAULI_CORE_D[ecp_type[ecp]] = utils::numeric(FLERR,arg[5],false,lmp); + PAULI_CORE_E[ecp_type[ecp]] = utils::numeric(FLERR,arg[6],false,lmp); } else error->all(FLERR,"Illegal pair_coeff command"); } } diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index 664750c7a7..488a85fc20 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -57,7 +57,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : fepinitflag = 0; // avoid init to run entirely when called by write_data - temp_fep = force->numeric(FLERR,arg[3]); + temp_fep = utils::numeric(FLERR,arg[3],false,lmp); // count # of perturbations diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 5d5f510547..f88f2b6c40 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -47,7 +47,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 5) error->all(FLERR,"Illegal fix adapt/fep command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix adapt/fep command"); dynamic_group_allow = 1; diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index be771dc0de..fd5141525c 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -159,10 +159,10 @@ void PairCoulCutSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphac = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphac = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -188,10 +188,10 @@ void PairCoulCutSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double lambda_one = force->numeric(FLERR,arg[2]); + double lambda_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_coul_long_soft.cpp b/src/USER-FEP/pair_coul_long_soft.cpp index a0273f9650..39e06ddd60 100644 --- a/src/USER-FEP/pair_coul_long_soft.cpp +++ b/src/USER-FEP/pair_coul_long_soft.cpp @@ -186,10 +186,10 @@ void PairCoulLongSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphac = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphac = utils::numeric(FLERR,arg[1],false,lmp); - cut_coul = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -206,7 +206,7 @@ void PairCoulLongSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double lambda_one = force->numeric(FLERR,arg[2]); + double lambda_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index eb9cedaa7b..f9149c8fb8 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -628,14 +628,14 @@ void PairLJCharmmCoulLongSoft::settings(int narg, char **arg) { if (narg != 5 && narg != 6) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_inner = force->numeric(FLERR,arg[3]); - cut_lj = force->numeric(FLERR,arg[4]); + cut_lj_inner = utils::numeric(FLERR,arg[3],false,lmp); + cut_lj = utils::numeric(FLERR,arg[4],false,lmp); if (narg == 5) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[5]); + else cut_coul = utils::numeric(FLERR,arg[5],false,lmp); } /* ---------------------------------------------------------------------- @@ -651,15 +651,15 @@ void PairLJCharmmCoulLongSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 7) { - eps14_one = force->numeric(FLERR,arg[5]); - sigma14_one = force->numeric(FLERR,arg[6]); + eps14_one = utils::numeric(FLERR,arg[5],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[6],false,lmp); } int count = 0; diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp index 1c898033c5..f1aa99b416 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp @@ -198,13 +198,13 @@ void PairLJClass2CoulCutSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[4]); + else cut_coul_global = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -232,16 +232,16 @@ void PairLJClass2CoulCutSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp index 33b1b46c2c..19c41f04cb 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp @@ -213,13 +213,13 @@ void PairLJClass2CoulLongSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[4]); + else cut_coul = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -245,14 +245,14 @@ void PairLJClass2CoulLongSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_class2_soft.cpp b/src/USER-FEP/pair_lj_class2_soft.cpp index aa6d08afe1..3c1869da08 100644 --- a/src/USER-FEP/pair_lj_class2_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_soft.cpp @@ -169,10 +169,10 @@ void PairLJClass2Soft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -197,13 +197,13 @@ void PairLJClass2Soft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index 7f62467f94..4a92a6fcef 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -198,13 +198,13 @@ void PairLJCutCoulCutSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[4]); + else cut_coul_global = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -233,16 +233,16 @@ void PairLJCutCoulCutSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index c813c23bc2..56cf31b9d3 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -566,13 +566,13 @@ void PairLJCutCoulLongSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[4]); + else cut_coul = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -598,14 +598,14 @@ void PairLJCutCoulLongSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 09ebd375a5..2ab677c454 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -450,10 +450,10 @@ void PairLJCutSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -479,14 +479,14 @@ void PairLJCutSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 0601a641ac..35342f68d8 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -413,18 +413,18 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg) { if (narg < 9 || narg > 10) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); - nlambda = force->numeric(FLERR,arg[5]); - alphalj = force->numeric(FLERR,arg[6]); - alphac = force->numeric(FLERR,arg[7]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); + nlambda = utils::numeric(FLERR,arg[5],false,lmp); + alphalj = utils::numeric(FLERR,arg[6],false,lmp); + alphac = utils::numeric(FLERR,arg[7],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[8]); + cut_lj_global = utils::numeric(FLERR,arg[8],false,lmp); if (narg == 9) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[9]); + else cut_coul = utils::numeric(FLERR,arg[9],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index b1f514711f..904799e1d3 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -180,13 +180,13 @@ void PairMorseSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double lambda_one = force->numeric(FLERR,arg[5]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -212,9 +212,9 @@ void PairMorseSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->inumeric(FLERR,arg[0]); - shift_range = force->numeric(FLERR,arg[1]); - cut_global = force->numeric(FLERR,arg[2]); + nlambda = utils::inumeric(FLERR,arg[0],false,lmp); + shift_range = utils::numeric(FLERR,arg[1],false,lmp); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index d5e1ae116c..fa130a9dc6 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -381,16 +381,16 @@ void PairTIP4PLongSoft::settings(int narg, char **arg) { if (narg != 8) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - nlambda = force->numeric(FLERR,arg[5]); - alphac = force->numeric(FLERR,arg[6]); + nlambda = utils::numeric(FLERR,arg[5],false,lmp); + alphac = utils::numeric(FLERR,arg[6],false,lmp); - cut_coul = force->numeric(FLERR,arg[7]); + cut_coul = utils::numeric(FLERR,arg[7],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/USER-H5MD/dump_h5md.cpp b/src/USER-H5MD/dump_h5md.cpp index af77258780..0c07e844cb 100644 --- a/src/USER-H5MD/dump_h5md.cpp +++ b/src/USER-H5MD/dump_h5md.cpp @@ -74,7 +74,7 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) datafile_from_dump = -1; author_name=NULL; - every_dump = force->inumeric(FLERR,arg[3]); + every_dump = utils::inumeric(FLERR,arg[3],false,lmp); every_position = every_image = -1; every_velocity = every_force = every_species = -1; every_charge = -1; diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index 1f8b5175b8..7bd510b189 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -59,7 +59,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal package intel command"); - int ncops = force->inumeric(FLERR,arg[3]); + int ncops = utils::inumeric(FLERR,arg[3],false,lmp); _nbor_pack_width = 1; _three_body_neighbor = 0; @@ -106,7 +106,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) while (iarg < narg) { if (strcmp(arg[iarg],"omp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); - nomp = force->inumeric(FLERR,arg[iarg+1]); + nomp = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); @@ -120,7 +120,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) iarg += 2; } else if (strcmp(arg[iarg],"balance") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); - _offload_balance = force->numeric(FLERR,arg[iarg+1]); + _offload_balance = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "ghost") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 74a9a1833f..41074903bd 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -92,7 +92,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Equal-style variables not allowed with fix manifoldforce"); // Use force->numeric to trigger an error if arg is not a number. - params[i] = force->numeric(FLERR,arg[i+4]); + params[i] = utils::numeric(FLERR,arg[i+4],false,lmp); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 312db1c411..2baa2944ae 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -91,8 +91,8 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, next_output = 0; dtv = dtf = 0; - tolerance = force->numeric( FLERR, arg[3] ); - max_iter = force->numeric( FLERR, arg[4] ); + tolerance = utils::numeric( FLERR, arg[3] ,false,lmp); + max_iter = utils::numeric( FLERR, arg[4] ,false,lmp); ptr_m = create_manifold(arg[5], lmp, narg, arg); if (!ptr_m) { @@ -124,7 +124,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, is_var[i] = 1; offset = 2; } else { - force->numeric(FLERR,arg[i+6]); // Check if legal number. + utils::numeric(FLERR,arg[i+6],false,lmp); // Check if legal number. len = strlen( arg[i+6] ) + 1; // +1 for \0. is_var[i] = 0; } @@ -137,7 +137,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, if (!ptr_m->params ) error->all(FLERR,"Failed to allocate params!"); for( int i = 0; i < nvars; ++i ){ // If param i was variable type, it will be set later... - ptr_m->params[i] = is_var[i] ? 0.0 : force->numeric( FLERR, arg[i+6] ); + ptr_m->params[i] = is_var[i] ? 0.0 : utils::numeric( FLERR, arg[i+6] ,false,lmp); } ptr_m->post_param_init(); @@ -146,7 +146,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, int argi = 6 + nvars; while( argi < narg ){ if (strcmp(arg[argi], "every") == 0) { - nevery = force->inumeric(FLERR,arg[argi+1]); + nevery = utils::inumeric(FLERR,arg[argi+1],false,lmp); next_output = update->ntimestep + nevery; if (comm->me == 0) { fprintf(screen,"Outputting every %d steps, next is %d\n", diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index db3267db28..f07e414ac9 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -101,9 +101,9 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, if (argi+3 >= narg) error->all(FLERR,"Keyword 'temp' needs 3 arguments"); - t_start = force->numeric(FLERR, arg[argi+1]); - t_stop = force->numeric(FLERR, arg[argi+2]); - t_period = force->numeric(FLERR, arg[argi+3]); + t_start = utils::numeric(FLERR, arg[argi+1],false,lmp); + t_stop = utils::numeric(FLERR, arg[argi+2],false,lmp); + t_period = utils::numeric(FLERR, arg[argi+3],false,lmp); t_target = t_start; got_temp = 1; @@ -112,7 +112,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, if (argi+1 >= narg) error->all(FLERR,"Keyword 'tchain' needs 1 argument"); - mtchain = force->inumeric(FLERR, arg[argi+1]); + mtchain = utils::inumeric(FLERR, arg[argi+1],false,lmp); argi += 2; } else if (error_on_unknown_keyword) { char msg[2048]; diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index 6378ed5ef6..bc02c93e1a 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -31,7 +31,7 @@ ComputeTDPDCCAtom::ComputeTDPDCCAtom(LAMMPS *lmp, int narg, char **arg) : if (narg != 4) error->all(FLERR,"Number of arguments for compute tdpd/cc/atom command != 4"); if (atom->tdpd_flag != 1) error->all(FLERR,"compute tdpd/cc/atom command requires atom_style with concentration (e.g. tdpd)"); - index = force->inumeric(FLERR,arg[3]); + index = utils::inumeric(FLERR,arg[3],false,lmp); peratom_flag = 1; size_peratom_cols = 0; diff --git a/src/USER-MESODPD/fix_edpd_source.cpp b/src/USER-MESODPD/fix_edpd_source.cpp index e62d9a8a79..9d31e5f410 100644 --- a/src/USER-MESODPD/fix_edpd_source.cpp +++ b/src/USER-MESODPD/fix_edpd_source.cpp @@ -38,21 +38,21 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) : if(option == 0){ if (narg != 9 ) error->all(FLERR,"Illegal fix edpd/source command (5 args for sphere)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - radius = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + radius = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else if(option == 1){ if (narg != 11 ) error->all(FLERR,"Illegal fix edpd/edpd command (7 args for cuboid)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - dLx = force->numeric(FLERR,arg[iarg++]); - dLy = force->numeric(FLERR,arg[iarg++]); - dLz = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLx = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLy = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLz = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else error->all(FLERR,"Illegal fix edpd/source command"); } diff --git a/src/USER-MESODPD/fix_mvv_dpd.cpp b/src/USER-MESODPD/fix_mvv_dpd.cpp index 116bbf506a..4e82085baa 100644 --- a/src/USER-MESODPD/fix_mvv_dpd.cpp +++ b/src/USER-MESODPD/fix_mvv_dpd.cpp @@ -39,7 +39,7 @@ FixMvvDPD::FixMvvDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/dpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); dynamic_group_allow = 1; time_integrate = 1; diff --git a/src/USER-MESODPD/fix_mvv_edpd.cpp b/src/USER-MESODPD/fix_mvv_edpd.cpp index 3294d8d682..a0a4bac0b7 100644 --- a/src/USER-MESODPD/fix_mvv_edpd.cpp +++ b/src/USER-MESODPD/fix_mvv_edpd.cpp @@ -48,7 +48,7 @@ FixMvvEDPD::FixMvvEDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/edpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); dynamic_group_allow = 1; time_integrate = 1; diff --git a/src/USER-MESODPD/fix_mvv_tdpd.cpp b/src/USER-MESODPD/fix_mvv_tdpd.cpp index b7fe37d7ee..87978eebe3 100644 --- a/src/USER-MESODPD/fix_mvv_tdpd.cpp +++ b/src/USER-MESODPD/fix_mvv_tdpd.cpp @@ -44,7 +44,7 @@ FixMvvTDPD::FixMvvTDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/tdpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); cc_species = atom->cc_species; diff --git a/src/USER-MESODPD/fix_tdpd_source.cpp b/src/USER-MESODPD/fix_tdpd_source.cpp index 990f6a5b78..7c19d78b1f 100644 --- a/src/USER-MESODPD/fix_tdpd_source.cpp +++ b/src/USER-MESODPD/fix_tdpd_source.cpp @@ -30,7 +30,7 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix tdpd/source command"); int iarg = 3; - cc_index = force->inumeric(FLERR,arg[iarg++]); + cc_index = utils::inumeric(FLERR,arg[iarg++],false,lmp); if (strcmp(arg[iarg],"sphere") == 0) option = 0; else if (strcmp(arg[iarg],"cuboid") == 0) option = 1; @@ -39,21 +39,21 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : if(option == 0){ if (narg != 10 ) error->all(FLERR,"Illegal fix tdpd/source command (5 args for sphere)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - radius = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + radius = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else if(option == 1){ if (narg != 12 ) error->all(FLERR,"Illegal fix tdpd/edpd command (7 args for cuboid)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - dLx = force->numeric(FLERR,arg[iarg++]); - dLy = force->numeric(FLERR,arg[iarg++]); - dLz = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLx = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLy = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLz = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else error->all(FLERR,"Illegal fix tdpd/source command"); } diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index b4264985e4..60a437a47c 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -270,8 +270,8 @@ void PairEDPD::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -309,13 +309,13 @@ void PairEDPD::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); - double power_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double kappa_one = force->numeric(FLERR,arg[6]); - double powerT_one= force->numeric(FLERR,arg[7]); - double cutT_one = force->numeric(FLERR,arg[8]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); + double power_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double kappa_one = utils::numeric(FLERR,arg[6],false,lmp); + double powerT_one= utils::numeric(FLERR,arg[7],false,lmp); + double cutT_one = utils::numeric(FLERR,arg[8],false,lmp); int iarg = 9; power_flag = kappa_flag = 0; @@ -325,14 +325,14 @@ void PairEDPD::coeff(int narg, char **arg) if (strcmp(arg[iarg],"power") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal pair edpd coefficients"); for (int i = 0; i < 4; i++) - sc_one[i] = force->numeric(FLERR,arg[iarg+i+1]); + sc_one[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); iarg += 5; power_flag = 1; memory->create(sc,n+1,n+1,4,"pair:sc"); } else if (strcmp(arg[iarg],"kappa") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal pair edpd coefficients"); for (int i = 0; i < 4; i++) - kc_one[i] = force->numeric(FLERR,arg[iarg+i+1]); + kc_one[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); iarg += 5; kappa_flag = 1; memory->create(kc,n+1,n+1,4,"pair:kc"); diff --git a/src/USER-MESODPD/pair_mdpd.cpp b/src/USER-MESODPD/pair_mdpd.cpp index f46f88861b..755008f443 100644 --- a/src/USER-MESODPD/pair_mdpd.cpp +++ b/src/USER-MESODPD/pair_mdpd.cpp @@ -211,9 +211,9 @@ void PairMDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -248,11 +248,11 @@ void PairMDPD::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double A_one = force->numeric(FLERR,arg[2]); - double B_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double cut_two = force->numeric(FLERR,arg[6]); + double A_one = utils::numeric(FLERR,arg[2],false,lmp); + double B_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double cut_two = utils::numeric(FLERR,arg[6],false,lmp); if(cut_one < cut_two) error->all(FLERR,"Incorrect args for pair coefficients\n cutA should be larger than cutB."); diff --git a/src/USER-MESODPD/pair_mdpd_rhosum.cpp b/src/USER-MESODPD/pair_mdpd_rhosum.cpp index 6f60234af3..bfbc6f7c82 100644 --- a/src/USER-MESODPD/pair_mdpd_rhosum.cpp +++ b/src/USER-MESODPD/pair_mdpd_rhosum.cpp @@ -200,7 +200,7 @@ void PairMDPDRhoSum::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double cut_one = force->numeric(FLERR,arg[2]); + double cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MESODPD/pair_tdpd.cpp b/src/USER-MESODPD/pair_tdpd.cpp index 0da187fd7b..face9221d9 100644 --- a/src/USER-MESODPD/pair_tdpd.cpp +++ b/src/USER-MESODPD/pair_tdpd.cpp @@ -233,9 +233,9 @@ void PairTDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -272,18 +272,18 @@ void PairTDPD::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); - double power_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double cutcc_one = force->numeric(FLERR,arg[6]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); + double power_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double cutcc_one = utils::numeric(FLERR,arg[6],false,lmp); double *kappa_one = new double[cc_species]; double *epsilon_one = new double[cc_species]; double *powercc_one = new double[cc_species]; for(int k=0; knumeric(FLERR,arg[7+3*k]); - epsilon_one[k] = force->numeric(FLERR,arg[8+3*k]); - powercc_one[k] = force->numeric(FLERR,arg[9+3*k]); + kappa_one[k] = utils::numeric(FLERR,arg[7+3*k],false,lmp); + epsilon_one[k] = utils::numeric(FLERR,arg[8+3*k],false,lmp); + powercc_one[k] = utils::numeric(FLERR,arg[9+3*k],false,lmp); } int count = 0; diff --git a/src/USER-MESONT/pair_mesont_tpm.cpp b/src/USER-MESONT/pair_mesont_tpm.cpp index 1f91b0e823..9fb0f604c8 100644 --- a/src/USER-MESONT/pair_mesont_tpm.cpp +++ b/src/USER-MESONT/pair_mesont_tpm.cpp @@ -586,7 +586,7 @@ void PairMESONTTPM::allocate(){ void PairMESONTTPM::settings(int narg, char **arg){ if ((narg == 0) || (narg > 4)) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set if (allocated) { @@ -604,12 +604,12 @@ void PairMESONTTPM::settings(int narg, char **arg){ mesont_lib_SetTablePath(tab_path, tab_path_length); if (narg > 2) { - BendingMode = force->numeric(FLERR,arg[2]); + BendingMode = utils::numeric(FLERR,arg[2],false,lmp); if ((BendingMode < 0) || (BendingMode > 1)) error->all(FLERR,"Incorrect BendingMode"); } if (narg > 3) { - TPMType = force->numeric(FLERR,arg[3]); + TPMType = utils::numeric(FLERR,arg[3],false,lmp); if ((TPMType < 0) || (TPMType > 1)) error->all(FLERR,"Incorrect TPMType"); } @@ -643,7 +643,7 @@ void PairMESONTTPM::coeff(int narg, char **arg){ utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp index f2a3ddc54b..2ed1a85672 100644 --- a/src/USER-MISC/angle_cosine_shift.cpp +++ b/src/USER-MISC/angle_cosine_shift.cpp @@ -177,8 +177,8 @@ void AngleCosineShift::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double umin = force->numeric(FLERR,arg[1]); - double theta0 = force->numeric(FLERR,arg[2]); + double umin = utils::numeric(FLERR,arg[1],false,lmp); + double theta0 = utils::numeric(FLERR,arg[2],false,lmp); // k=Umin/2 diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp index ec1a02bf30..fb1cc0a4e6 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.cpp +++ b/src/USER-MISC/angle_cosine_shift_exp.cpp @@ -205,9 +205,9 @@ void AngleCosineShiftExp::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double umin_ = force->numeric(FLERR,arg[1]); - double theta0_ = force->numeric(FLERR,arg[2]); - double a_ = force->numeric(FLERR,arg[3]); + double umin_ = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_ = utils::numeric(FLERR,arg[2],false,lmp); + double a_ = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp index 1f959192a5..6e449fe472 100644 --- a/src/USER-MISC/angle_dipole.cpp +++ b/src/USER-MISC/angle_dipole.cpp @@ -162,8 +162,8 @@ void AngleDipole::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double gamma0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double gamma0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert gamma0 from degrees to radians diff --git a/src/USER-MISC/angle_fourier.cpp b/src/USER-MISC/angle_fourier.cpp index c1ddc0d640..5f34be8d65 100644 --- a/src/USER-MISC/angle_fourier.cpp +++ b/src/USER-MISC/angle_fourier.cpp @@ -181,10 +181,10 @@ void AngleFourier::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C0_one = force->numeric(FLERR,arg[2]); - double C1_one = force->numeric(FLERR,arg[3]); - double C2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C0_one = utils::numeric(FLERR,arg[2],false,lmp); + double C1_one = utils::numeric(FLERR,arg[3],false,lmp); + double C2_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/angle_fourier_simple.cpp b/src/USER-MISC/angle_fourier_simple.cpp index 640922ceba..cddc07da90 100644 --- a/src/USER-MISC/angle_fourier_simple.cpp +++ b/src/USER-MISC/angle_fourier_simple.cpp @@ -195,9 +195,9 @@ void AngleFourierSimple::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C_one = force->numeric(FLERR,arg[2]); - double N_one = force->numeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C_one = utils::numeric(FLERR,arg[2],false,lmp); + double N_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp index 7ad97cebd4..c84739ac91 100644 --- a/src/USER-MISC/angle_quartic.cpp +++ b/src/USER-MISC/angle_quartic.cpp @@ -185,10 +185,10 @@ void AngleQuartic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp index 87e40ecc86..dd2c1a1524 100644 --- a/src/USER-MISC/bond_harmonic_shift.cpp +++ b/src/USER-MISC/bond_harmonic_shift.cpp @@ -130,9 +130,9 @@ void BondHarmonicShift::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double Umin = force->numeric(FLERR,arg[1]); // energy at minimum - double r0_one = force->numeric(FLERR,arg[2]); // position of minimum - double r1_one = force->numeric(FLERR,arg[3]); // position where energy = 0 + double Umin = utils::numeric(FLERR,arg[1],false,lmp); // energy at minimum + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); // position of minimum + double r1_one = utils::numeric(FLERR,arg[3],false,lmp); // position where energy = 0 if (r0_one == r1_one) error->all(FLERR,"Bond harmonic/shift r0 and r1 must be different"); diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp index abf01d9739..2cbfa01c0a 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.cpp +++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp @@ -132,9 +132,9 @@ void BondHarmonicShiftCut::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double Umin = force->numeric(FLERR,arg[1]); // energy at minimum - double r0_one = force->numeric(FLERR,arg[2]); // position of minimum - double r1_one = force->numeric(FLERR,arg[3]); // position where energy = 0 = cutoff + double Umin = utils::numeric(FLERR,arg[1],false,lmp); // energy at minimum + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); // position of minimum + double r1_one = utils::numeric(FLERR,arg[3],false,lmp); // position where energy = 0 = cutoff if (r0_one == r1_one) error->all(FLERR,"Bond harmonic/shift/cut r0 and r1 must be different"); diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 87b3db95e8..ebbdcb1899 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -146,8 +146,8 @@ void BondSpecial::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double factor_lj_one = force->numeric(FLERR,arg[1]); - double factor_coul_one = force->numeric(FLERR,arg[2]); + double factor_lj_one = utils::numeric(FLERR,arg[1],false,lmp); + double factor_coul_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 34882b0272..fdce944034 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -56,7 +56,7 @@ ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; size_peratom_cols = 0; - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal compute cnp/atom command"); cutsq = cutoff*cutoff; diff --git a/src/USER-MISC/compute_entropy_atom.cpp b/src/USER-MISC/compute_entropy_atom.cpp index 2641ec9313..d539d51e99 100644 --- a/src/USER-MISC/compute_entropy_atom.cpp +++ b/src/USER-MISC/compute_entropy_atom.cpp @@ -55,10 +55,10 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : // local is optional and allows using the local density to normalize // the g(r) - sigma = force->numeric(FLERR,arg[3]); + sigma = utils::numeric(FLERR,arg[3],false,lmp); if (sigma <= 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; sigma must be positive"); - cutoff = force->numeric(FLERR,arg[4]); + cutoff = utils::numeric(FLERR,arg[4],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; cutoff must be positive"); @@ -77,7 +77,7 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"no") == 0) avg_flag = 0; else error->all(FLERR,"Illegal compute entropy/atom;" " argument after avg should be yes or no"); - cutoff2 = force->numeric(FLERR,arg[iarg+2]); + cutoff2 = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (cutoff2 < 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; negative cutoff2"); cutsq2 = cutoff2*cutoff2; diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index d1f3e6b6f8..ccecf43aaf 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -145,7 +145,7 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal compute hma command"); if (computeP>-1) continue; computeP = size_vector; - deltaPcap = force->numeric(FLERR, arg[iarg+1]); + deltaPcap = utils::numeric(FLERR, arg[iarg+1],false,lmp); extlist[size_vector] = 0; size_vector++; iarg++; diff --git a/src/USER-MISC/compute_pressure_cylinder.cpp b/src/USER-MISC/compute_pressure_cylinder.cpp index 6d2509d685..8346bd3410 100644 --- a/src/USER-MISC/compute_pressure_cylinder.cpp +++ b/src/USER-MISC/compute_pressure_cylinder.cpp @@ -56,10 +56,10 @@ ComputePressureCyl::ComputePressureCyl(LAMMPS *lmp, int narg, char **arg) : if (lmp->citeme) lmp->citeme->add(cite_compute_pressure_cylinder); if (narg != 7) error->all(FLERR,"Illegal compute pressure/cylinder command"); - zlo=force->numeric(FLERR,arg[3]); - zhi=force->numeric(FLERR,arg[4]); - Rmax=force->numeric(FLERR,arg[5]); - bin_width=force->numeric(FLERR,arg[6]); + zlo=utils::numeric(FLERR,arg[3],false,lmp); + zhi=utils::numeric(FLERR,arg[4],false,lmp); + Rmax=utils::numeric(FLERR,arg[5],false,lmp); + bin_width=utils::numeric(FLERR,arg[6],false,lmp); if ((bin_width <= 0.0) || (bin_width > Rmax)) error->all(FLERR,"Illegal compute pressure/cylinder command"); diff --git a/src/USER-MISC/compute_stress_mop.cpp b/src/USER-MISC/compute_stress_mop.cpp index c403ed3247..1e42a9df02 100644 --- a/src/USER-MISC/compute_stress_mop.cpp +++ b/src/USER-MISC/compute_stress_mop.cpp @@ -65,7 +65,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : pos = domain->boxhi[dir]; } else if (strcmp(arg[4],"center")==0) { pos = 0.5*(domain->boxlo[dir]+domain->boxhi[dir]); - } else pos = force->numeric(FLERR,arg[4]); + } else pos = utils::numeric(FLERR,arg[4],false,lmp); if ( pos < (domain->boxlo[dir]+domain->prd_half[dir]) ) { pos1 = pos + domain->prd[dir]; diff --git a/src/USER-MISC/compute_stress_mop_profile.cpp b/src/USER-MISC/compute_stress_mop_profile.cpp index 9649a61090..022840166f 100644 --- a/src/USER-MISC/compute_stress_mop_profile.cpp +++ b/src/USER-MISC/compute_stress_mop_profile.cpp @@ -65,8 +65,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a else if (strcmp(arg[4],"upper") == 0) originflag = UPPER; else originflag = COORD; if (originflag == COORD) - origin = force->numeric(FLERR,arg[4]); - delta = force->numeric(FLERR,arg[5]); + origin = utils::numeric(FLERR,arg[4],false,lmp); + delta = utils::numeric(FLERR,arg[5],false,lmp); invdelta = 1.0/delta; // parse values until one isn't recognized diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp index 2098e713cc..1b3afb13eb 100644 --- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp +++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp @@ -278,9 +278,9 @@ void DihedralCosineShiftExp::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double umin_ = force->numeric(FLERR,arg[1]); - double theta0_ = force->numeric(FLERR,arg[2]); - double a_ = force->numeric(FLERR,arg[3]); + double umin_ = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_ = utils::numeric(FLERR,arg[2],false,lmp); + double a_ = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp index aafef7d7d5..e897e58649 100644 --- a/src/USER-MISC/dihedral_fourier.cpp +++ b/src/USER-MISC/dihedral_fourier.cpp @@ -306,7 +306,7 @@ void DihedralFourier::coeff(int narg, char **arg) double k_one; int multiplicity_one; double shift_one; - int nterms_one = force->inumeric(FLERR,arg[1]); + int nterms_one = utils::inumeric(FLERR,arg[1],false,lmp); if (nterms_one < 1) error->all(FLERR,"Incorrect number of terms arg for dihedral coefficients"); @@ -324,9 +324,9 @@ void DihedralFourier::coeff(int narg, char **arg) sin_shift[i] = new double [nterms_one]; for (int j = 0; jnumeric(FLERR,arg[offset+1]); - multiplicity_one = force->inumeric(FLERR,arg[offset+2]); - shift_one = force->numeric(FLERR,arg[offset+3]); + k_one = utils::numeric(FLERR,arg[offset+1],false,lmp); + multiplicity_one = utils::inumeric(FLERR,arg[offset+2],false,lmp); + shift_one = utils::numeric(FLERR,arg[offset+3],false,lmp); k[i][j] = k_one; multiplicity[i][j] = multiplicity_one; shift[i][j] = shift_one; diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index 15ffb6914d..0ff62320e4 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -277,7 +277,7 @@ void DihedralNHarmonic::coeff(int narg, char **arg) { if (narg < 4 ) error->all(FLERR,"Incorrect args for dihedral coefficients"); - int n = force->inumeric(FLERR,arg[1]); + int n = utils::inumeric(FLERR,arg[1],false,lmp); if (narg != n + 2) error->all(FLERR,"Incorrect args for dihedral coefficients"); @@ -291,7 +291,7 @@ void DihedralNHarmonic::coeff(int narg, char **arg) a[i] = new double [n]; nterms[i] = n; for (int j = 0; j < n; j++ ) { - a[i][j] = force->numeric(FLERR,arg[2+j]); + a[i][j] = utils::numeric(FLERR,arg[2+j],false,lmp); setflag[i] = 1; } count++; diff --git a/src/USER-MISC/dihedral_quadratic.cpp b/src/USER-MISC/dihedral_quadratic.cpp index 30aeb34c0d..d91c237838 100644 --- a/src/USER-MISC/dihedral_quadratic.cpp +++ b/src/USER-MISC/dihedral_quadratic.cpp @@ -289,8 +289,8 @@ void DihedralQuadratic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double phi0_one= force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double phi0_one= utils::numeric(FLERR,arg[2],false,lmp); // require k >= 0 if (k_one < 0.0) diff --git a/src/USER-MISC/dihedral_spherical.cpp b/src/USER-MISC/dihedral_spherical.cpp index 6a10b19523..1cfb756127 100644 --- a/src/USER-MISC/dihedral_spherical.cpp +++ b/src/USER-MISC/dihedral_spherical.cpp @@ -683,7 +683,7 @@ void DihedralSpherical::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - int nterms_one = force->inumeric(FLERR,arg[1]); + int nterms_one = utils::inumeric(FLERR,arg[1],false,lmp); if (nterms_one < 1) error->all(FLERR,"Incorrect number of terms arg for dihedral coefficients"); @@ -706,16 +706,16 @@ void DihedralSpherical::coeff(int narg, char **arg) theta2_offset[i] = new double [nterms_one]; for (int j = 0; j < nterms_one; j++) { int offset = 1+10*j; - Ccoeff[i][j] = force->numeric(FLERR,arg[offset+1]); - phi_mult[i][j] = force->numeric(FLERR,arg[offset+2]); - phi_shift[i][j] = force->numeric(FLERR,arg[offset+3]) * MY_PI/180.0; - phi_offset[i][j] = force->numeric(FLERR,arg[offset+4]); - theta1_mult[i][j] = force->numeric(FLERR,arg[offset+5]); - theta1_shift[i][j] = force->numeric(FLERR,arg[offset+6]) * MY_PI/180.0; - theta1_offset[i][j] = force->numeric(FLERR,arg[offset+7]); - theta2_mult[i][j] = force->numeric(FLERR,arg[offset+8]); - theta2_shift[i][j] = force->numeric(FLERR,arg[offset+9]) * MY_PI/180.0; - theta2_offset[i][j] = force->numeric(FLERR,arg[offset+10]); + Ccoeff[i][j] = utils::numeric(FLERR,arg[offset+1],false,lmp); + phi_mult[i][j] = utils::numeric(FLERR,arg[offset+2],false,lmp); + phi_shift[i][j] = utils::numeric(FLERR,arg[offset+3],false,lmp) * MY_PI/180.0; + phi_offset[i][j] = utils::numeric(FLERR,arg[offset+4],false,lmp); + theta1_mult[i][j] = utils::numeric(FLERR,arg[offset+5],false,lmp); + theta1_shift[i][j] = utils::numeric(FLERR,arg[offset+6],false,lmp) * MY_PI/180.0; + theta1_offset[i][j] = utils::numeric(FLERR,arg[offset+7],false,lmp); + theta2_mult[i][j] = utils::numeric(FLERR,arg[offset+8],false,lmp); + theta2_shift[i][j] = utils::numeric(FLERR,arg[offset+9],false,lmp) * MY_PI/180.0; + theta2_offset[i][j] = utils::numeric(FLERR,arg[offset+10],false,lmp); } setflag[i] = 1; count++; diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index eb09472a39..37410ba085 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -782,7 +782,7 @@ void DihedralTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in dihedral style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 3) error->all(FLERR,"Illegal number of dihedral table entries"); // delete old tables, since cannot just change settings diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index 239ae9a0a0..a734a8e998 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -764,7 +764,7 @@ void DihedralTableCut::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in dihedral style table_cut"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 3) error->all(FLERR,"Illegal number of dihedral table entries"); // delete old tables, since cannot just change settings @@ -796,9 +796,9 @@ void DihedralTableCut::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[2]); - double theta0_1_one = force->numeric(FLERR,arg[3]); - double theta0_2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0's from degrees to radians diff --git a/src/USER-MISC/fix_accelerate_cos.cpp b/src/USER-MISC/fix_accelerate_cos.cpp index 88e33023fd..17d6e9ad94 100644 --- a/src/USER-MISC/fix_accelerate_cos.cpp +++ b/src/USER-MISC/fix_accelerate_cos.cpp @@ -37,7 +37,7 @@ using namespace FixConst; FixAccelerateCos::FixAccelerateCos(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR, "Illegal fix accelerate/cos command"); - acceleration = force->numeric(FLERR, arg[3]); + acceleration = utils::numeric(FLERR, arg[3],false,lmp); if (domain->dimension == 2) error->all(FLERR,"Fix accelerate/cos cannot be used with 2d systems"); } diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index 665f1d4a60..4583d76e09 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -58,7 +58,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -66,7 +66,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -74,7 +74,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index 4d548d585a..abfa751d15 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -70,8 +70,8 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nfreq = force->inumeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nfreq = utils::inumeric(FLERR,arg[4],false,lmp); restart_global = 1; global_freq = nfreq; @@ -142,22 +142,22 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ncorr") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - numcorrelators = force->inumeric(FLERR,arg[iarg+1]); + numcorrelators = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nlen") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - p = force->inumeric(FLERR,arg[iarg+1]); + p = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ncount") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - m = force->inumeric(FLERR,arg[iarg+1]); + m = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) diff --git a/src/USER-MISC/fix_electron_stopping.cpp b/src/USER-MISC/fix_electron_stopping.cpp index 2130f07420..5ef0a1cb2f 100644 --- a/src/USER-MISC/fix_electron_stopping.cpp +++ b/src/USER-MISC/fix_electron_stopping.cpp @@ -57,7 +57,7 @@ FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) : if (narg < 5) error->all(FLERR, "Illegal fix electron/stopping command: too few arguments"); - Ecut = force->numeric(FLERR, arg[3]); + Ecut = utils::numeric(FLERR, arg[3],false,lmp); if (Ecut <= 0.0) error->all(FLERR, "Illegal fix electron/stopping command: Ecut <= 0"); @@ -83,7 +83,7 @@ FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) : minneighflag = true; if (iarg+2 > narg) error->all(FLERR, "Illegal fix electron/stopping command: minneigh number missing"); - minneigh = force->inumeric(FLERR, arg[iarg+1]); + minneigh = utils::inumeric(FLERR, arg[iarg+1],false,lmp); if (minneigh < 0) error->all(FLERR, "Illegal fix electron/stopping command: minneigh < 0"); iarg += 2; @@ -261,7 +261,7 @@ void FixElectronStopping::read_table(const char *file) int i = 0; for ( ; i < ncol && pch != NULL; i++) { - elstop_ranges[i][l] = force->numeric(FLERR, pch); + elstop_ranges[i][l] = utils::numeric(FLERR, pch,false,lmp); pch = strtok(NULL, " \t\n\r"); } diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index a245b6b4e5..4460c55183 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -64,21 +64,22 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; scalar_flag = 1; - //gamma = 1/ time constant(tau) - if (force->numeric(FLERR,arg[3]) <= 0) + //gamma = 1 / time constant(tau) + gamma = utils::numeric(FLERR,arg[3],false,lmp); + if (gamma <= 0.0) error->all(FLERR,"Illegal fix ffl tau value, should be greater than 0"); - gamma = 1.0/force->numeric(FLERR,arg[3]); + gamma = 1.0/gamma; ffl_every=1; ffl_step=0; // start temperature (t ramp) - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); // final temperature (t ramp) - t_stop = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); // PRNG seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // Flip type used, uses rescale if no flip is given if (narg == 8) { diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 52e979d32c..18fd784861 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -110,25 +110,25 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : // read numeric args of b,a,t,m else if (mode == 'b') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nbondtypes) error->all(FLERR,"Invalid bond type index for fix filter/corotate"); bond_flag[i] = 1; } else if (mode == 'a') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nangletypes) error->all(FLERR,"Invalid angle type index for fix filter/corotate"); angle_flag[i] = 1; } else if (mode == 't') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->ntypes) error->all(FLERR,"Invalid atom type index for fix filter/corotate"); type_flag[i] = 1; } else if (mode == 'm') { - double massone = force->numeric(FLERR,arg[next]); + double massone = utils::numeric(FLERR,arg[next],false,lmp); if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix filter/corotate"); if (nmass == atom->ntypes) diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index c7b7f86d37..2463e18b40 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -71,7 +71,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : int tmpFlag; for (int ii=0; ii<3; ii++) { - tmpFlag=force->inumeric(FLERR,arg[3+ii]); + tmpFlag=utils::inumeric(FLERR,arg[3+ii],false,lmp); if (tmpFlag==1 || tmpFlag==0) flow[ii]=tmpFlag; else diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index 87dbb19496..aa791679cb 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -197,7 +197,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; // number of additional momenta - ns = force->inumeric(FLERR,arg[3]); + ns = utils::inumeric(FLERR,arg[3],false,lmp); ns1sq = (ns+1)*(ns+1); // allocate GLE matrices @@ -209,13 +209,13 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ST = new double[ns1sq]; // start temperature (t ramp) - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); // final temperature (t ramp) - t_stop = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); // PRNG seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // LOADING A matrix FILE *fgle = NULL; @@ -276,7 +276,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : if (iarg+2>narg) error->all(FLERR, "Did not specify interval for applying the GLE"); - gle_every=force->inumeric(FLERR,arg[iarg+1]); + gle_every=utils::inumeric(FLERR,arg[iarg+1],false,lmp); } } diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index 9600cce90e..b17c601f05 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -52,9 +52,9 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : // tbath - temp of bath, the same as defined in thermostat - lambda = force->numeric(FLERR,arg[3]); - eta = force->numeric(FLERR,arg[4]); - h0 = force->numeric(FLERR,arg[5]); + lambda = utils::numeric(FLERR,arg[3],false,lmp); + eta = utils::numeric(FLERR,arg[4],false,lmp); + h0 = utils::numeric(FLERR,arg[5],false,lmp); int n = strlen(arg[6])+1; id_nh = new char[n]; diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 266142b529..af4a517269 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -446,7 +446,7 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix imd command"); - imd_port = force->inumeric(FLERR,arg[3]); + imd_port = utils::inumeric(FLERR,arg[3],false,lmp); if (imd_port < 1024) error->all(FLERR,"Illegal fix imd parameter: port < 1024"); @@ -473,9 +473,9 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : nowait_flag = 0; } } else if (0 == strcmp(arg[argsdone], "fscale")) { - imd_fscale = force->numeric(FLERR,arg[argsdone+1]); + imd_fscale = utils::numeric(FLERR,arg[argsdone+1],false,lmp); } else if (0 == strcmp(arg[argsdone], "trate")) { - imd_trate = force->inumeric(FLERR,arg[argsdone+1]); + imd_trate = utils::inumeric(FLERR,arg[argsdone+1],false,lmp); } else { error->all(FLERR,"Unknown fix imd parameter"); } diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index 74e757c2e9..b1d07eef41 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -185,7 +185,7 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : error->warning(FLERR,"Fix ipi always uses group all"); host = strdup(arg[3]); - port = force->inumeric(FLERR,arg[4]); + port = utils::inumeric(FLERR,arg[4],false,lmp); inet = ((narg > 5) && (strcmp(arg[5],"unix") == 0) ) ? 0 : 1; master = (comm->me==0) ? 1 : 0; diff --git a/src/USER-MISC/fix_momentum_chunk.cpp b/src/USER-MISC/fix_momentum_chunk.cpp index fe6c2f5bea..0ed5e1f877 100644 --- a/src/USER-MISC/fix_momentum_chunk.cpp +++ b/src/USER-MISC/fix_momentum_chunk.cpp @@ -41,7 +41,7 @@ FixMomentumChunk::FixMomentumChunk(LAMMPS *lmp, int narg, char **arg) : { if (narg < 5) error->all(FLERR,"Illegal fix momentum/chunk command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix momentum/chunk command"); id_chunk = arg[4]; @@ -60,9 +60,9 @@ FixMomentumChunk::FixMomentumChunk(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"linear") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command"); linear = 1; - xflag = force->inumeric(FLERR,arg[iarg+1]); - yflag = force->inumeric(FLERR,arg[iarg+2]); - zflag = force->inumeric(FLERR,arg[iarg+3]); + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"angular") == 0) { angular = 1; diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 067bad47ef..221886d388 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -134,10 +134,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix npt/cauchy cannot be 0.0"); @@ -146,10 +146,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"iso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -159,10 +159,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -173,15 +173,15 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_start[3] = p_start[4] = p_start[5] = 0.0; p_stop[3] = p_stop[4] = p_stop[5] = 0.0; p_period[3] = p_period[4] = p_period[5] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = p_flag[4] = p_flag[5] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -194,25 +194,25 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 4; @@ -221,9 +221,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[3] = force->numeric(FLERR,arg[iarg+1]); - p_stop[3] = force->numeric(FLERR,arg[iarg+2]); - p_period[3] = force->numeric(FLERR,arg[iarg+3]); + p_start[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[3] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -232,9 +232,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix npt/cauchy command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[4] = force->numeric(FLERR,arg[iarg+1]); - p_stop[4] = force->numeric(FLERR,arg[iarg+2]); - p_period[4] = force->numeric(FLERR,arg[iarg+3]); + p_start[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[4] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[4] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -243,9 +243,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix npt/cauchy command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[5] = force->numeric(FLERR,arg[iarg+1]); - p_stop[5] = force->numeric(FLERR,arg[iarg+2]); - p_period[5] = force->numeric(FLERR,arg[iarg+3]); + p_start[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[5] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[5] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -263,7 +263,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"drag") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - drag = force->numeric(FLERR,arg[iarg+1]); + drag = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (drag < 0.0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"dilate") == 0) { @@ -283,14 +283,14 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -301,17 +301,17 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -347,7 +347,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"alpha") == 0) { - alpha = force->numeric(FLERR,arg[iarg+1]); + alpha = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"continue") == 0) { if (strcmp(arg[iarg+1],"yes") != 0 && strcmp(arg[iarg+1],"no") != 0) @@ -357,9 +357,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; // disc keyword is also parsed in fix/nh/sphere diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index add32e7215..272ba1ca93 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -82,10 +82,10 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : peratom_freq = 1; // // parse input parameters - u_0 = force->numeric(FLERR, arg[3]); + u_0 = utils::numeric(FLERR, arg[3],false,lmp); sign = (u_0 >= 0.0 ? 1 : -1); - eta = force->numeric(FLERR, arg[4]); - r_cut = force->numeric(FLERR, arg[5]); + eta = utils::numeric(FLERR, arg[4],false,lmp); + r_cut = utils::numeric(FLERR, arg[5],false,lmp); // read reference orientations from file // work on rank 0 only diff --git a/src/USER-MISC/fix_propel_self.cpp b/src/USER-MISC/fix_propel_self.cpp index 921ce9b9ef..0a40177993 100644 --- a/src/USER-MISC/fix_propel_self.cpp +++ b/src/USER-MISC/fix_propel_self.cpp @@ -82,7 +82,7 @@ FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) error->all(FLERR, msg); } - magnitude = force->numeric( FLERR, argv[4] ); + magnitude = utils::numeric( FLERR, argv[4] ,false,lmp); // Handle rest of args: @@ -100,7 +100,7 @@ FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) int flag=0; while (iarg < narg) { if (isdigit(argv[iarg][0])) { - int thistype = force->inumeric(FLERR,argv[iarg]); + int thistype = utils::inumeric(FLERR,argv[iarg],false,lmp); if ((thistype < 1) || (thistype > atom->ntypes)) error->all(FLERR,"Illegal atom type to types keyword"); apply_to_type[thistype] = 1; diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index fb041b05cd..612352aae1 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -68,16 +68,16 @@ FixRhok::FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ) // Parse fix options int n[3]; - n[0] = force->inumeric(FLERR,inArgv[3]); - n[1] = force->inumeric(FLERR,inArgv[4]); - n[2] = force->inumeric(FLERR,inArgv[5]); + n[0] = utils::inumeric(FLERR,inArgv[3],false,lmp); + n[1] = utils::inumeric(FLERR,inArgv[4],false,lmp); + n[2] = utils::inumeric(FLERR,inArgv[5],false,lmp); mK[0] = n[0]*(2*MY_PI / (domain->boxhi[0] - domain->boxlo[0])); mK[1] = n[1]*(2*MY_PI / (domain->boxhi[1] - domain->boxlo[1])); mK[2] = n[2]*(2*MY_PI / (domain->boxhi[2] - domain->boxlo[2])); - mKappa = force->numeric(FLERR,inArgv[6]); - mRhoK0 = force->numeric(FLERR,inArgv[7]); + mKappa = utils::numeric(FLERR,inArgv[6],false,lmp); + mRhoK0 = utils::numeric(FLERR,inArgv[7],false,lmp); } // Methods that this fix implements diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index 32c040c2b4..d110637b3c 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -64,13 +64,13 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[argoffs],"cvel") == 0) { if (narg < argoffs+3) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_CVEL; - k_smd = force->numeric(FLERR,arg[argoffs+1]); - v_smd = force->numeric(FLERR,arg[argoffs+2]); // to be multiplied by update->dt when used. + k_smd = utils::numeric(FLERR,arg[argoffs+1],false,lmp); + v_smd = utils::numeric(FLERR,arg[argoffs+2],false,lmp); // to be multiplied by update->dt when used. argoffs += 3; } else if (strcmp(arg[argoffs],"cfor") == 0) { if (narg < argoffs+2) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_CFOR; - f_smd = force->numeric(FLERR,arg[argoffs+1]); + f_smd = utils::numeric(FLERR,arg[argoffs+1],false,lmp); argoffs += 2; } else error->all(FLERR,"Illegal fix smd command"); @@ -78,12 +78,12 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (narg < argoffs+5) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_TETHER; if (strcmp(arg[argoffs+1],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[argoffs+1]); + else xc = utils::numeric(FLERR,arg[argoffs+1],false,lmp); if (strcmp(arg[argoffs+2],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[argoffs+2]); + else yc = utils::numeric(FLERR,arg[argoffs+2],false,lmp); if (strcmp(arg[argoffs+3],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[argoffs+3]); - r0 = force->numeric(FLERR,arg[argoffs+4]); + else zc = utils::numeric(FLERR,arg[argoffs+3],false,lmp); + r0 = utils::numeric(FLERR,arg[argoffs+4],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command"); argoffs += 5; } else if (strcmp(arg[argoffs],"couple") == 0) { @@ -98,15 +98,15 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[argoffs+2],"NULL") == 0) xflag = 0; else if (strcmp(arg[argoffs+2],"auto") == 0) styleflag |= SMD_AUTOX; - else xc = force->numeric(FLERR,arg[argoffs+2]); + else xc = utils::numeric(FLERR,arg[argoffs+2],false,lmp); if (strcmp(arg[argoffs+3],"NULL") == 0) yflag = 0; else if (strcmp(arg[argoffs+3],"auto") == 0) styleflag |= SMD_AUTOY; - else yc = force->numeric(FLERR,arg[argoffs+3]); + else yc = utils::numeric(FLERR,arg[argoffs+3],false,lmp); if (strcmp(arg[argoffs+4],"NULL") == 0) zflag = 0; else if (strcmp(arg[argoffs+4],"auto") == 0) styleflag |= SMD_AUTOZ; - else zc = force->numeric(FLERR,arg[argoffs+4]); + else zc = utils::numeric(FLERR,arg[argoffs+4],false,lmp); - r0 = force->numeric(FLERR,arg[argoffs+5]); + r0 = utils::numeric(FLERR,arg[argoffs+5],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command"); argoffs +=6; } else error->all(FLERR,"Illegal fix smd command"); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index e72ea61b01..d61e7f1ee1 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -642,11 +642,11 @@ void FixSRP::restart(char *buf) int FixSRP::modify_param(int /*narg*/, char **arg) { if (strcmp(arg[0],"btype") == 0) { - btype = force->inumeric(FLERR,arg[1]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); return 2; } if (strcmp(arg[0],"bptype") == 0) { - bptype = force->inumeric(FLERR,arg[1]); + bptype = utils::inumeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 1f7c84b746..ef7c4c0296 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -69,7 +69,7 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : time_depend = 1; // Spring constant. - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); if (k <= 0.0) error->all(FLERR,"Illegal fix ti/spring command"); // Perform initial allocation of atom-based array @@ -93,15 +93,15 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : // Time variables. t0 = update->ntimestep; // timestep of original/starting coordinates - t_switch = force->bnumeric(FLERR,arg[4]); // Number of steps for switching - t_equil = force->bnumeric(FLERR,arg[5]); // Number of steps for equilibration + t_switch = utils::bnumeric(FLERR,arg[4],false,lmp); // Number of steps for switching + t_equil = utils::bnumeric(FLERR,arg[5],false,lmp); // Number of steps for equilibration if ((t_switch <= 0) || (t_equil < 0)) error->all(FLERR,"Illegal fix ti/spring command"); // Coupling parameter initialization sf = 1; if (narg > 6) { - if (strcmp(arg[6], "function") == 0) sf = force->inumeric(FLERR,arg[7]); + if (strcmp(arg[6], "function") == 0) sf = utils::inumeric(FLERR,arg[7],false,lmp); else error->all(FLERR,"Illegal fix ti/spring switching function"); if ((sf!=1) && (sf!=2)) error->all(FLERR,"Illegal fix ti/spring switching function"); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index aaeab5989a..8c37b19e8b 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -84,13 +84,13 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; restart_global = 1; - seed = force->inumeric(FLERR,arg[3]); + seed = utils::inumeric(FLERR,arg[3],false,lmp); if (seed <= 0) error->all(FLERR,"Invalid random number seed in fix ttm/mod command"); - nxnodes = force->inumeric(FLERR,arg[5]); - nynodes = force->inumeric(FLERR,arg[6]); - nznodes = force->inumeric(FLERR,arg[7]); + nxnodes = utils::inumeric(FLERR,arg[5],false,lmp); + nynodes = utils::inumeric(FLERR,arg[6],false,lmp); + nznodes = utils::inumeric(FLERR,arg[7],false,lmp); if (nxnodes <= 0 || nynodes <= 0 || nznodes <= 0) error->all(FLERR,"Fix ttm/mod number of nodes must be > 0"); @@ -98,7 +98,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : if (total_nnodes > MAXSMALLINT) error->all(FLERR,"Too many nodes in fix ttm/mod"); - nfileevery = force->inumeric(FLERR,arg[9]); + nfileevery = utils::inumeric(FLERR,arg[9],false,lmp); if (nfileevery > 0) { if (narg != 11) error->all(FLERR,"Illegal fix ttm/mod command"); if (comm->me == 0) { diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 18bb7ec011..8afc506804 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -70,7 +70,7 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix wall/reflect/stochastic command"); - seedfix = force->inumeric(FLERR,arg[4]); + seedfix = utils::inumeric(FLERR,arg[4],false,lmp); if (seedfix <= 0) error->all(FLERR,"Random seed must be a positive number"); int iarg = 5; @@ -103,13 +103,13 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : else coord0[nwall] = domain->boxhi[dim]; } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } - walltemp[nwall]= force->numeric(FLERR,arg[iarg+2]); + walltemp[nwall]= utils::numeric(FLERR,arg[iarg+2],false,lmp); for (int dir = 0; dir < 3; dir++) { - wallvel[nwall][dir]= force->numeric(FLERR,arg[iarg+dir+3]); + wallvel[nwall][dir]= utils::numeric(FLERR,arg[iarg+dir+3],false,lmp); int dim = wallwhich[nwall] / 2; if ((wallvel[nwall][dir] !=0) & (dir == dim)) error->all(FLERR,"The wall velocity must be tangential"); @@ -119,9 +119,9 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : // CCL = one for each dimension if (rstyle == CCL) - wallaccom[nwall][dir]= force->numeric(FLERR,arg[iarg+dir+6]); + wallaccom[nwall][dir]= utils::numeric(FLERR,arg[iarg+dir+6],false,lmp); else if (rstyle == MAXWELL) - wallaccom[nwall][dir]= force->numeric(FLERR,arg[iarg+6]); + wallaccom[nwall][dir]= utils::numeric(FLERR,arg[iarg+6],false,lmp); } nwall++; diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 5c6bb1874b..3a8323d58d 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -54,9 +54,9 @@ FixWallRegionEES::FixWallRegionEES(LAMMPS *lmp, int narg, char **arg) : idregion = new char[n]; strcpy(idregion,arg[3]); - epsilon = force->numeric(FLERR,arg[4]); - sigma = force->numeric(FLERR,arg[5]); - cutoff = force->numeric(FLERR,arg[6]); + epsilon = utils::numeric(FLERR,arg[4],false,lmp); + sigma = utils::numeric(FLERR,arg[5],false,lmp); + cutoff = utils::numeric(FLERR,arg[6],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region/ees cutoff <= 0.0"); diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp index babd63fb70..09cf7cf2c6 100644 --- a/src/USER-MISC/improper_cossq.cpp +++ b/src/USER-MISC/improper_cossq.cpp @@ -271,8 +271,8 @@ void ImproperCossq::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/improper_distance.cpp b/src/USER-MISC/improper_distance.cpp index 640e175ea7..8ea58b23b3 100644 --- a/src/USER-MISC/improper_distance.cpp +++ b/src/USER-MISC/improper_distance.cpp @@ -213,8 +213,8 @@ void ImproperDistance::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp index 63f4104053..3bdbc7bc68 100644 --- a/src/USER-MISC/improper_fourier.cpp +++ b/src/USER-MISC/improper_fourier.cpp @@ -281,12 +281,12 @@ void ImproperFourier::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C0_one = force->numeric(FLERR,arg[2]); - double C1_one = force->numeric(FLERR,arg[3]); - double C2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C0_one = utils::numeric(FLERR,arg[2],false,lmp); + double C1_one = utils::numeric(FLERR,arg[3],false,lmp); + double C2_one = utils::numeric(FLERR,arg[4],false,lmp); int all_one = 1; - if ( narg == 6 ) all_one = force->inumeric(FLERR,arg[5]); + if ( narg == 6 ) all_one = utils::inumeric(FLERR,arg[5],false,lmp); // convert w0 from degrees to radians diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp index 9c94a4d719..4102a250dd 100644 --- a/src/USER-MISC/improper_ring.cpp +++ b/src/USER-MISC/improper_ring.cpp @@ -290,8 +290,8 @@ void ImproperRing ::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 51d2f671b5..6a4575c6e4 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -184,8 +184,8 @@ void PairBuckMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -211,16 +211,16 @@ void PairBuckMDF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 7) { - cut_inner_one = force->numeric(FLERR,arg[5]); - cut_one = force->numeric(FLERR,arg[6]); + cut_inner_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_one = utils::numeric(FLERR,arg[6],false,lmp); } if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index becba54b2e..8e400d23ed 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -103,7 +103,7 @@ void PairCosineSquared::settings(int narg, char **arg) error->all(FLERR, "Illegal pair_style command (wrong number of params)"); } - cut_global = force->numeric(FLERR, arg[0]); + cut_global = utils::numeric(FLERR, arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -133,13 +133,13 @@ void PairCosineSquared::coeff(int narg, char **arg) utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error); - double epsilon_one = force->numeric(FLERR, arg[2]); - double sigma_one = force->numeric(FLERR, arg[3]); + double epsilon_one = utils::numeric(FLERR, arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR, arg[3],false,lmp); double cut_one = cut_global; double wca_one = 0; if (narg == 6) { - cut_one = force->numeric(FLERR, arg[4]); + cut_one = utils::numeric(FLERR, arg[4],false,lmp); if (strcmp(arg[5], "wca") == 0) { wca_one = 1; } else { @@ -149,7 +149,7 @@ void PairCosineSquared::coeff(int narg, char **arg) if (strcmp(arg[4], "wca") == 0) { wca_one = 1; } else { - cut_one = force->numeric(FLERR, arg[4]); + cut_one = utils::numeric(FLERR, arg[4],false,lmp); } } diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index f5a94bd0e1..14fbd374b6 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -159,7 +159,7 @@ void PairCoulDiel::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -184,12 +184,12 @@ void PairCoulDiel::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - eps_s = force->numeric(FLERR,arg[2]); - double rme_one =force->numeric(FLERR,arg[3]); - double sigmae_one = force->numeric(FLERR,arg[4]); + eps_s = utils::numeric(FLERR,arg[2],false,lmp); + double rme_one =utils::numeric(FLERR,arg[3],false,lmp); + double sigmae_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_coul_shield.cpp b/src/USER-MISC/pair_coul_shield.cpp index 3dad7a1a1f..883796de1b 100644 --- a/src/USER-MISC/pair_coul_shield.cpp +++ b/src/USER-MISC/pair_coul_shield.cpp @@ -175,8 +175,8 @@ void PairCoulShield::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -201,10 +201,10 @@ void PairCoulShield::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double sigmae_one = force->numeric(FLERR,arg[2]); + double sigmae_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_coul_slater_cut.cpp b/src/USER-MISC/pair_coul_slater_cut.cpp index 33363b869a..194ff664b3 100644 --- a/src/USER-MISC/pair_coul_slater_cut.cpp +++ b/src/USER-MISC/pair_coul_slater_cut.cpp @@ -123,8 +123,8 @@ void PairCoulSlaterCut::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - lamda = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + lamda = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index 28be30c340..d801d0342f 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -210,8 +210,8 @@ void PairCoulSlaterLong::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - lamda = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + lamda = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index 420e2135bd..2b58e4b1f8 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -381,7 +381,7 @@ void PairE3B::allocateE3B() void PairE3B::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - typeO=force->inumeric(FLERR,arg[0]); + typeO=utils::inumeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -421,29 +421,29 @@ void PairE3B::coeff(int narg, char **arg) while(iarg < narg) { char *keyword = arg[iarg++]; if (checkKeyword(keyword,"Ea",1,narg-iarg)) - ea=force->numeric(FLERR,arg[iarg++]); + ea=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Eb",1,narg-iarg)) - eb=force->numeric(FLERR,arg[iarg++]); + eb=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Ec",1,narg-iarg)) - ec=force->numeric(FLERR,arg[iarg++]); + ec=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"K3",1,narg-iarg)) - k3=force->numeric(FLERR,arg[iarg++]); + k3=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rs",1,narg-iarg)) - rs=force->numeric(FLERR,arg[iarg++]); + rs=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rc3",1,narg-iarg)) - rc3=force->numeric(FLERR,arg[iarg++]); + rc3=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rc2",1,narg-iarg)) - rc2=force->numeric(FLERR,arg[iarg++]); + rc2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"bondL",1,narg-iarg)) - bondL=force->numeric(FLERR,arg[iarg++]); + bondL=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"E2",1,narg-iarg)) - e2=force->numeric(FLERR,arg[iarg++]); + e2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"K2",1,narg-iarg)) - k2=force->numeric(FLERR,arg[iarg++]); + k2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"neigh",1,narg-iarg)) - pairPerAtom=force->inumeric(FLERR,arg[iarg++]); + pairPerAtom=utils::inumeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"preset",1,narg-iarg)) { - presetFlag=force->inumeric(FLERR,arg[iarg++]); + presetFlag=utils::inumeric(FLERR,arg[iarg++],false,lmp); presetParam(presetFlag,repeatFlag,bondL); } else { char str[256]; diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index ed34f91b8b..38d4c4d4c2 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -163,7 +163,7 @@ void PairGaussCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -188,15 +188,15 @@ void PairGaussCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double hgauss_one = force->numeric(FLERR,arg[2]); - double rmh_one = force->numeric(FLERR,arg[3]); - double sigmah_one = force->numeric(FLERR,arg[4]); + double hgauss_one = utils::numeric(FLERR,arg[2],false,lmp); + double rmh_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigmah_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigmah_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index 106d02dd48..e7689acda5 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -136,8 +136,8 @@ void PairILPGrapheneHBN::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 9627cbc08a..ee3eec3869 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -137,8 +137,8 @@ void PairKolmogorovCrespiFull::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 2a932b840f..bf88bac6e2 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -203,7 +203,7 @@ void PairKolmogorovCrespiZ::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index 82dc265ef9..27e21a12e3 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -199,7 +199,7 @@ void PairLebedevaZ::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index e1647f5220..6faa599d2c 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -184,8 +184,8 @@ void PairLennardMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -217,14 +217,14 @@ void PairLennardMDF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double aparm_one = force->numeric(FLERR,arg[2]); - double bparm_one = force->numeric(FLERR,arg[3]); + double aparm_one = utils::numeric(FLERR,arg[2],false,lmp); + double bparm_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) error->all(FLERR,"Illegal pair_coeff command"); diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index fe21dd6560..44811316a8 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -203,7 +203,7 @@ void PairList::settings(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg > 2) { if (strcmp(arg[2],"nocheck") == 0) check_flag = 0; if (strcmp(arg[2],"check") == 0) check_flag = 1; @@ -260,12 +260,12 @@ void PairList::settings(int narg, char **arg) ptr = strtok(NULL," \t\n\r\f"); if ((ptr == NULL) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); - par.parm.harm.k = force->numeric(FLERR,ptr); + par.parm.harm.k = utils::numeric(FLERR,ptr,false,lmp); ptr = strtok(NULL," \t\n\r\f"); if ((ptr == NULL) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); - par.parm.harm.r0 = force->numeric(FLERR,ptr); + par.parm.harm.r0 = utils::numeric(FLERR,ptr,false,lmp); ++nharm; @@ -276,17 +276,17 @@ void PairList::settings(int narg, char **arg) ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.d0 = force->numeric(FLERR,ptr); + par.parm.morse.d0 = utils::numeric(FLERR,ptr,false,lmp); ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.alpha = force->numeric(FLERR,ptr); + par.parm.morse.alpha = utils::numeric(FLERR,ptr,false,lmp); ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.r0 = force->numeric(FLERR,ptr); + par.parm.morse.r0 = utils::numeric(FLERR,ptr,false,lmp); ++nmorse; @@ -297,12 +297,12 @@ void PairList::settings(int narg, char **arg) ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); - par.parm.lj126.epsilon = force->numeric(FLERR,ptr); + par.parm.lj126.epsilon = utils::numeric(FLERR,ptr,false,lmp); ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); - par.parm.lj126.sigma = force->numeric(FLERR,ptr); + par.parm.lj126.sigma = utils::numeric(FLERR,ptr,false,lmp); ++nlj126; @@ -313,7 +313,7 @@ void PairList::settings(int narg, char **arg) // optional cutoff parameter. if not specified use global value ptr = strtok(NULL," \t\n\r\f"); if ((ptr != NULL) && (*ptr != '#')) { - double cut = force->numeric(FLERR,ptr); + double cut = utils::numeric(FLERR,ptr,false,lmp); par.cutsq = cut*cut; } else { par.cutsq = cut_global*cut_global; diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 033d1c3ccd..20081fa1e1 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -626,9 +626,9 @@ void PairLJExpandCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -654,12 +654,12 @@ void PairLJExpandCoulLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double shift_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double shift_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index d1d8221bcc..22f20a690e 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -186,8 +186,8 @@ void PairLJMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -219,14 +219,14 @@ void PairLJMDF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index 570c8f4eab..6a92602683 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -333,9 +333,9 @@ void PairLJSFDipoleSF::settings(int narg, char **arg) if (strcmp(update->unit_style,"electron") == 0) error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -364,8 +364,8 @@ void PairLJSFDipoleSF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; @@ -373,16 +373,16 @@ void PairLJSFDipoleSF::coeff(int narg, char **arg) int iarg = 4; if ((narg > iarg) && (strcmp(arg[iarg],"scale") != 0)) { - cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[iarg]); + cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[iarg],false,lmp); ++iarg; } if ((narg > iarg) && (strcmp(arg[iarg],"scale") != 0)) { - cut_coul_one = force->numeric(FLERR,arg[iarg]); + cut_coul_one = utils::numeric(FLERR,arg[iarg],false,lmp); ++iarg; } if (narg > iarg) { if (strcmp(arg[iarg],"scale") == 0) { - scale_one = force->numeric(FLERR,arg[iarg+1]); + scale_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Incorrect args for pair coefficients"); } diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index e98832c6d7..534f4acff5 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -189,9 +189,9 @@ void PairMomb::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - sscale = force->numeric(FLERR,arg[1]); - dscale = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + sscale = utils::numeric(FLERR,arg[1],false,lmp); + dscale = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -218,14 +218,14 @@ void PairMomb::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double c_one = force->numeric(FLERR,arg[5]); - double rr_one = force->numeric(FLERR,arg[6]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double rr_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 64549114a9..399723e0c5 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -162,7 +162,7 @@ void PairMorseSmoothLinear::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -187,12 +187,12 @@ void PairMorseSmoothLinear::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 3a53334b31..9926318597 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -362,12 +362,12 @@ void PairSRP::settings(int narg, char **arg) if (atom->tag_enable == 0) error->all(FLERR,"Pair_style srp requires atom IDs"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // wildcard if (strcmp(arg[1],"*") == 0) { btype = 0; } else { - btype = force->inumeric(FLERR,arg[1]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); if ((btype > atom->nbondtypes) || (btype <= 0)) error->all(FLERR,"Illegal pair_style command"); } @@ -401,7 +401,7 @@ void PairSRP::settings(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"bptype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair srp command"); - bptype = force->inumeric(FLERR,arg[iarg+1]); + bptype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if ((bptype < 1) || (bptype > atom->ntypes)) error->all(FLERR,"Illegal bond particle type for srp"); iarg += 2; @@ -432,9 +432,9 @@ void PairSRP::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0], 1, bptype, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, bptype, jlo, jhi, error); - double a0_one = force->numeric(FLERR,arg[2]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index 866f923fb9..8d7a4ee2c9 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -67,9 +67,9 @@ void TemperGrem::command(int narg, char **arg) if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double lambda = force->numeric(FLERR,arg[2]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double lambda = utils::numeric(FLERR,arg[2],false,lmp); // ignore temper command, if walltime limit was already reached if (timer->is_timeout()) return; @@ -106,11 +106,11 @@ void TemperGrem::command(int narg, char **arg) pressref = p_start[0]; } - seed_swap = force->inumeric(FLERR,arg[5]); - seed_boltz = force->inumeric(FLERR,arg[6]); + seed_swap = utils::inumeric(FLERR,arg[5],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[6],false,lmp); my_set_lambda = universe->iworld; - if (narg == 8) my_set_lambda = force->inumeric(FLERR,arg[7]); + if (narg == 8) my_set_lambda = utils::inumeric(FLERR,arg[7],false,lmp); if ((my_set_lambda < 0) || (my_set_lambda >= universe->nworlds)) error->universe_one(FLERR,"Illegal temperature index"); diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index d0a14d8e4d..e4cab277c1 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -69,10 +69,10 @@ void TemperNPT::command(int narg, char **arg) if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper/npt command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double temp = force->numeric(FLERR,arg[2]); - double press_set = force->numeric(FLERR,arg[6]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double temp = utils::numeric(FLERR,arg[2],false,lmp); + double press_set = utils::numeric(FLERR,arg[6],false,lmp); // ignore temper command, if walltime limit was already reached @@ -83,11 +83,11 @@ void TemperNPT::command(int narg, char **arg) if (whichfix == modify->nfix) error->universe_all(FLERR,"Tempering fix ID is not defined"); - seed_swap = force->inumeric(FLERR,arg[4]); - seed_boltz = force->inumeric(FLERR,arg[5]); + seed_swap = utils::inumeric(FLERR,arg[4],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[5],false,lmp); my_set_temp = universe->iworld; - if (narg == 8) my_set_temp = force->inumeric(FLERR,arg[6]); + if (narg == 8) my_set_temp = utils::inumeric(FLERR,arg[6],false,lmp); // swap frequency must evenly divide total # of timesteps diff --git a/src/USER-MOFFF/angle_class2_p6.cpp b/src/USER-MOFFF/angle_class2_p6.cpp index 5a913af379..aa56ababe1 100644 --- a/src/USER-MOFFF/angle_class2_p6.cpp +++ b/src/USER-MOFFF/angle_class2_p6.cpp @@ -287,9 +287,9 @@ void AngleClass2P6::coeff(int narg, char **arg) if (strcmp(arg[1],"bb") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double bb_k_one = force->numeric(FLERR,arg[2]); - double bb_r1_one = force->numeric(FLERR,arg[3]); - double bb_r2_one = force->numeric(FLERR,arg[4]); + double bb_k_one = utils::numeric(FLERR,arg[2],false,lmp); + double bb_r1_one = utils::numeric(FLERR,arg[3],false,lmp); + double bb_r2_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb_k[i] = bb_k_one; @@ -302,10 +302,10 @@ void AngleClass2P6::coeff(int narg, char **arg) } else if (strcmp(arg[1],"ba") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients"); - double ba_k1_one = force->numeric(FLERR,arg[2]); - double ba_k2_one = force->numeric(FLERR,arg[3]); - double ba_r1_one = force->numeric(FLERR,arg[4]); - double ba_r2_one = force->numeric(FLERR,arg[5]); + double ba_k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double ba_k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double ba_r1_one = utils::numeric(FLERR,arg[4],false,lmp); + double ba_r2_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { ba_k1[i] = ba_k1_one; @@ -319,12 +319,12 @@ void AngleClass2P6::coeff(int narg, char **arg) } else { if (narg != 7) error->all(FLERR,"Incorrect args for angle coefficients"); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); - double k5_one = force->numeric(FLERR,arg[5]); - double k6_one = force->numeric(FLERR,arg[6]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); + double k5_one = utils::numeric(FLERR,arg[5],false,lmp); + double k6_one = utils::numeric(FLERR,arg[6],false,lmp); // convert theta0 from degrees to radians diff --git a/src/USER-MOFFF/angle_cosine_buck6d.cpp b/src/USER-MOFFF/angle_cosine_buck6d.cpp index 838aa1ad70..0f49882e83 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.cpp +++ b/src/USER-MOFFF/angle_cosine_buck6d.cpp @@ -253,9 +253,9 @@ void AngleCosineBuck6d::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double c_one = force->numeric(FLERR,arg[1]); - int n_one = force->inumeric(FLERR,arg[2]); - int th0_one = force->numeric(FLERR,arg[3]); + double c_one = utils::numeric(FLERR,arg[1],false,lmp); + int n_one = utils::inumeric(FLERR,arg[2],false,lmp); + int th0_one = utils::numeric(FLERR,arg[3],false,lmp); if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients"); diff --git a/src/USER-MOFFF/improper_inversion_harmonic.cpp b/src/USER-MOFFF/improper_inversion_harmonic.cpp index ac2e06d364..0ecc60ecc1 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.cpp +++ b/src/USER-MOFFF/improper_inversion_harmonic.cpp @@ -278,8 +278,8 @@ void ImproperInversionHarmonic::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double w_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double w_one = utils::numeric(FLERR,arg[2],false,lmp); // convert w0 from degrees to radians diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp index 8ad6b55598..28fc955448 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp @@ -247,11 +247,11 @@ void PairBuck6dCoulGaussDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - vdwl_smooth = force->numeric(FLERR,arg[0]); + vdwl_smooth = utils::numeric(FLERR,arg[0],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[1]); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -278,14 +278,14 @@ void PairBuck6dCoulGaussDSF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double buck6d1_one = force->numeric(FLERR,arg[2]); - double buck6d2_one = force->numeric(FLERR,arg[3]); - double buck6d3_one = force->numeric(FLERR,arg[4]); - double buck6d4_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double buck6d1_one = utils::numeric(FLERR,arg[2],false,lmp); + double buck6d2_one = utils::numeric(FLERR,arg[3],false,lmp); + double buck6d3_one = utils::numeric(FLERR,arg[4],false,lmp); + double buck6d4_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp index 848cafd882..20bf7fa049 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp @@ -262,12 +262,12 @@ void PairBuck6dCoulGaussLong::settings(int narg, char **arg) { if (narg < 3 || narg > 4) error->all(FLERR,"Illegal pair_style command"); - vdwl_smooth = force->numeric(FLERR,arg[0]); - coul_smooth = force->numeric(FLERR,arg[1]); + vdwl_smooth = utils::numeric(FLERR,arg[0],false,lmp); + coul_smooth = utils::numeric(FLERR,arg[1],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[2]); + cut_lj_global = utils::numeric(FLERR,arg[2],false,lmp); if (narg == 3) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[3]); + else cut_coul = utils::numeric(FLERR,arg[3],false,lmp); // reset cutoffs that have been explicitly set @@ -294,14 +294,14 @@ void PairBuck6dCoulGaussLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double buck6d1_one = force->numeric(FLERR,arg[2]); - double buck6d2_one = force->numeric(FLERR,arg[3]); - double buck6d3_one = force->numeric(FLERR,arg[4]); - double buck6d4_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double buck6d1_one = utils::numeric(FLERR,arg[2],false,lmp); + double buck6d2_one = utils::numeric(FLERR,arg[3],false,lmp); + double buck6d3_one = utils::numeric(FLERR,arg[4],false,lmp); + double buck6d4_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index f297ef45eb..bb85dfb784 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -990,7 +990,7 @@ int DumpNetCDF::modify_param(int narg, char **arg) iarg++; if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword."); - framei = force->inumeric(FLERR,arg[iarg]); + framei = utils::inumeric(FLERR,arg[iarg],false,lmp); if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword."); else if (framei < 0) framei--; iarg++; diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 026a6eaa3a..8747bbea25 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -1003,7 +1003,7 @@ int DumpNetCDFMPIIO::modify_param(int narg, char **arg) iarg++; if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword."); - framei = force->inumeric(FLERR,arg[iarg]); + framei = utils::inumeric(FLERR,arg[iarg],false,lmp); if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword."); else if (framei < 0) framei--; iarg++; diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 51e65d24ed..47757c4ec3 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -75,7 +75,7 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) #pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(nthreads) nthreads = omp_get_num_threads(); else - nthreads = force->inumeric(FLERR,arg[3]); + nthreads = utils::inumeric(FLERR,arg[3],false,lmp); #endif } diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index 95f9cdb3e8..524850eb63 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -62,7 +62,7 @@ void MSMCGOMP::settings(int narg, char **arg) MSMOMP::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,Pointers::lmp)); else smallq = SMALLQ; } diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index d03a8d3ab0..adfcf6adb5 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -117,7 +117,7 @@ void DynamicalMatrix::command(int narg, char **arg) if (strcmp(arg[1],"regular") == 0) style = REGULAR; else if (strcmp(arg[1],"eskm") == 0) style = ESKM; else error->all(FLERR,"Illegal Dynamical Matrix command"); - del = force->numeric(FLERR, arg[2]); + del = utils::numeric(FLERR, arg[2],false,lmp); // set option defaults diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 9b663ce383..17325b062a 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -68,13 +68,13 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (narg < 8) error->all(FLERR,"Illegal fix phonon command: number of arguments < 8"); - nevery = force->inumeric(FLERR, arg[3]); // Calculate this fix every n steps! + nevery = utils::inumeric(FLERR, arg[3],false,lmp); // Calculate this fix every n steps! if (nevery < 1) error->all(FLERR,"Illegal fix phonon command"); - nfreq = force->inumeric(FLERR, arg[4]); // frequency to output result + nfreq = utils::inumeric(FLERR, arg[4],false,lmp); // frequency to output result if (nfreq < 1) error->all(FLERR,"Illegal fix phonon command"); - waitsteps = force->bnumeric(FLERR,arg[5]); // Wait this many timesteps before actually measuring + waitsteps = utils::bnumeric(FLERR,arg[5],false,lmp); // Wait this many timesteps before actually measuring if (waitsteps < 0) error->all(FLERR,"Illegal fix phonon command: waitsteps < 0 !"); int n = strlen(arg[6]) + 1; // map file @@ -95,12 +95,12 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) while (iarg < narg){ if (strcmp(arg[iarg],"sysdim") == 0){ if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options."); - sdim = force->inumeric(FLERR, arg[iarg]); + sdim = utils::inumeric(FLERR, arg[iarg],false,lmp); if (sdim < 1) error->all(FLERR,"Illegal fix phonon command: sysdim should not be less than 1."); } else if (strcmp(arg[iarg],"nasr") == 0){ if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options."); - nasr = force->inumeric(FLERR, arg[iarg]); + nasr = utils::inumeric(FLERR, arg[iarg],false,lmp); } else { error->all(FLERR,"Illegal fix phonon command: unknown option read!"); @@ -570,10 +570,10 @@ void FixPhonon::readmap() if (fgets(line,MAXLINE,fp) == NULL) error->all(FLERR,"Error while reading header of mapping file!"); - nx = force->inumeric(FLERR, strtok(line, " \n\t\r\f")); - ny = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - nz = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - nucell = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); + nx = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); + ny = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + nz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + nucell = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); ntotal = nx*ny*nz; if (ntotal*nucell != ngroup) error->all(FLERR,"FFT mesh and number of atoms in group mismatch!"); @@ -586,11 +586,11 @@ void FixPhonon::readmap() // the remaining lines carry the mapping info for (int i = 0; i < ngroup; ++i){ if (fgets(line,MAXLINE,fp) == NULL) {info = 1; break;} - ix = force->inumeric(FLERR, strtok(line, " \n\t\r\f")); - iy = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - iz = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - iu = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - itag = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); + ix = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); + iy = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + iz = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + iu = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); + itag = utils::inumeric(FLERR, strtok(NULL, " \n\t\r\f"),false,lmp); // check if index is in correct range if (ix < 0 || ix >= nx || iy < 0 || iy >= ny || diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 7764287337..6e09710833 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -132,7 +132,7 @@ void ThirdOrder::command(int narg, char **arg) if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK else if (style == BALLISTICO) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - del = force->numeric(FLERR, arg[2]); + del = utils::numeric(FLERR, arg[2],false,lmp); if (atom->map_style == 0) error->all(FLERR,"third_order command requires an atom map, see atom_modify"); diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index df6a01e6c6..309dd75c19 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -115,7 +115,7 @@ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) ptr++; } - double threshold = force->numeric(FLERR, arg[4]); + double threshold = utils::numeric(FLERR, arg[4],false,lmp); if (threshold < 0.0) error->all(FLERR, "Illegal compute ptm/atom command (threshold is negative)"); diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index d58c917308..b590e1ae9a 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -100,70 +100,70 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - qmass = force->numeric(FLERR,arg[iarg+1]); + qmass = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (qmass < 0.0) error->all(FLERR,"Fix qbmsst qmass must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"mu") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - mu = force->numeric(FLERR,arg[iarg+1]); + mu = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (mu < 0.0) error->all(FLERR,"Fix qbmsst mu must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"p0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - p0 = force->numeric(FLERR,arg[iarg+1]); + p0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (p0 < 0.0) error->all(FLERR,"Fix qbmsst p0 must be >= 0.0"); p0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"v0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - v0 = force->numeric(FLERR,arg[iarg+1]); + v0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (v0 < 0.0) error->all(FLERR,"Fix qbmsst v0 must be >= 0.0"); v0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"e0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - e0 = force->numeric(FLERR,arg[iarg+1]); + e0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); e0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"tscale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - tscale = force->numeric(FLERR,arg[iarg+1]); + tscale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (tscale < 0.0 || tscale > 1.0) error->all(FLERR,"Fix qbmsst tscale must satisfy 0 <= tscale < 1"); iarg += 2; } else if (strcmp(arg[iarg],"damp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - t_period = force->numeric(FLERR,arg[iarg+1]); + t_period = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix qbmsst damp must be > 0.0"); fric_coef = 1/t_period; iarg += 2; } else if (strcmp(arg[iarg],"seed") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - seed = force->inumeric(FLERR,arg[iarg+1]); + seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (seed <= 0) error->all(FLERR,"Fix qbmsst seed must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"f_max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - f_max = force->numeric(FLERR,arg[iarg+1]); + f_max = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (f_max <= 0) error->all(FLERR,"Fix qbmsst f_max must be > 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"N_f") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - N_f = force->inumeric(FLERR,arg[iarg+1]); + N_f = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (N_f <= 0) error->all(FLERR,"Fix qbmsst N_f must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"eta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - eta = force->numeric(FLERR,arg[iarg+1]); + eta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (eta <= 0) error->all(FLERR,"Fix qbmsst eta must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"beta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - beta = force->inumeric(FLERR,arg[iarg+1]); + beta = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (beta <= 0) error->all(FLERR,"Fix qbmsst beta must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"T_init") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - t_init = force->numeric(FLERR,arg[iarg+1]); + t_init = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_init <= 0) error->all(FLERR,"Fix qbmsst T_init must be >= 0.0"); iarg += 2; } else error->all(FLERR,"Illegal fix qbmsst command"); diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index a29dbc70a1..80c0efddab 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -64,28 +64,28 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - t_target = force->numeric(FLERR,arg[iarg+1]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_target < 0.0) error->all(FLERR,"Fix qtb temp must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"damp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - t_period = force->numeric(FLERR,arg[iarg+1]); + t_period = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix qtb damp must be > 0.0"); fric_coef = 1/t_period; iarg += 2; } else if (strcmp(arg[iarg],"seed") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - seed = force->inumeric(FLERR,arg[iarg+1]); + seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else if (strcmp(arg[iarg],"f_max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - f_max = force->numeric(FLERR,arg[iarg+1]); + f_max = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (f_max <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else if (strcmp(arg[iarg],"N_f") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - N_f = force->inumeric(FLERR,arg[iarg+1]); + N_f = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (N_f <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else error->all(FLERR,"Illegal fix qtb command"); diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 7c762208b7..64c56cb0e6 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -275,7 +275,7 @@ void PairQUIP::coeff(int narg, char **arg) if (strcmp(arg[i],"NULL") == 0) map[i-3] = -1; else - map[i-3] = force->inumeric(FLERR,arg[i]); + map[i-3] = utils::inumeric(FLERR,arg[i],false,lmp); } // clear setflag since coeff() called once with I,J = * * diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 0b0e41581d..4a34dd50cb 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -263,7 +263,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[NEVERY][rxn] = 1; delete [] str; } else { - nevery[rxn] = force->inumeric(FLERR,arg[iarg]); + nevery[rxn] = utils::inumeric(FLERR,arg[iarg],false,lmp); if (nevery[rxn] <= 0) error->all(FLERR,"Illegal fix bond/react command: " "'Nevery' must be a positive integer"); } @@ -283,7 +283,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[RMIN][rxn] = 1; delete [] str; } else { - double cutoff = force->numeric(FLERR,arg[iarg]); + double cutoff = utils::numeric(FLERR,arg[iarg],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command: " "'Rmin' cannot be negative"); cutsq[rxn][0] = cutoff*cutoff; @@ -304,7 +304,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[RMAX][rxn] = 1; delete [] str; } else { - double cutoff = force->numeric(FLERR,arg[iarg]); + double cutoff = utils::numeric(FLERR,arg[iarg],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command:" "'Rmax' cannot be negative"); cutsq[rxn][1] = cutoff*cutoff; @@ -342,9 +342,9 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : delete [] str; } else { // otherwise probability should be a number - fraction[rxn] = force->numeric(FLERR,arg[iarg+1]); + fraction[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } - seed[rxn] = force->inumeric(FLERR,arg[iarg+2]); + seed[rxn] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction[rxn] < 0.0 || fraction[rxn] > 1.0) error->all(FLERR,"Illegal fix bond/react command: " "probability fraction must between 0 and 1, inclusive"); @@ -354,7 +354,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"max_rxn") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'max_rxn' has too few arguments"); - max_rxn[rxn] = force->inumeric(FLERR,arg[iarg+1]); + max_rxn[rxn] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " "'max_rxn' cannot be negative"); iarg += 2; @@ -363,7 +363,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "used without stabilization keyword"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'stabilize_steps' has too few arguments"); - limit_duration[rxn] = force->numeric(FLERR,arg[iarg+1]); + limit_duration[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); stabilize_steps_flag[rxn] = 1; iarg += 2; } else if (strcmp(arg[iarg],"update_edges") == 0) { diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index b9cff75d65..433fd82bcd 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -66,12 +66,12 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reax command"); - swa = force->numeric(FLERR,arg[4]); - swb = force->numeric(FLERR,arg[5]); - tolerance = force->numeric(FLERR,arg[6]); + swa = utils::numeric(FLERR,arg[4],false,lmp); + swb = utils::numeric(FLERR,arg[5],false,lmp); + tolerance = utils::numeric(FLERR,arg[6],false,lmp); int len = strlen(arg[7]) + 1; pertype_option = new char[len]; strcpy(pertype_option,arg[7]); diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index f7ad7ed6d4..5c57fed261 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -44,7 +44,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : ntypes = atom->ntypes; nmax = atom->nmax; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0 ) error->all(FLERR,"Illegal fix reax/c/bonds command"); diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index c89ac5ba77..0262ffc14d 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -274,20 +274,20 @@ void PairReaxC::settings(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"safezone") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->safezone = force->numeric(FLERR,arg[iarg+1]); + system->safezone = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (system->safezone < 0.0) error->all(FLERR,"Illegal pair_style reax/c safezone command"); system->saferzone = system->safezone*1.2 + 0.2; iarg += 2; } else if (strcmp(arg[iarg],"mincap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->mincap = force->inumeric(FLERR,arg[iarg+1]); + system->mincap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (system->mincap < 0) error->all(FLERR,"Illegal pair_style reax/c mincap command"); iarg += 2; } else if (strcmp(arg[iarg],"minhbonds") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->minhbonds = force->inumeric(FLERR,arg[iarg+1]); + system->minhbonds = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (system->minhbonds < 0) error->all(FLERR,"Illegal pair_style reax/c minhbonds command"); iarg += 2; diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index 497442fbe8..c49f99a5a0 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -57,7 +57,7 @@ void Scafacos::settings(int narg, char **arg) int n = strlen(arg[0]) + 1; method = new char[n]; strcpy(method,arg[0]); - tolerance = force->numeric(FLERR,arg[1]); + tolerance = utils::numeric(FLERR,arg[1],false,lmp); // optional ScaFaCoS library setting defaults // choose the correct default tolerance type for chosen method diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 6db2aaa478..c39d142a6e 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -74,17 +74,17 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) vxflag = 0; else { vxflag = 1; - vx = force->numeric(FLERR,arg[4]); + vx = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) vyflag = 0; else { vyflag = 1; - vy = force->numeric(FLERR,arg[5]); + vy = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) vzflag = 0; else { vzflag = 1; - vz = force->numeric(FLERR,arg[6]); + vz = utils::numeric(FLERR,arg[6],false,lmp); } } else if (strcmp(arg[3],"wiggle") == 0) { @@ -94,32 +94,32 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) axflag = 0; else { axflag = 1; - ax = force->numeric(FLERR,arg[4]); + ax = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) ayflag = 0; else { ayflag = 1; - ay = force->numeric(FLERR,arg[5]); + ay = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) azflag = 0; else { azflag = 1; - az = force->numeric(FLERR,arg[6]); + az = utils::numeric(FLERR,arg[6],false,lmp); } - period = force->numeric(FLERR,arg[7]); + period = utils::numeric(FLERR,arg[7],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix meso/move command"); } else if (strcmp(arg[3],"rotate") == 0) { if (narg < 11) error->all(FLERR,"Illegal fix meso/move command"); iarg = 11; mstyle = ROTATE; - point[0] = force->numeric(FLERR,arg[4]); - point[1] = force->numeric(FLERR,arg[5]); - point[2] = force->numeric(FLERR,arg[6]); - axis[0] = force->numeric(FLERR,arg[7]); - axis[1] = force->numeric(FLERR,arg[8]); - axis[2] = force->numeric(FLERR,arg[9]); - period = force->numeric(FLERR,arg[10]); + point[0] = utils::numeric(FLERR,arg[4],false,lmp); + point[1] = utils::numeric(FLERR,arg[5],false,lmp); + point[2] = utils::numeric(FLERR,arg[6],false,lmp); + axis[0] = utils::numeric(FLERR,arg[7],false,lmp); + axis[1] = utils::numeric(FLERR,arg[8],false,lmp); + axis[2] = utils::numeric(FLERR,arg[9],false,lmp); + period = utils::numeric(FLERR,arg[10],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix meso/move command"); } else if (strcmp(arg[3],"variable") == 0) { diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp index befcdb8d34..b215e8d278 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp @@ -243,15 +243,15 @@ void PairSDPDTaitwaterIsothermal::settings (int narg, char **arg) { error->all (FLERR, "Illegal number of arguments for " "pair_style sdpd/taitwater/isothermal"); - temperature = force->numeric (FLERR, arg[0]); - viscosity = force->numeric (FLERR, arg[1]); + temperature = utils::numeric(FLERR, arg[0], false, lmp); + viscosity = utils::numeric(FLERR, arg[1], false, lmp); if (temperature <= 0) error->all (FLERR, "Temperature must be positive"); if (viscosity <= 0) error->all (FLERR, "Viscosity must be positive"); // seed is immune to underflow/overflow because it is unsigned seed = comm->nprocs + comm->me + atom->nlocal; - if (narg == 3) seed += force->inumeric (FLERR, arg[2]); + if (narg == 3) seed += utils::inumeric(FLERR, arg[2], false, lmp); #ifdef USE_ZEST generator.seed (seed); #else @@ -274,9 +274,9 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) { utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric (FLERR,arg[2]); - double soundspeed_one = force->numeric (FLERR,arg[3]); - double cut_one = force->numeric (FLERR,arg[4]); + double rho0_one = utils::numeric(FLERR,arg[2], false, lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3], false, lmp); + double cut_one = utils::numeric(FLERR,arg[4], false, lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; if (rho0_one <= 0) error->all (FLERR, "Density must be positive"); diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index ed039d39d4..7d5e89f895 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -74,7 +74,7 @@ FixSMDIntegrateTlsph::FixSMDIntegrateTlsph(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "expected number following limit_velocity"); } - vlimit = force->numeric(FLERR, arg[iarg]); + vlimit = utils::numeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will limit velocities to <= %g\n", vlimit); } diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 4978416e66..215759331e 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -77,21 +77,21 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - adjust_radius_factor = force->numeric(FLERR, arg[iarg]); + adjust_radius_factor = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - min_nn = force->inumeric(FLERR, arg[iarg]); + min_nn = utils::inumeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - max_nn = force->inumeric(FLERR, arg[iarg]); + max_nn = utils::inumeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will adjust smoothing length dynamically with factor %g to achieve %d to %d neighbors per particle.\n ", @@ -103,7 +103,7 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected number following limit_velocity"); } - vlimit = force->numeric(FLERR, arg[iarg]); + vlimit = utils::numeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will limit velocities to <= %g\n", vlimit); diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp index cbaad9ac4c..2aa6f980ed 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp @@ -77,19 +77,19 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vx = force->numeric(FLERR, arg[iarg]); + vx = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vy = force->numeric(FLERR, arg[iarg]); + vy = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vz = force->numeric(FLERR, arg[iarg]); + vz = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*WIGGLE") == 0) { wiggleFlag = true; @@ -101,25 +101,25 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vx = force->numeric(FLERR, arg[iarg]); + vx = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vy = force->numeric(FLERR, arg[iarg]); + vy = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vz = force->numeric(FLERR, arg[iarg]); + vz = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - wiggle_max_travel = force->numeric(FLERR, arg[iarg]); + wiggle_max_travel = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*ROTATE") == 0) { rotateFlag = true; @@ -128,43 +128,43 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(0) = force->numeric(FLERR, arg[iarg]); + origin(0) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(1) = force->numeric(FLERR, arg[iarg]); + origin(1) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(2) = force->numeric(FLERR, arg[iarg]); + origin(2) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(0) = force->numeric(FLERR, arg[iarg]); + rotation_axis(0) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(1) = force->numeric(FLERR, arg[iarg]); + rotation_axis(1) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(2) = force->numeric(FLERR, arg[iarg]); + rotation_axis(2) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_period = force->numeric(FLERR, arg[iarg]); + rotation_period = utils::numeric(FLERR, arg[iarg],false,lmp); /* * construct rotation matrix diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index 2964ded544..895e5b1a25 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -66,7 +66,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3], "NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR, arg[3]); + xvalue = utils::numeric(FLERR, arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4], "v_") == arg[4]) { @@ -76,7 +76,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4], "NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR, arg[4]); + yvalue = utils::numeric(FLERR, arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5], "v_") == arg[5]) { @@ -86,7 +86,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5], "NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR, arg[5]); + zvalue = utils::numeric(FLERR, arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 9183bcd9ea..ba3a324d56 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -51,8 +51,8 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal number of arguments for fix smd/wall_surface"); filename = strdup(arg[3]); - wall_particle_type = force->inumeric(FLERR, arg[4]); - wall_molecule_id = force->inumeric(FLERR, arg[5]); + wall_particle_type = utils::inumeric(FLERR,arg[4],false,lmp); + wall_molecule_id = utils::inumeric(FLERR,arg[5],false,lmp); if (wall_molecule_id < 65535) { error->one(FLERR, "wall molcule id must be >= 65535\n"); } @@ -310,7 +310,9 @@ void FixSMDWallSurface::read_triangles(int pass) { error->all(FLERR, "Incorrect atom format in data file"); } - normal << force->numeric(FLERR, values[2]), force->numeric(FLERR, values[3]), force->numeric(FLERR, values[4]); + normal << utils::numeric(FLERR, values[2], false, lmp), + utils::numeric(FLERR, values[3], false, lmp), + utils::numeric(FLERR, values[4], false, lmp); //cout << "normal is " << normal << endl; delete[] values; @@ -349,7 +351,9 @@ void FixSMDWallSurface::read_triangles(int pass) { error->all(FLERR, "Incorrect vertex line"); } - vert[k] << force->numeric(FLERR, values[1]), force->numeric(FLERR, values[2]), force->numeric(FLERR, values[3]); + vert[k] << utils::numeric(FLERR, values[1], false, lmp), + utils::numeric(FLERR, values[2], false, lmp), + utils::numeric(FLERR, values[3], false, lmp); //cout << "vertex is " << vert[k] << endl; //printf("%s %s %s\n", values[1], values[2], values[3]); delete[] values; diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index b4af7ca955..67fda5f18d 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -240,7 +240,7 @@ void PairHertz::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of args for pair_style hertz"); - scale = force->numeric(FLERR, arg[0]); + scale = utils::numeric(FLERR, arg[0],false,lmp); if (comm->me == 0) { printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); printf("SMD/HERTZ CONTACT SETTINGS:\n"); diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index c932086a32..1ba4b37520 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -935,7 +935,7 @@ void PairTlsph::settings(int narg, char **arg) { } update_method = UPDATE_CONSTANT_THRESHOLD; - update_threshold = force->numeric(FLERR, arg[iarg]); + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { iarg++; @@ -944,7 +944,7 @@ void PairTlsph::settings(int narg, char **arg) { } update_method = UPDATE_PAIRWISE_RATIO; - update_threshold = force->numeric(FLERR, arg[iarg]); + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); } else { char msg[128]; @@ -1002,11 +1002,11 @@ void PairTlsph::coeff(int narg, char **arg) { /* * check that TLSPH parameters are given only in i,i form */ - if (force->inumeric(FLERR, arg[0]) != force->inumeric(FLERR, arg[1])) { + if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) { sprintf(str, "TLSPH coefficients can only be specified between particles of same type!"); error->all(FLERR, str); } - itype = force->inumeric(FLERR, arg[0]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); // set all eos, strength and failure models to inactive by default eos[itype] = EOS_NONE; @@ -1050,13 +1050,13 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[REFERENCE_DENSITY][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[YOUNGS_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[POISSON_RATIO][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[VISCOSITY_Q1][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[VISCOSITY_Q2][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[HEAT_CAPACITY][itype] = force->numeric(FLERR, arg[ioffset + 7]); + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); @@ -1201,8 +1201,8 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[YIELD_STRESS][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[HARDENING_PARAMETER][itype] = force->numeric(FLERR, arg[ioffset + 2]); + Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); if (comm->me == 0) { printf("%60s\n", "Linear elastic / perfectly plastic strength based on strain rate"); @@ -1245,14 +1245,14 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[JC_A][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[JC_B][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[JC_a][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[JC_C][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[JC_epdot0][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[JC_T0][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[JC_Tmelt][itype] = force->numeric(FLERR, arg[ioffset + 7]); - Lookup[JC_M][itype] = force->numeric(FLERR, arg[ioffset + 8]); + Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); if (comm->me == 0) { printf("%60s\n", "Johnson Cook material strength model"); @@ -1370,9 +1370,9 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_SHOCK_C0][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[EOS_SHOCK_S][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[EOS_SHOCK_GAMMA][itype] = force->numeric(FLERR, arg[ioffset + 3]); + Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "shock EOS based on strain rate"); printf("%60s : %g\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); @@ -1411,13 +1411,13 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_POLYNOMIAL_C0][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[EOS_POLYNOMIAL_C1][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[EOS_POLYNOMIAL_C2][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[EOS_POLYNOMIAL_C3][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[EOS_POLYNOMIAL_C4][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[EOS_POLYNOMIAL_C5][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[EOS_POLYNOMIAL_C6][itype] = force->numeric(FLERR, arg[ioffset + 7]); + Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "polynomial EOS based on strain rate"); printf("%60s : %g\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); @@ -1462,7 +1462,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_plastic_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum plastic strain failure criterion"); @@ -1506,7 +1506,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_pairwise_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum pairwise strain failure criterion"); @@ -1546,7 +1546,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_principal_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum principal strain failure criterion"); @@ -1583,11 +1583,11 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_johnson_cook = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_JC_D1][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[FAILURE_JC_D2][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[FAILURE_JC_D3][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[FAILURE_JC_D4][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[FAILURE_JC_EPDOT0][itype] = force->numeric(FLERR, arg[ioffset + 5]); + Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "Johnson-Cook failure criterion"); @@ -1631,7 +1631,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_principal_stress = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum principal stress failure criterion"); @@ -1666,7 +1666,7 @@ void PairTlsph::coeff(int narg, char **arg) { } failureModel[itype].failure_energy_release_rate = true; - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "critical energy release rate failure criterion"); diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index b09fd38d09..9243883719 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -322,7 +322,7 @@ void PairTriSurf::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of args for pair_style smd/tri_surface"); - scale = force->numeric(FLERR, arg[0]); + scale = utils::numeric(FLERR, arg[0],false,lmp); if (comm->me == 0) { printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); printf("SMD/TRI_SURFACE CONTACT SETTINGS:\n"); diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index 8c8da7b2bc..ecd0d5f4ec 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -949,9 +949,9 @@ void PairULSPH::coeff(int narg, char **arg) { * if parameters are give in i,i form, i.e., no a cross interaction, set material parameters */ - if (force->inumeric(FLERR, arg[0]) == force->inumeric(FLERR, arg[1])) { + if (utils::inumeric(FLERR, arg[0], false, lmp) == utils::inumeric(FLERR, arg[1], false, lmp)) { - itype = force->inumeric(FLERR, arg[0]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); eos[itype] = viscosity[itype] = strength[itype] = NONE; if (comm->me == 0) { @@ -992,11 +992,11 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[REFERENCE_DENSITY][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[REFERENCE_SOUNDSPEED][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Q1[itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[HEAT_CAPACITY][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = force->numeric(FLERR, arg[ioffset + 5]); + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[REFERENCE_SOUNDSPEED][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Q1[itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); Lookup[BULK_MODULUS][itype] = Lookup[REFERENCE_SOUNDSPEED][itype] * Lookup[REFERENCE_SOUNDSPEED][itype] * Lookup[REFERENCE_DENSITY][itype]; @@ -1057,7 +1057,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_TAIT_EXPONENT][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[EOS_TAIT_EXPONENT][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Tait EOS"); @@ -1094,7 +1094,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_PERFECT_GAS_GAMMA][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[EOS_PERFECT_GAS_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Perfect Gas EOS"); @@ -1168,9 +1168,9 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[SHEAR_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[YIELD_STRENGTH][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[HARDENING_PARAMETER][itype] = force->numeric(FLERR, arg[ioffset + 3]); + Lookup[SHEAR_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YIELD_STRENGTH][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); if (comm->me == 0) { printf(FORMAT2, "linear elastic / ideal plastic material mode"); @@ -1210,7 +1210,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[SHEAR_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[SHEAR_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "linear elastic strength model"); @@ -1248,7 +1248,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[VISCOSITY_MU][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[VISCOSITY_MU][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Newton viscosity model"); @@ -1282,7 +1282,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - artificial_pressure[itype][itype] = force->numeric(FLERR, arg[ioffset + 1]); + artificial_pressure[itype][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Artificial Pressure is enabled."); @@ -1316,7 +1316,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - artificial_stress[itype][itype] = force->numeric(FLERR, arg[ioffset + 1]); + artificial_stress[itype][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Artificial Stress is enabled."); @@ -1358,8 +1358,8 @@ void PairULSPH::coeff(int narg, char **arg) { * we are reading a cross-interaction line for particle types i, j */ - itype = force->inumeric(FLERR, arg[0]); - jtype = force->inumeric(FLERR, arg[1]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); + jtype = utils::inumeric(FLERR, arg[1],false,lmp); if (strcmp(arg[2], "*CROSS") != 0) { sprintf(str, "ulsph cross interaction between particle type %d and %d requested, however, *CROSS keyword is missing", diff --git a/src/USER-SPH/pair_sph_heatconduction.cpp b/src/USER-SPH/pair_sph_heatconduction.cpp index 2305bcf240..7bb06c14d9 100644 --- a/src/USER-SPH/pair_sph_heatconduction.cpp +++ b/src/USER-SPH/pair_sph_heatconduction.cpp @@ -171,8 +171,8 @@ void PairSPHHeatConduction::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double alpha_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double alpha_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_idealgas.cpp b/src/USER-SPH/pair_sph_idealgas.cpp index 16d5f173ca..c80e2b4725 100644 --- a/src/USER-SPH/pair_sph_idealgas.cpp +++ b/src/USER-SPH/pair_sph_idealgas.cpp @@ -213,8 +213,8 @@ void PairSPHIdealGas::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double viscosity_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double viscosity_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_lj.cpp b/src/USER-SPH/pair_sph_lj.cpp index c4d62bff38..4004e41574 100644 --- a/src/USER-SPH/pair_sph_lj.cpp +++ b/src/USER-SPH/pair_sph_lj.cpp @@ -221,8 +221,8 @@ void PairSPHLJ::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double viscosity_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double viscosity_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp index 5b68e157fd..c70cc7cd83 100644 --- a/src/USER-SPH/pair_sph_rhosum.cpp +++ b/src/USER-SPH/pair_sph_rhosum.cpp @@ -225,7 +225,7 @@ void PairSPHRhoSum::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of arguments for pair_style sph/rhosum"); - nstep = force->inumeric(FLERR,arg[0]); + nstep = utils::inumeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -242,7 +242,7 @@ void PairSPHRhoSum::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double cut_one = force->numeric(FLERR,arg[2]); + double cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_taitwater.cpp b/src/USER-SPH/pair_sph_taitwater.cpp index d49840ed5b..6455c1e8be 100644 --- a/src/USER-SPH/pair_sph_taitwater.cpp +++ b/src/USER-SPH/pair_sph_taitwater.cpp @@ -243,10 +243,10 @@ void PairSPHTaitwater::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric(FLERR,arg[2]); - double soundspeed_one = force->numeric(FLERR,arg[3]); - double viscosity_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); + double rho0_one = utils::numeric(FLERR,arg[2],false,lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3],false,lmp); + double viscosity_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; int count = 0; diff --git a/src/USER-SPH/pair_sph_taitwater_morris.cpp b/src/USER-SPH/pair_sph_taitwater_morris.cpp index f513cb36a2..7a6188da69 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.cpp +++ b/src/USER-SPH/pair_sph_taitwater_morris.cpp @@ -244,10 +244,10 @@ void PairSPHTaitwaterMorris::coeff(int narg, char **arg) { utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric(FLERR,arg[2]); - double soundspeed_one = force->numeric(FLERR,arg[3]); - double viscosity_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); + double rho0_one = utils::numeric(FLERR,arg[2],false,lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3],false,lmp); + double viscosity_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; int count = 0; diff --git a/src/USER-UEF/fix_nh_uef.cpp b/src/USER-UEF/fix_nh_uef.cpp index 80866bbd56..f910caac59 100644 --- a/src/USER-UEF/fix_nh_uef.cpp +++ b/src/USER-UEF/fix_nh_uef.cpp @@ -82,14 +82,14 @@ FixNHUef::FixNHUef(LAMMPS *lmp, int narg, char **arg) : while (iarg narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); - erate[0] = force->numeric(FLERR,arg[iarg+1]); - erate[1] = force->numeric(FLERR,arg[iarg+2]); + erate[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + erate[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); erate_flag = true; iarg += 3; } else if (strcmp(arg[iarg],"strain")==0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); - strain[0] = force->numeric(FLERR,arg[iarg+1]); - strain[1] = force->numeric(FLERR,arg[iarg+2]); + strain[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + strain[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"ext")==0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 7f1443c654..72ed2640d8 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -2296,7 +2296,7 @@ int DumpVTK::modify_param(int narg, char **arg) // set threshold value - thresh_value[nthresh] = force->numeric(FLERR,arg[3]); + thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); nthresh++; return 4; diff --git a/src/USER-YAFF/angle_cross.cpp b/src/USER-YAFF/angle_cross.cpp index e60563401a..9c925d2365 100644 --- a/src/USER-YAFF/angle_cross.cpp +++ b/src/USER-YAFF/angle_cross.cpp @@ -227,12 +227,12 @@ void AngleCross::coeff(int narg, char **arg) int count = 0; - double kss_one = force->numeric(FLERR,arg[1]); - double kbs0_one = force->numeric(FLERR,arg[2]); - double kbs1_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double r1_one = force->numeric(FLERR,arg[5]); - double theta0_one = force->numeric(FLERR,arg[6]); + double kss_one = utils::numeric(FLERR,arg[1],false,lmp); + double kbs0_one = utils::numeric(FLERR,arg[2],false,lmp); + double kbs1_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double r1_one = utils::numeric(FLERR,arg[5],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[6],false,lmp); for (int i = ilo; i <= ihi; i++) { kss[i] = kss_one; diff --git a/src/USER-YAFF/angle_mm3.cpp b/src/USER-YAFF/angle_mm3.cpp index 0ebb92d933..38a2cea3aa 100644 --- a/src/USER-YAFF/angle_mm3.cpp +++ b/src/USER-YAFF/angle_mm3.cpp @@ -184,8 +184,8 @@ void AngleMM3::coeff(int narg, char **arg) int count = 0; - double k2_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k2_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians diff --git a/src/USER-YAFF/bond_mm3.cpp b/src/USER-YAFF/bond_mm3.cpp index 4009f64448..39f238f1ab 100644 --- a/src/USER-YAFF/bond_mm3.cpp +++ b/src/USER-YAFF/bond_mm3.cpp @@ -137,8 +137,8 @@ void BondMM3::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k2_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k2_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-YAFF/improper_distharm.cpp b/src/USER-YAFF/improper_distharm.cpp index 8486809813..e9b454bdb9 100644 --- a/src/USER-YAFF/improper_distharm.cpp +++ b/src/USER-YAFF/improper_distharm.cpp @@ -221,8 +221,8 @@ void ImproperDistHarm::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians diff --git a/src/USER-YAFF/improper_sqdistharm.cpp b/src/USER-YAFF/improper_sqdistharm.cpp index 9bd07e51e0..af5086917a 100644 --- a/src/USER-YAFF/improper_sqdistharm.cpp +++ b/src/USER-YAFF/improper_sqdistharm.cpp @@ -221,8 +221,8 @@ void ImproperSQDistHarm::coeff(int narg, char **arg) int ilo,ihi; utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index fa0f3f4b05..2cbf01f7b7 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -267,14 +267,14 @@ void PairLJSwitch3CoulGaussLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { cut_coul = cut_lj_global; - truncw = force->numeric(FLERR,arg[1]); + truncw = utils::numeric(FLERR,arg[1],false,lmp); } else { - cut_coul = force->numeric(FLERR,arg[1]); - truncw = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); + truncw = utils::numeric(FLERR,arg[2],false,lmp); } if (truncw>0.0) truncwi = 1.0/truncw; else truncwi = 0.0; @@ -302,12 +302,12 @@ void PairLJSwitch3CoulGaussLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index 7b31aca039..52bcf20b9b 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -269,14 +269,14 @@ void PairMM3Switch3CoulGaussLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { cut_coul = cut_lj_global; - truncw = force->numeric(FLERR,arg[1]); + truncw = utils::numeric(FLERR,arg[1],false,lmp); } else { - cut_coul = force->numeric(FLERR,arg[1]); - truncw = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); + truncw = utils::numeric(FLERR,arg[2],false,lmp); } if (truncw>0.0) truncwi = 1.0/truncw; else truncwi = 0.0; @@ -304,12 +304,12 @@ void PairMM3Switch3CoulGaussLong::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index c9b0617f5e..bda4299a68 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -100,15 +100,15 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg], "edge_histo") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - maxedge = force->inumeric(FLERR,arg[iarg+1]); + maxedge = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "face_threshold") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - fthresh = force->numeric(FLERR,arg[iarg+1]); + fthresh = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "edge_threshold") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - ethresh = force->numeric(FLERR,arg[iarg+1]); + ethresh = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "neighbors") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index 90359fbb53..eb9cbf1ea2 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -91,7 +91,7 @@ void AngleZero::coeff(int narg, char **arg) double theta0_one = 0.0; if (coeffflag && (narg == 2)) - theta0_one = force->numeric(FLERR,arg[1]); + theta0_one = utils::numeric(FLERR,arg[1],false,lmp); // convert theta0 from degrees to radians diff --git a/src/atom.cpp b/src/atom.cpp index e930a0255e..f4c93db459 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -795,8 +795,8 @@ void Atom::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"sort") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal atom_modify command"); - sortfreq = force->inumeric(FLERR,arg[iarg+1]); - userbinsize = force->numeric(FLERR,arg[iarg+2]); + sortfreq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + userbinsize = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (sortfreq < 0 || userbinsize < 0.0) error->all(FLERR,"Illegal atom_modify command"); if (sortfreq >= 0 && firstgroupname) @@ -1576,8 +1576,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) else error->one(FLERR,"Duplicate atom ID in Bodies section of data file"); - ninteger = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); - ndouble = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + ninteger = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); + ndouble = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); if ((m = map(tagdata)) >= 0) { if (ninteger > maxint) { @@ -1592,9 +1592,9 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) } for (j = 0; j < ninteger; j++) - ivalues[j] = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + ivalues[j] = utils::inumeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); for (j = 0; j < ndouble; j++) - dvalues[j] = force->numeric(FLERR,strtok(NULL," \t\n\r\f")); + dvalues[j] = utils::numeric(FLERR,strtok(NULL," \t\n\r\f"),false,lmp); avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues); @@ -1702,7 +1702,7 @@ void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg) if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); int lo,hi; - force->bounds(file,line,arg[0],ntypes,lo,hi); + utils::bounds(file,line,arg[0],1,ntypes,lo,hi,error); if (lo < 1 || hi > ntypes) error->all(file,line,"Invalid type for mass set"); for (int itype = lo; itype <= hi; itype++) { diff --git a/src/balance.cpp b/src/balance.cpp index d5032d8923..168d7f59a4 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -119,7 +119,7 @@ void Balance::command(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal balance command"); - thresh = force->numeric(FLERR,arg[0]); + thresh = utils::numeric(FLERR,arg[0],false,lmp); int dimension = domain->dimension; int *procgrid = comm->procgrid; @@ -145,7 +145,7 @@ void Balance::command(int narg, char **arg) user_xsplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[0]; i++) - user_xsplit[i] = force->numeric(FLERR,arg[iarg++]); + user_xsplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_xsplit[procgrid[0]] = 1.0; } } else if (strcmp(arg[iarg],"y") == 0) { @@ -165,7 +165,7 @@ void Balance::command(int narg, char **arg) user_ysplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[1]; i++) - user_ysplit[i] = force->numeric(FLERR,arg[iarg++]); + user_ysplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_ysplit[procgrid[1]] = 1.0; } } else if (strcmp(arg[iarg],"z") == 0) { @@ -185,7 +185,7 @@ void Balance::command(int narg, char **arg) user_zsplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[2]; i++) - user_zsplit[i] = force->numeric(FLERR,arg[iarg++]); + user_zsplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_zsplit[procgrid[2]] = 1.0; } @@ -195,9 +195,9 @@ void Balance::command(int narg, char **arg) style = SHIFT; if (strlen(arg[iarg+1]) > 3) error->all(FLERR,"Illegal balance command"); strcpy(bstr,arg[iarg+1]); - nitermax = force->inumeric(FLERR,arg[iarg+2]); + nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nitermax <= 0) error->all(FLERR,"Illegal balance command"); - stopthresh = force->numeric(FLERR,arg[iarg+3]); + stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (stopthresh < 1.0) error->all(FLERR,"Illegal balance command"); iarg += 4; diff --git a/src/bond.cpp b/src/bond.cpp index 0fb42da98a..12659fd8aa 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -236,16 +236,16 @@ void Bond::write_file(int narg, char **arg) int itype = 0; int jtype = 0; if (narg == 8) { - itype = force->inumeric(FLERR,arg[6]); - jtype = force->inumeric(FLERR,arg[7]); + itype = utils::inumeric(FLERR,arg[6],false,lmp); + jtype = utils::inumeric(FLERR,arg[7],false,lmp); if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes) error->all(FLERR,"Invalid atom types in bond_write command"); } - int btype = force->inumeric(FLERR,arg[0]); - int n = force->inumeric(FLERR,arg[1]); - double inner = force->numeric(FLERR,arg[2]); - double outer = force->numeric(FLERR,arg[3]); + int btype = utils::inumeric(FLERR,arg[0],false,lmp); + int n = utils::inumeric(FLERR,arg[1],false,lmp); + double inner = utils::numeric(FLERR,arg[2],false,lmp); + double outer = utils::numeric(FLERR,arg[3],false,lmp); if (inner <= 0.0 || inner >= outer) error->all(FLERR,"Invalid rlo/rhi values in bond_write command"); diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index abc497d5d5..8053c5531d 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -89,7 +89,7 @@ void BondZero::coeff(int narg, char **arg) double r0_one = 0.0; if (coeffflag && (narg == 2)) - r0_one = force->numeric(FLERR,arg[1]); + r0_one = utils::numeric(FLERR,arg[1],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/change_box.cpp b/src/change_box.cpp index ff7658a01f..5fe4eb8a06 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -83,23 +83,23 @@ void ChangeBox::command(int narg, char **arg) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = FINAL; - ops[nops].flo = force->numeric(FLERR,arg[iarg+2]); - ops[nops].fhi = force->numeric(FLERR,arg[iarg+3]); + ops[nops].flo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ops[nops].fhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = DELTA; - ops[nops].dlo = force->numeric(FLERR,arg[iarg+2]); - ops[nops].dhi = force->numeric(FLERR,arg[iarg+3]); + ops[nops].dlo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ops[nops].dhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = SCALE; - ops[nops].scale = force->numeric(FLERR,arg[iarg+2]); + ops[nops].scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 3; @@ -129,13 +129,13 @@ void ChangeBox::command(int narg, char **arg) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = FINAL; - ops[nops].ftilt = force->numeric(FLERR,arg[iarg+2]); + ops[nops].ftilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = DELTA; - ops[nops].dtilt = force->numeric(FLERR,arg[iarg+2]); + ops[nops].dtilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; } else error->all(FLERR,"Illegal change_box command"); diff --git a/src/comm.cpp b/src/comm.cpp index c9a517340c..7e603f2104 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -300,7 +300,7 @@ void Comm::modify_params(int narg, char **arg) if (mode == Comm::MULTI) error->all(FLERR, "Use cutoff/multi keyword to set cutoff in multi mode"); - cutghostuser = force->numeric(FLERR,arg[iarg+1]); + cutghostuser = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutghostuser < 0.0) error->all(FLERR,"Invalid cutoff in comm_modify command"); iarg += 2; @@ -321,7 +321,7 @@ void Comm::modify_params(int narg, char **arg) cutusermulti[i] = -1.0; } utils::bounds(FLERR,arg[iarg+1],1,ntypes,nlo,nhi,error); - cut = force->numeric(FLERR,arg[iarg+2]); + cut = utils::numeric(FLERR,arg[iarg+2],false,lmp); cutghostuser = MAX(cutghostuser,cut); if (cut < 0.0) error->all(FLERR,"Invalid cutoff in comm_modify command"); @@ -348,11 +348,11 @@ void Comm::set_processors(int narg, char **arg) if (narg < 3) error->all(FLERR,"Illegal processors command"); if (strcmp(arg[0],"*") == 0) user_procgrid[0] = 0; - else user_procgrid[0] = force->inumeric(FLERR,arg[0]); + else user_procgrid[0] = utils::inumeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"*") == 0) user_procgrid[1] = 0; - else user_procgrid[1] = force->inumeric(FLERR,arg[1]); + else user_procgrid[1] = utils::inumeric(FLERR,arg[1],false,lmp); if (strcmp(arg[2],"*") == 0) user_procgrid[2] = 0; - else user_procgrid[2] = force->inumeric(FLERR,arg[2]); + else user_procgrid[2] = utils::inumeric(FLERR,arg[2],false,lmp); if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0) error->all(FLERR,"Illegal processors command"); @@ -373,13 +373,13 @@ void Comm::set_processors(int narg, char **arg) if (iarg+6 > narg) error->all(FLERR,"Illegal processors command"); gridflag = TWOLEVEL; - ncores = force->inumeric(FLERR,arg[iarg+2]); + ncores = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0; - else user_coregrid[0] = force->inumeric(FLERR,arg[iarg+3]); + else user_coregrid[0] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0; - else user_coregrid[1] = force->inumeric(FLERR,arg[iarg+4]); + else user_coregrid[1] = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0; - else user_coregrid[2] = force->inumeric(FLERR,arg[iarg+5]); + else user_coregrid[2] = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (ncores <= 0 || user_coregrid[0] < 0 || user_coregrid[1] < 0 || user_coregrid[2] < 0) @@ -422,8 +422,8 @@ void Comm::set_processors(int narg, char **arg) error->all(FLERR, "Cannot use processors part command " "without using partitions"); - int isend = force->inumeric(FLERR,arg[iarg+1]); - int irecv = force->inumeric(FLERR,arg[iarg+2]); + int isend = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int irecv = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (isend < 1 || isend > universe->nworlds || irecv < 1 || irecv > universe->nworlds || isend == irecv) error->all(FLERR,"Invalid partitions in processors part command"); diff --git a/src/compute.cpp b/src/compute.cpp index 4009396eb0..208b93730e 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -129,7 +129,7 @@ void Compute::modify_params(int narg, char **arg) if (strcmp(arg[iarg],"extra") == 0 || strcmp(arg[iarg],"extra/dof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command"); - extra_dof = force->numeric(FLERR,arg[iarg+1]); + extra_dof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dynamic") == 0 || strcmp(arg[iarg],"dynamic/dof") == 0) { diff --git a/src/compute_adf.cpp b/src/compute_adf.cpp index e525d0250b..0bd329079a 100644 --- a/src/compute_adf.cpp +++ b/src/compute_adf.cpp @@ -68,7 +68,7 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : ordinate_style = DEGREE; cutflag = 0; - nbin = force->inumeric(FLERR,arg[3]); + nbin = utils::inumeric(FLERR,arg[3],false,lmp); if (nbin < 1) error->all(FLERR,"Illegal compute adf command"); // optional args @@ -142,12 +142,12 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : jlo[m] > jhi[m] || klo[m] > khi[m]) error->all(FLERR,"Illegal compute adf command"); - rcutinnerj[m] = force->numeric(FLERR,arg[iarg+3]); - rcutouterj[m] = force->numeric(FLERR,arg[iarg+4]); + rcutinnerj[m] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + rcutouterj[m] = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (rcutinnerj[m] < 0.0 || rcutinnerj[m] >= rcutouterj[m]) error->all(FLERR,"Illegal compute adf command"); - rcutinnerk[m] = force->numeric(FLERR,arg[iarg+5]); - rcutouterk[m] = force->numeric(FLERR,arg[iarg+6]); + rcutinnerk[m] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + rcutouterk[m] = utils::numeric(FLERR,arg[iarg+6],false,lmp); if (rcutinnerk[m] < 0.0 || rcutinnerk[m] >= rcutouterk[m]) error->all(FLERR,"Illegal compute adf command"); iarg += nargsperadf; diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index e495ac6899..6e28a94388 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -44,7 +44,7 @@ ComputeAggregateAtom::ComputeAggregateAtom(LAMMPS *lmp, int narg, char **arg) : { if (narg != 4) error->all(FLERR,"Illegal compute aggregate/atom command"); - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); cutsq = cutoff*cutoff; if (atom->avec->bonds_allow == 0) diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 18fc31390f..f88dea9ebe 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -43,7 +43,7 @@ ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"fcc") == 0) nnn = 12; else if (strcmp(arg[3],"bcc") == 0) nnn = 8; - else nnn = force->inumeric(FLERR,arg[3]); + else nnn = utils::inumeric(FLERR,arg[3],false,lmp); // default values diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index c8e4269b56..ae041c1997 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -108,12 +108,12 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : ncoord = 1; iarg = 4; if (iarg+6 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); - sorigin_user[0] = force->numeric(FLERR,arg[iarg]); - sorigin_user[1] = force->numeric(FLERR,arg[iarg+1]); - sorigin_user[2] = force->numeric(FLERR,arg[iarg+2]); - sradmin_user = force->numeric(FLERR,arg[iarg+3]); - sradmax_user = force->numeric(FLERR,arg[iarg+4]); - nsbin = force->inumeric(FLERR,arg[iarg+5]); + sorigin_user[0] = utils::numeric(FLERR,arg[iarg],false,lmp); + sorigin_user[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + sorigin_user[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + sradmin_user = utils::numeric(FLERR,arg[iarg+3],false,lmp); + sradmax_user = utils::numeric(FLERR,arg[iarg+4],false,lmp); + nsbin = utils::inumeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else if (strcmp(arg[3],"bin/cylinder") == 0) { binflag = 1; @@ -134,12 +134,12 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : } if (iarg+5 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); corigin_user[dim[0]] = 0.0; - corigin_user[cdim1] = force->numeric(FLERR,arg[iarg]); - corigin_user[cdim2] = force->numeric(FLERR,arg[iarg+1]); - cradmin_user = force->numeric(FLERR,arg[iarg+2]); - cradmax_user = force->numeric(FLERR,arg[iarg+3]); + corigin_user[cdim1] = utils::numeric(FLERR,arg[iarg],false,lmp); + corigin_user[cdim2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + cradmin_user = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cradmax_user = utils::numeric(FLERR,arg[iarg+3],false,lmp); - ncbin = force->inumeric(FLERR,arg[iarg+4]); + ncbin = utils::inumeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[3],"type") == 0) { @@ -218,7 +218,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"limit") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); - limit = force->inumeric(FLERR,arg[iarg+1]); + limit = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (limit < 0) error->all(FLERR,"Illegal compute chunk/atom command"); if (limit && !compress) limitfirst = 1; iarg += 2; @@ -261,11 +261,11 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+2],"lower") == 0) minflag[idim] = LOWER; else minflag[idim] = COORD; if (minflag[idim] == COORD) - minvalue[idim] = force->numeric(FLERR,arg[iarg+2]); + minvalue[idim] = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"upper") == 0) maxflag[idim] = UPPER; else maxflag[idim] = COORD; if (maxflag[idim] == COORD) - maxvalue[idim] = force->numeric(FLERR,arg[iarg+3]); + maxvalue[idim] = utils::numeric(FLERR,arg[iarg+3],false,lmp); else error->all(FLERR,"Illegal compute chunk/atom command"); iarg += 4; } else if (strcmp(arg[iarg],"units") == 0) { @@ -1983,9 +1983,9 @@ void ComputeChunkAtom::readdim(int narg, char **arg, int iarg, int idim) else if (strcmp(arg[iarg+1],"upper") == 0) originflag[idim] = UPPER; else originflag[idim] = COORD; if (originflag[idim] == COORD) - origin[idim] = force->numeric(FLERR,arg[iarg+1]); + origin[idim] = utils::numeric(FLERR,arg[iarg+1],false,lmp); - delta[idim] = force->numeric(FLERR,arg[iarg+2]); + delta[idim] = utils::numeric(FLERR,arg[iarg+2],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index ff227b3590..021665a647 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -41,7 +41,7 @@ ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : { if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command"); - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); cutsq = cutoff*cutoff; peratom_flag = 1; diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 7ab9e8adf2..8bbe2c15d0 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -51,7 +51,7 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; size_peratom_cols = 0; - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal compute cna/atom command"); cutsq = cutoff*cutoff; diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 7bf3d017a9..be2f9c39bd 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -48,7 +48,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"cutoff") == 0) { cstyle = CUTOFF; - double cutoff = force->numeric(FLERR,arg[4]); + double cutoff = utils::numeric(FLERR,arg[4],false,lmp); cutsq = cutoff*cutoff; int iarg = 5; @@ -97,7 +97,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(modify->compute[iorientorder]->style,"^orientorder/atom")) error->all(FLERR,"Compute coord/atom compute ID is not orientorder/atom"); - threshold = force->numeric(FLERR,arg[5]); + threshold = utils::numeric(FLERR,arg[5],false,lmp); if (threshold <= -1.0 || threshold >= 1.0) error->all(FLERR,"Compute coord/atom threshold not between -1 and 1"); diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index b4ffd91b43..00f81dc845 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -59,7 +59,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"degree") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute hexorder/atom command"); - ndegree = force->numeric(FLERR,arg[iarg+1]); + ndegree = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (ndegree < 0) error->all(FLERR,"Illegal compute hexorder/atom command"); iarg += 2; @@ -68,14 +68,14 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"NULL") == 0) nnn = 0; else { - nnn = force->numeric(FLERR,arg[iarg+1]); + nnn = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nnn < 0) error->all(FLERR,"Illegal compute hexorder/atom command"); } iarg += 2; } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute hexorder/atom command"); - double cutoff = force->numeric(FLERR,arg[iarg+1]); + double cutoff = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute hexorder/atom command"); cutsq = cutoff*cutoff; diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index c278ccc520..ade9f7615e 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -85,7 +85,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg if (strcmp(arg[iarg+1],"NULL") == 0) { nnn = 0; } else { - nnn = force->numeric(FLERR,arg[iarg+1]); + nnn = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nnn <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); } @@ -93,7 +93,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"degrees") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - nqlist = force->numeric(FLERR,arg[iarg+1]); + nqlist = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nqlist <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); memory->destroy(qlist); @@ -103,7 +103,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg error->all(FLERR,"Illegal compute orientorder/atom command"); qmax = 0; for (int il = 0; il < nqlist; il++) { - qlist[il] = force->numeric(FLERR,arg[iarg+il]); + qlist[il] = utils::numeric(FLERR,arg[iarg+il],false,lmp); if (qlist[il] < 0) error->all(FLERR,"Illegal compute orientorder/atom command"); if (qlist[il] > qmax) qmax = qlist[il]; @@ -127,7 +127,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg qlcompflag = 1; if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - qlcomp = force->numeric(FLERR,arg[iarg+1]); + qlcomp = utils::numeric(FLERR,arg[iarg+1],false,lmp); iqlcomp = -1; for (int il = 0; il < nqlist; il++) if (qlcomp == qlist[il]) { @@ -140,7 +140,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - double cutoff = force->numeric(FLERR,arg[iarg+1]); + double cutoff = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute orientorder/atom command"); cutsq = cutoff*cutoff; @@ -148,7 +148,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"chunksize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - chunksize = force->numeric(FLERR,arg[iarg+1]); + chunksize = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (chunksize <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); iarg += 2; diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index e9a3faf723..054a50bed4 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -48,7 +48,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : if (narg > iarg) { if (isdigit(arg[iarg][0])) { - nsub = force->inumeric(FLERR,arg[iarg]); + nsub = utils::inumeric(FLERR,arg[iarg],false,lmp); ++iarg; if (nsub <= 0) error->all(FLERR,"Illegal compute pair command"); diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index cb0743a7d6..4712c83461 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -90,7 +90,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : if (narg > iarg) { if (isdigit(arg[iarg][0])) { - nsub = force->inumeric(FLERR,arg[iarg]); + nsub = utils::inumeric(FLERR,arg[iarg],false,lmp); ++iarg; if (nsub <= 0) error->all(FLERR,"Illegal compute pressure command"); diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 5ceddd4578..920228e056 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -50,7 +50,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : array_flag = 1; extarray = 0; - nbin = force->inumeric(FLERR,arg[3]); + nbin = utils::inumeric(FLERR,arg[3],false,lmp); if (nbin < 1) error->all(FLERR,"Illegal compute rdf command"); // optional args @@ -67,7 +67,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute rdf command"); - cutoff_user = force->numeric(FLERR,arg[iarg+1]); + cutoff_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff_user <= 0.0) cutflag = 0; else cutflag = 1; iarg += 2; diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 67b60882f6..6ff462258f 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -41,9 +41,9 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nstart = force->inumeric(FLERR,arg[3]); - nstop = force->inumeric(FLERR,arg[4]); - nskip = force->inumeric(FLERR,arg[5]); + nstart = utils::inumeric(FLERR,arg[3],false,lmp); + nstop = utils::inumeric(FLERR,arg[4],false,lmp); + nskip = utils::inumeric(FLERR,arg[5],false,lmp); if (nstart < 1 || nstop < nstart || nskip < 1) error->all(FLERR,"Illegal compute slice command"); diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 0fa5bbbb8a..6274ac4292 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -94,12 +94,12 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/chunk command"); - adof = force->numeric(FLERR,arg[iarg+1]); + adof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cdof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/chunk command"); - cdof = force->numeric(FLERR,arg[iarg+1]); + cdof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal compute temp/chunk command"); } diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index f5f29d9dc0..c78e830c95 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -37,9 +37,9 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 1; - xflag = force->inumeric(FLERR,arg[3]); - yflag = force->inumeric(FLERR,arg[4]); - zflag = force->inumeric(FLERR,arg[5]); + xflag = utils::inumeric(FLERR,arg[3],false,lmp); + yflag = utils::inumeric(FLERR,arg[4],false,lmp); + zflag = utils::inumeric(FLERR,arg[5],false,lmp); if ((xflag != 0 && xflag != 1) || (yflag != 0 && yflag != 1) || (zflag != 0 && zflag != 1)) error->all(FLERR,"Illegal compute temp/partial command"); diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index fce145848e..c2ef1d5c11 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -39,9 +39,9 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 1; - xflag = force->inumeric(FLERR,arg[3]); - yflag = force->inumeric(FLERR,arg[4]); - zflag = force->inumeric(FLERR,arg[5]); + xflag = utils::inumeric(FLERR,arg[3],false,lmp); + yflag = utils::inumeric(FLERR,arg[4],false,lmp); + zflag = utils::inumeric(FLERR,arg[5],false,lmp); if (zflag && domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot use vz for 2d systemx"); @@ -57,44 +57,44 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbiny = force->inumeric(FLERR,arg[iarg+1]); + nbiny = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinz = force->inumeric(FLERR,arg[iarg+1]); + nbinz = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbiny = force->inumeric(FLERR,arg[iarg+2]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbiny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbiny = force->inumeric(FLERR,arg[iarg+1]); - nbinz = force->inumeric(FLERR,arg[iarg+2]); + nbiny = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbinz = force->inumeric(FLERR,arg[iarg+2]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"xyz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbiny = force->inumeric(FLERR,arg[iarg+2]); - nbinz = force->inumeric(FLERR,arg[iarg+3]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbiny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else error->all(FLERR,"Illegal compute temp/profile command"); diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index 30f6701fcd..187ea2454c 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -71,14 +71,14 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal compute temp/ramp command"); if (v_dim == 0) { - v_lo = xscale*force->numeric(FLERR,arg[4]); - v_hi = xscale*force->numeric(FLERR,arg[5]); + v_lo = xscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = xscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (v_dim == 1) { - v_lo = yscale*force->numeric(FLERR,arg[4]); - v_hi = yscale*force->numeric(FLERR,arg[5]); + v_lo = yscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = yscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (v_dim == 2) { - v_lo = zscale*force->numeric(FLERR,arg[4]); - v_hi = zscale*force->numeric(FLERR,arg[5]); + v_lo = zscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = zscale*utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"x") == 0) coord_dim = 0; @@ -87,14 +87,14 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal compute temp/ramp command"); if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[7]); - coord_hi = xscale*force->numeric(FLERR,arg[8]); + coord_lo = xscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[8],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[7]); - coord_hi = yscale*force->numeric(FLERR,arg[8]); + coord_lo = yscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[8],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[7]); - coord_hi = zscale*force->numeric(FLERR,arg[8]); + coord_lo = zscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[8],false,lmp); } maxbias = 0; diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index de20e15698..b121edb5b2 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -88,7 +88,7 @@ void CreateAtoms::command(int narg, char **arg) // parse arguments if (narg < 2) error->all(FLERR,"Illegal create_atoms command"); - ntype = force->inumeric(FLERR,arg[0]); + ntype = utils::inumeric(FLERR,arg[0],false,lmp); int iarg; if (strcmp(arg[1],"box") == 0) { @@ -107,15 +107,15 @@ void CreateAtoms::command(int narg, char **arg) } else if (strcmp(arg[1],"single") == 0) { style = SINGLE; if (narg < 5) error->all(FLERR,"Illegal create_atoms command"); - xone[0] = force->numeric(FLERR,arg[2]); - xone[1] = force->numeric(FLERR,arg[3]); - xone[2] = force->numeric(FLERR,arg[4]); + xone[0] = utils::numeric(FLERR,arg[2],false,lmp); + xone[1] = utils::numeric(FLERR,arg[3],false,lmp); + xone[2] = utils::numeric(FLERR,arg[4],false,lmp); iarg = 5; } else if (strcmp(arg[1],"random") == 0) { style = RANDOM; if (narg < 5) error->all(FLERR,"Illegal create_atoms command"); - nrandom = force->inumeric(FLERR,arg[2]); - seed = force->inumeric(FLERR,arg[3]); + nrandom = utils::inumeric(FLERR,arg[2],false,lmp); + seed = utils::inumeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) nregion = -1; else { nregion = domain->find_region(arg[4]); @@ -146,8 +146,8 @@ void CreateAtoms::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"basis") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); - int ibasis = force->inumeric(FLERR,arg[iarg+1]); - int itype = force->inumeric(FLERR,arg[iarg+2]); + int ibasis = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int itype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Invalid basis setting in create_atoms command"); basistype[ibasis-1] = itype; @@ -168,7 +168,7 @@ void CreateAtoms::command(int narg, char **arg) "create_atoms has multiple molecules"); mode = MOLECULE; onemol = atom->molecules[imol]; - molseed = force->inumeric(FLERR,arg[iarg+2]); + molseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"units") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command"); @@ -207,10 +207,10 @@ void CreateAtoms::command(int narg, char **arg) if (iarg+5 > narg) error->all(FLERR,"Illegal create_atoms command"); double thetaone; double axisone[3]; - thetaone = force->numeric(FLERR,arg[iarg+1]) / 180.0 * MY_PI;; - axisone[0] = force->numeric(FLERR,arg[iarg+2]); - axisone[1] = force->numeric(FLERR,arg[iarg+3]); - axisone[2] = force->numeric(FLERR,arg[iarg+4]); + thetaone = utils::numeric(FLERR,arg[iarg+1],false,lmp) / 180.0 * MY_PI;; + axisone[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + axisone[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + axisone[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (axisone[0] == 0.0 && axisone[1] == 0.0 && axisone[2] == 0.0) error->all(FLERR,"Illegal create_atoms command"); if (domain->dimension == 2 && (axisone[0] != 0.0 || axisone[1] != 0.0)) @@ -221,16 +221,16 @@ void CreateAtoms::command(int narg, char **arg) } else if (strcmp(arg[iarg],"ratio") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); subsetflag = RATIO; - subsetfrac = force->numeric(FLERR,arg[iarg+1]); - subsetseed = force->inumeric(FLERR,arg[iarg+2]); + subsetfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); + subsetseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (subsetfrac <= 0.0 || subsetfrac > 1.0 || subsetseed <= 0) error->all(FLERR,"Illegal create_atoms command"); iarg += 3; } else if (strcmp(arg[iarg],"subset") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); subsetflag = SUBSET; - nsubset = force->bnumeric(FLERR,arg[iarg+1]); - subsetseed = force->inumeric(FLERR,arg[iarg+2]); + nsubset = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); + subsetseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nsubset <= 0 || subsetseed <= 0) error->all(FLERR,"Illegal create_atoms command"); iarg += 3; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index e210a5e061..4261d9f766 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -69,38 +69,38 @@ void CreateBonds::command(int narg, char **arg) igroup = group->find(arg[2]); if (igroup == -1) error->all(FLERR,"Cannot find create_bonds group ID"); group2bit = group->bitmask[igroup]; - btype = force->inumeric(FLERR,arg[3]); - rmin = force->numeric(FLERR,arg[4]); - rmax = force->numeric(FLERR,arg[5]); + btype = utils::inumeric(FLERR,arg[3],false,lmp); + rmin = utils::numeric(FLERR,arg[4],false,lmp); + rmax = utils::numeric(FLERR,arg[5],false,lmp); if (rmin > rmax) error->all(FLERR,"Illegal create_bonds command"); iarg = 6; } else if (strcmp(arg[0],"single/bond") == 0) { style = SBOND; if (narg < 4) error->all(FLERR,"Illegal create_bonds command"); - btype = force->inumeric(FLERR,arg[1]); - batom1 = force->tnumeric(FLERR,arg[2]); - batom2 = force->tnumeric(FLERR,arg[3]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); + batom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + batom2 = utils::tnumeric(FLERR,arg[3],false,lmp); if (batom1 == batom2) error->all(FLERR,"Illegal create_bonds command"); iarg = 4; } else if (strcmp(arg[0],"single/angle") == 0) { style = SANGLE; if (narg < 5) error->all(FLERR,"Illegal create_bonds command"); - atype = force->inumeric(FLERR,arg[1]); - aatom1 = force->tnumeric(FLERR,arg[2]); - aatom2 = force->tnumeric(FLERR,arg[3]); - aatom3 = force->tnumeric(FLERR,arg[4]); + atype = utils::inumeric(FLERR,arg[1],false,lmp); + aatom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + aatom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + aatom3 = utils::tnumeric(FLERR,arg[4],false,lmp); if ((aatom1 == aatom2) || (aatom1 == aatom3) || (aatom2 == aatom3)) error->all(FLERR,"Illegal create_bonds command"); iarg = 5; } else if (strcmp(arg[0],"single/dihedral") == 0) { style = SDIHEDRAL; if (narg < 6) error->all(FLERR,"Illegal create_bonds command"); - dtype = force->inumeric(FLERR,arg[1]); - datom1 = force->tnumeric(FLERR,arg[2]); - datom2 = force->tnumeric(FLERR,arg[3]); - datom3 = force->tnumeric(FLERR,arg[4]); - datom4 = force->tnumeric(FLERR,arg[5]); + dtype = utils::inumeric(FLERR,arg[1],false,lmp); + datom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + datom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + datom3 = utils::tnumeric(FLERR,arg[4],false,lmp); + datom4 = utils::tnumeric(FLERR,arg[5],false,lmp); if ((datom1 == datom2) || (datom1 == datom3) || (datom1 == datom4) || (datom2 == datom3) || (datom2 == datom4) || (datom3 == datom4)) error->all(FLERR,"Illegal create_bonds command"); @@ -108,11 +108,11 @@ void CreateBonds::command(int narg, char **arg) } else if (strcmp(arg[0],"single/improper") == 0) { style = SIMPROPER; if (narg < 6) error->all(FLERR,"Illegal create_bonds command"); - dtype = force->inumeric(FLERR,arg[1]); - datom1 = force->tnumeric(FLERR,arg[2]); - datom2 = force->tnumeric(FLERR,arg[3]); - datom3 = force->tnumeric(FLERR,arg[4]); - datom4 = force->tnumeric(FLERR,arg[5]); + dtype = utils::inumeric(FLERR,arg[1],false,lmp); + datom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + datom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + datom3 = utils::tnumeric(FLERR,arg[4],false,lmp); + datom4 = utils::tnumeric(FLERR,arg[5],false,lmp); if ((datom1 == datom2) || (datom1 == datom3) || (datom1 == datom4) || (datom2 == datom3) || (datom2 == datom4) || (datom3 == datom4)) error->all(FLERR,"Illegal create_bonds command"); diff --git a/src/create_box.cpp b/src/create_box.cpp index 4a826cb691..f5d9edb844 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -96,7 +96,7 @@ void CreateBox::command(int narg, char **arg) // set atom and topology type quantities - atom->ntypes = force->inumeric(FLERR,arg[0]); + atom->ntypes = utils::inumeric(FLERR,arg[0],false,lmp); atom->nbondtypes = 0; atom->nangletypes = 0; atom->ndihedraltypes = 0; @@ -110,53 +110,53 @@ void CreateBox::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - atom->nbondtypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nbondtypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"angle/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - atom->nangletypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nangletypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dihedral/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->ndihedraltypes = force->inumeric(FLERR,arg[iarg+1]); + atom->ndihedraltypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"improper/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - atom->nimpropertypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nimpropertypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/bond/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - atom->bond_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->bond_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/angle/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - atom->angle_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->angle_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/dihedral/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->dihedral_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->dihedral_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/improper/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - atom->improper_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->improper_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); - force->special_extra = force->inumeric(FLERR,arg[iarg+1]); + force->special_extra = utils::inumeric(FLERR,arg[iarg+1],false,lmp); atom->maxspecial += force->special_extra; iarg += 2; } else error->all(FLERR,"Illegal create_box command"); diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 03d5d2f65d..7dcc4748e9 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -270,7 +270,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) // read args - double cut = force->numeric(FLERR,arg[1]); + double cut = utils::numeric(FLERR,arg[1],false,lmp); double cutsq = cut*cut; int igroup1 = group->find(arg[2]); @@ -430,8 +430,8 @@ void DeleteAtoms::delete_porosity(int narg, char **arg) if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID"); domain->regions[iregion]->prematch(); - double porosity_fraction = force->numeric(FLERR,arg[2]); - int seed = force->inumeric(FLERR,arg[3]); + double porosity_fraction = utils::numeric(FLERR,arg[2],false,lmp); + int seed = utils::inumeric(FLERR,arg[3],false,lmp); options(narg-4,&arg[4]); RanMars *random = new RanMars(lmp,seed + comm->me); diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 82b7bf9492..a30ac2c2b2 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -128,14 +128,14 @@ void DisplaceAtoms::command(int narg, char **arg) double d_lo,d_hi; if (d_dim == 0) { - d_lo = xscale*force->numeric(FLERR,arg[3]); - d_hi = xscale*force->numeric(FLERR,arg[4]); + d_lo = xscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = xscale*utils::numeric(FLERR,arg[4],false,lmp); } else if (d_dim == 1) { - d_lo = yscale*force->numeric(FLERR,arg[3]); - d_hi = yscale*force->numeric(FLERR,arg[4]); + d_lo = yscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = yscale*utils::numeric(FLERR,arg[4],false,lmp); } else if (d_dim == 2) { - d_lo = zscale*force->numeric(FLERR,arg[3]); - d_hi = zscale*force->numeric(FLERR,arg[4]); + d_lo = zscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = zscale*utils::numeric(FLERR,arg[4],false,lmp); } int coord_dim = 0; @@ -146,14 +146,14 @@ void DisplaceAtoms::command(int narg, char **arg) double coord_lo,coord_hi; if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[6]); - coord_hi = xscale*force->numeric(FLERR,arg[7]); + coord_lo = xscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[7],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[6]); - coord_hi = yscale*force->numeric(FLERR,arg[7]); + coord_lo = yscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[7],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[6]); - coord_hi = zscale*force->numeric(FLERR,arg[7]); + coord_lo = zscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[7],false,lmp); } double **x = atom->x; @@ -179,10 +179,10 @@ void DisplaceAtoms::command(int narg, char **arg) if (style == RANDOM) { RanPark *random = new RanPark(lmp,1); - double dx = xscale*force->numeric(FLERR,arg[2]); - double dy = yscale*force->numeric(FLERR,arg[3]); - double dz = zscale*force->numeric(FLERR,arg[4]); - int seed = force->inumeric(FLERR,arg[5]); + double dx = xscale*utils::numeric(FLERR,arg[2],false,lmp); + double dy = yscale*utils::numeric(FLERR,arg[3],false,lmp); + double dz = zscale*utils::numeric(FLERR,arg[4],false,lmp); + int seed = utils::inumeric(FLERR,arg[5],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal displace_atoms random command"); double **x = atom->x; @@ -219,13 +219,13 @@ void DisplaceAtoms::command(int narg, char **arg) double *quat; int dim = domain->dimension; - point[0] = xscale*force->numeric(FLERR,arg[2]); - point[1] = yscale*force->numeric(FLERR,arg[3]); - point[2] = zscale*force->numeric(FLERR,arg[4]); - axis[0] = force->numeric(FLERR,arg[5]); - axis[1] = force->numeric(FLERR,arg[6]); - axis[2] = force->numeric(FLERR,arg[7]); - double theta = force->numeric(FLERR,arg[8]); + point[0] = xscale*utils::numeric(FLERR,arg[2],false,lmp); + point[1] = yscale*utils::numeric(FLERR,arg[3],false,lmp); + point[2] = zscale*utils::numeric(FLERR,arg[4],false,lmp); + axis[0] = utils::numeric(FLERR,arg[5],false,lmp); + axis[1] = utils::numeric(FLERR,arg[6],false,lmp); + axis[2] = utils::numeric(FLERR,arg[7],false,lmp); + double theta = utils::numeric(FLERR,arg[8],false,lmp); if (dim == 2 && (axis[0] != 0.0 || axis[1] != 0.0)) error->all(FLERR,"Invalid displace_atoms rotate axis for 2d"); @@ -372,7 +372,7 @@ void DisplaceAtoms::move(int idim, char *arg, double scale) int nlocal = atom->nlocal; if (strstr(arg,"v_") != arg) { - double delta = scale*force->numeric(FLERR,arg); + double delta = scale*utils::numeric(FLERR,arg,false,lmp); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += delta; diff --git a/src/dump.cpp b/src/dump.cpp index 83b74f1bbc..f876126df9 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -938,7 +938,7 @@ void Dump::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"delay") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); - delaystep = force->bnumeric(FLERR,arg[iarg+1]); + delaystep = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (delaystep >= 0) delay_flag = 1; else delay_flag = 0; iarg += 2; @@ -956,7 +956,7 @@ void Dump::modify_params(int narg, char **arg) strcpy(output->var_dump[idump],&arg[iarg+1][2]); n = 0; } else { - n = force->inumeric(FLERR,arg[iarg+1]); + n = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (n <= 0) error->all(FLERR,"Illegal dump_modify command"); } output->every_dump[idump] = n; @@ -967,7 +967,7 @@ void Dump::modify_params(int narg, char **arg) if (!multiproc) error->all(FLERR,"Cannot use dump_modify fileper " "without % in dump file name"); - int nper = force->inumeric(FLERR,arg[iarg+1]); + int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nper <= 0) error->all(FLERR,"Illegal dump_modify command"); multiproc = nprocs/nper; @@ -1048,7 +1048,7 @@ void Dump::modify_params(int narg, char **arg) delete[] nameslist[idx]; delete[] nameslist; } - maxfiles = force->inumeric(FLERR,arg[iarg+1]); + maxfiles = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (maxfiles == 0) error->all(FLERR,"Illegal dump_modify command"); if (maxfiles > 0) { nameslist = new char*[maxfiles]; @@ -1063,7 +1063,7 @@ void Dump::modify_params(int narg, char **arg) if (!multiproc) error->all(FLERR,"Cannot use dump_modify nfile " "without % in dump file name"); - int nfile = force->inumeric(FLERR,arg[iarg+1]); + int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nfile <= 0) error->all(FLERR,"Illegal dump_modify command"); nfile = MIN(nfile,nprocs); @@ -1093,7 +1093,7 @@ void Dump::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"pad") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); - padflag = force->inumeric(FLERR,arg[iarg+1]); + padflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (padflag < 0) error->all(FLERR,"Illegal dump_modify command"); iarg += 2; @@ -1113,7 +1113,7 @@ void Dump::modify_params(int narg, char **arg) sortorder = ASCEND; } else { sort_flag = 1; - sortcol = force->inumeric(FLERR,arg[iarg+1]); + sortcol = utils::inumeric(FLERR,arg[iarg+1],false,lmp); sortorder = ASCEND; if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command"); if (sortcol < 0) { diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 33b7c4603b..3b0594a2cb 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -68,7 +68,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : clearstep = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal dump custom command"); // expand args if any have wildcard character "*" @@ -1748,7 +1748,7 @@ int DumpCustom::modify_param(int narg, char **arg) strcpy(format_float_user,arg[2]); } else { - int i = force->inumeric(FLERR,arg[1]) - 1; + int i = utils::inumeric(FLERR,arg[1],false,lmp) - 1; if (i < 0 || i >= size_one) error->all(FLERR,"Illegal dump_modify command"); if (format_column_user[i]) delete [] format_column_user[i]; @@ -2060,7 +2060,7 @@ int DumpCustom::modify_param(int narg, char **arg) // id = dump-ID + nthreshlast + DUMP_STORE, fix group = dump group if (strcmp(arg[3],"LAST") != 0) { - thresh_value[nthresh] = force->numeric(FLERR,arg[3]); + thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); thresh_last[nthresh] = -1; } else { thresh_fix = (FixStore **) diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 73252e94f2..ea9fb612cb 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -153,7 +153,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adiam") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); adiam = NUMERIC; - adiamvalue = force->numeric(FLERR,arg[iarg+1]); + adiamvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 2; @@ -168,7 +168,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal dump image command"); if (!islower(arg[iarg+2][0])) { bdiam = NUMERIC; - bdiamvalue = force->numeric(FLERR,arg[iarg+2]); + bdiamvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command"); } else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM; else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE; @@ -183,7 +183,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"type") == 0) lcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); ldiam = NUMERIC; - ldiamvalue = force->numeric(FLERR,arg[iarg+2]); + ldiamvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tri") == 0) { @@ -191,8 +191,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : triflag = YES; if (strcmp(arg[iarg+1],"type") == 0) tcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - tstyle = force->inumeric(FLERR,arg[iarg+2]); - tdiamvalue = force->numeric(FLERR,arg[iarg+3]); + tstyle = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + tdiamvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"body") == 0) { @@ -200,8 +200,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : bodyflag = YES; if (strcmp(arg[iarg+1],"type") == 0) bodycolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - bodyflag1 = force->numeric(FLERR,arg[iarg+2]); - bodyflag2 = force->numeric(FLERR,arg[iarg+3]); + bodyflag1 = utils::numeric(FLERR,arg[iarg+2],false,lmp); + bodyflag2 = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"fix") == 0) { @@ -210,14 +210,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : fixID = arg[iarg+1]; if (strcmp(arg[iarg+2],"type") == 0) fixcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - fixflag1 = force->numeric(FLERR,arg[iarg+3]); - fixflag2 = force->numeric(FLERR,arg[iarg+4]); + fixflag1 = utils::numeric(FLERR,arg[iarg+3],false,lmp); + fixflag2 = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"size") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command"); - int width = force->inumeric(FLERR,arg[iarg+1]); - int height = force->inumeric(FLERR,arg[iarg+2]); + int width = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int height = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (width <= 0 || height <= 0) error->all(FLERR,"Illegal dump image command"); image->width = width; @@ -231,7 +231,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : thetastr = new char[n]; strcpy(thetastr,&arg[iarg+1][2]); } else { - double theta = force->numeric(FLERR,arg[iarg+1]); + double theta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (theta < 0.0 || theta > 180.0) error->all(FLERR,"Invalid dump image theta value"); theta *= MY_PI/180.0; @@ -242,7 +242,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : phistr = new char[n]; strcpy(phistr,&arg[iarg+2][2]); } else { - double phi = force->numeric(FLERR,arg[iarg+2]); + double phi = utils::numeric(FLERR,arg[iarg+2],false,lmp); phi *= MY_PI/180.0; image->phi = phi; } @@ -258,19 +258,19 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : cxstr = new char[n]; strcpy(cxstr,&arg[iarg+2][2]); cflag = DYNAMIC; - } else cx = force->numeric(FLERR,arg[iarg+2]); + } else cx = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; cystr = new char[n]; strcpy(cystr,&arg[iarg+3][2]); cflag = DYNAMIC; - } else cy = force->numeric(FLERR,arg[iarg+3]); + } else cy = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; czstr = new char[n]; strcpy(czstr,&arg[iarg+4][2]); cflag = DYNAMIC; - } else cz = force->numeric(FLERR,arg[iarg+4]); + } else cz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"up") == 0) { @@ -279,17 +279,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : int n = strlen(&arg[iarg+1][2]) + 1; upxstr = new char[n]; strcpy(upxstr,&arg[iarg+1][2]); - } else image->up[0] = force->numeric(FLERR,arg[iarg+1]); + } else image->up[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; upystr = new char[n]; strcpy(upystr,&arg[iarg+2][2]); - } else image->up[1] = force->numeric(FLERR,arg[iarg+2]); + } else image->up[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; upzstr = new char[n]; strcpy(upzstr,&arg[iarg+3][2]); - } else image->up[2] = force->numeric(FLERR,arg[iarg+3]); + } else image->up[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"zoom") == 0) { @@ -299,7 +299,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : zoomstr = new char[n]; strcpy(zoomstr,&arg[iarg+1][2]); } else { - double zoom = force->numeric(FLERR,arg[iarg+1]); + double zoom = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command"); image->zoom = zoom; } @@ -313,7 +313,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : perspstr = new char[n]; strcpy(perspstr,&arg[iarg+1][2]); } else { - double persp = force->numeric(FLERR,arg[iarg+1]); + double persp = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (persp < 0.0) error->all(FLERR,"Illegal dump image command"); image->persp = persp; } @@ -324,7 +324,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO; else error->all(FLERR,"Illegal dump image command"); - boxdiam = force->numeric(FLERR,arg[iarg+2]); + boxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 3; @@ -333,8 +333,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO; else error->all(FLERR,"Illegal dump image command"); - axeslen = force->numeric(FLERR,arg[iarg+2]); - axesdiam = force->numeric(FLERR,arg[iarg+3]); + axeslen = utils::numeric(FLERR,arg[iarg+2],false,lmp); + axesdiam = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (axeslen < 0.0 || axesdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 4; @@ -344,13 +344,13 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) subboxflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) subboxflag = NO; else error->all(FLERR,"Illegal dump image command"); - subboxdiam = force->numeric(FLERR,arg[iarg+2]); + subboxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (subboxdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 3; } else if (strcmp(arg[iarg],"shiny") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); - double shiny = force->numeric(FLERR,arg[iarg+1]); + double shiny = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (shiny < 0.0 || shiny > 1.0) error->all(FLERR,"Illegal dump image command"); image->shiny = shiny; @@ -361,10 +361,10 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) image->ssao = YES; else if (strcmp(arg[iarg+1],"no") == 0) image->ssao = NO; else error->all(FLERR,"Illegal dump image command"); - int seed = force->inumeric(FLERR,arg[iarg+2]); + int seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal dump image command"); image->seed = seed; - double ssaoint = force->numeric(FLERR,arg[iarg+3]); + double ssaoint = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (ssaoint < 0.0 || ssaoint > 1.0) error->all(FLERR,"Illegal dump image command"); image->ssaoint = ssaoint; @@ -1282,7 +1282,7 @@ int DumpImage::modify_param(int narg, char **arg) if (narg < 3) error->all(FLERR,"Illegal dump_modify command"); int nlo,nhi; utils::bounds(FLERR,arg[1],1,atom->ntypes,nlo,nhi,error); - double diam = force->numeric(FLERR,arg[2]); + double diam = utils::numeric(FLERR,arg[2],false,lmp); if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command"); for (int i = nlo; i <= nhi; i++) diamtype[i] = diam; return 3; @@ -1296,7 +1296,7 @@ int DumpImage::modify_param(int narg, char **arg) else if (arg[3][0] == 'c') factor = 2; else if (arg[3][0] == 'd') factor = 3; else error->all(FLERR,"Illegal dump_modify command"); - int nentry = force->inumeric(FLERR,arg[5]); + int nentry = utils::inumeric(FLERR,arg[5],false,lmp); if (nentry < 1) error->all(FLERR,"Illegal dump_modify command"); int n = 6 + factor*nentry; if (narg < n) error->all(FLERR,"Illegal dump_modify command"); @@ -1347,7 +1347,7 @@ int DumpImage::modify_param(int narg, char **arg) error->all(FLERR,"Dump modify bdiam not allowed with no bond types"); int nlo,nhi; utils::bounds(FLERR,arg[1],1,atom->nbondtypes,nlo,nhi,error); - double diam = force->numeric(FLERR,arg[2]); + double diam = utils::numeric(FLERR,arg[2],false,lmp); if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command"); for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam; return 3; @@ -1373,7 +1373,9 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"color") == 0) { if (narg < 5) error->all(FLERR,"Illegal dump_modify command"); - int flag = image->addcolor(arg[1],force->numeric(FLERR,arg[2]),force->numeric(FLERR,arg[3]),force->numeric(FLERR,arg[4])); + int flag = image->addcolor(arg[1],utils::numeric(FLERR,arg[2],false,lmp), + utils::numeric(FLERR,arg[3],false,lmp), + utils::numeric(FLERR,arg[4],false,lmp)); if (flag) error->all(FLERR,"Illegal dump_modify command"); return 5; } diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 85fb5dff14..5914d2ac1c 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -46,7 +46,7 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : clearstep = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal dump local command"); if (binary) diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index 68a77c8f63..4966310470 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -84,14 +84,14 @@ int DumpMovie::modify_param(int narg, char **arg) if (strcmp(arg[0],"bitrate") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - bitrate = force->inumeric(FLERR,arg[1]); + bitrate = utils::inumeric(FLERR,arg[1],false,lmp); if (bitrate <= 0.0) error->all(FLERR,"Illegal dump_modify command"); return 2; } if (strcmp(arg[0],"framerate") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - framerate = force->numeric(FLERR,arg[1]); + framerate = utils::numeric(FLERR,arg[1],false,lmp); if ((framerate <= 0.1) || (framerate > 24.0)) error->all(FLERR,"Illegal dump_modify framerate command"); return 2; diff --git a/src/fix.cpp b/src/fix.cpp index c15f5638e2..549208a0ce 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -163,7 +163,7 @@ void Fix::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"respa") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (!respa_level_support) error->all(FLERR,"Illegal fix_modify command"); - int lvl = force->inumeric(FLERR,arg[iarg+1]); + int lvl = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (lvl < 0) error->all(FLERR,"Illegal fix_modify command"); respa_level = lvl-1; iarg += 2; diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index f8b8092c0d..c07b225f9d 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -46,7 +46,7 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) { if (narg < 5) error->all(FLERR,"Illegal fix adapt command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix adapt command"); dynamic_group_allow = 1; @@ -354,7 +354,7 @@ void FixAdapt::init() int nsub = 0; if ((cptr = strchr(pstyle,':'))) { *cptr = '\0'; - nsub = force->inumeric(FLERR,cptr+1); + nsub = utils::inumeric(FLERR,cptr+1,false,lmp); } if (lmp->suffix_enable) { diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 275ec2c846..d5c1bbef29 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -60,7 +60,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -68,7 +68,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -76,7 +76,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 710aec1ef8..a8d78f14e7 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -41,9 +41,9 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : { if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command"); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - peratom_freq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + peratom_freq = utils::inumeric(FLERR,arg[5],false,lmp); nvalues = narg - 6; diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index a5730c6e60..dd753ddc2d 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -57,9 +57,9 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); int n = strlen(arg[6]) + 1; idchunk = new char[n]; @@ -196,7 +196,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal fix ave/chunk command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/chunk command"); } iarg += 2; @@ -213,12 +213,12 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - adof = force->numeric(FLERR,arg[iarg+1]); + adof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cdof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - cdof = force->numeric(FLERR,arg[iarg+1]); + cdof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 510b7ca769..293b7fc296 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -55,9 +55,9 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -140,11 +140,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): iarg += 2; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"prefactor") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); - prefactor = force->numeric(FLERR,arg[iarg+1]); + prefactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index a07da83ed9..091ec19fff 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -57,9 +57,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; vector_flag = 1; @@ -70,9 +70,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : extarray = 0; dynamic_group_allow = 1; - lo = force->numeric(FLERR,arg[6]); - hi = force->numeric(FLERR,arg[7]); - nbins = force->inumeric(FLERR,arg[8]); + lo = utils::numeric(FLERR,arg[6],false,lmp); + hi = utils::numeric(FLERR,arg[7],false,lmp); + nbins = utils::inumeric(FLERR,arg[8],false,lmp); // scan values to count them // then read options so know mode = SCALAR/VECTOR before re-reading values @@ -985,14 +985,14 @@ void FixAveHisto::options(int iarg, int narg, char **arg) else error->all(FLERR,"Illegal fix ave/histo command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index a2c18361f6..4cc8cc3d3d 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -56,9 +56,9 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -1058,14 +1058,14 @@ void FixAveTime::options(int iarg, int narg, char **arg) else error->all(FLERR,"Illegal fix ave/time command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); @@ -1076,7 +1076,7 @@ void FixAveTime::options(int iarg, int narg, char **arg) } else if (strcmp(arg[iarg],"off") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); memory->grow(offlist,noff+1,"ave/time:offlist"); - offlist[noff++] = force->inumeric(FLERR,arg[iarg+1]); + offlist[noff++] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { overwrite = 1; diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 8ad07780a9..b5b2527e25 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -55,7 +55,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -65,7 +65,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -75,7 +75,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index f374a7c5c5..7cee835375 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -52,9 +52,9 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : int dimension = domain->dimension; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix balance command"); - thresh = force->numeric(FLERR,arg[4]); + thresh = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"shift") == 0) lbstyle = SHIFT; else if (strcmp(arg[5],"rcb") == 0) lbstyle = BISECTION; @@ -66,9 +66,9 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : if (strlen(arg[iarg+1]) > 3) error->all(FLERR,"Illegal fix balance command"); strcpy(bstr,arg[iarg+1]); - nitermax = force->inumeric(FLERR,arg[iarg+2]); + nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nitermax <= 0) error->all(FLERR,"Illegal fix balance command"); - stopthresh = force->numeric(FLERR,arg[iarg+3]); + stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (stopthresh < 1.0) error->all(FLERR,"Illegal fix balance command"); iarg += 4; } else if (lbstyle == BISECTION) { diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 832799831e..39760e9479 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -90,7 +90,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"iso") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = XYZ; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_target[2] = 0.0; @@ -100,7 +100,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = NONE; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_target[2] = 0.0; @@ -111,7 +111,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_target[3] = p_target[4] = p_target[5] = 0.0; p_flag[3] = p_flag[4] = p_flag[5] = 1; @@ -123,19 +123,19 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[0] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[1] = force->numeric(FLERR,arg[iarg+1]); + p_target[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 2; @@ -144,7 +144,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[3] = force->numeric(FLERR,arg[iarg+1]); + p_target[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -153,7 +153,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix box/relax command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[4] = force->numeric(FLERR,arg[iarg+1]); + p_target[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -162,7 +162,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix box/relax command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[5] = force->numeric(FLERR,arg[iarg+1]); + p_target[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -186,11 +186,11 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"vmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - vmax = force->numeric(FLERR,arg[iarg+1]); + vmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix box/relax command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -213,9 +213,9 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix box/relax command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else error->all(FLERR,"Illegal fix box/relax command"); } diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index f7012e5565..4b12c393cb 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -43,13 +43,13 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix controller command"); - alpha = force->numeric(FLERR,arg[4]); - kp = force->numeric(FLERR,arg[5]); - ki = force->numeric(FLERR,arg[6]); - kd = force->numeric(FLERR,arg[7]); + alpha = utils::numeric(FLERR,arg[4],false,lmp); + kp = utils::numeric(FLERR,arg[5],false,lmp); + ki = utils::numeric(FLERR,arg[6],false,lmp); + kd = utils::numeric(FLERR,arg[7],false,lmp); // process variable arg @@ -84,7 +84,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : // setpoint arg - setpoint = force->numeric(FLERR,arg[iarg]); + setpoint = utils::numeric(FLERR,arg[iarg],false,lmp); iarg++; // control variable arg diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index 2514f28fa5..b4c36ca43e 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -50,7 +50,7 @@ rfix(NULL), irregular(NULL), set(NULL) restart_global = 1; pre_exchange_migrate = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix deform command"); // set defaults @@ -77,34 +77,34 @@ rfix(NULL), irregular(NULL), set(NULL) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = FINAL; - set[index].flo = force->numeric(FLERR,arg[iarg+2]); - set[index].fhi = force->numeric(FLERR,arg[iarg+3]); + set[index].flo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].fhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = DELTA; - set[index].dlo = force->numeric(FLERR,arg[iarg+2]); - set[index].dhi = force->numeric(FLERR,arg[iarg+3]); + set[index].dlo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].dhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg+1],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = SCALE; - set[index].scale = force->numeric(FLERR,arg[iarg+2]); + set[index].scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"vel") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = VEL; - set[index].vel = force->numeric(FLERR,arg[iarg+2]); + set[index].vel = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"erate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = ERATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"trate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = TRATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"volume") == 0) { set[index].style = VOLUME; @@ -112,8 +112,8 @@ rfix(NULL), irregular(NULL), set(NULL) } else if (strcmp(arg[iarg+1],"wiggle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = WIGGLE; - set[index].amplitude = force->numeric(FLERR,arg[iarg+2]); - set[index].tperiod = force->numeric(FLERR,arg[iarg+3]); + set[index].amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].tperiod = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (set[index].tperiod <= 0.0) error->all(FLERR,"Illegal fix deform command"); iarg += 4; @@ -149,33 +149,33 @@ rfix(NULL), irregular(NULL), set(NULL) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = FINAL; - set[index].ftilt = force->numeric(FLERR,arg[iarg+2]); + set[index].ftilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = DELTA; - set[index].dtilt = force->numeric(FLERR,arg[iarg+2]); + set[index].dtilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"vel") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = VEL; - set[index].vel = force->numeric(FLERR,arg[iarg+2]); + set[index].vel = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"erate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = ERATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"trate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = TRATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"wiggle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = WIGGLE; - set[index].amplitude = force->numeric(FLERR,arg[iarg+2]); - set[index].tperiod = force->numeric(FLERR,arg[iarg+3]); + set[index].amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].tperiod = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (set[index].tperiod <= 0.0) error->all(FLERR,"Illegal fix deform command"); iarg += 4; diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp index 9af5a37675..5b74b75fcd 100644 --- a/src/fix_drag.cpp +++ b/src/fix_drag.cpp @@ -42,14 +42,14 @@ FixDrag::FixDrag(LAMMPS *lmp, int narg, char **arg) : xflag = yflag = zflag = 1; if (strcmp(arg[3],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[3]); + else xc = utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[4]); + else yc = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[5]); + else zc = utils::numeric(FLERR,arg[5],false,lmp); - f_mag = force->numeric(FLERR,arg[6]); - delta = force->numeric(FLERR,arg[7]); + f_mag = utils::numeric(FLERR,arg[6],false,lmp); + delta = utils::numeric(FLERR,arg[7],false,lmp); force_flag = 0; ftotal[0] = ftotal[1] = ftotal[2] = 0.0; diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index da4bdad827..8fb4f0cdfc 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -50,16 +50,16 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) : extvector = 0; dynamic_group_allow = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix dt/reset command"); minbound = maxbound = 1; tmin = tmax = 0.0; if (strcmp(arg[4],"NULL") == 0) minbound = 0; - else tmin = force->numeric(FLERR,arg[4]); + else tmin = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) maxbound = 0; - else tmax = force->numeric(FLERR,arg[5]); - xmax = force->numeric(FLERR,arg[6]); + else tmax = utils::numeric(FLERR,arg[5],false,lmp); + xmax = utils::numeric(FLERR,arg[6],false,lmp); if (minbound && tmin < 0.0) error->all(FLERR,"Illegal fix dt/reset command"); if (maxbound && tmax < 0.0) error->all(FLERR,"Illegal fix dt/reset command"); @@ -80,7 +80,7 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"emax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix dt/reset command"); - emax = force->numeric(FLERR,arg[iarg+1]); + emax = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (emax <= 0.0) error->all(FLERR,"Illegal fix dt/reset command"); iarg += 2; } else error->all(FLERR,"Illegal fix dt/reset command"); diff --git a/src/fix_external.cpp b/src/fix_external.cpp index afb420df93..5d810ff38b 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -41,14 +41,14 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"pf/callback") == 0) { if (narg != 6) error->all(FLERR,"Illegal fix external command"); mode = PF_CALLBACK; - ncall = force->inumeric(FLERR,arg[4]); - napply = force->inumeric(FLERR,arg[5]); + ncall = utils::inumeric(FLERR,arg[4],false,lmp); + napply = utils::inumeric(FLERR,arg[5],false,lmp); if (ncall <= 0 || napply <= 0) error->all(FLERR,"Illegal fix external command"); } else if (strcmp(arg[3],"pf/array") == 0) { if (narg != 5) error->all(FLERR,"Illegal fix external command"); mode = PF_ARRAY; - napply = force->inumeric(FLERR,arg[4]); + napply = utils::inumeric(FLERR,arg[4],false,lmp); if (napply <= 0) error->all(FLERR,"Illegal fix external command"); } else error->all(FLERR,"Illegal fix external command"); diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 2c56181415..82b8311968 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -58,7 +58,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(mstr,&arg[3][2]); mstyle = EQUAL; } else { - magnitude = force->numeric(FLERR,arg[3]); + magnitude = utils::numeric(FLERR,arg[3],false,lmp); mstyle = CONSTANT; } @@ -73,7 +73,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(vstr,&arg[5][2]); vstyle = EQUAL; } else { - vert = force->numeric(FLERR,arg[5]); + vert = utils::numeric(FLERR,arg[5],false,lmp); vstyle = CONSTANT; } iarg = 6; @@ -87,7 +87,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(pstr,&arg[5][2]); pstyle = EQUAL; } else { - phi = force->numeric(FLERR,arg[5]); + phi = utils::numeric(FLERR,arg[5],false,lmp); pstyle = CONSTANT; } if (strstr(arg[6],"v_") == arg[6]) { @@ -96,7 +96,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[6][2]); tstyle = EQUAL; } else { - theta = force->numeric(FLERR,arg[6]); + theta = utils::numeric(FLERR,arg[6],false,lmp); tstyle = CONSTANT; } iarg = 7; @@ -110,7 +110,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(xstr,&arg[5][2]); xstyle = EQUAL; } else { - xdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[5],false,lmp); xstyle = CONSTANT; } if (strstr(arg[6],"v_") == arg[6]) { @@ -119,7 +119,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(ystr,&arg[6][2]); ystyle = EQUAL; } else { - ydir = force->numeric(FLERR,arg[6]); + ydir = utils::numeric(FLERR,arg[6],false,lmp); ystyle = CONSTANT; } if (strstr(arg[7],"v_") == arg[7]) { @@ -128,7 +128,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(zstr,&arg[7][2]); zstyle = EQUAL; } else { - zdir = force->numeric(FLERR,arg[7]); + zdir = utils::numeric(FLERR,arg[7],false,lmp); zstyle = CONSTANT; } iarg = 8; diff --git a/src/fix_group.cpp b/src/fix_group.cpp index d2eea9f781..5e2a12c988 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -86,7 +86,7 @@ idregion(NULL), idvar(NULL), idprop(NULL) iarg += 2; } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal group command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal group command"); iarg += 2; } else error->all(FLERR,"Illegal group command"); diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index c5960dfe13..cf39ba61e2 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -42,7 +42,7 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), idvar(NULL), dlimit_path(NULL) { if (narg < 7) error->all(FLERR,"Illegal fix halt command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix halt command"); // comparison args @@ -80,7 +80,7 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Invalid fix halt operator"); ++iarg; - value = force->numeric(FLERR,arg[iarg]); + value = utils::numeric(FLERR,arg[iarg],false,lmp); // parse optional args diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index 65ca47c46d..7fbdd24b4c 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -47,7 +47,7 @@ idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) global_freq = 1; extscalar = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix heat command"); hstr = NULL; @@ -57,7 +57,7 @@ idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) hstr = new char[n]; strcpy(hstr,&arg[4][2]); } else { - heat_input = force->numeric(FLERR,arg[4]); + heat_input = utils::numeric(FLERR,arg[4],false,lmp); hstyle = CONSTANT; } diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index 04837ff39b..dcddad95b2 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -53,7 +53,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); k3 = k/3.0; // read options from end of input line @@ -421,22 +421,22 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+1][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+1][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+1]); + } else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+2]); + } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); - } else rvalue = force->numeric(FLERR,arg[iarg+4]); + } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = SPHERE; iarg += 5; @@ -450,43 +450,43 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+2]); + } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"y") == 0) { cdim = 1; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+2]); + } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"z") == 0) { cdim = 2; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+2]); + } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+3][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+3]); + } else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else error->all(FLERR,"Illegal fix indent command"); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); - } else rvalue = force->numeric(FLERR,arg[iarg+4]); + } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = CYLINDER; iarg += 5; @@ -502,7 +502,7 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+2][2]) + 1; pstr = new char[n]; strcpy(pstr,&arg[iarg+2][2]); - } else pvalue = force->numeric(FLERR,arg[iarg+2]); + } else pvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1; else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 4ec34a3631..81c186c703 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -69,14 +69,14 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : tstr = new char[n]; strcpy(tstr,&arg[3][2]); } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix langevin command"); @@ -107,7 +107,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command"); if (strcmp(arg[iarg+1],"no") == 0) ascale = 0.0; - else ascale = force->numeric(FLERR,arg[iarg+1]); + else ascale = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gjf") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command"); @@ -133,8 +133,8 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix langevin command"); - int itype = force->inumeric(FLERR,arg[iarg+1]); - double scale = force->numeric(FLERR,arg[iarg+2]); + int itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + double scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Illegal fix langevin command"); ratio[itype] = scale; diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index c153ee65dd..0287c8c0db 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -31,9 +31,9 @@ FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; if (narg != 6) error->all(FLERR,"Illegal fix lineforce command"); - xdir = force->numeric(FLERR,arg[3]); - ydir = force->numeric(FLERR,arg[4]); - zdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[3],false,lmp); + ydir = utils::numeric(FLERR,arg[4],false,lmp); + zdir = utils::numeric(FLERR,arg[5],false,lmp); double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir); if (len == 0.0) error->all(FLERR,"Illegal fix lineforce command"); diff --git a/src/fix_momentum.cpp b/src/fix_momentum.cpp index a363cb8eac..c1056d2b16 100644 --- a/src/fix_momentum.cpp +++ b/src/fix_momentum.cpp @@ -34,7 +34,7 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix momentum command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix momentum command"); dynamic = linear = angular = rescale = 0; @@ -44,9 +44,9 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"linear") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command"); linear = 1; - xflag = force->inumeric(FLERR,arg[iarg+1]); - yflag = force->inumeric(FLERR,arg[iarg+2]); - zflag = force->inumeric(FLERR,arg[iarg+3]); + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"angular") == 0) { angular = 1; diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 8c58146c52..d6f61af091 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -75,17 +75,17 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) vxflag = 0; else { vxflag = 1; - vx = force->numeric(FLERR,arg[4]); + vx = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) vyflag = 0; else { vyflag = 1; - vy = force->numeric(FLERR,arg[5]); + vy = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) vzflag = 0; else { vzflag = 1; - vz = force->numeric(FLERR,arg[6]); + vz = utils::numeric(FLERR,arg[6],false,lmp); } } else if (strcmp(arg[3],"wiggle") == 0) { @@ -95,32 +95,32 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) axflag = 0; else { axflag = 1; - ax = force->numeric(FLERR,arg[4]); + ax = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) ayflag = 0; else { ayflag = 1; - ay = force->numeric(FLERR,arg[5]); + ay = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) azflag = 0; else { azflag = 1; - az = force->numeric(FLERR,arg[6]); + az = utils::numeric(FLERR,arg[6],false,lmp); } - period = force->numeric(FLERR,arg[7]); + period = utils::numeric(FLERR,arg[7],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); } else if (strcmp(arg[3],"rotate") == 0) { if (narg < 11) error->all(FLERR,"Illegal fix move command"); iarg = 11; mstyle = ROTATE; - point[0] = force->numeric(FLERR,arg[4]); - point[1] = force->numeric(FLERR,arg[5]); - point[2] = force->numeric(FLERR,arg[6]); - axis[0] = force->numeric(FLERR,arg[7]); - axis[1] = force->numeric(FLERR,arg[8]); - axis[2] = force->numeric(FLERR,arg[9]); - period = force->numeric(FLERR,arg[10]); + point[0] = utils::numeric(FLERR,arg[4],false,lmp); + point[1] = utils::numeric(FLERR,arg[5],false,lmp); + point[2] = utils::numeric(FLERR,arg[6],false,lmp); + axis[0] = utils::numeric(FLERR,arg[7],false,lmp); + axis[1] = utils::numeric(FLERR,arg[8],false,lmp); + axis[2] = utils::numeric(FLERR,arg[9],false,lmp); + period = utils::numeric(FLERR,arg[10],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); } else if (strcmp(arg[3],"variable") == 0) { diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index e3d0d2830a..d951a924fe 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -45,7 +45,7 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : newton_pair = force->newton_pair; - dnum = force->inumeric(FLERR,arg[3]); + dnum = utils::inumeric(FLERR,arg[3],false,lmp); dnumbytes = dnum * sizeof(double); zeroes = new double[dnum]; diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 014a2b8855..0e3dc8931f 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -129,10 +129,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix nvt/npt/nph cannot be 0.0"); @@ -141,10 +141,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"iso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -154,10 +154,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -168,15 +168,15 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_start[3] = p_start[4] = p_start[5] = 0.0; p_stop[3] = p_stop[4] = p_stop[5] = 0.0; p_period[3] = p_period[4] = p_period[5] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = p_flag[4] = p_flag[5] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -189,25 +189,25 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 4; @@ -216,9 +216,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[3] = force->numeric(FLERR,arg[iarg+1]); - p_stop[3] = force->numeric(FLERR,arg[iarg+2]); - p_period[3] = force->numeric(FLERR,arg[iarg+3]); + p_start[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[3] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -227,9 +227,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[4] = force->numeric(FLERR,arg[iarg+1]); - p_stop[4] = force->numeric(FLERR,arg[iarg+2]); - p_period[4] = force->numeric(FLERR,arg[iarg+3]); + p_start[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[4] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[4] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -238,9 +238,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[5] = force->numeric(FLERR,arg[iarg+1]); - p_stop[5] = force->numeric(FLERR,arg[iarg+2]); - p_period[5] = force->numeric(FLERR,arg[iarg+3]); + p_start[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[5] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[5] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -258,12 +258,12 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"drag") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - drag = force->numeric(FLERR,arg[iarg+1]); + drag = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"ptemp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_temp = force->numeric(FLERR,arg[iarg+1]); + p_temp = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_temp_flag = 1; if (p_temp <= 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; @@ -284,14 +284,14 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -302,17 +302,17 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -349,9 +349,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; // disc keyword is also parsed in fix/nh/sphere diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index a4ac86e0c5..f6d064b794 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -50,8 +50,8 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 3; respa_level_support = 1; - nevery = force->inumeric(FLERR,arg[3]); - delta = force->numeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + delta = utils::numeric(FLERR,arg[4],false,lmp); if (nevery <= 0 || delta <= 0.0) error->all(FLERR,"Illegal fix numdiff command"); diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index d63c736e73..83a6af5d0c 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -40,7 +40,7 @@ FixNVELimit::FixNVELimit(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; dynamic_group_allow = 1; - xlimit = force->numeric(FLERR,arg[3]); + xlimit = utils::numeric(FLERR,arg[3],false,lmp); ncount = 0; } diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index a3f27277bd..9434a4b348 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -31,9 +31,9 @@ FixPlaneForce::FixPlaneForce(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; if (narg != 6) error->all(FLERR,"Illegal fix planeforce command"); - xdir = force->numeric(FLERR,arg[3]); - ydir = force->numeric(FLERR,arg[4]); - zdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[3],false,lmp); + ydir = utils::numeric(FLERR,arg[4],false,lmp); + zdir = utils::numeric(FLERR,arg[5],false,lmp); double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir); if (len == 0.0) error->all(FLERR,"Illegal fix planeforce command"); diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index db6d56799a..a430130fe4 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -68,9 +68,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = p_period[1] = p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -81,9 +81,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = p_period[1] = p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -94,25 +94,25 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; if (dimension == 2) @@ -132,7 +132,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"modulus") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - bulkmodulus = force->numeric(FLERR,arg[iarg+1]); + bulkmodulus = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (bulkmodulus <= 0.0) error->all(FLERR,"Illegal fix press/berendsen command"); iarg += 2; diff --git a/src/fix_print.cpp b/src/fix_print.cpp index fac639ae63..8964a9ba82 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -40,7 +40,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : strcpy(var_print,&arg[3][2]); nevery = 1; } else { - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix print command"); } diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index afedf9c12c..c1c0150177 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -25,8 +25,8 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), count(NULL), extra(NULL) { - nextra = force->inumeric(FLERR,arg[3]); - int nfix = force->inumeric(FLERR,arg[4]); + nextra = utils::inumeric(FLERR,arg[3],false,lmp); + int nfix = utils::inumeric(FLERR,arg[4],false,lmp); // perform initial allocation of atom-based array // register with Atom class diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index f461e0fa52..8997e4b805 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -56,13 +56,13 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"NULL") == 0) xflag = 0; else if (strcmp(arg[3],"INIT") == 0) xinitflag = 1; - else xcom = force->numeric(FLERR,arg[3]); + else xcom = utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) yflag = 0; else if (strcmp(arg[4],"INIT") == 0) yinitflag = 1; - else ycom = force->numeric(FLERR,arg[4]); + else ycom = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) zflag = 0; else if (strcmp(arg[5],"INIT") == 0) zinitflag = 1; - else zcom = force->numeric(FLERR,arg[5]); + else zcom = utils::numeric(FLERR,arg[5],false,lmp); // optional args diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index 742dd5c58b..459b30c1b2 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -28,7 +28,7 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : { // nlevels = # of rRESPA levels - nlevels = force->inumeric(FLERR,arg[3]); + nlevels = utils::inumeric(FLERR,arg[3],false,lmp); // optional arguments store_torque = 0; diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 07ff7dc13c..305ee0ea26 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -83,62 +83,62 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"bond") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = BOND; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+3]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - deqstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + deqstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); if (iarg+6 == narg) { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); iarg += 7; } } else if (strcmp(arg[iarg],"lbound") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = LBOUND; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+3]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - deqstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + deqstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); if (iarg+6 == narg) { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); iarg += 7; } } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+7 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = ANGLE; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - ids[nrestrain][2] = force->tnumeric(FLERR,arg[iarg+3]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); - target[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + ids[nrestrain][2] = utils::tnumeric(FLERR,arg[iarg+3],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + target[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); target[nrestrain] *= MY_PI / 180.0; iarg += 7; } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+8 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = DIHEDRAL; mult[nrestrain] = 1; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - ids[nrestrain][2] = force->tnumeric(FLERR,arg[iarg+3]); - ids[nrestrain][3] = force->tnumeric(FLERR,arg[iarg+4]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); - target[nrestrain] = force->numeric(FLERR,arg[iarg+7]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + ids[nrestrain][2] = utils::tnumeric(FLERR,arg[iarg+3],false,lmp); + ids[nrestrain][3] = utils::tnumeric(FLERR,arg[iarg+4],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); + target[nrestrain] = utils::numeric(FLERR,arg[iarg+7],false,lmp); target[nrestrain] *= MY_PI / 180.0; cos_target[nrestrain] = cos(target[nrestrain]); sin_target[nrestrain] = sin(target[nrestrain]); iarg += 8; if ((iarg < narg) && (strcmp("mult",arg[iarg]) == 0)) { if (iarg+1 > narg) error->all(FLERR,"Illegal fix restrain command"); - mult[nrestrain] = force->inumeric(FLERR,arg[iarg+1]); + mult[nrestrain] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mult[nrestrain] < 0) error->all(FLERR,"Illegal fix restrain command"); iarg += 2; diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 108d18afb6..1a3158ed4c 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -55,7 +55,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -65,7 +65,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -75,7 +75,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 510b194ab7..1bd76f5c55 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -53,15 +53,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"tether") == 0) { if (narg != 9) error->all(FLERR,"Illegal fix spring command"); styleflag = TETHER; - k_spring = force->numeric(FLERR,arg[4]); + k_spring = utils::numeric(FLERR,arg[4],false,lmp); xflag = yflag = zflag = 1; if (strcmp(arg[5],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[5]); + else xc = utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[6]); + else yc = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[7]); - r0 = force->numeric(FLERR,arg[8]); + else zc = utils::numeric(FLERR,arg[7],false,lmp); + r0 = utils::numeric(FLERR,arg[8],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command"); } else if (strcmp(arg[3],"couple") == 0) { @@ -78,15 +78,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Two groups cannot be the same in fix spring couple"); group2bit = group->bitmask[igroup2]; - k_spring = force->numeric(FLERR,arg[5]); + k_spring = utils::numeric(FLERR,arg[5],false,lmp); xflag = yflag = zflag = 1; if (strcmp(arg[6],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[6]); + else xc = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[7]); + else yc = utils::numeric(FLERR,arg[7],false,lmp); if (strcmp(arg[8],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[8]); - r0 = force->numeric(FLERR,arg[9]); + else zc = utils::numeric(FLERR,arg[8],false,lmp); + r0 = utils::numeric(FLERR,arg[9],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command"); } else error->all(FLERR,"Illegal fix spring command"); diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index f9f36e11e9..778a6f0c43 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -45,7 +45,7 @@ FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - k_spring = force->numeric(FLERR,arg[3]); + k_spring = utils::numeric(FLERR,arg[3],false,lmp); int n = strlen(arg[4]) + 1; idchunk = new char[n]; diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 1c65023169..e3ba935340 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -37,10 +37,10 @@ FixSpringRG::FixSpringRG(LAMMPS *lmp, int narg, char **arg) : { if (narg != 5) error->all(FLERR,"Illegal fix spring/rg command"); - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); rg0_flag = 0; if (strcmp(arg[4],"NULL") == 0) rg0_flag = 1; - else rg0 = force->numeric(FLERR,arg[4]); + else rg0 = utils::numeric(FLERR,arg[4],false,lmp); restart_global = 1; scalar_flag = 1; diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 4f8a03c8bd..fef7e2086c 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -44,7 +44,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; respa_level_support = 1; - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); if (k <= 0.0) error->all(FLERR,"Illegal fix spring/self command"); xflag = yflag = zflag = 1; diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3cf3125be5..8ce94fb54a 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -52,16 +52,16 @@ vstore(NULL), astore(NULL), rbuf(NULL) if (flavor == GLOBAL) { restart_global = 1; - nrow = force->inumeric(FLERR,arg[4]); - ncol = force->inumeric(FLERR,arg[5]); + nrow = utils::inumeric(FLERR,arg[4],false,lmp); + ncol = utils::inumeric(FLERR,arg[5],false,lmp); if (nrow <= 0 || ncol <= 0) error->all(FLERR,"Illegal fix store command"); vecflag = 0; if (ncol == 1) vecflag = 1; } if (flavor == PERATOM) { - restart_peratom = force->inumeric(FLERR,arg[4]); - nvalues = force->inumeric(FLERR,arg[5]); + restart_peratom = utils::inumeric(FLERR,arg[4],false,lmp); + nvalues = utils::inumeric(FLERR,arg[5],false,lmp); if (restart_peratom < 0 or restart_peratom > 1 || nvalues <= 0) error->all(FLERR,"Illegal fix store command"); vecflag = 0; diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index e1e2aab663..60a1a70037 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -47,7 +47,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; peratom_freq = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix store/state command"); // parse values until one isn't recognized diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 7a1d1d06fc..5016b8c343 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -57,13 +57,13 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); // error checks diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index 89664d9913..5a7b9a04db 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -63,14 +63,14 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // error checks diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 90200e2566..72e4dd635d 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -140,14 +140,14 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // error checks diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 083f590c9a..e575d72f7f 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -41,7 +41,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale command"); restart_global = 1; @@ -57,14 +57,14 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[4][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[5]); - t_window = force->numeric(FLERR,arg[6]); - fraction = force->numeric(FLERR,arg[7]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); + t_window = utils::numeric(FLERR,arg[6],false,lmp); + fraction = utils::numeric(FLERR,arg[7],false,lmp); // create a new compute temp // id = fix-ID + temp, compute group = fix group diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 5db7bacbc6..98fb373075 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -45,8 +45,8 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) { if (narg < 6) error->all(FLERR,"Illegal fix tmd command"); - rho_stop = force->numeric(FLERR,arg[3]); - nfileevery = force->inumeric(FLERR,arg[5]); + rho_stop = utils::numeric(FLERR,arg[3],false,lmp); + nfileevery = utils::inumeric(FLERR,arg[5],false,lmp); if (rho_stop < 0 || nfileevery < 0) error->all(FLERR,"Illegal fix tmd command"); if (nfileevery && narg != 7) error->all(FLERR,"Illegal fix tmd command"); diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 53093acbf6..48f14f5e2f 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -42,7 +42,7 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : { if (narg < 5) error->all(FLERR,"Illegal fix vector command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix vector command"); nvalues = narg-4; diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index bdd1e19976..7d532d832d 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -32,7 +32,7 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix viscous command"); - double gamma_one = force->numeric(FLERR,arg[3]); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); gamma = new double[atom->ntypes+1]; for (int i = 1; i <= atom->ntypes; i++) gamma[i] = gamma_one; @@ -42,8 +42,8 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix viscous command"); - int itype = force->inumeric(FLERR,arg[iarg+1]); - double scale = force->numeric(FLERR,arg[iarg+2]); + int itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + double scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Illegal fix viscous command"); gamma[itype] = gamma_one * scale; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index a30b14c231..0c343938ab 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -87,7 +87,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(xstr[nwall],&arg[iarg+1][2]); } else { xstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { @@ -96,7 +96,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(estr[nwall],&arg[iarg+2][2]); estyle[nwall] = VARIABLE; } else { - epsilon[nwall] = force->numeric(FLERR,arg[iarg+2]); + epsilon[nwall] = utils::numeric(FLERR,arg[iarg+2],false,lmp); estyle[nwall] = CONSTANT; } @@ -107,7 +107,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(astr[nwall],&arg[iarg+3][2]); astyle[nwall] = VARIABLE; } else { - alpha[nwall] = force->numeric(FLERR,arg[iarg+3]); + alpha[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); astyle[nwall] = CONSTANT; } ++iarg; @@ -119,11 +119,11 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(sstr[nwall],&arg[iarg+3][2]); sstyle[nwall] = VARIABLE; } else { - sigma[nwall] = force->numeric(FLERR,arg[iarg+3]); + sigma[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); sstyle[nwall] = CONSTANT; } - cutoff[nwall] = force->numeric(FLERR,arg[iarg+4]); + cutoff[nwall] = utils::numeric(FLERR,arg[iarg+4],false,lmp); nwall++; iarg += 5; diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index 032a11e328..061083e55c 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -79,7 +79,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : strcpy(varstr[nwall],&arg[iarg+1][2]); } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } nwall++; diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 70bde90d2b..e60b3b4aad 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -71,18 +71,18 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : if (narg != 9) error->all(FLERR,"Illegal fix wall/region command"); - epsilon = force->numeric(FLERR,arg[5]); - alpha = force->numeric(FLERR,arg[6]); - sigma = force->numeric(FLERR,arg[7]); - cutoff = force->numeric(FLERR,arg[8]); + epsilon = utils::numeric(FLERR,arg[5],false,lmp); + alpha = utils::numeric(FLERR,arg[6],false,lmp); + sigma = utils::numeric(FLERR,arg[7],false,lmp); + cutoff = utils::numeric(FLERR,arg[8],false,lmp); } else { if (narg != 8) error->all(FLERR,"Illegal fix wall/region command"); - epsilon = force->numeric(FLERR,arg[5]); - sigma = force->numeric(FLERR,arg[6]); - cutoff = force->numeric(FLERR,arg[7]); + epsilon = utils::numeric(FLERR,arg[5],false,lmp); + sigma = utils::numeric(FLERR,arg[6],false,lmp); + cutoff = utils::numeric(FLERR,arg[7],false,lmp); } if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region cutoff <= 0.0"); diff --git a/src/force.cpp b/src/force.cpp index 13b1971545..cb0e0ac5a8 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -799,21 +799,21 @@ void Force::set_special(int narg, char **arg) iarg += 1; } else if (strcmp(arg[iarg],"lj/coul") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_lj[1] = special_coul[1] = numeric(FLERR,arg[iarg+1]); - special_lj[2] = special_coul[2] = numeric(FLERR,arg[iarg+2]); - special_lj[3] = special_coul[3] = numeric(FLERR,arg[iarg+3]); + special_lj[1] = special_coul[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_lj[2] = special_coul[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_lj[3] = special_coul[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"lj") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_lj[1] = numeric(FLERR,arg[iarg+1]); - special_lj[2] = numeric(FLERR,arg[iarg+2]); - special_lj[3] = numeric(FLERR,arg[iarg+3]); + special_lj[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_lj[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_lj[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"coul") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_coul[1] = numeric(FLERR,arg[iarg+1]); - special_coul[2] = numeric(FLERR,arg[iarg+2]); - special_coul[3] = numeric(FLERR,arg[iarg+3]); + special_coul[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_coul[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_coul[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command"); @@ -836,104 +836,6 @@ void Force::set_special(int narg, char **arg) error->all(FLERR,"Illegal special_bonds command"); } -/* ---------------------------------------------------------------------- - read a floating point value from a string - generate an error if not a legitimate floating point value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -double Force::numeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected floating point parameter instead of" - " NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i])) continue; - if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue; - if (str[i] == 'e' || str[i] == 'E') continue; - error->all(file,line,fmt::format("Expected floating point parameter " - "instead of '{}' in input script or data file",str)); - } - - return atof(str); -} - -/* ---------------------------------------------------------------------- - read an integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -int Force::inumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return atoi(str); -} - -/* ---------------------------------------------------------------------- - read a big integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -bigint Force::bnumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return ATOBIGINT(str); -} - -/* ---------------------------------------------------------------------- - read a tag integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -tagint Force::tnumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return ATOTAGINT(str); -} - /* ---------------------------------------------------------------------- open a potential file as specified by name if fails, search in dir specified by env variable LAMMPS_POTENTIALS diff --git a/src/force.h b/src/force.h index 929d29d8e5..8d3ae25294 100644 --- a/src/force.h +++ b/src/force.h @@ -128,10 +128,6 @@ class Force : protected Pointers { void store_style(char *&, const std::string &, int); void set_special(int, char **); - double numeric(const char *, int, char *); - int inumeric(const char *, int, char *); - bigint bnumeric(const char *, int, char *); - tagint tnumeric(const char *, int, char *); FILE *open_potential(const char *, int *auto_convert = nullptr); diff --git a/src/group.cpp b/src/group.cpp index 79405c9344..2377f028bd 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -229,12 +229,12 @@ void Group::assign(int narg, char **arg) else error->all(FLERR,"Illegal group command"); tagint bound1,bound2; - bound1 = force->tnumeric(FLERR,arg[3]); + bound1 = utils::tnumeric(FLERR,arg[3],false,lmp); bound2 = -1; if (condition == BETWEEN) { if (narg != 5) error->all(FLERR,"Illegal group command"); - bound2 = force->tnumeric(FLERR,arg[4]); + bound2 = utils::tnumeric(FLERR,arg[4],false,lmp); } else if (narg != 4) error->all(FLERR,"Illegal group command"); int *attribute = NULL; @@ -311,13 +311,13 @@ void Group::assign(int narg, char **arg) delta = 1; if (strchr(arg[iarg],':')) { ptr = strtok(arg[iarg],":"); - start = force->tnumeric(FLERR,ptr); + start = utils::tnumeric(FLERR,ptr,false,lmp); ptr = strtok(NULL,":"); - stop = force->tnumeric(FLERR,ptr); + stop = utils::tnumeric(FLERR,ptr,false,lmp); ptr = strtok(NULL,":"); - if (ptr) delta = force->tnumeric(FLERR,ptr); + if (ptr) delta = utils::tnumeric(FLERR,ptr,false,lmp); } else { - start = stop = force->tnumeric(FLERR,arg[iarg]); + start = stop = utils::tnumeric(FLERR,arg[iarg],false,lmp); } if (delta < 1) error->all(FLERR,"Illegal range increment value"); diff --git a/src/image.cpp b/src/image.cpp index e264ba3979..56d9bc301a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1708,13 +1708,13 @@ int ColorMap::reset(int narg, char **arg) { if (!islower(arg[0][0])) { mlo = NUMERIC; - mlovalue = force->numeric(FLERR,arg[0]); + mlovalue = utils::numeric(FLERR,arg[0],false,lmp); } else if (strcmp(arg[0],"min") == 0) mlo = MINVALUE; else return 1; if (!islower(arg[1][0])) { mhi = NUMERIC; - mhivalue = force->numeric(FLERR,arg[1]); + mhivalue = utils::numeric(FLERR,arg[1],false,lmp); } else if (strcmp(arg[1],"max") == 0) mhi = MAXVALUE; else return 1; @@ -1733,12 +1733,12 @@ int ColorMap::reset(int narg, char **arg) else return 1; if (mstyle == SEQUENTIAL) { - mbinsize = force->numeric(FLERR,arg[3]); + mbinsize = utils::numeric(FLERR,arg[3],false,lmp); if (mbinsize <= 0.0) return 1; mbinsizeinv = 1.0/mbinsize; } - nentry = force->inumeric(FLERR,arg[4]); + nentry = utils::inumeric(FLERR,arg[4],false,lmp); if (nentry < 1) return 1; delete [] mentry; mentry = new MapEntry[nentry]; @@ -1751,7 +1751,7 @@ int ColorMap::reset(int narg, char **arg) if (n+2 > narg) return 1; if (!islower(arg[n][0])) { mentry[i].single = NUMERIC; - mentry[i].svalue = force->numeric(FLERR,arg[n]); + mentry[i].svalue = utils::numeric(FLERR,arg[n],false,lmp); } else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE; else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE; else return 1; @@ -1761,13 +1761,13 @@ int ColorMap::reset(int narg, char **arg) if (n+3 > narg) return 1; if (!islower(arg[n][0])) { mentry[i].lo = NUMERIC; - mentry[i].lvalue = force->numeric(FLERR,arg[n]); + mentry[i].lvalue = utils::numeric(FLERR,arg[n],false,lmp); } else if (strcmp(arg[n],"min") == 0) mentry[i].lo = MINVALUE; else if (strcmp(arg[n],"max") == 0) mentry[i].lo = MAXVALUE; else return 1; if (!islower(arg[n+1][0])) { mentry[i].hi = NUMERIC; - mentry[i].hvalue = force->numeric(FLERR,arg[n+1]); + mentry[i].hvalue = utils::numeric(FLERR,arg[n+1],false,lmp); } else if (strcmp(arg[n+1],"min") == 0) mentry[i].hi = MINVALUE; else if (strcmp(arg[n+1],"max") == 0) mentry[i].hi = MAXVALUE; else return 1; diff --git a/src/imbalance_group.cpp b/src/imbalance_group.cpp index dd3370ae92..72b1028791 100644 --- a/src/imbalance_group.cpp +++ b/src/imbalance_group.cpp @@ -40,7 +40,7 @@ int ImbalanceGroup::options(int narg, char **arg) { if (narg < 3) error->all(FLERR,"Illegal balance weight command"); - num = force->inumeric(FLERR,arg[0]); + num = utils::inumeric(FLERR,arg[0],false,lmp); if (num < 1) error->all(FLERR,"Illegal balance weight command"); if (2*num+1 > narg) error->all(FLERR,"Illegal balance weight command"); @@ -50,7 +50,7 @@ int ImbalanceGroup::options(int narg, char **arg) id[i] = group->find(arg[2*i+1]); if (id[i] < 0) error->all(FLERR,"Unknown group in balance weight command"); - factor[i] = force->numeric(FLERR,arg[2*i+2]); + factor[i] = utils::numeric(FLERR,arg[2*i+2],false,lmp); if (factor[i] <= 0.0) error->all(FLERR,"Illegal balance weight command"); } return 2*num+1; diff --git a/src/imbalance_neigh.cpp b/src/imbalance_neigh.cpp index c50b430c51..0beb62bdb4 100644 --- a/src/imbalance_neigh.cpp +++ b/src/imbalance_neigh.cpp @@ -38,7 +38,7 @@ ImbalanceNeigh::ImbalanceNeigh(LAMMPS *lmp) : Imbalance(lmp) int ImbalanceNeigh::options(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal balance weight command"); - factor = force->numeric(FLERR,arg[0]); + factor = utils::numeric(FLERR,arg[0],false,lmp); if (factor <= 0.0) error->all(FLERR,"Illegal balance weight command"); return 1; } diff --git a/src/imbalance_time.cpp b/src/imbalance_time.cpp index 898d3ceef0..99e549e90e 100644 --- a/src/imbalance_time.cpp +++ b/src/imbalance_time.cpp @@ -32,7 +32,7 @@ ImbalanceTime::ImbalanceTime(LAMMPS *lmp) : Imbalance(lmp) {} int ImbalanceTime::options(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal balance weight command"); - factor = force->numeric(FLERR,arg[0]); + factor = utils::numeric(FLERR,arg[0],false,lmp); if (factor <= 0.0) error->all(FLERR,"Illegal balance weight command"); return 1; } diff --git a/src/input.cpp b/src/input.cpp index a26bab5a0c..c74232648c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1100,7 +1100,7 @@ void Input::python() void Input::quit() { if (narg == 0) error->done(0); // 1 would be fully backwards compatible - if (narg == 1) error->done(force->inumeric(FLERR,arg[0])); + if (narg == 1) error->done(utils::inumeric(FLERR,arg[0],false,lmp)); error->all(FLERR,"Illegal quit command"); } @@ -1374,7 +1374,7 @@ void Input::compute_modify() void Input::dielectric() { if (narg != 1) error->all(FLERR,"Illegal dielectric command"); - force->dielectric = force->numeric(FLERR,arg[0]); + force->dielectric = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- */ @@ -1408,7 +1408,7 @@ void Input::dimension() if (narg != 1) error->all(FLERR,"Illegal dimension command"); if (domain->box_exist) error->all(FLERR,"Dimension command after simulation box is defined"); - domain->dimension = force->inumeric(FLERR,arg[0]); + domain->dimension = utils::inumeric(FLERR,arg[0],false,lmp); if (domain->dimension != 2 && domain->dimension != 3) error->all(FLERR,"Illegal dimension command"); @@ -1818,7 +1818,7 @@ void Input::timer_command() void Input::timestep() { if (narg != 1) error->all(FLERR,"Illegal timestep command"); - update->dt = force->numeric(FLERR,arg[0]); + update->dt = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- */ diff --git a/src/kspace.cpp b/src/kspace.cpp index 13be635794..2485db67b8 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -453,9 +453,9 @@ void KSpace::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"mesh") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); - nx_pppm = nx_msm_max = force->inumeric(FLERR,arg[iarg+1]); - ny_pppm = ny_msm_max = force->inumeric(FLERR,arg[iarg+2]); - nz_pppm = nz_msm_max = force->inumeric(FLERR,arg[iarg+3]); + nx_pppm = nx_msm_max = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny_pppm = ny_msm_max = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz_pppm = nz_msm_max = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (nx_pppm == 0 && ny_pppm == 0 && nz_pppm == 0) gridflag = 0; else if (nx_pppm <= 0 || ny_pppm <= 0 || nz_pppm <= 0) @@ -465,9 +465,9 @@ void KSpace::modify_params(int narg, char **arg) iarg += 4; } else if (strcmp(arg[iarg],"mesh/disp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); - nx_pppm_6 = force->inumeric(FLERR,arg[iarg+1]); - ny_pppm_6 = force->inumeric(FLERR,arg[iarg+2]); - nz_pppm_6 = force->inumeric(FLERR,arg[iarg+3]); + nx_pppm_6 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny_pppm_6 = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz_pppm_6 = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (nx_pppm_6 == 0 && ny_pppm_6 == 0 && nz_pppm_6 == 0) gridflag_6 = 0; else if (nx_pppm_6 <= 0 || ny_pppm_6 <= 0 || nz_pppm_6 == 0) @@ -477,15 +477,15 @@ void KSpace::modify_params(int narg, char **arg) iarg += 4; } else if (strcmp(arg[iarg],"order") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - order = force->inumeric(FLERR,arg[iarg+1]); + order = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"order/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - order_6 = force->inumeric(FLERR,arg[iarg+1]); + order_6 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"minorder") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - minorder = force->inumeric(FLERR,arg[iarg+1]); + minorder = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (minorder < 2) error->all(FLERR,"Illegal kspace_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"overlap") == 0) { @@ -496,17 +496,17 @@ void KSpace::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"force") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - accuracy_absolute = force->numeric(FLERR,arg[iarg+1]); + accuracy_absolute = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gewald") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - g_ewald = force->numeric(FLERR,arg[iarg+1]); + g_ewald = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (g_ewald == 0.0) gewaldflag = 0; else gewaldflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"gewald/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - g_ewald_6 = force->numeric(FLERR,arg[iarg+1]); + g_ewald_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (g_ewald_6 == 0.0) gewaldflag_6 = 0; else gewaldflag_6 = 1; iarg += 2; @@ -516,7 +516,7 @@ void KSpace::modify_params(int narg, char **arg) slabflag = 2; } else { slabflag = 1; - slab_volfactor = force->numeric(FLERR,arg[iarg+1]); + slab_volfactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (slab_volfactor <= 1.0) error->all(FLERR,"Bad kspace_modify slab parameter"); if (slab_volfactor < 2.0 && comm->me == 0) diff --git a/src/lattice.cpp b/src/lattice.cpp index 8ecf9fed73..f41c32d239 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -58,7 +58,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // before Force class is instantiated, just use atof() in that case if (force) - xlattice = ylattice = zlattice = force->numeric(FLERR,arg[1]); + xlattice = ylattice = zlattice = utils::numeric(FLERR,arg[1],false,lmp); else xlattice = ylattice = zlattice = atof(arg[1]); @@ -83,7 +83,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // scale = conversion factor between lattice and box units if (narg < 2) error->all(FLERR,"Illegal lattice command"); - scale = force->numeric(FLERR,arg[1]); + scale = utils::numeric(FLERR,arg[1],false,lmp); if (scale <= 0.0) error->all(FLERR,"Illegal lattice command"); // set basis atoms for each style @@ -150,9 +150,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) while (iarg < narg) { if (strcmp(arg[iarg],"origin") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); - origin[0] = force->numeric(FLERR,arg[iarg+1]); - origin[1] = force->numeric(FLERR,arg[iarg+2]); - origin[2] = force->numeric(FLERR,arg[iarg+3]); + origin[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + origin[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + origin[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (origin[0] < 0.0 || origin[0] >= 1.0 || origin[1] < 0.0 || origin[1] >= 1.0 || origin[2] < 0.0 || origin[2] >= 1.0) @@ -170,17 +170,17 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (dim == 0) orient = orientx; else if (dim == 1) orient = orienty; else if (dim == 2) orient = orientz; - orient[0] = force->inumeric(FLERR,arg[iarg+2]); - orient[1] = force->inumeric(FLERR,arg[iarg+3]); - orient[2] = force->inumeric(FLERR,arg[iarg+4]); + orient[0] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + orient[1] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + orient[2] = utils::inumeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"spacing") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); spaceflag = 1; - xlattice = force->numeric(FLERR,arg[iarg+1]); - ylattice = force->numeric(FLERR,arg[iarg+2]); - zlattice = force->numeric(FLERR,arg[iarg+3]); + xlattice = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ylattice = utils::numeric(FLERR,arg[iarg+2],false,lmp); + zlattice = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a1") == 0) { @@ -188,27 +188,27 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a1[0] = force->numeric(FLERR,arg[iarg+1]); - a1[1] = force->numeric(FLERR,arg[iarg+2]); - a1[2] = force->numeric(FLERR,arg[iarg+3]); + a1[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a1[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a1[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a2") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a2[0] = force->numeric(FLERR,arg[iarg+1]); - a2[1] = force->numeric(FLERR,arg[iarg+2]); - a2[2] = force->numeric(FLERR,arg[iarg+3]); + a2[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a2[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a2[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a3") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a3[0] = force->numeric(FLERR,arg[iarg+1]); - a3[1] = force->numeric(FLERR,arg[iarg+2]); - a3[2] = force->numeric(FLERR,arg[iarg+3]); + a3[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a3[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a3[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"basis") == 0) { @@ -216,9 +216,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - double x = force->numeric(FLERR,arg[iarg+1]); - double y = force->numeric(FLERR,arg[iarg+2]); - double z = force->numeric(FLERR,arg[iarg+3]); + double x = utils::numeric(FLERR,arg[iarg+1],false,lmp); + double y = utils::numeric(FLERR,arg[iarg+2],false,lmp); + double z = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (x < 0.0 || x >= 1.0 || y < 0.0 || y >= 1.0 || z < 0.0 || z >= 1.0) error->all(FLERR,"Illegal lattice command"); add_basis(x,y,z); diff --git a/src/min.cpp b/src/min.cpp index b14137f689..0bf0445525 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -671,35 +671,35 @@ void Min::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"dmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dmax = force->numeric(FLERR,arg[iarg+1]); + dmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"delaystep") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - delaystep = force->numeric(FLERR,arg[iarg+1]); + delaystep = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dtgrow") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dtgrow = force->numeric(FLERR,arg[iarg+1]); + dtgrow = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dtshrink") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dtshrink = force->numeric(FLERR,arg[iarg+1]); + dtshrink = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"alpha0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - alpha0 = force->numeric(FLERR,arg[iarg+1]); + alpha0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"alphashrink") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - alphashrink = force->numeric(FLERR,arg[iarg+1]); + alphashrink = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - tmax = force->numeric(FLERR,arg[iarg+1]); + tmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tmin") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - tmin = force->numeric(FLERR,arg[iarg+1]); + tmin = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"halfstepback") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); @@ -715,7 +715,7 @@ void Min::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"vdfmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - max_vdotf_negatif = force->numeric(FLERR,arg[iarg+1]); + max_vdotf_negatif = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"integrator") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); diff --git a/src/minimize.cpp b/src/minimize.cpp index 94fdcd8681..0146390763 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -38,10 +38,10 @@ void Minimize::command(int narg, char **arg) // ignore minimize command, if walltime limit was already reached if (timer->is_timeout()) return; - update->etol = force->numeric(FLERR,arg[0]); - update->ftol = force->numeric(FLERR,arg[1]); - update->nsteps = force->inumeric(FLERR,arg[2]); - update->max_eval = force->inumeric(FLERR,arg[3]); + update->etol = utils::numeric(FLERR,arg[0],false,lmp); + update->ftol = utils::numeric(FLERR,arg[1],false,lmp); + update->nsteps = utils::inumeric(FLERR,arg[2],false,lmp); + update->max_eval = utils::inumeric(FLERR,arg[3],false,lmp); if (update->etol < 0.0 || update->ftol < 0.0) error->all(FLERR,"Illegal minimize command"); diff --git a/src/molecule.cpp b/src/molecule.cpp index cf9d995e2b..18f5c38992 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -79,43 +79,43 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : while (iarg < narg) { if (strcmp(arg[iarg],"offset") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal molecule command"); - toffset = force->inumeric(FLERR,arg[iarg+1]); - boffset = force->inumeric(FLERR,arg[iarg+2]); - aoffset = force->inumeric(FLERR,arg[iarg+3]); - doffset = force->inumeric(FLERR,arg[iarg+4]); - ioffset = force->inumeric(FLERR,arg[iarg+5]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + boffset = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + aoffset = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + doffset = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + ioffset = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (toffset < 0 || boffset < 0 || aoffset < 0 || doffset < 0 || ioffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 6; } else if (strcmp(arg[iarg],"toff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - toffset = force->inumeric(FLERR,arg[iarg+1]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (toffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"boff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - boffset = force->inumeric(FLERR,arg[iarg+1]); + boffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (boffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"aoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - aoffset = force->inumeric(FLERR,arg[iarg+1]); + aoffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (aoffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"doff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - doffset = force->inumeric(FLERR,arg[iarg+1]); + doffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (doffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"ioff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - ioffset = force->inumeric(FLERR,arg[iarg+1]); + ioffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ioffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"scale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - sizescale = force->numeric(FLERR,arg[iarg+1]); + sizescale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (sizescale <= 0.0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else break; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 70333461ba..c9b16f67a0 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2194,7 +2194,7 @@ void Neighbor::set(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal neighbor command"); - skin = force->numeric(FLERR,arg[0]); + skin = utils::numeric(FLERR,arg[0],false,lmp); if (skin < 0.0) error->all(FLERR,"Illegal neighbor command"); if (strcmp(arg[1],"nsq") == 0) style = Neighbor::NSQ; @@ -2236,12 +2236,12 @@ void Neighbor::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - every = force->inumeric(FLERR,arg[iarg+1]); + every = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (every <= 0) error->all(FLERR,"Illegal neigh_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"delay") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - delay = force->inumeric(FLERR,arg[iarg+1]); + delay = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (delay < 0) error->all(FLERR,"Illegal neigh_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"check") == 0) { @@ -2259,16 +2259,16 @@ void Neighbor::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"page") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); old_pgsize = pgsize; - pgsize = force->inumeric(FLERR,arg[iarg+1]); + pgsize = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"one") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); old_oneatom = oneatom; - oneatom = force->inumeric(FLERR,arg[iarg+1]); + oneatom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - binsize_user = force->numeric(FLERR,arg[iarg+1]); + binsize_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (binsize_user <= 0.0) binsizeflag = 0; else binsizeflag = 1; iarg += 2; @@ -2300,8 +2300,8 @@ void Neighbor::modify_params(int narg, char **arg) memory->grow(ex1_type,maxex_type,"neigh:ex1_type"); memory->grow(ex2_type,maxex_type,"neigh:ex2_type"); } - ex1_type[nex_type] = force->inumeric(FLERR,arg[iarg+2]); - ex2_type[nex_type] = force->inumeric(FLERR,arg[iarg+3]); + ex1_type[nex_type] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + ex2_type[nex_type] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); nex_type++; iarg += 4; diff --git a/src/output.cpp b/src/output.cpp index 6051e04055..16d2fa54a0 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -541,7 +541,7 @@ void Output::add_dump(int narg, char **arg) error->all(FLERR,"Reuse of dump ID"); int igroup = group->find(arg[1]); if (igroup == -1) error->all(FLERR,"Could not find dump group ID"); - if (force->inumeric(FLERR,arg[3]) <= 0) + if (utils::inumeric(FLERR,arg[3],false,lmp) <= 0) error->all(FLERR,"Invalid dump frequency"); // extend Dump list if necessary @@ -572,7 +572,7 @@ void Output::add_dump(int narg, char **arg) dump[ndump] = dump_creator(lmp, narg, arg); } else error->all(FLERR,utils::check_packages_for_style("dump",arg[2],lmp)); - every_dump[ndump] = force->inumeric(FLERR,arg[3]); + every_dump[ndump] = utils::inumeric(FLERR,arg[3],false,lmp); if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command"); last_dump[ndump] = -1; var_dump[ndump] = NULL; @@ -670,7 +670,7 @@ void Output::set_thermo(int narg, char **arg) var_thermo = new char[n]; strcpy(var_thermo,&arg[0][2]); } else { - thermo_every = force->inumeric(FLERR,arg[0]); + thermo_every = utils::inumeric(FLERR,arg[0],false,lmp); if (thermo_every < 0) error->all(FLERR,"Illegal thermo command"); } } @@ -714,7 +714,7 @@ void Output::create_restart(int narg, char **arg) int varflag = 0; if (strstr(arg[0],"v_") == arg[0]) varflag = 1; - else every = force->inumeric(FLERR,arg[0]); + else every = utils::inumeric(FLERR,arg[0],false,lmp); if (!varflag && every == 0) { if (narg != 1) error->all(FLERR,"Illegal restart command"); diff --git a/src/pair.cpp b/src/pair.cpp index db9792cdbc..e003ef740a 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -161,23 +161,23 @@ void Pair::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"table") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - ncoultablebits = force->inumeric(FLERR,arg[iarg+1]); + ncoultablebits = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ncoultablebits > (int)sizeof(float)*CHAR_BIT) error->all(FLERR,"Too many total bits for bitmapped lookup table"); iarg += 2; } else if (strcmp(arg[iarg],"table/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - ndisptablebits = force->inumeric(FLERR,arg[iarg+1]); + ndisptablebits = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ndisptablebits > (int)sizeof(float)*CHAR_BIT) error->all(FLERR,"Too many total bits for bitmapped lookup table"); iarg += 2; } else if (strcmp(arg[iarg],"tabinner") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - tabinner = force->numeric(FLERR,arg[iarg+1]); + tabinner = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tabinner/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - tabinner_disp = force->numeric(FLERR,arg[iarg+1]); + tabinner_disp = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tail") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); @@ -1622,12 +1622,12 @@ void Pair::write_file(int narg, char **arg) // parse arguments - int itype = force->inumeric(FLERR,arg[0]); - int jtype = force->inumeric(FLERR,arg[1]); + int itype = utils::inumeric(FLERR,arg[0],false,lmp); + int jtype = utils::inumeric(FLERR,arg[1],false,lmp); if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes) error->all(FLERR,"Invalid atom types in pair_write command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); int style = NONE; if (strcmp(arg[3],"r") == 0) style = RLINEAR; @@ -1635,8 +1635,8 @@ void Pair::write_file(int narg, char **arg) else if (strcmp(arg[3],"bitmap") == 0) style = BMP; else error->all(FLERR,"Invalid style in pair_write command"); - double inner = force->numeric(FLERR,arg[4]); - double outer = force->numeric(FLERR,arg[5]); + double inner = utils::numeric(FLERR,arg[4],false,lmp); + double outer = utils::numeric(FLERR,arg[5],false,lmp); if (inner <= 0.0 || inner >= outer) error->all(FLERR,"Invalid cutoffs in pair_write command"); @@ -1709,8 +1709,8 @@ void Pair::write_file(int narg, char **arg) double q[2]; q[0] = q[1] = 1.0; if (narg == 10) { - q[0] = force->numeric(FLERR,arg[8]); - q[1] = force->numeric(FLERR,arg[9]); + q[0] = utils::numeric(FLERR,arg[8],false,lmp); + q[1] = utils::numeric(FLERR,arg[9],false,lmp); } double *q_hold; diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index 0b300bc7f5..a858f87910 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -176,7 +176,7 @@ void PairBeck::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -202,14 +202,14 @@ void PairBeck::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double AA_one = force->numeric(FLERR,arg[2]); - double BB_one = force->numeric(FLERR,arg[3]); - double aa_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); - double beta_one = force->numeric(FLERR,arg[6]); + double AA_one = utils::numeric(FLERR,arg[2],false,lmp); + double BB_one = utils::numeric(FLERR,arg[3],false,lmp); + double aa_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); + double beta_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_born.cpp b/src/pair_born.cpp index b2a5ee2f7b..ca0ab9a17b 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -177,7 +177,7 @@ void PairBorn::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -202,15 +202,15 @@ void PairBorn::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index ced2c3ccf3..1a6b12a345 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -216,10 +216,10 @@ void PairBornCoulDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); if (allocated) { int i,j; @@ -243,15 +243,15 @@ void PairBornCoulDSF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index 30275a05b1..4c51b0bb9f 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -219,10 +219,10 @@ void PairBornCoulWolf::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); if (allocated) { int i,j; @@ -246,15 +246,15 @@ void PairBornCoulWolf::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 982c400135..91071fccb1 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -169,7 +169,7 @@ void PairBuck::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -195,13 +195,13 @@ void PairBuck::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 76ff05729e..6141205db0 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -197,9 +197,9 @@ void PairBuckCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -228,15 +228,15 @@ void PairBuckCoulCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index 2abc65f322..d19374b5d9 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -149,7 +149,7 @@ void PairCoulCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -176,7 +176,7 @@ void PairCoulCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index b45353837a..2a3def0d4f 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -114,8 +114,8 @@ void PairCoulDebye::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/pair_coul_dsf.cpp b/src/pair_coul_dsf.cpp index b1bea9edbb..2f1a834060 100644 --- a/src/pair_coul_dsf.cpp +++ b/src/pair_coul_dsf.cpp @@ -171,8 +171,8 @@ void PairCoulDSF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 5b7d7ea08a..efe8d46017 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -112,11 +112,11 @@ void PairCoulStreitz::settings(int narg, char **arg) { if (narg < 2) error->all(FLERR,"Illegal pair_style command"); - cut_coul = force->numeric(FLERR,arg[0]); + cut_coul = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"wolf") == 0){ kspacetype = 1; - g_wolf = force->numeric(FLERR,arg[2]); + g_wolf = utils::numeric(FLERR,arg[2],false,lmp); } else if (strcmp(arg[1],"ewald") == 0){ ewaldflag = pppmflag = 1; kspacetype = 2; diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp index 38220386c0..e94c4abb73 100644 --- a/src/pair_coul_wolf.cpp +++ b/src/pair_coul_wolf.cpp @@ -172,8 +172,8 @@ void PairCoulWolf::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index d38e1f0655..613ad90cc3 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -190,9 +190,9 @@ void PairDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -224,11 +224,11 @@ void PairDPD::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index fde8e2e2c3..3f3f05f7f5 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -142,10 +142,10 @@ void PairDPDTstat::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - t_start = force->numeric(FLERR,arg[0]); - t_stop = force->numeric(FLERR,arg[1]); - cut_global = force->numeric(FLERR,arg[2]); - seed = force->inumeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[0],false,lmp); + t_stop = utils::numeric(FLERR,arg[1],false,lmp); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); + seed = utils::inumeric(FLERR,arg[3],false,lmp); temperature = t_start; @@ -180,10 +180,10 @@ void PairDPDTstat::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double a0_one = 0.0; - double gamma_one = force->numeric(FLERR,arg[2]); + double gamma_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index fbf55b397a..d8b8e36b8c 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -164,7 +164,7 @@ void PairGauss::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -190,11 +190,11 @@ void PairGauss::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double b_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double b_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index baf3fd550f..693ed7fa24 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -456,7 +456,7 @@ void PairHybrid::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; @@ -864,7 +864,7 @@ void PairHybrid::modify_params(int narg, char **arg) if (multiple[m]) { if (narg < 3) error->all(FLERR,"Illegal pair_modify command"); - int multiflag = force->inumeric(FLERR,arg[2]); + int multiflag = utils::inumeric(FLERR,arg[2],false,lmp); for (m = 0; m < nstyles; m++) if (strcmp(arg[1],keywords[m]) == 0 && multiflag == multiple[m]) break; if (m == nstyles) @@ -934,9 +934,9 @@ void PairHybrid::modify_special(int m, int /*narg*/, char **arg) int i; special[0] = 1.0; - special[1] = force->numeric(FLERR,arg[1]); - special[2] = force->numeric(FLERR,arg[2]); - special[3] = force->numeric(FLERR,arg[3]); + special[1] = utils::numeric(FLERR,arg[1],false,lmp); + special[2] = utils::numeric(FLERR,arg[2],false,lmp); + special[3] = utils::numeric(FLERR,arg[3],false,lmp); // have to cast to PairHybrid to work around C++ access restriction diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index a0b233d5bc..dc8ac65dd4 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -53,7 +53,7 @@ void PairHybridOverlay::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index de9ffcf486..c60908e8cf 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -433,7 +433,7 @@ void PairLJ96Cut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -459,11 +459,11 @@ void PairLJ96Cut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index 2a2bd77599..833c954330 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -195,8 +195,8 @@ void PairLJCubic::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double rmin = sigma_one*RT6TWO; int count = 0; diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index e9f6bce50b..fedf029fb8 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -427,7 +427,7 @@ void PairLJCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -453,11 +453,11 @@ void PairLJCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 8c1a52fa6c..a11de35c53 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -189,9 +189,9 @@ void PairLJCutCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -220,13 +220,13 @@ void PairLJCutCoulCut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp index a65d7aa50f..2d4b0bbe98 100644 --- a/src/pair_lj_cut_coul_debye.cpp +++ b/src/pair_lj_cut_coul_debye.cpp @@ -133,10 +133,10 @@ void PairLJCutCoulDebye::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[2]); + else cut_coul_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that were previously set from data file diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index cb2a4079c1..2d9368a0ca 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -214,10 +214,10 @@ void PairLJCutCoulDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -244,11 +244,11 @@ void PairLJCutCoulDSF::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_cut_coul_wolf.cpp b/src/pair_lj_cut_coul_wolf.cpp index 40bdfc5ce4..c6fa33f03c 100644 --- a/src/pair_lj_cut_coul_wolf.cpp +++ b/src/pair_lj_cut_coul_wolf.cpp @@ -212,9 +212,9 @@ void PairLJCutCoulWolf::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); - if (narg == 3) cut_coul = force->numeric(FLERR,arg[2]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); + if (narg == 3) cut_coul = utils::numeric(FLERR,arg[2],false,lmp); else cut_coul = cut_lj_global; if (allocated) { @@ -239,11 +239,11 @@ void PairLJCutCoulWolf::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index a0728319c8..1063d05672 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -172,7 +172,7 @@ void PairLJExpand::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -197,12 +197,12 @@ void PairLJExpand::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double shift_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double shift_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index d7cb640f30..b7e3516ec3 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -190,8 +190,8 @@ void PairLJGromacs::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -223,14 +223,14 @@ void PairLJGromacs::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index ab0e42e483..37837b695f 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -220,14 +220,14 @@ void PairLJGromacsCoulGromacs::settings(int narg, char **arg) if (narg != 2 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul_inner = cut_lj_inner; cut_coul = cut_lj; } else { - cut_coul_inner = force->numeric(FLERR,arg[2]); - cut_coul = force->numeric(FLERR,arg[3]); + cut_coul_inner = utils::numeric(FLERR,arg[2],false,lmp); + cut_coul = utils::numeric(FLERR,arg[3],false,lmp); } if (cut_lj_inner <= 0.0 || cut_coul_inner < 0.0) @@ -249,8 +249,8 @@ void PairLJGromacsCoulGromacs::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index 182738f547..5c6bc671f9 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -195,8 +195,8 @@ void PairLJSmooth::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -228,14 +228,14 @@ void PairLJSmooth::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index e69fdc162b..14646f19f2 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -170,7 +170,7 @@ void PairLJSmoothLinear::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -197,12 +197,12 @@ void PairLJSmoothLinear::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; if (narg == 5) { - cut_one = force->numeric(FLERR,arg[4]); + cut_one = utils::numeric(FLERR,arg[4],false,lmp); } int count = 0; diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 01f4ae98a4..f838d96145 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -438,7 +438,7 @@ void PairMIECut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -464,13 +464,13 @@ void PairMIECut::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamR_one = force->numeric(FLERR,arg[4]); - double gamA_one = force->numeric(FLERR,arg[5]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamR_one = utils::numeric(FLERR,arg[4],false,lmp); + double gamA_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index 52237555a0..cbfaccab2c 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -158,7 +158,7 @@ void PairMorse::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -184,12 +184,12 @@ void PairMorse::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index dee10052f9..4d3702313e 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -149,7 +149,7 @@ void PairSoft::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -175,10 +175,10 @@ void PairSoft::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double prefactor_one = force->numeric(FLERR,arg[2]); + double prefactor_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 0d9769cab8..4aec954c38 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -216,7 +216,7 @@ void PairTable::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -273,7 +273,7 @@ void PairTable::coeff(int narg, char **arg) // set table cutoff - if (narg == 5) tb->cut = force->numeric(FLERR,arg[4]); + if (narg == 5) tb->cut = utils::numeric(FLERR,arg[4],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/pair_ufm.cpp b/src/pair_ufm.cpp index 9f9f18dced..fd700e9886 100644 --- a/src/pair_ufm.cpp +++ b/src/pair_ufm.cpp @@ -164,7 +164,7 @@ void PairUFM::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -190,12 +190,12 @@ void PairUFM::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 5a3a589702..b746204892 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -153,8 +153,8 @@ void PairYukawa::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -180,10 +180,10 @@ void PairYukawa::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index 5655570351..d78c156935 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -183,8 +183,8 @@ void PairZBL::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner <= 0.0 ) error->all(FLERR,"Illegal pair_style command"); @@ -211,8 +211,8 @@ void PairZBL::coeff(int narg, char **arg) int jlo,jhi; utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - z_one = force->numeric(FLERR,arg[2]); - z_two = force->numeric(FLERR,arg[3]); + z_one = utils::numeric(FLERR,arg[2],false,lmp); + z_two = utils::numeric(FLERR,arg[3],false,lmp); // set flag for each i-j pair // set z-parameter only for i-i pairs diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index be09647365..f08d919f83 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -89,7 +89,7 @@ void PairZero::settings(int narg, char **arg) if ((narg != 1) && (narg != 2)) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { if (strcmp("nocoeff",arg[1]) == 0) coeffflag=0; else error->all(FLERR,"Illegal pair_style command"); @@ -121,7 +121,7 @@ void PairZero::coeff(int narg, char **arg) utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (coeffflag && (narg == 3)) cut_one = force->numeric(FLERR,arg[2]); + if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/pointers.h b/src/pointers.h index 2d528db392..4b91e009ac 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -25,7 +25,9 @@ #include // IWYU pragma: export #include // IWYU pragme: export #include // IWYU pragma: export +#include // IWYU pragma: export #include "lammps.h" // IWYU pragma: export +#include "utils.h" // IWYU pragma: export namespace LAMMPS_NS { diff --git a/src/read_data.cpp b/src/read_data.cpp index 19e5c56b81..7224ac89ea 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -148,13 +148,13 @@ void ReadData::command(int narg, char **arg) if (atom->molecule_flag && (iarg+3 > narg)) error->all(FLERR,"Illegal read_data command"); addflag = VALUE; - bigint offset = force->bnumeric(FLERR,arg[iarg+1]); + bigint offset = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (offset > MAXTAGINT) error->all(FLERR,"Read data add atomID offset is too big"); id_offset = offset; if (atom->molecule_flag) { - offset = force->bnumeric(FLERR,arg[iarg+2]); + offset = utils::bnumeric(FLERR,arg[iarg+2],false,lmp); if (offset > MAXTAGINT) error->all(FLERR,"Read data add molID offset is too big"); mol_offset = offset; @@ -165,11 +165,11 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(arg[iarg],"offset") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal read_data command"); offsetflag = 1; - toffset = force->inumeric(FLERR,arg[iarg+1]); - boffset = force->inumeric(FLERR,arg[iarg+2]); - aoffset = force->inumeric(FLERR,arg[iarg+3]); - doffset = force->inumeric(FLERR,arg[iarg+4]); - ioffset = force->inumeric(FLERR,arg[iarg+5]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + boffset = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + aoffset = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + doffset = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + ioffset = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (toffset < 0 || boffset < 0 || aoffset < 0 || doffset < 0 || ioffset < 0) error->all(FLERR,"Illegal read_data command"); @@ -177,9 +177,9 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(arg[iarg],"shift") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal read_data command"); shiftflag = 1; - shift[0] = force->numeric(FLERR,arg[iarg+1]); - shift[1] = force->numeric(FLERR,arg[iarg+2]); - shift[2] = force->numeric(FLERR,arg[iarg+3]); + shift[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + shift[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + shift[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (domain->dimension == 2 && shift[2] != 0.0) error->all(FLERR,"Non-zero read_data shift z value for 2d simulation"); iarg += 4; @@ -188,28 +188,28 @@ void ReadData::command(int narg, char **arg) iarg ++; } else if (strcmp(arg[iarg],"extra/atom/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); - extra_atom_types = force->inumeric(FLERR,arg[iarg+1]); + extra_atom_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_atom_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/bond/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - extra_bond_types = force->inumeric(FLERR,arg[iarg+1]); + extra_bond_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_bond_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/angle/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - extra_angle_types = force->inumeric(FLERR,arg[iarg+1]); + extra_angle_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_angle_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/dihedral/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - extra_dihedral_types = force->inumeric(FLERR,arg[iarg+1]); + extra_dihedral_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_dihedral_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -217,7 +217,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - extra_improper_types = force->inumeric(FLERR,arg[iarg+1]); + extra_improper_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_improper_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -225,7 +225,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No bonds allowed with this atom style"); - atom->extra_bond_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_bond_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_bond_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -233,7 +233,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No angles allowed with this atom style"); - atom->extra_angle_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_angle_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_angle_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -241,7 +241,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->extra_dihedral_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_dihedral_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_dihedral_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -249,7 +249,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No impropers allowed with this atom style"); - atom->extra_improper_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_improper_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_improper_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -257,7 +257,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No bonded interactions allowed with this atom style"); - force->special_extra = force->inumeric(FLERR,arg[iarg+1]); + force->special_extra = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (force->special_extra < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -2075,11 +2075,11 @@ void ReadData::parse_coeffs(char *line, const char *addstr, if (narg == 0) return; if (noffset) { - int value = force->inumeric(FLERR,arg[0]); + int value = utils::inumeric(FLERR,arg[0],false,lmp); sprintf(argoffset1,"%d",value+offset); arg[0] = argoffset1; if (noffset == 2) { - value = force->inumeric(FLERR,arg[1]); + value = utils::inumeric(FLERR,arg[1],false,lmp); sprintf(argoffset2,"%d",value+offset); arg[1] = argoffset2; } diff --git a/src/read_dump.cpp b/src/read_dump.cpp index f47eda3262..fbafb4ca84 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -110,7 +110,7 @@ void ReadDump::command(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal read_dump command"); store_files(1,&arg[0]); - bigint nstep = force->bnumeric(FLERR,arg[1]); + bigint nstep = utils::bnumeric(FLERR,arg[1],false,lmp); int nremain = narg - 2; if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); @@ -1217,7 +1217,7 @@ int ReadDump::fields_and_keywords(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"nfile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - multiproc_nfile = force->inumeric(FLERR,arg[iarg+1]); + multiproc_nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"box") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp index a5209956b9..ad8cb0cc6e 100644 --- a/src/reader_xyz.cpp +++ b/src/reader_xyz.cpp @@ -65,7 +65,7 @@ int ReaderXYZ::read_time(bigint &ntimestep) break; } } - natoms = force->bnumeric(FLERR,line); + natoms = utils::bnumeric(FLERR,line,false,lmp); if (natoms < 1) error->one(FLERR,"Dump file is incorrectly formatted"); diff --git a/src/region.cpp b/src/region.cpp index 7a676de1af..8a6ec3305a 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -365,18 +365,18 @@ void Region::options(int narg, char **arg) int n = strlen(&arg[iarg+1][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[iarg+1][2]); - point[0] = force->numeric(FLERR,arg[iarg+2]); - point[1] = force->numeric(FLERR,arg[iarg+3]); - point[2] = force->numeric(FLERR,arg[iarg+4]); - axis[0] = force->numeric(FLERR,arg[iarg+5]); - axis[1] = force->numeric(FLERR,arg[iarg+6]); - axis[2] = force->numeric(FLERR,arg[iarg+7]); + point[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + point[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + point[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + axis[0] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + axis[1] = utils::numeric(FLERR,arg[iarg+6],false,lmp); + axis[2] = utils::numeric(FLERR,arg[iarg+7],false,lmp); rotateflag = 1; iarg += 8; } else if (strcmp(arg[iarg],"open") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal region command"); - int iface = force->inumeric(FLERR,arg[iarg+1]); + int iface = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (iface < 1 || iface > 6) error->all(FLERR,"Illegal region command"); // additional checks on valid face index are done by region classes open_faces[iface-1] = 1; diff --git a/src/region_block.cpp b/src/region_block.cpp index 8ea8b3f202..e06c05d1a7 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -34,7 +34,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[2],"INF") == 0) xlo = -BIG; else if (domain->triclinic == 0) xlo = domain->boxlo[0]; else xlo = domain->boxlo_bound[0]; - } else xlo = xscale*force->numeric(FLERR,arg[2]); + } else xlo = xscale*utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) { if (domain->box_exist == 0) @@ -42,7 +42,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[3],"INF") == 0) xhi = BIG; else if (domain->triclinic == 0) xhi = domain->boxhi[0]; else xhi = domain->boxhi_bound[0]; - } else xhi = xscale*force->numeric(FLERR,arg[3]); + } else xhi = xscale*utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) { if (domain->box_exist == 0) @@ -50,7 +50,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[4],"INF") == 0) ylo = -BIG; else if (domain->triclinic == 0) ylo = domain->boxlo[1]; else ylo = domain->boxlo_bound[1]; - } else ylo = yscale*force->numeric(FLERR,arg[4]); + } else ylo = yscale*utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) { if (domain->box_exist == 0) @@ -58,7 +58,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[5],"INF") == 0) yhi = BIG; else if (domain->triclinic == 0) yhi = domain->boxhi[1]; else yhi = domain->boxhi_bound[1]; - } else yhi = yscale*force->numeric(FLERR,arg[5]); + } else yhi = yscale*utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) { if (domain->box_exist == 0) @@ -66,7 +66,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[6],"INF") == 0) zlo = -BIG; else if (domain->triclinic == 0) zlo = domain->boxlo[2]; else zlo = domain->boxlo_bound[2]; - } else zlo = zscale*force->numeric(FLERR,arg[6]); + } else zlo = zscale*utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { if (domain->box_exist == 0) @@ -74,7 +74,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[7],"INF") == 0) zhi = BIG; else if (domain->triclinic == 0) zhi = domain->boxhi[2]; else zhi = domain->boxhi_bound[2]; - } else zhi = zscale*force->numeric(FLERR,arg[7]); + } else zhi = zscale*utils::numeric(FLERR,arg[7],false,lmp); // error check diff --git a/src/region_cone.cpp b/src/region_cone.cpp index 3c7d0a29d8..400fb07229 100644 --- a/src/region_cone.cpp +++ b/src/region_cone.cpp @@ -43,20 +43,20 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : axis = arg[2][0]; if (axis == 'x') { - c1 = yscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); - radiuslo = yscale*force->numeric(FLERR,arg[5]); - radiushi = yscale*force->numeric(FLERR,arg[6]); + c1 = yscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = yscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = yscale*utils::numeric(FLERR,arg[6],false,lmp); } else if (axis == 'y') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); - radiuslo = xscale*force->numeric(FLERR,arg[5]); - radiushi = xscale*force->numeric(FLERR,arg[6]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = xscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = xscale*utils::numeric(FLERR,arg[6],false,lmp); } else if (axis == 'z') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = yscale*force->numeric(FLERR,arg[4]); - radiuslo = xscale*force->numeric(FLERR,arg[5]); - radiushi = xscale*force->numeric(FLERR,arg[6]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = yscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = xscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = xscale*utils::numeric(FLERR,arg[6],false,lmp); } if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -78,9 +78,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : else lo = domain->boxlo_bound[2]; } } else { - if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[7]); - if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[7]); - if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[7]); + if (axis == 'x') lo = xscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'y') lo = yscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'z') lo = zscale*utils::numeric(FLERR,arg[7],false,lmp); } if (strcmp(arg[8],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -102,9 +102,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : else hi = domain->boxhi_bound[2]; } } else { - if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[8]); - if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[8]); - if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[8]); + if (axis == 'x') hi = xscale*utils::numeric(FLERR,arg[8],false,lmp); + if (axis == 'y') hi = yscale*utils::numeric(FLERR,arg[8],false,lmp); + if (axis == 'z') hi = zscale*utils::numeric(FLERR,arg[8],false,lmp); } // error check diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index b2c06270d0..dc1584a96b 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -51,7 +51,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = yscale*force->numeric(FLERR,arg[3]); + c1 = yscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -62,7 +62,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = zscale*force->numeric(FLERR,arg[4]); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } else if (axis == 'y') { @@ -74,7 +74,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = xscale*force->numeric(FLERR,arg[3]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -85,7 +85,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = zscale*force->numeric(FLERR,arg[4]); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } else if (axis == 'z') { @@ -97,7 +97,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = xscale*force->numeric(FLERR,arg[3]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -108,7 +108,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = yscale*force->numeric(FLERR,arg[4]); + c2 = yscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } @@ -121,7 +121,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : rstyle = VARIABLE; varshape = 1; } else { - radius = force->numeric(FLERR,arg[5]); + radius = utils::numeric(FLERR,arg[5],false,lmp); if (axis == 'x') radius *= yscale; else radius *= xscale; rstyle = CONSTANT; @@ -151,9 +151,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : else lo = domain->boxlo_bound[2]; } } else { - if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[6]); - if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[6]); - if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[6]); + if (axis == 'x') lo = xscale*utils::numeric(FLERR,arg[6],false,lmp); + if (axis == 'y') lo = yscale*utils::numeric(FLERR,arg[6],false,lmp); + if (axis == 'z') lo = zscale*utils::numeric(FLERR,arg[6],false,lmp); } if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -175,9 +175,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : else hi = domain->boxhi_bound[2]; } } else { - if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[7]); - if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[7]); - if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[7]); + if (axis == 'x') hi = xscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'y') hi = yscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'z') hi = zscale*utils::numeric(FLERR,arg[7],false,lmp); } // error check diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index fe074a6b4c..4096657d30 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -27,7 +27,7 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); if (n < 2) error->all(FLERR,"Illegal region command"); options(narg-(n+3),&arg[n+3]); diff --git a/src/region_plane.cpp b/src/region_plane.cpp index 85671357ef..bf12f3cd91 100644 --- a/src/region_plane.cpp +++ b/src/region_plane.cpp @@ -25,12 +25,12 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) : { options(narg-8,&arg[8]); - xp = xscale*force->numeric(FLERR,arg[2]); - yp = yscale*force->numeric(FLERR,arg[3]); - zp = zscale*force->numeric(FLERR,arg[4]); - normal[0] = xscale*force->numeric(FLERR,arg[5]); - normal[1] = yscale*force->numeric(FLERR,arg[6]); - normal[2] = zscale*force->numeric(FLERR,arg[7]); + xp = xscale*utils::numeric(FLERR,arg[2],false,lmp); + yp = yscale*utils::numeric(FLERR,arg[3],false,lmp); + zp = zscale*utils::numeric(FLERR,arg[4],false,lmp); + normal[0] = xscale*utils::numeric(FLERR,arg[5],false,lmp); + normal[1] = yscale*utils::numeric(FLERR,arg[6],false,lmp); + normal[2] = zscale*utils::numeric(FLERR,arg[7],false,lmp); // enforce unit normal diff --git a/src/region_prism.cpp b/src/region_prism.cpp index b6c54c2fb9..5d7c5bce1f 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -37,46 +37,46 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[2],"INF") == 0) xlo = -BIG; else xlo = domain->boxlo[0]; - } else xlo = xscale*force->numeric(FLERR,arg[2]); + } else xlo = xscale*utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[3],"INF") == 0) xhi = BIG; else xhi = domain->boxhi[0]; - } else xhi = xscale*force->numeric(FLERR,arg[3]); + } else xhi = xscale*utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[4],"INF") == 0) ylo = -BIG; else ylo = domain->boxlo[1]; - } else ylo = yscale*force->numeric(FLERR,arg[4]); + } else ylo = yscale*utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[5],"INF") == 0) yhi = BIG; else yhi = domain->boxhi[1]; - } else yhi = yscale*force->numeric(FLERR,arg[5]); + } else yhi = yscale*utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[6],"INF") == 0) zlo = -BIG; else zlo = domain->boxlo[2]; - } else zlo = zscale*force->numeric(FLERR,arg[6]); + } else zlo = zscale*utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[7],"INF") == 0) zhi = BIG; else zhi = domain->boxhi[2]; - } else zhi = zscale*force->numeric(FLERR,arg[7]); + } else zhi = zscale*utils::numeric(FLERR,arg[7],false,lmp); - xy = xscale*force->numeric(FLERR,arg[8]); - xz = xscale*force->numeric(FLERR,arg[9]); - yz = yscale*force->numeric(FLERR,arg[10]); + xy = xscale*utils::numeric(FLERR,arg[8],false,lmp); + xz = xscale*utils::numeric(FLERR,arg[9],false,lmp); + yz = yscale*utils::numeric(FLERR,arg[10],false,lmp); // error check // prism cannot be 0 thickness in any dim, else inverse blows up diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index bf874ad311..44db951fde 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -39,7 +39,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : xstyle = VARIABLE; varshape = 1; } else { - xc = xscale*force->numeric(FLERR,arg[2]); + xc = xscale*utils::numeric(FLERR,arg[2],false,lmp); xstyle = CONSTANT; } @@ -51,7 +51,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : ystyle = VARIABLE; varshape = 1; } else { - yc = yscale*force->numeric(FLERR,arg[3]); + yc = yscale*utils::numeric(FLERR,arg[3],false,lmp); ystyle = CONSTANT; } @@ -63,7 +63,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : zstyle = VARIABLE; varshape = 1; } else { - zc = zscale*force->numeric(FLERR,arg[4]); + zc = zscale*utils::numeric(FLERR,arg[4],false,lmp); zstyle = CONSTANT; } @@ -75,7 +75,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : rstyle = VARIABLE; varshape = 1; } else { - radius = xscale*force->numeric(FLERR,arg[5]); + radius = xscale*utils::numeric(FLERR,arg[5],false,lmp); rstyle = CONSTANT; } diff --git a/src/region_union.cpp b/src/region_union.cpp index be1fe6eeff..30f563df2c 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -28,7 +28,7 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), { nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); if (n < 2) error->all(FLERR,"Illegal region command"); options(narg-(n+3),&arg[n+3]); diff --git a/src/replicate.cpp b/src/replicate.cpp index 6fe37bc600..9c915d08c0 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -52,9 +52,9 @@ void Replicate::command(int narg, char **arg) // nrep = total # of replications - int nx = force->inumeric(FLERR,arg[0]); - int ny = force->inumeric(FLERR,arg[1]); - int nz = force->inumeric(FLERR,arg[2]); + int nx = utils::inumeric(FLERR,arg[0],false,lmp); + int ny = utils::inumeric(FLERR,arg[1],false,lmp); + int nz = utils::inumeric(FLERR,arg[2],false,lmp); int nrep = nx*ny*nz; int bbox_flag = 0; diff --git a/src/rerun.cpp b/src/rerun.cpp index 3cd1c53628..a63fd1ea55 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -70,34 +70,34 @@ void Rerun::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"first") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - first = force->bnumeric(FLERR,arg[iarg+1]); + first = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (first < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"last") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - last = force->bnumeric(FLERR,arg[iarg+1]); + last = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (last < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"skip") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nskip = force->inumeric(FLERR,arg[iarg+1]); + nskip = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nskip <= 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); startflag = 1; - start = force->bnumeric(FLERR,arg[iarg+1]); + start = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (start < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"stop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); stopflag = 1; - stop = force->bnumeric(FLERR,arg[iarg+1]); + stop = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (stop < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"dump") == 0) { diff --git a/src/respa.cpp b/src/respa.cpp index f894333e39..1dcc4b898a 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -53,13 +53,13 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : nhybrid_styles = 0; if (narg < 1) error->all(FLERR,"Illegal run_style respa command"); - nlevels = force->inumeric(FLERR,arg[0]); + nlevels = utils::inumeric(FLERR,arg[0],false,lmp); if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1"); if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command"); loop = new int[nlevels]; for (int iarg = 1; iarg < nlevels; iarg++) { - loop[iarg-1] = force->inumeric(FLERR,arg[iarg]); + loop[iarg-1] = utils::inumeric(FLERR,arg[iarg],false,lmp); if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command"); } loop[nlevels-1] = 1; @@ -81,43 +81,43 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_bond = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_bond = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_angle = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_angle = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_dihedral = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_dihedral = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"improper") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_improper = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_improper = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"pair") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_pair = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_pair = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"inner") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_inner = force->inumeric(FLERR,arg[iarg+1]) - 1; - cutoff[0] = force->numeric(FLERR,arg[iarg+2]); - cutoff[1] = force->numeric(FLERR,arg[iarg+3]); + level_inner = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; + cutoff[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cutoff[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"middle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_middle = force->inumeric(FLERR,arg[iarg+1]) - 1; - cutoff[2] = force->numeric(FLERR,arg[iarg+2]); - cutoff[3] = force->numeric(FLERR,arg[iarg+3]); + level_middle = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; + cutoff[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cutoff[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"outer") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_outer = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_outer = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"kspace") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_kspace = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_kspace = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"hybrid") == 0) { // the hybrid keyword requires a hybrid pair style @@ -132,7 +132,7 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : hybrid_compute = new int[nhybrid_styles]; for (int i=0; i < nhybrid_styles; ++i) { ++iarg; - hybrid_level[i] = force->inumeric(FLERR,arg[iarg])-1; + hybrid_level[i] = utils::inumeric(FLERR,arg[iarg],false,lmp)-1; } ++iarg; } else error->all(FLERR,"Illegal run_style respa command"); diff --git a/src/run.cpp b/src/run.cpp index 2c2f00a7a8..91e2db5c6b 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -45,7 +45,7 @@ void Run::command(int narg, char **arg) if (timer->is_timeout()) return; - bigint nsteps_input = force->bnumeric(FLERR,arg[0]); + bigint nsteps_input = utils::bnumeric(FLERR,arg[0],false,lmp); // parse optional args @@ -68,12 +68,12 @@ void Run::command(int narg, char **arg) } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); startflag = 1; - start = force->bnumeric(FLERR,arg[iarg+1]); + start = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"stop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); stopflag = 1; - stop = force->bnumeric(FLERR,arg[iarg+1]); + stop = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"pre") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); @@ -94,7 +94,7 @@ void Run::command(int narg, char **arg) } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal run command"); first = iarg+2; last = narg-1; diff --git a/src/set.cpp b/src/set.cpp index 22121c0b72..f18746652e 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -95,15 +95,15 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg],"type") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); set(TYPE); iarg += 2; } else if (strcmp(arg[iarg],"type/fraction") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - fraction = force->numeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (fraction < 0.0 || fraction > 1.0) @@ -115,9 +115,9 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"type/ratio") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - fraction = force->numeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (fraction < 0.0 || fraction > 1.0) @@ -129,9 +129,9 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"type/subset") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - nsubset = force->bnumeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nsubset = utils::bnumeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (nsubset < 0) @@ -144,7 +144,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->molecule_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(MOLECULE); @@ -153,49 +153,49 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(X); iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Y); iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Z); iarg += 2; } else if (strcmp(arg[iarg],"vx") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VX); iarg += 2; } else if (strcmp(arg[iarg],"vy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VY); iarg += 2; } else if (strcmp(arg[iarg],"vz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VZ); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->q_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(CHARGE); @@ -204,7 +204,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mass") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(MASS); @@ -213,11 +213,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"shape") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->ellipsoid_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(SHAPE); @@ -226,7 +226,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->line_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(LENGTH); @@ -235,7 +235,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"tri") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->tri_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(TRI); @@ -244,11 +244,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dipole") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->mu_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(DIPOLE); @@ -256,8 +256,8 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dipole/random") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (!atom->mu_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -270,13 +270,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"spin") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else xvalue = force->numeric(FLERR,arg[iarg+2]); + else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else yvalue = force->numeric(FLERR,arg[iarg+3]); + else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); - else zvalue = force->numeric(FLERR,arg[iarg+4]); + else zvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->sp_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(SPIN); @@ -284,8 +284,8 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"spin/random") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (!atom->sp_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -298,13 +298,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); - else wvalue = force->numeric(FLERR,arg[iarg+4]); + else wvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(QUAT); @@ -312,7 +312,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -324,7 +324,7 @@ void Set::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); dvalue *= MY_PI/180.0; } if (!atom->line_flag) @@ -334,7 +334,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"theta/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->line_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -345,11 +345,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->angmom_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(ANGMOM); @@ -358,11 +358,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"omega") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->omega_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(OMEGA); @@ -371,7 +371,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"diameter") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->radius_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(DIAMETER); @@ -381,7 +381,7 @@ void Set::command(int narg, char **arg) (strcmp(arg[iarg],"density/disc") == 0)) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (dvalue <= 0.0) error->all(FLERR,"Invalid density in set command"); @@ -397,7 +397,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"volume") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->vfrac_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (dvalue <= 0.0) error->all(FLERR,"Invalid volume in set command"); @@ -410,17 +410,17 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") != 0) { ximageflag = 1; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ximage = force->inumeric(FLERR,arg[iarg+1]); + else ximage = utils::inumeric(FLERR,arg[iarg+1],false,lmp); } if (strcmp(arg[iarg+2],"NULL") != 0) { yimageflag = 1; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yimage = force->inumeric(FLERR,arg[iarg+2]); + else yimage = utils::inumeric(FLERR,arg[iarg+2],false,lmp); } if (strcmp(arg[iarg+3],"NULL") != 0) { zimageflag = 1; if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zimage = force->inumeric(FLERR,arg[iarg+3]); + else zimage = utils::inumeric(FLERR,arg[iarg+3],false,lmp); } if (ximageflag && ximage && !domain->xperiodic) error->all(FLERR, @@ -436,7 +436,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->bonds_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nbondtypes) @@ -446,7 +446,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->angles_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nangletypes) @@ -456,7 +456,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->ndihedraltypes) @@ -466,7 +466,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"improper") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->impropers_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nimpropertypes) @@ -477,7 +477,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/e") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->esph_flag) error->all(FLERR,"Cannot set meso/e for this atom style"); set(SPH_E); @@ -486,7 +486,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/cv") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->cv_flag) error->all(FLERR,"Cannot set meso/cv for this atom style"); set(SPH_CV); @@ -495,7 +495,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/rho") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rho_flag) error->all(FLERR,"Cannot set meso/rho for this atom style"); set(SPH_RHO); @@ -506,7 +506,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->edpd_flag) @@ -519,7 +519,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->edpd_flag) @@ -532,8 +532,8 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - cc_index = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + cc_index = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (cc_index < 1) error->all(FLERR,"Illegal set command"); } if (!atom->tdpd_flag) @@ -544,7 +544,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/mass/density") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/mass/density for this atom style"); set(SMD_MASS_DENSITY); @@ -553,7 +553,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/contact/radius") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/contact/radius " "for this atom style"); @@ -565,7 +565,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->dpd_flag) @@ -576,7 +576,7 @@ void Set::command(int narg, char **arg) } else if (strstr(arg[iarg],"i_") == arg[iarg]) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); if (index_custom < 0 || flag != 0) @@ -587,7 +587,7 @@ void Set::command(int narg, char **arg) } else if (strstr(arg[iarg],"d_") == arg[iarg]) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); if (index_custom < 0 || flag != 1) diff --git a/src/thermo.cpp b/src/thermo.cpp index f608b25016..96de72b4ab 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -608,7 +608,7 @@ void Thermo::modify_params(int narg, char **arg) format_float_user = new char[n]; strcpy(format_float_user,arg[iarg+2]); } else { - int i = force->inumeric(FLERR,arg[iarg+1]) - 1; + int i = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; if (i < 0 || i >= nfield_initial+1) error->all(FLERR,"Illegal thermo_modify command"); if (format_column_user[i]) delete [] format_column_user[i]; diff --git a/src/timer.cpp b/src/timer.cpp index 97f0e8abab..b9124978a9 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -277,7 +277,7 @@ void Timer::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"every") == 0) { ++iarg; if (iarg < narg) { - _checkfreq = force->inumeric(FLERR,arg[iarg]); + _checkfreq = utils::inumeric(FLERR,arg[iarg],false,lmp); if (_checkfreq <= 0) error->all(FLERR,"Illegal timers command"); } else error->all(FLERR,"Illegal timers command"); diff --git a/src/universe.cpp b/src/universe.cpp index 0fad232d2c..e920270c1e 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -84,7 +84,7 @@ void Universe::reorder(char *style, char *arg) if (uworld != uorig) MPI_Comm_free(&uworld); if (strcmp(style,"nth") == 0) { - int n = force->inumeric(FLERR,arg); + int n = utils::inumeric(FLERR,arg,false,lmp); if (n <= 0) error->universe_all(FLERR,"Invalid -reorder N value"); if (nprocs % n) diff --git a/src/update.cpp b/src/update.cpp index 612b4de409..a1c712c354 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -446,7 +446,7 @@ Min *Update::minimize_creator(LAMMPS *lmp) void Update::reset_timestep(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal reset_timestep command"); - bigint newstep = force->bnumeric(FLERR,arg[0]); + bigint newstep = utils::bnumeric(FLERR,arg[0],false,lmp); reset_timestep(newstep); } diff --git a/src/variable.cpp b/src/variable.cpp index 8eecc4690f..d16987984f 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -189,7 +189,7 @@ void Variable::set(int narg, char **arg) int nfirst = 0,nlast = 0; if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) { nfirst = 1; - nlast = force->inumeric(FLERR,arg[2]); + nlast = utils::inumeric(FLERR,arg[2],false,lmp); if (nlast <= 0) error->all(FLERR,"Illegal variable command"); if (narg == 4 && strcmp(arg[3],"pad") == 0) { char digits[12]; @@ -197,8 +197,8 @@ void Variable::set(int narg, char **arg) pad[nvar] = strlen(digits); } else pad[nvar] = 0; } else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) { - nfirst = force->inumeric(FLERR,arg[2]); - nlast = force->inumeric(FLERR,arg[3]); + nfirst = utils::inumeric(FLERR,arg[2],false,lmp); + nlast = utils::inumeric(FLERR,arg[3],false,lmp); if (nfirst > nlast || nlast < 0) error->all(FLERR,"Illegal variable command"); if (narg == 5 && strcmp(arg[4],"pad") == 0) { @@ -252,7 +252,7 @@ void Variable::set(int narg, char **arg) if (find(arg[0]) >= 0) return; if (nvar == maxvar) grow(); style[nvar] = ULOOP; - num[nvar] = force->inumeric(FLERR,arg[2]); + num[nvar] = utils::inumeric(FLERR,arg[2],false,lmp); data[nvar] = new char*[1]; data[nvar][0] = NULL; if (narg == 4) { @@ -508,7 +508,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != INTERNAL) error->all(FLERR,"Cannot redefine variable as a different style"); - dvalue[nvar] = force->numeric(FLERR,arg[2]); + dvalue[nvar] = utils::numeric(FLERR,arg[2],false,lmp); replaceflag = 1; } else { if (nvar == maxvar) grow(); @@ -518,7 +518,7 @@ void Variable::set(int narg, char **arg) pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; data[nvar][0] = new char[VALUELENGTH]; - dvalue[nvar] = force->numeric(FLERR,arg[2]); + dvalue[nvar] = utils::numeric(FLERR,arg[2],false,lmp); } } else error->all(FLERR,"Illegal variable command"); @@ -5198,7 +5198,7 @@ int VarReader::read_peratom() if (n == 0) return 1; MPI_Bcast(str,n,MPI_CHAR,0,world); - bigint nlines = force->bnumeric(FLERR,str); + bigint nlines = utils::bnumeric(FLERR,str,false,lmp); tagint map_tag_max = atom->map_tag_max; bigint nread = 0; diff --git a/src/velocity.cpp b/src/velocity.cpp index c2776ea174..140a396926 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -127,8 +127,8 @@ void Velocity::command(int narg, char **arg) // create() invoked differently, so can be called externally if (style == CREATE) { - double t_desired = force->numeric(FLERR,arg[2]); - int seed = force->inumeric(FLERR,arg[3]); + double t_desired = utils::numeric(FLERR,arg[2],false,lmp); + int seed = utils::inumeric(FLERR,arg[3],false,lmp); create(t_desired,seed); } else if (style == SET) set(narg-2,&arg[2]); @@ -424,21 +424,21 @@ void Velocity::set(int /*narg*/, char **arg) xstr = new char[n]; strcpy(xstr,&arg[0][2]); } else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE; - else vx = force->numeric(FLERR,arg[0]); + else vx = utils::numeric(FLERR,arg[0],false,lmp); if (strstr(arg[1],"v_") == arg[1]) { int n = strlen(&arg[1][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[1][2]); } else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE; - else vy = force->numeric(FLERR,arg[1]); + else vy = utils::numeric(FLERR,arg[1],false,lmp); if (strstr(arg[2],"v_") == arg[2]) { int n = strlen(&arg[2][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[2][2]); } else if (strcmp(arg[2],"NULL") == 0) zstyle = NONE; - else vz = force->numeric(FLERR,arg[2]); + else vz = utils::numeric(FLERR,arg[2],false,lmp); // set and apply scale factors @@ -578,7 +578,7 @@ void Velocity::set(int /*narg*/, char **arg) void Velocity::scale(int /*narg*/, char **arg) { - double t_desired = force->numeric(FLERR,arg[0]); + double t_desired = utils::numeric(FLERR,arg[0],false,lmp); // if temperature = NULL, create a new ComputeTemp with the velocity group @@ -649,14 +649,14 @@ void Velocity::ramp(int /*narg*/, char **arg) double v_lo,v_hi; if (v_dim == 0) { - v_lo = xscale*force->numeric(FLERR,arg[1]); - v_hi = xscale*force->numeric(FLERR,arg[2]); + v_lo = xscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = xscale*utils::numeric(FLERR,arg[2],false,lmp); } else if (v_dim == 1) { - v_lo = yscale*force->numeric(FLERR,arg[1]); - v_hi = yscale*force->numeric(FLERR,arg[2]); + v_lo = yscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = yscale*utils::numeric(FLERR,arg[2],false,lmp); } else if (v_dim == 2) { - v_lo = zscale*force->numeric(FLERR,arg[1]); - v_hi = zscale*force->numeric(FLERR,arg[2]); + v_lo = zscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = zscale*utils::numeric(FLERR,arg[2],false,lmp); } int coord_dim = 0; @@ -667,14 +667,14 @@ void Velocity::ramp(int /*narg*/, char **arg) double coord_lo,coord_hi; if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[4]); - coord_hi = xscale*force->numeric(FLERR,arg[5]); + coord_lo = xscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[4]); - coord_hi = yscale*force->numeric(FLERR,arg[5]); + coord_lo = yscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[4]); - coord_hi = zscale*force->numeric(FLERR,arg[5]); + coord_lo = zscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[5],false,lmp); } // vramp = ramped velocity component for v_dim diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 062add3b3c..22e993c37c 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -159,7 +159,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, if (!multiproc) error->all(FLERR,"Cannot use write_restart fileper " "without % in restart file name"); - int nper = force->inumeric(FLERR,arg[iarg+1]); + int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nper <= 0) error->all(FLERR,"Illegal write_restart command"); multiproc = nprocs/nper; @@ -177,7 +177,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, if (!multiproc) error->all(FLERR,"Cannot use write_restart nfile " "without % in restart file name"); - int nfile = force->inumeric(FLERR,arg[iarg+1]); + int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nfile <= 0) error->all(FLERR,"Illegal write_restart command"); nfile = MIN(nfile,nprocs);