This commit is contained in:
2024-12-24 17:47:02 +08:00
parent f871c28768
commit d4578c7991
50 changed files with 281 additions and 83 deletions

View File

@@ -83,14 +83,14 @@ namespace ufo
auto ratio = config.MaxDisplacement / atom_movement.rowwise().norm().maxCoeff();
atom_movement *= ratio;
// 输出
auto path = "{}/{}/{}"_f(config.OutputPoscarDirectory, i_of_qpoint, i_of_mode);
std::filesystem::create_directories(path);
std::ofstream("{}/POSCAR"_f(path)) << generate_poscar
(
cell.Cell,
cell.AtomPosition + atom_movement * cell.Cell.inverse(),
cell.AtomType
);
for (auto direction : {1, -1})
{
auto path = "{}/{}/{}/{}"_f
(config.OutputPoscarDirectory, i_of_qpoint, i_of_mode, direction > 0 ? "+" : "-");
std::filesystem::create_directories(path);
std::ofstream("{}/POSCAR"_f(path)) << generate_poscar
(cell.Cell, cell.AtomPosition + atom_movement * cell.Cell.inverse() * direction, cell.AtomType);
}
output.ModeRatio[{i_of_qpoint, i_of_mode}] = ratio;
log.debug("Write mode {} {} {}"_f(i_of_qpoint, i_of_mode, atom_movement.rowwise().norm().eval()));
}
@@ -140,7 +140,12 @@ namespace ufo
}
else for (auto entry : std::filesystem::directory_iterator(path)) if (entry.is_directory())
{
std::cout << "{}{}:\n"_f(std::string(indent * 2, ' '), entry.path().filename());
std::cout << "{}{}:\n"_f
(
std::string(indent * 2, ' '),
(std::set{"+"s, "-"s}.contains(entry.path().filename()))
? "\"{}\""_f(entry.path().filename()) : entry.path().filename().string()
);
self(indent + 1, entry.path());
}
};
@@ -152,7 +157,7 @@ namespace ufo
struct Config
{
Eigen::Matrix3d OriginalSusceptibility;
std::map<std::size_t, std::map<std::size_t, Eigen::Matrix3d>> Susceptibility;
std::map<std::size_t, std::map<std::size_t, std::map<std::string, Eigen::Matrix3d>>> Susceptibility;
std::array<Eigen::Vector3d, 2> Polarization;
std::string InputDataFile;
std::string RamanInputDataFile;
@@ -173,7 +178,8 @@ namespace ufo
{
auto&& [i_of_qpoint, i_of_mode] = i;
auto&& _ = cell.Qpoint[i_of_qpoint].Mode[i_of_mode];
Eigen::Matrix3d raman_tensor = (config.Susceptibility[i_of_qpoint][i_of_mode] - config.OriginalSusceptibility)
auto&& susceptibility = config.Susceptibility[i_of_qpoint][i_of_mode];
Eigen::Matrix3d raman_tensor = (susceptibility["+"] - susceptibility["-"]) / 2
/ ratio / raman_input.MaxDisplacement;
_.RamanTensor = raman_tensor | biu::fromEigen;
_.WeightOnRaman = config.Polarization[0].transpose() * raman_tensor * config.Polarization[1];

View File

@@ -5,101 +5,221 @@ OriginalSusceptibility:
Susceptibility:
0:
0:
- [ 7.006379, -5e-06, -2e-06 ]
- [ -1.6e-05, 7.002547, -3e-05 ]
- [ -1.1e-05, -6e-06, 7.303627 ]
"+":
- [ 7.006379, -5e-06, -2e-06 ]
- [ -1.6e-05, 7.002547, -3e-05 ]
- [ -1.1e-05, -6e-06, 7.303627 ]
"-":
- [ 7.006463, 4e-06, -4.5e-05 ]
- [ 1e-06, 7.002729, -1.7e-05 ]
- [ -4.9e-05, 6e-06, 7.303617 ]
1:
- [ 7.006331, 7e-06, 1.6e-05 ]
- [ 2e-06, 7.002539, -1.9e-05 ]
- [ 1.7e-05, -3e-06, 7.303612 ]
"+":
- [ 7.006331, 7e-06, 1.6e-05 ]
- [ 2e-06, 7.002539, -1.9e-05 ]
- [ 1.7e-05, -3e-06, 7.303612 ]
"-":
- [ 7.006366, -8e-06, 1.5e-05 ]
- [ -1.1e-05, 7.002548, -8e-06 ]
- [ 1.3e-05, 1.1e-05, 7.303606 ]
10:
- [ 7.00768, 0.004054, 1e-06 ]
- [ 0.004046, 7.003291, -4e-05 ]
- [ -1e-06, -1.7e-05, 7.305554 ]
"+":
- [ 7.00768, 0.004054, 1e-06 ]
- [ 0.004046, 7.003291, -4e-05 ]
- [ -1e-06, -1.7e-05, 7.305554 ]
"-":
- [ 7.007955, -0.004016, -1e-06 ]
- [ -0.004015, 7.003451, -9e-06 ]
- [ -4e-06, 7e-06, 7.305848 ]
107:
- [ 7.007532, -4.7e-05, -6e-06 ]
- [ -4.8e-05, 7.003828, -9e-06 ]
- [ -4e-06, 4e-06, 7.307759 ]
"+":
- [ 7.007532, -4.7e-05, -6e-06 ]
- [ -4.8e-05, 7.003828, -9e-06 ]
- [ -4e-06, 4e-06, 7.307759 ]
"-":
- [ 7.0076, -5e-06, -1.2e-05 ]
- [ -5e-06, 7.003875, -8e-06 ]
- [ -1e-05, 2e-06, 7.307945 ]
115:
- [ 7.007683, 5e-06, -5.3e-05 ]
- [ -0, 7.003913, 5e-06 ]
- [ -4e-05, 2.8e-05, 7.307388 ]
"+":
- [ 7.007683, 5e-06, -5.3e-05 ]
- [ -0, 7.003913, 5e-06 ]
- [ -4e-05, 2.8e-05, 7.307388 ]
"-":
- [ 7.007917, 5e-06, -3e-06 ]
- [ 4e-06, 7.004128, -3e-06 ]
- [ -2e-06, 1.1e-05, 7.307671 ]
15:
- [ 7.010948, -8.3e-05, -0.007718 ]
- [ -8e-05, 7.004814, -3.4e-05 ]
- [ -0.00772, -1.5e-05, 7.3101 ]
"+":
- [ 7.010948, -8.3e-05, -0.007718 ]
- [ -8e-05, 7.004814, -3.4e-05 ]
- [ -0.00772, -1.5e-05, 7.3101 ]
"-":
- [ 7.011174, 3e-06, 0.00773 ]
- [ -5e-06, 7.005176, -7e-06 ]
- [ 0.007728, 1e-05, 7.3104 ]
16:
- [ 7.008787, 7.2e-05, -1.8e-05 ]
- [ 7.4e-05, 7.007313, 0.007694 ]
- [ -2.4e-05, 0.007696, 7.310191 ]
"+":
- [ 7.008787, 7.2e-05, -1.8e-05 ]
- [ 7.4e-05, 7.007313, 0.007694 ]
- [ -2.4e-05, 0.007696, 7.310191 ]
"-":
- [ 7.008947, -1.3e-05, -7e-06 ]
- [ -2.1e-05, 7.007438, -0.007742 ]
- [ -7e-06, -0.007727, 7.310434 ]
185:
- [ 7.018886, 1.8e-05, -5e-05 ]
- [ 2.7e-05, 7.015141, -3e-05 ]
- [ -5e-05, -1.7e-05, 7.307471 ]
"+":
- [ 7.018886, 1.8e-05, -5e-05 ]
- [ 2.7e-05, 7.015141, -3e-05 ]
- [ -5e-05, -1.7e-05, 7.307471 ]
"-":
- [ 7.003657, 1e-06, 9e-06 ]
- [ -1e-06, 6.999828, -1.4e-05 ]
- [ 1e-05, 5e-06, 7.326057 ]
2:
- [ 7.006421, -8e-06, -4e-05 ]
- [ -1.5e-05, 7.002682, -6.7e-05 ]
- [ -3.9e-05, -4.5e-05, 7.303477 ]
"+":
- [ 7.006421, -8e-06, -4e-05 ]
- [ -1.5e-05, 7.002682, -6.7e-05 ]
- [ -3.9e-05, -4.5e-05, 7.303477 ]
"-":
- [ 7.00633, 2.4e-05, -7.4e-05 ]
- [ 2.2e-05, 7.00253, -9.1e-05 ]
- [ -7.7e-05, -7.2e-05, 7.303417 ]
251:
- [ 7.008862, 4.9e-05, -8.8e-05 ]
- [ 4.8e-05, 7.011172, -0.00086 ]
- [ -7.8e-05, -0.000845, 7.305162 ]
"+":
- [ 7.008862, 4.9e-05, -8.8e-05 ]
- [ 4.8e-05, 7.011172, -0.00086 ]
- [ -7.8e-05, -0.000845, 7.305162 ]
"-":
- [ 7.009107, -5e-06, -2e-06 ]
- [ -8e-06, 7.011587, 0.000791 ]
- [ 3e-06, 0.000809, 7.305493 ]
252:
- [ 7.015066, -4.3e-05, -0.000838 ]
- [ -4.5e-05, 7.005147, -2.9e-05 ]
- [ -0.000841, -9e-06, 7.305197 ]
"+":
- [ 7.015066, -4.3e-05, -0.000838 ]
- [ -4.5e-05, 7.005147, -2.9e-05 ]
- [ -0.000841, -9e-06, 7.305197 ]
"-":
- [ 7.015285, -4e-06, 0.000833 ]
- [ -2e-06, 7.005368, -4e-06 ]
- [ 0.000824, 1.2e-05, 7.305474 ]
281:
- [ 6.981143, 1.4e-05, -5.8e-05 ]
- [ 1.1e-05, 7.038724, 4.3e-05 ]
- [ -5.7e-05, 5.9e-05, 7.306158 ]
"+":
- [ 6.981143, 1.4e-05, -5.8e-05 ]
- [ 1.1e-05, 7.038724, 4.3e-05 ]
- [ -5.7e-05, 5.9e-05, 7.306158 ]
"-":
- [ 7.037206, 2e-06, 0 ]
- [ 3e-06, 6.983191, -1e-05 ]
- [ 2e-06, 0, 7.306576 ]
282:
- [ 7.014582, -0.027613, 1.6e-05 ]
- [ -0.027632, 7.005279, -7.1e-05 ]
- [ 4e-06, -6.7e-05, 7.306158 ]
"+":
- [ 7.014582, -0.027613, 1.6e-05 ]
- [ -0.027632, 7.005279, -7.1e-05 ]
- [ 4e-06, -6.7e-05, 7.306158 ]
"-":
- [ 7.014711, 0.027632, -2e-06 ]
- [ 0.027633, 7.005478, -1.1e-05 ]
- [ -3e-06, 4e-06, 7.306578 ]
287:
- [ 7.032791, 2.6e-05, -4.1e-05 ]
- [ 3.2e-05, 7.028882, -1.7e-05 ]
- [ -3.6e-05, -2e-06, 7.250185 ]
"+":
- [ 7.032791, 2.6e-05, -4.1e-05 ]
- [ 3.2e-05, 7.028882, -1.7e-05 ]
- [ -3.6e-05, -2e-06, 7.250185 ]
"-":
- [ 6.985897, -3e-06, 4e-06 ]
- [ 5e-06, 6.982421, -1.4e-05 ]
- [ 2e-06, -3e-06, 7.382705 ]
292:
- [ 7.007262, 1.3e-05, 1.3e-05 ]
- [ 9e-06, 7.013971, -5.9e-05 ]
- [ 7e-06, -4.6e-05, 7.305084 ]
"+":
- [ 7.007262, 1.3e-05, 1.3e-05 ]
- [ 9e-06, 7.013971, -5.9e-05 ]
- [ 7e-06, -4.6e-05, 7.305084 ]
"-":
- [ 7.011688, 0, 2e-06 ]
- [ -2e-06, 7.009318, -7e-06 ]
- [ 4e-06, 9e-06, 7.306455 ]
293:
- [ 7.015281, 0.002384, -0 ]
- [ 0.002373, 7.005685, -4.4e-05 ]
- [ -4e-06, -2.8e-05, 7.3058 ]
"+":
- [ 7.015281, 0.002384, -0 ]
- [ 0.002373, 7.005685, -4.4e-05 ]
- [ -4e-06, -2.8e-05, 7.3058 ]
"-":
- [ 7.015423, -0.002375, -9e-06 ]
- [ -0.00237, 7.005799, -7e-06 ]
- [ -8e-06, 1.1e-05, 7.305927 ]
311:
- [ 7.017108, 0.000122, -0.023832 ]
- [ 0.00013, 7.006382, -5.6e-05 ]
- [ -0.02384, -3.4e-05, 7.306937 ]
"+":
- [ 7.017108, 0.000122, -0.023832 ]
- [ 0.00013, 7.006382, -5.6e-05 ]
- [ -0.02384, -3.4e-05, 7.306937 ]
"-":
- [ 7.017506, 5e-06, 0.023741 ]
- [ -6e-06, 7.006811, -2e-06 ]
- [ 0.023733, 1.6e-05, 7.307537 ]
312:
- [ 7.010335, 7.8e-05, -4.6e-05 ]
- [ 8.4e-05, 7.013598, 0.023664 ]
- [ -4.1e-05, 0.023683, 7.307236 ]
"+":
- [ 7.010335, 7.8e-05, -4.6e-05 ]
- [ 8.4e-05, 7.013598, 0.023664 ]
- [ -4.1e-05, 0.023683, 7.307236 ]
"-":
- [ 7.010567, -1e-06, -3e-06 ]
- [ -9e-06, 7.013715, -0.023726 ]
- [ -4e-06, -0.023709, 7.307591 ]
327:
- [ 7.008517, 2.9e-05, -1.6e-05 ]
- [ 2.5e-05, 7.004613, -9.3e-05 ]
- [ -1.8e-05, -7.1e-05, 7.324773 ]
"+":
- [ 7.008517, 2.9e-05, -1.6e-05 ]
- [ 2.5e-05, 7.004613, -9.3e-05 ]
- [ -1.8e-05, -7.1e-05, 7.324773 ]
"-":
- [ 7.012664, -1e-05, 1e-06 ]
- [ -8e-06, 7.008951, -1.2e-05 ]
- [ 5e-06, 7e-06, 7.306262 ]
378:
- [ 7.012128, 1e-05, 1.8e-05 ]
- [ 1e-06, 7.008401, -1e-05 ]
- [ 1.3e-05, -1e-06, 7.322152 ]
"+":
- [ 7.012128, 1e-05, 1.8e-05 ]
- [ 1e-06, 7.008401, -1e-05 ]
- [ 1.3e-05, -1e-06, 7.322152 ]
"-":
- [ 7.012153, 1e-06, -1.3e-05 ]
- [ 9e-06, 7.008396, -1.4e-05 ]
- [ -1.9e-05, 3e-06, 7.322317 ]
379:
- [ 7.010873, -5.9e-05, -3.8e-05 ]
- [ -7.8e-05, 7.007166, -3.6e-05 ]
- [ -4.3e-05, -2.5e-05, 7.319279 ]
"+":
- [ 7.010873, -5.9e-05, -3.8e-05 ]
- [ -7.8e-05, 7.007166, -3.6e-05 ]
- [ -4.3e-05, -2.5e-05, 7.319279 ]
"-":
- [ 7.011186, -5e-06, -1.4e-05 ]
- [ 6e-06, 7.007443, -1e-06 ]
- [ -1.9e-05, 1.4e-05, 7.319705 ]
5:
- [ 7.007563, -0.001516, 5e-06 ]
- [ -0.001515, 7.00316, -5.5e-05 ]
- [ 0, -2.9e-05, 7.305665 ]
"+":
- [ 7.007563, -0.001516, 5e-06 ]
- [ -0.001515, 7.00316, -5.5e-05 ]
- [ 0, -2.9e-05, 7.305665 ]
"-":
- [ 7.007833, 0.001555, -9e-06 ]
- [ 0.001554, 7.003468, -1.1e-05 ]
- [ -1.2e-05, 1e-05, 7.306111 ]
6:
- [ 7.005528, 1.8e-05, 4.1e-05 ]
- [ 1.2e-05, 7.005511, -3.7e-05 ]
- [ 3.7e-05, -1.5e-05, 7.30606 ]
"+":
- [ 7.005528, 1.8e-05, 4.1e-05 ]
- [ 1.2e-05, 7.005511, -3.7e-05 ]
- [ 3.7e-05, -1.5e-05, 7.30606 ]
"-":
- [ 7.008811, -2e-06, 4e-06 ]
- [ -5e-06, 7.002567, -3e-06 ]
- [ 7e-06, 1.7e-05, 7.306146 ]
9:
- [ 7.011048, 8e-05, -2.7e-05 ]
- [ 8.6e-05, 7.000001, 6e-06 ]
- [ -2.6e-05, 4.1e-05, 7.30555 ]
"+":
- [ 7.011048, 8e-05, -2.7e-05 ]
- [ 8.6e-05, 7.000001, 6e-06 ]
- [ -2.6e-05, 4.1e-05, 7.30555 ]
"-":
- [ 7.003087, -6e-06, 3e-06 ]
- [ -3e-06, 7.008199, -1e-06 ]
- [ 5e-06, 1.8e-05, 7.305867 ]
origin:
- [ 7.006328, -3.3e-05, -2e-06 ]
- [ -3.4e-05, 7.002539, -2.4e-05 ]

BIN
test/raman-extract/0/0/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/1/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/10/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/107/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/115/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/15/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/16/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/185/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/2/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/251/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/252/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/281/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/282/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/287/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/292/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/293/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/311/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/312/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/327/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/378/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/379/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/5/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/6/-/OUTCAR LFS Normal file

Binary file not shown.

BIN
test/raman-extract/0/9/-/OUTCAR LFS Normal file

Binary file not shown.