|
|
|
|
#if defined(DEBUG) && not defined(RELEASE_BRANCH)
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <iomanip>
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <surface_integral.hpp>
|
|
|
|
|
#include <chain_process.hpp>
|
|
|
|
|
#include <calculate_integral.hpp>
|
|
|
|
|
|
|
|
|
|
static const std::string subface_type_name[] = {"plane", "sphere", "cylinder", "cone"};
|
|
|
|
|
|
|
|
|
|
integrator execute_integrand_calculation(uint8_t q,
|
|
|
|
|
const baked_blobtree_t& tree,
|
|
|
|
|
const std::vector<Eigen::Vector3d>& vertices,
|
|
|
|
|
const icurve_relation_graph_t& icurve_relation_graph)
|
|
|
|
|
{
|
|
|
|
|
integrator result{};
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
pcurve_relation_graph_t pcurve_relation_graph{};
|
|
|
|
|
map_chain_to_parametric_plane(tree, vertices, icurve_relation_graph, pcurve_relation_graph);
|
|
|
|
|
identify_parametric_chain_valid_side(tree, vertices, icurve_relation_graph, pcurve_relation_graph);
|
|
|
|
|
simplify_parametric_chain(pcurve_relation_graph);
|
|
|
|
|
#if defined(DEBUG) && not defined(RELEASE_BRANCH)
|
|
|
|
|
auto path = std::filesystem::current_path().parent_path().parent_path().parent_path().parent_path()
|
|
|
|
|
/ "surface_integral_v2" / "plot";
|
|
|
|
|
const auto& subface_types = tree.subface_types;
|
|
|
|
|
for (auto subface_node : pcurve_relation_graph.nodes<0>()) {
|
|
|
|
|
const auto subface_index = subface_node.index();
|
|
|
|
|
const auto subface_type = subface_types[subface_index];
|
|
|
|
|
std::ofstream file(path / std::string("subface_" + std::to_string(subface_index) + ".txt"));
|
|
|
|
|
|
|
|
|
|
for (auto edge_to_chain : subface_node.edges<edge_bidirection::to_prev>()) {
|
|
|
|
|
const auto property = edge_to_chain.property();
|
|
|
|
|
for (const auto& [vertices, _] : property.subchains) {
|
|
|
|
|
for (const auto& v : vertices)
|
|
|
|
|
file << std::scientific << std::setprecision(16) << v.x() << " " << v.y() << "\n";
|
|
|
|
|
file << "\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
|
|
|
|
|
file.open(path / std::string("subface_" + std::to_string(subface_index) + ".meta"));
|
|
|
|
|
|
|
|
|
|
file << subface_type_name[static_cast<uint8_t>(subface_type)] << "\n\n";
|
|
|
|
|
|
|
|
|
|
size_t subchain_index_offset{};
|
|
|
|
|
for (auto edge_to_chain : subface_node.edges<edge_bidirection::to_prev>()) {
|
|
|
|
|
const auto property = edge_to_chain.property();
|
|
|
|
|
file << subchain_index_offset << " " << subchain_index_offset + property.subchains.size() << " ";
|
|
|
|
|
file << std::boolalpha << property.double_sided << " " << property.patch_on_pos_side << "\n";
|
|
|
|
|
subchain_index_offset += property.subchains.size();
|
|
|
|
|
}
|
|
|
|
|
file << "\n";
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
calculate_integral(q,
|
|
|
|
|
tree,
|
|
|
|
|
pcurve_relation_graph,
|
|
|
|
|
result.integral_points,
|
|
|
|
|
result.surface_integral_weights,
|
|
|
|
|
result.volume_integral_weights);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|