Commit 876a5d56 authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

add log kernel

parent ad51488c
......@@ -80,7 +80,7 @@
//! <b>examples</b>
//! * Onve over r2 in dimension 2
//! \code
//! ./direct_computation -fin input_2d_file.fma --kernel 4 --dimension 2 -fout res.fma
//! ./direct_computation --input-file input_2d_file.fma --kernel 4 --dimension 2 --output-fil res.fma
//! \endcode
//! file-name.{fma, bfma} \endcode
namespace local_args
......@@ -88,12 +88,12 @@ namespace local_args
struct newmatrix_kernel : public laplace::args::matrix_kernel
{
const char* description = "Matrix kernels: \n 0 1/r, 1) grad(1/r), 2) p & grad(1/r) 3) shift grad,\n"
"4) 1/r^2";
"4) 1/r^2 5) ln in 2d ";
};
struct dimension
struct dimension : inria::tcli::required_tag
{
inria::tcli::str_vec flags = {"--dimension", "--d"};
const char* description = "Dimension : \n (2 or 3 except for kernel 4 1 <dimension <4";
const char* description = "Dimension : \n - 1 <dimension <4";
using type = int;
type def = 1;
};
......@@ -103,9 +103,6 @@ auto direct_run(const std::string& input_file, const std::string& output_file, c
{
using value_type = double;
//
// command_line_parameters params(args::cli);
std::cout << scalfmm::colors::blue << "Entering tree test...\n" << scalfmm::colors::reset;
if(!input_file.empty())
......@@ -126,7 +123,7 @@ auto direct_run(const std::string& input_file, const std::string& output_file, c
//
// Open particle file
scalfmm::utils::timer<std::chrono::seconds> time{};
scalfmm::utils::timer<std::chrono::minutes> time{};
using point_type = scalfmm::container::point<value_type, dimension>;
using particle_type =
......@@ -142,6 +139,7 @@ auto direct_run(const std::string& input_file, const std::string& output_file, c
point_type box_center{};
time.tic();
container_type* container{};
// read the data (pos and inputs). The outputs are set to zeros.
laplace::read_data<dimension>(input_file, container, box_center, box_width);
time.tac();
const std::size_t number_of_particles = std::get<0>(container->size());
......@@ -159,7 +157,7 @@ auto direct_run(const std::string& input_file, const std::string& output_file, c
time.tac();
std::cout << scalfmm::colors::green << "... Done.\n" << scalfmm::colors::reset;
std::cout << scalfmm::colors::yellow << "Computation done in " << time.elapsed() << " s\n"
std::cout << scalfmm::colors::yellow << "Computation done in " << time.elapsed() << " min\n"
<< scalfmm::colors::reset;
if(postreat)
......@@ -281,10 +279,12 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
// std::cerr << "Dimension should be lower than 5 (d < 5)\n";
// std::exit(EXIT_FAILURE);
// }
case 5:
direct_run<2, scalfmm::matrix_kernels::laplace::ln_2d>(input_file, output_file, postreat);
break;
default:
std::cout << "Kernel not implemented. values are\n Laplace kernels: 0) 1/r, 1) grad(1/r),"
<< " 2) p + grad(1/r) 3) like_mrhs." << std::endl
<< "Scalar kernels 4) 1/r^2 " << std::endl;
<< "Scalar kernels 4) 1/r^2 5) ln in 2d" << std::endl;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment