Merge pull request #943 from Pakketeretet2/improve-manifoldforce-warning

Improve fix manifoldforce warning
This commit is contained in:
Steve Plimpton
2018-06-18 10:09:18 -06:00
committed by GitHub
2 changed files with 15 additions and 9 deletions

View File

@ -31,12 +31,12 @@ using namespace user_manifold;
// Helper functions for parameters/equal style variables in input script
inline bool was_var( const char *arg )
static bool was_var( const char *arg )
{
return strstr( arg, "v_" ) == arg;
}
inline bool str_eq( const char *str1, const char *str2 )
static bool str_eq( const char *str1, const char *str2 )
{
return strcmp(str1,str2) == 0;
}
@ -50,13 +50,6 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
// Check the min-style:
int good_minner = str_eq(update->minimize_style,"hftn") |
str_eq(update->minimize_style,"quickmin");
if( !good_minner){
error->warning(FLERR,"Minimizing with fix manifoldforce without hftn or quickmin is fishy");
}
// Command is given as
// fix <name> <group> manifoldforce manifold_name manifold_args
@ -121,6 +114,18 @@ int FixManifoldForce::setmask()
/* ---------------------------------------------------------------------- */
void FixManifoldForce::init()
{
// Check the min-style:
const bool is_good_min_style = str_eq(update->minimize_style,"hftn")
|| str_eq(update->minimize_style,"quickmin");
if (!is_good_min_style) {
error->all(FLERR,"Fix manifoldforce requires min_style hftn or quickmin");
}
}
/* ---------------------------------------------------------------------- */
void FixManifoldForce::setup(int vflag)
{
if (strstr(update->integrate_style,"verlet"))

View File

@ -51,6 +51,7 @@ class FixManifoldForce : public Fix {
public:
FixManifoldForce(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
void min_setup(int);
void post_force(int);