add extract support for TIP4P parameters to cutoff versions

This commit is contained in:
Axel Kohlmeyer
2023-03-09 17:53:03 -05:00
parent 7b07fe04c8
commit 416df96c1b
5 changed files with 41 additions and 9 deletions

View File

@ -18,20 +18,20 @@
#include "pair_lj_cut_tip4p_cut.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "domain.h"
#include "angle.h"
#include "atom.h"
#include "bond.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "neigh_list.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
using namespace MathConst;
@ -743,12 +743,18 @@ void PairLJCutTIP4PCut::compute_newsite(double *xO, double *xH1,
void *PairLJCutTIP4PCut::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
if (strcmp(str,"typeO") == 0) return (void *) &typeO;
if (strcmp(str,"typeH") == 0) return (void *) &typeH;
if (strcmp(str,"typeA") == 0) return (void *) &typeA;
if (strcmp(str,"typeB") == 0) return (void *) &typeB;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
dim = 2;
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
if (strcmp(str,"sigma") == 0) return (void *) sigma;
return nullptr;
}
/* ----------------------------------------------------------------------
memory usage of hneigh
------------------------------------------------------------------------- */

View File

@ -562,3 +562,17 @@ double PairTIP4PCut::memory_usage()
bytes += (double)2 * nmax * sizeof(double);
return bytes;
}
/* ---------------------------------------------------------------------- */
void *PairTIP4PCut::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
if (strcmp(str,"typeO") == 0) return (void *) &typeO;
if (strcmp(str,"typeH") == 0) return (void *) &typeH;
if (strcmp(str,"typeA") == 0) return (void *) &typeA;
if (strcmp(str,"typeB") == 0) return (void *) &typeB;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return nullptr;
}

View File

@ -38,6 +38,7 @@ class PairTIP4PCut : public Pair {
void write_restart(FILE *) override;
void read_restart(FILE *) override;
double memory_usage() override;
void *extract(const char *, int &) override;
protected:
double cut_coul_global;

View File

@ -21,6 +21,11 @@ pair_coeff: ! |
4 4 0.015 3.1
5 5 0.015 3.1
extract: ! |
qdist 0
typeO 0
typeH 0
typeA 0
typeB 0
epsilon 2
sigma 2
cut_coul 0

View File

@ -15,7 +15,13 @@ input_file: in.fourmol
pair_style: tip4p/cut 5 2 5 1 0.15 10.0
pair_coeff: ! |
* *
extract: ! ""
extract: ! |
qdist 0
typeO 0
typeH 0
typeA 0
typeB 0
cut_coul 0
natoms: 29
init_vdwl: 0
init_coul: -128.97793216803515