convert more style_creators to use local static functions

This commit is contained in:
Axel Kohlmeyer
2022-02-11 18:29:52 -05:00
parent 5ab9b46b67
commit 6a0e93a18a
10 changed files with 110 additions and 152 deletions

View File

@ -47,6 +47,15 @@ using namespace LAMMPS_NS;
#define DELTAREGION 4
#define BONDSTRETCH 1.1
/* ----------------------------------------------------------------------
one instance per region style in style_region.h
------------------------------------------------------------------------- */
template <typename T> static Region *region_creator(LAMMPS *lmp, int narg, char ** arg)
{
return new T(lmp, narg, arg);
}
/* ----------------------------------------------------------------------
default is periodic
------------------------------------------------------------------------- */
@ -1797,16 +1806,6 @@ void Domain::add_region(int narg, char **arg)
nregion++;
}
/* ----------------------------------------------------------------------
one instance per region style in style_region.h
------------------------------------------------------------------------- */
template <typename T>
Region *Domain::region_creator(LAMMPS *lmp, int narg, char ** arg)
{
return new T(lmp, narg, arg);
}
/* ----------------------------------------------------------------------
delete a region
------------------------------------------------------------------------- */