add documentation for sublo/subhi extracted flags. add corresponding entries to get data type.

This commit is contained in:
Axel Kohlmeyer
2020-11-19 19:20:02 -05:00
parent 371b1a80e3
commit 2d69051cdf
3 changed files with 40 additions and 0 deletions

View File

@ -2979,6 +2979,8 @@ Subclassed
subcutoff
subcycle
subcycling
subhi
sublo
Subramaniyan
subscripted
subscripting

View File

@ -995,6 +995,10 @@ int lammps_extract_global_datatype(void *handle, const char *name)
if (strcmp(name,"boxlo") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"boxhi") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"sublo") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"subhi") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"sublo_lambda") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"subhi_lambda") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"boxxlo") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"boxxhi") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"boxylo") == 0) return LAMMPS_DOUBLE;
@ -1159,6 +1163,22 @@ report the "native" data type. The following tables are provided:
- double
- 1
- upper box boundary in z-direction. See :doc:`create_box`.
* - sublo
- double
- 3
- subbox lower boundaries
* - subhi
- double
- 3
- subbox upper boundaries
* - sublo_lambda
- double
- 3
- subbox lower boundaries in fractional coordinates (for triclinic cells)
* - subhi_lambda
- double
- 3
- subbox upper boundaries in fractional coordinates (for triclinic cells)
* - periodicity
- int
- 3
@ -1352,6 +1372,8 @@ void *lammps_extract_global(void *handle, const char *name)
if (strcmp(name,"boxhi") == 0) return (void *) lmp->domain->boxhi;
if (strcmp(name,"sublo") == 0) return (void *) lmp->domain->sublo;
if (strcmp(name,"subhi") == 0) return (void *) lmp->domain->subhi;
if (strcmp(name,"sublo_lambda") == 0) return (void *) lmp->domain->sublo_lamda;
if (strcmp(name,"subhi_lambda") == 0) return (void *) lmp->domain->subhi_lamda;
if (strcmp(name,"boxxlo") == 0) return (void *) &lmp->domain->boxlo[0];
if (strcmp(name,"boxxhi") == 0) return (void *) &lmp->domain->boxhi[0];
if (strcmp(name,"boxylo") == 0) return (void *) &lmp->domain->boxlo[1];

View File

@ -110,6 +110,22 @@ TEST(MPI, sub_box)
EXPECT_LE(subhi[1], boxhi[1]);
EXPECT_LE(subhi[2], boxhi[2]);
::testing::internal::CaptureStdout();
lammps_command(lmp, "change_box all triclinic");
::testing::internal::GetCapturedStdout();
sublo = (double *)lammps_extract_global(lmp, "sublo_lambda");
subhi = (double *)lammps_extract_global(lmp, "subhi_lambda");
ASSERT_NE(sublo, nullptr);
ASSERT_NE(subhi, nullptr);
EXPECT_GE(sublo[0], 0.0);
EXPECT_GE(sublo[1], 0.0);
EXPECT_GE(sublo[2], 0.0);
EXPECT_LE(subhi[0], 1.0);
EXPECT_LE(subhi[1], 1.0);
EXPECT_LE(subhi[2], 1.0);
::testing::internal::CaptureStdout();
lammps_close(lmp);
::testing::internal::GetCapturedStdout();