This commit is contained in:
陈浩南 2023-10-05 20:59:28 +08:00
parent 7590a2fb4a
commit 3178d8acc3
3 changed files with 10 additions and 9 deletions

View File

@ -8,7 +8,7 @@ set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(GLOBAL PROPERTY CXX_EXTENSIONS OFF)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Setting build type to 'RelWithDebInfo' as none was specified.")
message("Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
@ -26,6 +26,7 @@ add_executable(ufo src/unfold.cpp src/plot.cpp src/main.cpp)
target_include_directories(ufo PRIVATE ${PROJECT_SOURCE_DIR}/include ${ZPP_BITS_INCLUDE_DIR})
target_link_libraries(ufo PRIVATE
yaml-cpp Eigen3::Eigen fmt::fmt concurrencpp::concurrencpp HighFive_HighFive TBB::tbb Matplot++::matplot)
# target_compile_definitions(ufo PRIVATE $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>)
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")

View File

@ -18,7 +18,7 @@
packages = with pkgs; [ pkg-config cmake ninja ];
buildInputs = (with pkgs; [ eigen yaml-cpp fmt highfive tbb_2021_8.dev ])
++ (with localPackages; [ concurrencpp matplotplusplus zpp-bits ]);
# hardeningDisable = [ "all" ];
hardeningDisable = [ "all" ];
# NIX_DEBUG = "1";
};
};

View File

@ -431,9 +431,9 @@ namespace ufo
// 当 SuperCellDeformation 不是单位矩阵时, input.QPointData[i_of_qpoint].QPoint 不一定在 reciprocal_primative_cell 中
// 需要首先将 q 点平移数个周期, 进入不包含 SuperCellDeformation 的超胞的倒格子中
auto qpoint_by_reciprocal_modified_super_cell_in_modified_reciprocal_super_cell
= !super_cell_deformation ? qpoint.at(i_of_qpoint).get() : [&]
= !super_cell_deformation ? qpoint[i_of_qpoint].get() : [&]
{
auto current_qpoint = qpoint.at(i_of_qpoint).get();
auto current_qpoint = qpoint[i_of_qpoint].get();
// 给一个 q 点打分
// 计算这个 q 点以 modified_reciprocal_supre_cell 为单位的坐标, 依次考虑每个维度, 总分为每个维度之和.
// 如果这个坐标大于 0 小于 1, 则打 0 分.
@ -496,16 +496,16 @@ namespace ufo
// * PrimativeCell.transpose().inverse()
// 得到 sub_qpoint_by_reciprocal_primative_cell = PrimativeCell * sub_qpoint
_.QPoint = primative_cell * sub_qpoint;
_.Source = qpoint.at(i_of_qpoint);
_.Source = qpoint[i_of_qpoint];
_.SourceIndex_ = i_of_qpoint;
for (unsigned i_of_mode = 0; i_of_mode < frequency.at(i_of_qpoint).size(); i_of_mode++)
for (unsigned i_of_mode = 0; i_of_mode < frequency[i_of_qpoint].size(); i_of_mode++)
{
auto& __ = _.ModeData.emplace_back();
__.Frequency = frequency.at(i_of_qpoint).at(i_of_mode);
__.Weight = projection_coefficient.at(num_of_mode_manipulated + i_of_mode).at(i_of_sub_qpoint);
__.Frequency = frequency[i_of_qpoint][i_of_mode];
__.Weight = projection_coefficient[num_of_mode_manipulated + i_of_mode][i_of_sub_qpoint];
}
}
num_of_mode_manipulated += frequency.at(i_of_qpoint).size();
num_of_mode_manipulated += frequency[i_of_qpoint].size();
}
return output;
}