add extract function to fix_property_atom

This commit is contained in:
Shern Tee
2023-12-14 10:46:32 +10:00
parent 1e0d0e327c
commit b199368c19
2 changed files with 25 additions and 0 deletions

View File

@ -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;
}

View File

@ -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: