Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
876a5d56
Commit
876a5d56
authored
Feb 10, 2021
by
COULAUD Olivier
Browse files
add log kernel
parent
ad51488c
Changes
1
Hide whitespace changes
Inline
Side-by-side
experimental/examples/direct_computation.cpp
View file @
876a5d56
...
...
@@ -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 -
f
out res.fma
//! ./direct_computation -
-input-file
input_2d_file.fma --kernel 4 --dimension 2 -
-
out
put-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
::
second
s
>
time
{};
scalfmm
::
utils
::
timer
<
std
::
chrono
::
minute
s
>
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
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment