convert fix store/state
This commit is contained in:
@ -527,9 +527,8 @@ double ComputeReduce::compute_one(int m, int flag)
|
|||||||
if (val.flavor == PERATOM) {
|
if (val.flavor == PERATOM) {
|
||||||
if (aidx == 0) {
|
if (aidx == 0) {
|
||||||
double *fix_vector = val.val.f->vector_atom;
|
double *fix_vector = val.val.f->vector_atom;
|
||||||
int n = nlocal;
|
|
||||||
if (flag < 0) {
|
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);
|
if (mask[i] & groupbit) combine(one, fix_vector[i], i);
|
||||||
} else
|
} else
|
||||||
one = fix_vector[flag];
|
one = fix_vector[flag];
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -44,10 +44,22 @@ class FixStoreState : public Fix {
|
|||||||
int maxsize_restart() override;
|
int maxsize_restart() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nvalues;
|
struct value_t {
|
||||||
int *which, *argindex, *value2index;
|
int which;
|
||||||
char **ids;
|
int argindex;
|
||||||
double **values; // archived atom properties
|
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
|
double *vbuf; // 1d ptr to values
|
||||||
|
|
||||||
int comflag;
|
int comflag;
|
||||||
@ -56,9 +68,6 @@ class FixStoreState : public Fix {
|
|||||||
int kflag, cfv_flag, firstflag;
|
int kflag, cfv_flag, firstflag;
|
||||||
int cfv_any; // 1 if any compute/fix/variable specified
|
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_id(int);
|
||||||
void pack_molecule(int);
|
void pack_molecule(int);
|
||||||
void pack_type(int);
|
void pack_type(int);
|
||||||
@ -113,8 +122,6 @@ class FixStoreState : public Fix {
|
|||||||
void pack_tqy(int);
|
void pack_tqy(int);
|
||||||
void pack_tqz(int);
|
void pack_tqz(int);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user