expose document and test more atom style property flags
This commit is contained in:
@ -961,6 +961,18 @@ not recognized, the function returns -1.
|
||||
- 1 if the atom style includes point dipoles. See :doc:`atom_style`.
|
||||
* - rmass_flag
|
||||
- 1 if the atom style includes per-atom masses, 0 if there are per-type masses. See :doc:`atom_style`.
|
||||
* - radius_flag
|
||||
- 1 if the atom style includes a per-atom radius. See :doc:`atom_style`.
|
||||
* - sphere_flag
|
||||
- 1 if the atom style describes extended particles that can rotate. See :doc:`atom_style`.
|
||||
* - ellipsoid_flag
|
||||
- 1 if the atom style describes extended particles that may be ellipsoidal. See :doc:`atom_style`.
|
||||
* - omega_flag
|
||||
- 1 if the atom style can store per-atom rotational velocities. See :doc:`atom_style`.
|
||||
* - torque_flag
|
||||
- 1 if the atom style can store per-atom torques. See :doc:`atom_style`.
|
||||
* - angmom_flag
|
||||
- 1 if the atom style can store per-atom angular momentum. See :doc:`atom_style`.
|
||||
|
||||
*See also*
|
||||
:cpp:func:`lammps_extract_global`
|
||||
@ -998,6 +1010,13 @@ int lammps_extract_setting(void *handle, const char *keyword)
|
||||
if (strcmp(keyword,"q_flag") == 0) return lmp->atom->q_flag;
|
||||
if (strcmp(keyword,"mu_flag") == 0) return lmp->atom->mu_flag;
|
||||
if (strcmp(keyword,"rmass_flag") == 0) return lmp->atom->rmass_flag;
|
||||
if (strcmp(keyword,"radius_flag") == 0) return lmp->atom->radius_flag;
|
||||
if (strcmp(keyword,"sphere_flag") == 0) return lmp->atom->sphere_flag;
|
||||
if (strcmp(keyword,"ellipsoid_flag") == 0) return lmp->atom->ellipsoid_flag;
|
||||
if (strcmp(keyword,"omega_flag") == 0) return lmp->atom->omega_flag;
|
||||
if (strcmp(keyword,"torque_flag") == 0) return lmp->atom->torque_flag;
|
||||
if (strcmp(keyword,"angmom_flag") == 0) return lmp->atom->angmom_flag;
|
||||
if (strcmp(keyword,"peri_flag") == 0) return lmp->atom->peri_flag;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -198,6 +198,13 @@ TEST_F(LibraryProperties, setting)
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lammps_command(lmp, "dimension 3");
|
||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "ntypes"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nbondtypes"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nangletypes"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "ndihedraltypes"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nimpropertypes"), 0);
|
||||
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "molecule_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "q_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "mu_flag"), 0);
|
||||
@ -217,10 +224,22 @@ TEST_F(LibraryProperties, setting)
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nghost"), 518);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nall"), 547);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nmax"), 16384);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "ntypes"), 5);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nbondtypes"), 5);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nangletypes"), 4);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "ndihedraltypes"), 5);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "nimpropertypes"), 2);
|
||||
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "molecule_flag"), 1);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "q_flag"), 1);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "mu_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "rmass_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "radius_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "sphere_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "ellipsoid_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "omega_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "torque_flag"), 0);
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "angmom_flag"), 0);
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lammps_command(lmp, "change_box all triclinic");
|
||||
lammps_command(lmp, "fix rmass all property/atom rmass ghost yes");
|
||||
|
||||
Reference in New Issue
Block a user