diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index e57419022c..da444bc451 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -164,7 +164,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : maxbondperatom = FCCBONDS; numcoeff = NULL; clist = NULL; - cpage = new MyPage; + cpage = new MyPage; cpage->init(maxbondperatom,1024*maxbondperatom,1); // set comm sizes needed by this fix @@ -976,7 +976,7 @@ void FixHyperLocal::build_bond_list(int natom) memory->sfree(clist); maxcoeff = atom->nmax; memory->create(numcoeff,maxcoeff,"hyper/local:numcoeff"); - clist = (OneCoeff **) memory->smalloc(maxcoeff*sizeof(OneCoeff *), + clist = (HyperOneCoeff **) memory->smalloc(maxcoeff*sizeof(HyperOneCoeff *), "hyper/local:clist"); } @@ -1741,7 +1741,7 @@ double FixHyperLocal::memory_usage() bytes += 2*maxall * sizeof(double); // maxstrain,maxstrain_domain if (checkbias) bytes += maxall * sizeof(tagint); // biasflag bytes += maxcoeff * sizeof(int); // numcoeff - bytes += maxcoeff * sizeof(OneCoeff *); // clist - bytes += maxlocal*maxbondperatom * sizeof(OneCoeff); // cpage estimate + bytes += maxcoeff * sizeof(HyperOneCoeff *); // clist + bytes += maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate return bytes; } diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 4fb54d166c..aa3f050bb9 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -23,6 +23,8 @@ FixStyle(hyper/local,FixHyperLocal) #include "fix_hyper.h" namespace LAMMPS_NS { + // forward declaration. struct HyperOneCoeff is defined in my_page.h + struct HyperOneCoeff; class FixHyperLocal : public FixHyper { public: @@ -183,13 +185,8 @@ class FixHyperLocal : public FixHyper { // data structs for persisting bias coeffs when bond list is reformed - struct OneCoeff { - double biascoeff; - tagint tag; - }; - - MyPage *cpage; // pages of OneCoeff datums for clist - OneCoeff **clist; // ptrs to vectors of bias coeffs for each atom + MyPage *cpage;// pages of OneCoeff datums for clist + HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom int *numcoeff; // # of bias coeffs per atom (one per bond) int maxcoeff; // allocate sized of clist and numcoeff diff --git a/src/my_page.cpp b/src/my_page.cpp index bf636bd93d..6b4372b38b 100644 --- a/src/my_page.cpp +++ b/src/my_page.cpp @@ -257,12 +257,11 @@ void MyPage::allocate() { } // explicit instantiations -#include "fix.h" -#include "REPLICA/fix_hyper_local.h" + namespace LAMMPS_NS { template class MyPage; template class MyPage; template class MyPage; template class MyPage; - template class MyPage; + template class MyPage; } diff --git a/src/my_page.h b/src/my_page.h index 02135b204c..1f40eb48cf 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -22,8 +22,15 @@ #define LAMMPS_MEMALIGN 64 #endif +#include "lmptype.h" + namespace LAMMPS_NS { +struct HyperOneCoeff { + double biascoeff; + tagint tag; +}; + template class MyPage { public: