XtalOptimizer: Have one function to rebuild lattice from three arrays
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 10m35s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m48s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 10m32s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m30s
Build Packages / Build documentation (push) Successful in 53s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 11m3s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m36s
Build Packages / build:rpm (rocky9) (push) Successful in 11m42s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 11m4s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m49s
Build Packages / build:rpm (rocky8_nocuda) (pull_request) Successful in 9m50s
Build Packages / build:rpm (ubuntu2204_nocuda) (pull_request) Successful in 8m59s
Build Packages / build:rpm (rocky9_nocuda) (pull_request) Successful in 10m16s
Build Packages / build:rpm (ubuntu2404_nocuda) (pull_request) Successful in 9m4s
Build Packages / build:rpm (rocky8_sls9) (pull_request) Successful in 9m40s
Build Packages / Generate python client (pull_request) Successful in 21s
Build Packages / Build documentation (pull_request) Successful in 52s
Build Packages / build:rpm (rocky8) (pull_request) Successful in 9m22s
Build Packages / Create release (pull_request) Has been skipped
Build Packages / build:rpm (rocky9_sls9) (pull_request) Successful in 10m17s
Build Packages / build:rpm (ubuntu2404) (pull_request) Successful in 8m59s
Build Packages / build:rpm (rocky9) (pull_request) Successful in 10m25s
Build Packages / build:rpm (ubuntu2204) (pull_request) Successful in 9m43s
Build Packages / Unit tests (push) Successful in 1h4m28s
Build Packages / Unit tests (pull_request) Successful in 51m46s
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 10m35s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m48s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 10m32s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m30s
Build Packages / Build documentation (push) Successful in 53s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 11m3s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m36s
Build Packages / build:rpm (rocky9) (push) Successful in 11m42s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 11m4s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m49s
Build Packages / build:rpm (rocky8_nocuda) (pull_request) Successful in 9m50s
Build Packages / build:rpm (ubuntu2204_nocuda) (pull_request) Successful in 8m59s
Build Packages / build:rpm (rocky9_nocuda) (pull_request) Successful in 10m16s
Build Packages / build:rpm (ubuntu2404_nocuda) (pull_request) Successful in 9m4s
Build Packages / build:rpm (rocky8_sls9) (pull_request) Successful in 9m40s
Build Packages / Generate python client (pull_request) Successful in 21s
Build Packages / Build documentation (pull_request) Successful in 52s
Build Packages / build:rpm (rocky8) (pull_request) Successful in 9m22s
Build Packages / Create release (pull_request) Has been skipped
Build Packages / build:rpm (rocky9_sls9) (pull_request) Successful in 10m17s
Build Packages / build:rpm (ubuntu2404) (pull_request) Successful in 8m59s
Build Packages / build:rpm (rocky9) (pull_request) Successful in 10m25s
Build Packages / build:rpm (ubuntu2204) (pull_request) Successful in 9m43s
Build Packages / Unit tests (push) Successful in 1h4m28s
Build Packages / Unit tests (pull_request) Successful in 51m46s
This commit is contained in:
@@ -494,7 +494,7 @@ TEST_CASE("LatticeToRodrigues") {
|
||||
CHECK(fabs(rod[1]) < 0.001);
|
||||
CHECK(fabs(rod[2]) < 0.001);
|
||||
|
||||
auto latt_o = AngleAxisAndLengthsToLattice(rod, lengths, false);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, lengths, M_PI/2, M_PI/2, M_PI/2);
|
||||
|
||||
CHECK(latt_o.Vec0().Length() == Catch::Approx(40.0));
|
||||
CHECK(latt_o.Vec1().Length() == Catch::Approx(50.0));
|
||||
@@ -514,8 +514,7 @@ TEST_CASE("LatticeToRodrigues_irregular") {
|
||||
CHECK(lengths[1] == Catch::Approx(50.0));
|
||||
CHECK(lengths[2] == Catch::Approx(80.0));
|
||||
|
||||
|
||||
auto latt_o = AngleAxisAndLengthsToLattice(rod, lengths, false);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, lengths, M_PI/2, M_PI/2, M_PI/2);
|
||||
|
||||
CHECK(latt_o.Vec0().Length() == Catch::Approx(40.0));
|
||||
CHECK(latt_o.Vec1().Length() == Catch::Approx(50.0));
|
||||
@@ -538,7 +537,7 @@ TEST_CASE("LatticeToRodrigues_Hex") {
|
||||
CHECK(lengths[1] == Catch::Approx(40.0));
|
||||
CHECK(lengths[2] == Catch::Approx(70.0));
|
||||
|
||||
auto latt_o = AngleAxisAndLengthsToLattice(rod, lengths, true);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, lengths,M_PI / 2.0, M_PI / 2.0, 2.0 * M_PI / 3.0);
|
||||
auto uc_o = latt_o.GetUnitCell();
|
||||
CHECK(uc_o.a == Catch::Approx(40.0));
|
||||
CHECK(uc_o.b == Catch::Approx(40.0));
|
||||
@@ -782,7 +781,7 @@ TEST_CASE("XtalOptimizer Lattice param roundtrip (GS) preserves Gram matrix") {
|
||||
|
||||
double rod[3]{}, lengths[3]{};
|
||||
LatticeToRodriguesAndLengths_GS(latt_i, rod, lengths);
|
||||
CrystalLattice latt_o = AngleAxisAndLengthsToLattice(rod, lengths, false);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, lengths, M_PI/2, M_PI/2, M_PI/2);
|
||||
|
||||
// This parametrization only keeps "lengths + rotation", i.e. it cannot reproduce shear.
|
||||
// So we *do not* compare Gram matrices here.
|
||||
@@ -803,7 +802,7 @@ TEST_CASE("XtalOptimizer Lattice param roundtrip (Hex) preserves unit cell") {
|
||||
|
||||
double rod[3]{}, ac[3]{};
|
||||
LatticeToRodriguesAndLengths_Hex(latt_i, rod, ac);
|
||||
CrystalLattice latt_o = AngleAxisAndLengthsToLattice(rod, ac, true);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, ac, M_PI/2, M_PI/2, 2*M_PI/3);
|
||||
|
||||
auto uc_o = latt_o.GetUnitCell();
|
||||
CHECK(uc_o.a == Catch::Approx(40.0).margin(1e-6));
|
||||
@@ -841,7 +840,7 @@ TEST_CASE("XtalOptimizer Monoclinic param roundtrip preserves Gram matrix (beta
|
||||
CHECK(lengths[2] == Catch::Approx(70.0).margin(1e-6));
|
||||
CHECK(beta_rad * 180.0 / M_PI == Catch::Approx(cs.beta_deg).margin(1e-6));
|
||||
|
||||
CrystalLattice latt_o = AngleAxisLengthsBetaToLattice_Mono(rod, lengths, beta_rad);
|
||||
auto latt_o = AngleAxisAndCellToLattice(rod, lengths, M_PI/2, beta_rad, M_PI/2);
|
||||
|
||||
// Rotation-invariant check: Gram matrices match.
|
||||
check_gram_close(latt_i, latt_o, /*abs_eps=*/5e-4, /*rel_eps=*/1e-10);
|
||||
|
||||
Reference in New Issue
Block a user