rohskopf / hessian

Hessian potential based on a second order Taylor series of the potential energy surface
1 stars 0 forks source link

Make mpi error: compatibility issue? #1

Open shaswat-m opened 2 years ago

shaswat-m commented 2 years ago

I get the following error on moving the .cpp and .h files into my src and doing a make mpi

../pair_hessian2.cpp:396:23: error: no member named 'numeric' in 'LAMMPS_NS::Force'
  cut_global = force->numeric(FLERR,arg[0]);
               ~~~~~  ^
../pair_hessian2.cpp:418:10: error: no member named 'bounds' in 'LAMMPS_NS::Force'
  force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
  ~~~~~  ^
../pair_hessian2.cpp:419:10: error: no member named 'bounds' in 'LAMMPS_NS::Force'
  force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
  ~~~~~  ^
../pair_hessian2.cpp:423:24: error: no member named 'numeric' in 'LAMMPS_NS::Force'
  cut_one_min = force->numeric(FLERR,arg[2]);
                ~~~~~  ^
../pair_hessian2.cpp:426:20: error: no member named 'numeric' in 'LAMMPS_NS::Force'
  cut_one = force->numeric(FLERR,arg[3]);
            ~~~~~  ^
../pair_hessian2.cpp:477:26: error: member access into incomplete type 'LAMMPS_NS::Neighbor'
  int irequest = neighbor->request(this,instance_me);
                         ^
../lammps.h:32:9: note: forward declaration of 'LAMMPS_NS::Neighbor'
  class Neighbor *neighbor;      // neighbor lists
        ^
../pair_hessian2.cpp:478:11: error: member access into incomplete type 'LAMMPS_NS::Neighbor'
  neighbor->requests[irequest]->half = 0;
          ^
../lammps.h:32:9: note: forward declaration of 'LAMMPS_NS::Neighbor'
  class Neighbor *neighbor;      // neighbor lists
        ^
../pair_hessian2.cpp:479:11: error: member access into incomplete type 'LAMMPS_NS::Neighbor'
  neighbor->requests[irequest]->full = 1;
          ^
../lammps.h:32:9: note: forward declaration of 'LAMMPS_NS::Neighbor'
  class Neighbor *neighbor;      // neighbor lists
        ^
../pair_hessian2.cpp:592:20: error: no member named 'count_words' in 'LAMMPS_NS::Atom'
    nwords = atom->count_words(line);
             ~~~~  ^
../pair_hessian2.cpp:749:20: error: no member named 'count_words' in 'LAMMPS_NS::Atom'
    nwords = atom->count_words(line);
             ~~~~  ^
10 errors generated.
make[1]: *** [pair_hessian2.o] Error 1
make: *** [mpi] Error 2
shaswat-m commented 2 years ago

Turns out it is just the change in the class that holds bounds and numeric. Moved from atom/force respectively to utils.

shaswat-m commented 2 years ago

Here are the to-dos (changes) to both the cpp files:

  1. add #include "neighbor.h"
  2. change force->numeric(FLERR,arg[*]) to utils::numeric(FLERR,arg[*],false,lmp)
  3. change force->bounds(FLERR,arg[*],atom->ntypes,ilo,ihi) to utils::bounds(FLERR,arg[*],1,atom->ntypes,ilo,ihi,error)
  4. change nwords = atom->count_words(line) to nwords = utils::trim_and_count_words(line)
rohskopf commented 2 years ago

Thanks @shaswat-m and apologies for the deprecated repo. I've also noticed that a bond style is better for using the Taylor expansion potential, it's more stable because atoms may move outside the cutoff radius.

shaswat-m commented 2 years ago

Do you have the bond potential type implementation for this? That would be really helpful!

Also, I see that the IILIST and IJLIST encodes the global hessian matrix which might hamper the parallelization, so I see the merit in implementing this as a bond style.

rohskopf commented 2 years ago

@shaswat-m i don't have the bond style at the moment, I'll upload if I find it or make it again. But the bond style is really the best way to implement.

shaswat-m commented 2 years ago

@rohskopf I'm looking to work on a 4-body potential, effectively like a tetrahedral Finite Element. I'll use the dihedral style to develop something similar to what you're suggesting in the bond style.