add documentation for sublo/subhi extracted flags. add corresponding entries to get data type.
This commit is contained in:
@ -2979,6 +2979,8 @@ Subclassed
|
|||||||
subcutoff
|
subcutoff
|
||||||
subcycle
|
subcycle
|
||||||
subcycling
|
subcycling
|
||||||
|
subhi
|
||||||
|
sublo
|
||||||
Subramaniyan
|
Subramaniyan
|
||||||
subscripted
|
subscripted
|
||||||
subscripting
|
subscripting
|
||||||
|
|||||||
@ -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,"boxlo") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"boxhi") == 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,"boxxlo") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"boxxhi") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"boxxhi") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"boxylo") == 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
|
- double
|
||||||
- 1
|
- 1
|
||||||
- upper box boundary in z-direction. See :doc:`create_box`.
|
- 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
|
* - periodicity
|
||||||
- int
|
- int
|
||||||
- 3
|
- 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,"boxhi") == 0) return (void *) lmp->domain->boxhi;
|
||||||
if (strcmp(name,"sublo") == 0) return (void *) lmp->domain->sublo;
|
if (strcmp(name,"sublo") == 0) return (void *) lmp->domain->sublo;
|
||||||
if (strcmp(name,"subhi") == 0) return (void *) lmp->domain->subhi;
|
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,"boxxlo") == 0) return (void *) &lmp->domain->boxlo[0];
|
||||||
if (strcmp(name,"boxxhi") == 0) return (void *) &lmp->domain->boxhi[0];
|
if (strcmp(name,"boxxhi") == 0) return (void *) &lmp->domain->boxhi[0];
|
||||||
if (strcmp(name,"boxylo") == 0) return (void *) &lmp->domain->boxlo[1];
|
if (strcmp(name,"boxylo") == 0) return (void *) &lmp->domain->boxlo[1];
|
||||||
|
|||||||
@ -110,6 +110,22 @@ TEST(MPI, sub_box)
|
|||||||
EXPECT_LE(subhi[1], boxhi[1]);
|
EXPECT_LE(subhi[1], boxhi[1]);
|
||||||
EXPECT_LE(subhi[2], boxhi[2]);
|
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();
|
::testing::internal::CaptureStdout();
|
||||||
lammps_close(lmp);
|
lammps_close(lmp);
|
||||||
::testing::internal::GetCapturedStdout();
|
::testing::internal::GetCapturedStdout();
|
||||||
|
|||||||
Reference in New Issue
Block a user