mirror of https://github.com/lammps/lammps.git
add Atom::get_style() method
This commit is contained in:
parent
3b1a6f5e8e
commit
b6ce6755d9
15
src/atom.cpp
15
src/atom.cpp
|
@ -760,6 +760,21 @@ void Atom::setup()
|
|||
if (sortfreq > 0) setup_sort_bins();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
std::string Atom::get_style()
|
||||
{
|
||||
std::string retval = atom_style;
|
||||
if (retval == "hybrid") {
|
||||
auto avec_hybrid = dynamic_cast<AtomVecHybrid *>(avec);
|
||||
for (int i = 0; i < avec_hybrid->nstyles; i++) {
|
||||
retval += ' ';
|
||||
retval += avec_hybrid->keywords[i];
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
return ptr to AtomVec class if matches style or to matching hybrid sub-class
|
||||
return nullptr if no match
|
||||
|
|
|
@ -311,6 +311,7 @@ class Atom : protected Pointers {
|
|||
void init();
|
||||
void setup();
|
||||
|
||||
std::string get_style();
|
||||
AtomVec *style_match(const char *);
|
||||
void modify_params(int, char **);
|
||||
void tag_check();
|
||||
|
|
|
@ -402,7 +402,7 @@ void Info::command(int narg, char **arg)
|
|||
if (flags & SYSTEM) {
|
||||
fputs("\nSystem information:\n",out);
|
||||
fmt::print(out,"Units = {}\n", update->unit_style);
|
||||
fmt::print(out,"Atom style = {}\n", atom->atom_style);
|
||||
fmt::print(out,"Atom style = {}\n", atom->get_style());
|
||||
fmt::print(out,"Atom map = {}\n", mapstyles[atom->map_style]);
|
||||
if (atom->molecular != Atom::ATOMIC) {
|
||||
const char *msg;
|
||||
|
|
Loading…
Reference in New Issue