Refactor md_enums
authorPaul Bauer <paul.bauer.q@gmail.com>
Mon, 22 Feb 2021 10:24:36 +0000 (10:24 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Mon, 22 Feb 2021 10:24:36 +0000 (10:24 +0000)
commit3ba95aac31a47eaf90ad7c5394b4cbe3d9a88a1a
treed1d8fcbf0132c2b2fa0e5d015a7f5977ba5a5642
parentc66827166fc9099ecd1a4a2f7080558df70bf529
Refactor md_enums

The old enum handling caused clang-tidy to complain about the globally
defined symbols for the enum strings, and also violated type safety by
using the enums both as enumerations and integers.

Changed all exposed enum strings and their corresponding char arrays
to classes and enumeration arrays.

Used enumeration array in a few places where it made sense to me.

Was not able to get rid of some instances where the enum to integer
conversion was abused.

Moved enum reading template to header to have it available for reading
all enums.
151 files changed:
api/nblib/gmxsetup.cpp
src/gromacs/applied_forces/awh/awh.cpp
src/gromacs/applied_forces/awh/read_params.cpp
src/gromacs/domdec/collect.cpp
src/gromacs/domdec/distribute.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/domdec/mdsetup.cpp
src/gromacs/domdec/partition.cpp
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/long_range_correction.cpp
src/gromacs/ewald/pme.cpp
src/gromacs/ewald/pme_gpu.cpp
src/gromacs/ewald/pme_internal.h
src/gromacs/ewald/pme_load_balancing.cpp
src/gromacs/ewald/tests/pmebsplinetest.cpp
src/gromacs/ewald/tests/pmegathertest.cpp
src/gromacs/ewald/tests/pmesolvetest.cpp
src/gromacs/ewald/tests/pmesplinespreadtest.cpp
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/checkpoint.h
src/gromacs/fileio/readinp.cpp
src/gromacs/fileio/readinp.h
src/gromacs/fileio/tpxio.cpp
src/gromacs/gmxana/gmx_bar.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_nmr.cpp
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/gmxlib/nonbonded/nb_kernel.h
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/convparm.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/gmxpreprocess/readpull.cpp
src/gromacs/gmxpreprocess/readrot.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toppush.h
src/gromacs/imd/imd.cpp
src/gromacs/listed_forces/disre.cpp
src/gromacs/listed_forces/listed_forces.cpp
src/gromacs/listed_forces/listed_forces.h
src/gromacs/listed_forces/listed_internal.h
src/gromacs/listed_forces/pairs.cpp
src/gromacs/listed_forces/position_restraints.cpp
src/gromacs/listed_forces/position_restraints.h
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/calc_verletbuf.cpp
src/gromacs/mdlib/compute_io.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/constr.h
src/gromacs/mdlib/constraintrange.cpp
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/dispersioncorrection.cpp
src/gromacs/mdlib/dispersioncorrection.h
src/gromacs/mdlib/enerdata_utils.cpp
src/gromacs/mdlib/energyoutput.cpp
src/gromacs/mdlib/expanded.cpp
src/gromacs/mdlib/expanded_internal.cpp
src/gromacs/mdlib/expanded_internal.h
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/forcerec_threading.h
src/gromacs/mdlib/freeenergyparameters.cpp
src/gromacs/mdlib/freeenergyparameters.h
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/mdatoms.cpp
src/gromacs/mdlib/mdebin_bar.cpp
src/gromacs/mdlib/mdebin_bar.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/perf_est.cpp
src/gromacs/mdlib/rbin.cpp
src/gromacs/mdlib/rbin.h
src/gromacs/mdlib/rf_util.cpp
src/gromacs/mdlib/shake.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/tests/constrtestdata.cpp
src/gromacs/mdlib/tests/energyoutput.cpp
src/gromacs/mdlib/tests/expanded.cpp
src/gromacs/mdlib/tests/freeenergyparameters.cpp
src/gromacs/mdlib/tests/leapfrogtestdata.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update_vv.cpp
src/gromacs/mdlib/vcm.cpp
src/gromacs/mdlib/vcm.h
src/gromacs/mdlib/wall.cpp
src/gromacs/mdrun/legacysimulator.cpp
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/mimic.cpp
src/gromacs/mdrun/minimize.cpp
src/gromacs/mdrun/replicaexchange.cpp
src/gromacs/mdrun/rerun.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/shellfc.cpp
src/gromacs/mdrun/tpi.cpp
src/gromacs/mdtypes/awh_params.h
src/gromacs/mdtypes/enerdata.h
src/gromacs/mdtypes/fcdata.h
src/gromacs/mdtypes/forcerec.h
src/gromacs/mdtypes/inputrec.cpp
src/gromacs/mdtypes/inputrec.h
src/gromacs/mdtypes/interaction_const.h
src/gromacs/mdtypes/md_enums.cpp
src/gromacs/mdtypes/md_enums.h
src/gromacs/mdtypes/multipletimestepping.cpp
src/gromacs/mdtypes/nblist.h
src/gromacs/mdtypes/pull_params.h
src/gromacs/mdtypes/state.cpp
src/gromacs/mdtypes/state.h
src/gromacs/mdtypes/swaphistory.h
src/gromacs/mdtypes/tests/multipletimestepping.cpp
src/gromacs/modularsimulator/computeglobalselement.cpp
src/gromacs/modularsimulator/constraintelement.cpp
src/gromacs/modularsimulator/energydata.cpp
src/gromacs/modularsimulator/forceelement.cpp
src/gromacs/modularsimulator/forceelement.h
src/gromacs/modularsimulator/freeenergyperturbationdata.cpp
src/gromacs/modularsimulator/freeenergyperturbationdata.h
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp
src/gromacs/modularsimulator/pmeloadbalancehelper.cpp
src/gromacs/modularsimulator/simulatoralgorithm.cpp
src/gromacs/modularsimulator/statepropagatordata.cpp
src/gromacs/nbnxm/benchmark/bench_setup.cpp
src/gromacs/nbnxm/cuda/nbnxm_cuda_data_mgmt.cu
src/gromacs/nbnxm/kerneldispatch.cpp
src/gromacs/nbnxm/nbnxm_gpu_data_mgmt.cpp
src/gromacs/nbnxm/nbnxm_setup.cpp
src/gromacs/nbnxm/opencl/nbnxm_ocl_data_mgmt.cpp
src/gromacs/nbnxm/pairlist_tuning.cpp
src/gromacs/nbnxm/sycl/nbnxm_sycl_data_mgmt.cpp
src/gromacs/pulling/output.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pullutil.cpp
src/gromacs/pulling/tests/pull.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/tables/forcetable.cpp
src/gromacs/taskassignment/decidegpuusage.cpp
src/gromacs/taskassignment/resourcedivision.cpp
src/gromacs/tools/check.cpp
src/gromacs/tools/report_methods.cpp
src/gromacs/tools/tune_pme.cpp
src/gromacs/utility/enumerationhelpers.h
src/gromacs/utility/iserializer.h