add extract function to fix_property_atom
This commit is contained in:
@ -948,3 +948,27 @@ int FixPropertyAtom::size_restart(int /*nlocal*/)
|
||||
{
|
||||
return values_peratom + 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
extract fix property/atom properties
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *FixPropertyAtom::extract(const char *str, int &dim)
|
||||
{
|
||||
dim=0;
|
||||
if (strcmp(str, "nvalue") == 0) {
|
||||
return &nvalue;
|
||||
} else if (strcmp(str, "border") == 0) {
|
||||
return &border;
|
||||
}
|
||||
dim=1;
|
||||
if (strcmp(str, "styles") == 0) {
|
||||
return &styles;
|
||||
} else if (strcmp(str, "index") == 0) {
|
||||
return &index;
|
||||
} else if (strcmp(str, "cols") == 0) {
|
||||
return &cols;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ class FixPropertyAtom : public Fix {
|
||||
void unpack_restart(int, int) override;
|
||||
int size_restart(int) override;
|
||||
int maxsize_restart() override;
|
||||
void *extract(const char *, int &) override;
|
||||
double memory_usage() override;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user