From 4ac7a26fe13e68a640a455a0d828f4e662ff23ee Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 18 May 2020 19:35:50 -0400 Subject: [PATCH] add support for extracting r0 array to bond style zero --- src/bond_zero.cpp | 11 +++++++++-- src/bond_zero.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index 428fd0ace2..cb336ddd67 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -144,8 +144,6 @@ void BondZero::write_data(FILE *fp) fprintf(fp,"%d %g\n",i,r0[i]); } - - /* ---------------------------------------------------------------------- */ double BondZero::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, @@ -153,3 +151,12 @@ double BondZero::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, { return 0.0; } + +/* ---------------------------------------------------------------------- */ + +void *BondZero::extract(const char *str, int &dim) +{ + dim = 1; + if (strcmp(str,"r0")==0) return (void*) r0; + return NULL; +} diff --git a/src/bond_zero.h b/src/bond_zero.h index 7cbd2b9a96..b31e89edf7 100644 --- a/src/bond_zero.h +++ b/src/bond_zero.h @@ -38,6 +38,7 @@ class BondZero : public Bond { void write_data(FILE *); double single(int, double, int, int, double &); + virtual void *extract(const char *, int &); protected: double *r0;