From e102f446a8255826842010f49acd07616eac65de Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 12 Feb 2009 20:14:58 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2576 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/neigh_request.cpp | 44 +++++++++++++++++++++++++------------------ src/neigh_request.h | 8 +++++++- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 5739a8175c..4eb2a73a56 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -38,6 +38,10 @@ NeighRequest::NeighRequest(LAMMPS *lmp) : Pointers(lmp) respainner = respamiddle = respaouter = 0; half_from_full = 0; + // default is use newton_pair setting in force + + newton = 0; + // default is every reneighboring occasional = 0; @@ -89,6 +93,7 @@ int NeighRequest::identical(NeighRequest *other) if (respaouter != other->respaouter) same = 0; if (half_from_full != other->half_from_full) same = 0; + if (newton != other->newton) same = 0; if (occasional != other->occasional) same = 0; if (dnum != other->dnum) same = 0; @@ -116,28 +121,11 @@ int NeighRequest::same_kind(NeighRequest *other) if (respamiddle != other->respamiddle) same = 0; if (respaouter != other->respaouter) same = 0; if (half_from_full != other->half_from_full) same = 0; + if (newton != other->newton) same = 0; return same; } -/* ---------------------------------------------------------------------- - set kind value of this request to that of other request -------------------------------------------------------------------------- */ - -void NeighRequest::copy_kind(NeighRequest *other) -{ - half = 0; - - if (other->half) half = 1; - if (other->full) full = 1; - if (other->gran) gran = 1; - if (other->granhistory) granhistory = 1; - if (other->respainner) respainner = 1; - if (other->respamiddle) respamiddle = 1; - if (other->respaouter) respaouter = 1; - if (other->half_from_full) half_from_full = 1; -} - /* ---------------------------------------------------------------------- compare skip attributes of this request to other request return 1 if same, 0 if different @@ -162,3 +150,23 @@ int NeighRequest::same_skip(NeighRequest *other) return same; } +/* ---------------------------------------------------------------------- + set kind and other values of this request to that of other request +------------------------------------------------------------------------- */ + +void NeighRequest::copy_request(NeighRequest *other) +{ + half = 0; + + if (other->half) half = 1; + if (other->full) full = 1; + if (other->gran) gran = 1; + if (other->granhistory) granhistory = 1; + if (other->respainner) respainner = 1; + if (other->respamiddle) respamiddle = 1; + if (other->respaouter) respaouter = 1; + if (other->half_from_full) half_from_full = 1; + + newton = other->newton; + dnum = other->dnum; +} diff --git a/src/neigh_request.h b/src/neigh_request.h index 8b244bf0cd..4c9abf8276 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -52,6 +52,12 @@ class NeighRequest : protected Pointers { int occasional; + // 0 if use force::newton_pair setting + // 1 if override with pair newton on + // 2 if override with pair newton off + + int newton; + // number of auxiliary floating point values to store, 0 if none // set by requesting class @@ -74,8 +80,8 @@ class NeighRequest : protected Pointers { ~NeighRequest(); int identical(NeighRequest *); int same_kind(NeighRequest *); - void copy_kind(NeighRequest *); int same_skip(NeighRequest *); + void copy_request(NeighRequest *); }; }