mods to fix numdiff

This commit is contained in:
Steve Plimpton
2020-02-27 09:52:23 -07:00
parent 49873f765c
commit 67bfda532f
5 changed files with 229 additions and 285 deletions

77
src/fix_numdiff.h Normal file
View File

@ -0,0 +1,77 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(numdiff,FixNumDiff)
#else
#ifndef LMP_FIX_NUMDIFF_H
#define LMP_FIX_NUMDIFF_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNumDiff : public Fix {
public:
FixNumDiff(class LAMMPS *, int, char **);
~FixNumDiff();
int setmask();
void init();
void post_force(int);
void post_force_respa(int, int, int);
void min_post_force(int);
double memory_usage();
private:
double delta;
int maxatom;
int ilevel_respa;
int pair_compute_flag; // 0 if pair->compute is skipped
int kspace_compute_flag; // 0 if kspace->compute is skipped
char *id_pe;
class Compute *pe;
double **numdiff_forces; // finite diff forces
double **temp_f; // original forces
double **temp_x; // original coords
double update_energy(int vflag);
void force_clear(double **forces);
void create_groupmap();
void displace_atom(int local_idx, int direction, int magnitude);
void calculate_forces(int vflag);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Compute ID for fix numdiff does not exist
Self-explanatory.
*/