From cfa30117225e2feab82ea9906c7f7b4d0e24d266 Mon Sep 17 00:00:00 2001 From: Olivier Coulaud <olivier.coulaud@inria.fr> Date: Fri, 7 Feb 2025 09:03:55 +0100 Subject: [PATCH] Change --k to -k for kernel and dimension is required for the target source example --- examples/fmm_source_target.cpp | 7 ++++--- include/scalfmm/tools/laplace_tools.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/fmm_source_target.cpp b/examples/fmm_source_target.cpp index 75ca335be..c898f9022 100644 --- a/examples/fmm_source_target.cpp +++ b/examples/fmm_source_target.cpp @@ -73,7 +73,7 @@ using namespace scalfmm::io; //! --output-file, -fout value //! Output particle file (with extension .fma (ascii) or bfma (binary). //! -//! --kernel, --k value +//! --kernel, -k value //! Matrix kernels: //! 0 1/r, 1) grad(1/r), 2) p & grad(1/r) 3) shift grad, //! 4) 1/r^2 5) ln in 2d @@ -81,6 +81,7 @@ using namespace scalfmm::io; //! --dimension, -d value //! Dimension : //! - 1 <dimension <4 +//! default 1 //! ./tools/direct_source_target --input-source-file test_source.fma --input-target-file test_target.fma --dimension 2 //! --kernel 0 //! ./examples/Release/fmm_source_target --input-source-file test_source.fma --input-target-file test_target.fma @@ -119,7 +120,6 @@ namespace local_args cpp_tools::cl_parser::str_vec flags = {"--dimension", "-d"}; std::string description = "Dimension : \n - 1 <dimension <4"; using type = int; - type def = 1; }; struct check { @@ -177,6 +177,7 @@ auto read_data(const std::string& filename) const bool verbose{false}; scalfmm::io::FFmaGenericLoader<value_type, dimension> loader(filename, verbose); + const auto width{loader.getBoxWidth()}; const auto center{loader.getBoxCenter()}; const std::size_t number_of_particles{loader.getNumberOfParticles()}; @@ -212,7 +213,7 @@ auto fmm_run(const std::string& input_source_file, const std::string& input_targ const int& group_size, const int& order, bool check_direct, const std::string& output_file) -> int { bool display_container = false; - bool display_tree = true; + bool display_tree = false; std::cout << cpp_tools::colors::blue << "Entering tree test...\n" << cpp_tools::colors::reset; // The matrix kernel diff --git a/include/scalfmm/tools/laplace_tools.hpp b/include/scalfmm/tools/laplace_tools.hpp index 51c13997f..5bcce4597 100644 --- a/include/scalfmm/tools/laplace_tools.hpp +++ b/include/scalfmm/tools/laplace_tools.hpp @@ -23,7 +23,7 @@ namespace laplace */ struct matrix_kernel { - cpp_tools::cl_parser::str_vec flags = {"--kernel", "--k"}; + cpp_tools::cl_parser::str_vec flags = {"--kernel", "-k"}; const char* description = "Matrix kernels: \n 0) 1/r, 1) grad(1/r), 2) p & grad(1/r) 3) shift(1/r)-> " "grad 4) shift(1/r)-> p & grad. "; using type = int; @@ -43,7 +43,7 @@ namespace laplace { flagged }; - cpp_tools::cl_parser::str_vec flags = {"--post_traitement", "--pt"}; + cpp_tools::cl_parser::str_vec flags = {"--post_traitement", "-pt"}; std::string description = "Post traitement to obtain Electric field or the weight "; }; } // namespace args @@ -224,8 +224,8 @@ namespace laplace * @param container The container of particles */ template<class MatrixKernelType, class ContainerType, std::size_t Dimension> - auto post_traitement(scalfmm::matrix_kernels::laplace::grad_one_over_r<Dimension>& mat, - ContainerType& container) -> void + auto post_traitement(scalfmm::matrix_kernels::laplace::grad_one_over_r<Dimension>& mat, ContainerType& container) + -> void { std::cout << "From post_traitement grad_one_over_r " << std::endl; multiply_force_by_q(0, 3, container); -- GitLab