BUGFIX: raise error only if some atoms in current spatial domain but extracted per-atom array is still nullptr

This commit is contained in:
Yury Lysogorskiy
2022-10-26 18:50:08 +02:00
parent 2b8d6fc4d9
commit e4ca652648

View File

@ -247,7 +247,8 @@ void FixPair::post_force(int /*vflag*/)
for (int ifield = 0; ifield < nfield; ifield++) {
void *pvoid = pstyle->extract_peratom(fieldname[ifield],columns);
if (pvoid == nullptr)
//pvoid could return nullptr if no atoms in current spatial domain
if (pvoid == nullptr && nlocal>0)
error->all(FLERR,"Fix pair pair style cannot extract {}",fieldname[ifield]);
if (columns == 0) {