convert fix store/state

This commit is contained in:
Axel Kohlmeyer
2022-10-07 07:33:42 -04:00
parent 68482ffe14
commit c312bf97ae
3 changed files with 322 additions and 327 deletions

View File

@ -527,9 +527,8 @@ double ComputeReduce::compute_one(int m, int flag)
if (val.flavor == PERATOM) {
if (aidx == 0) {
double *fix_vector = val.val.f->vector_atom;
int n = nlocal;
if (flag < 0) {
for (int i = 0; i < n; i++)
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) combine(one, fix_vector[i], i);
} else
one = fix_vector[flag];

File diff suppressed because it is too large Load Diff

View File

@ -44,10 +44,22 @@ class FixStoreState : public Fix {
int maxsize_restart() override;
private:
int nvalues;
int *which, *argindex, *value2index;
char **ids;
double **values; // archived atom properties
struct value_t {
int which;
int argindex;
std::string id;
union {
class Compute *c;
class Fix *f;
int v;
int d;
int i;
} val;
void (FixStoreState::* pack_choice)(int); // ptr to pack function
};
std::vector<value_t> values;
double **avalues; // archived atom properties
double *vbuf; // 1d ptr to values
int comflag;
@ -56,9 +68,6 @@ class FixStoreState : public Fix {
int kflag, cfv_flag, firstflag;
int cfv_any; // 1 if any compute/fix/variable specified
typedef void (FixStoreState::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_id(int);
void pack_molecule(int);
void pack_type(int);
@ -113,8 +122,6 @@ class FixStoreState : public Fix {
void pack_tqy(int);
void pack_tqz(int);
};
} // namespace LAMMPS_NS
#endif
#endif