Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
ScalFMM
Commits
dcb054ca
Commit
dcb054ca
authored
5 months ago
by
Olivier COULAUD
Browse files
Options
Downloads
Patches
Plain Diff
Only 1/r kernel is available
Use tree.hpp
parent
6039d3c1
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1111467
skipped
Stage: docker
Stage: deploy
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/fmm_source_target.cpp
+27
-72
27 additions, 72 deletions
examples/fmm_source_target.cpp
with
27 additions
and
72 deletions
examples/fmm_source_target.cpp
+
27
−
72
View file @
dcb054ca
...
...
@@ -12,6 +12,7 @@
//
#include
"scalfmm/algorithms/fmm.hpp"
#include
"scalfmm/algorithms/full_direct.hpp"
#include
"scalfmm/interpolation/grid_storage.hpp"
#include
"scalfmm/interpolation/interpolation.hpp"
#include
"scalfmm/lists/lists.hpp"
#include
"scalfmm/matrix_kernels/laplace.hpp"
...
...
@@ -19,13 +20,8 @@
#include
"scalfmm/operators/fmm_operators.hpp"
//
// Tree
#include
"scalfmm/interpolation/grid_storage.hpp"
#include
"scalfmm/tools/tree_io.hpp"
#include
"scalfmm/tree/box.hpp"
#include
"scalfmm/tree/cell.hpp"
#include
"scalfmm/tree/group_tree_view.hpp"
#include
"scalfmm/tree/leaf_view.hpp"
#include
"scalfmm/tree/utils.hpp"
#include
"scalfmm/tree/tree.hpp"
//
#include
"scalfmm/meta/utils.hpp"
...
...
@@ -110,10 +106,16 @@ namespace local_args
std
::
string
description
=
"Output particle file (with extension .fma (ascii) or bfma (binary)."
;
using
type
=
std
::
string
;
};
struct
newmatrix_kernel
:
public
laplace
::
args
::
matrix_kernel
struct
newmatrix_kernel
//
: public laplace::args::matrix_kernel
{
std
::
string
description
=
"Matrix kernels:
\n
0 1/r, 1) grad(1/r), 2) p & grad(1/r) 3) shift grad,
\n
"
"4) 1/r^2 5) ln in 2d "
;
cpp_tools
::
cl_parser
::
str_vec
flags
=
{
"--kernel"
,
"-k"
};
std
::
string
description
=
"Matrix kernels:
\n
0 1/r, 1) grad(1/r)
\n
"
;
// , 2) p & grad(1/r) 3) shift grad,\n"
// "4) 1/r^2 5) ln in 2d ";
// 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
;
type
def
=
0
;
};
struct
dimension
:
cpp_tools
::
cl_parser
::
required_tag
{
...
...
@@ -380,36 +382,40 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
//
// Parameter handling
auto
parser
=
cpp_tools
::
cl_parser
::
make_parser
(
cpp_tools
::
cl_parser
::
help
{},
local_args
::
input_source_file
(),
local_args
::
input_target_file
(),
args
::
tree_height
{},
args
::
block_size
{},
args
::
order
{},
local_args
::
output_file
(),
local_args
::
newmatrix_kernel
{},
local_args
::
dimension
{},
local_args
::
check
{});
auto
parser
=
cpp_tools
::
cl_parser
::
make_parser
(
cpp_tools
::
cl_parser
::
help
{},
local_args
::
input_source_file
(),
local_args
::
input_target_file
(),
args
::
tree_height
{},
args
::
block_size
{},
args
::
order
{},
local_args
::
output_file
(),
//local_args::newmatrix_kernel{},
local_args
::
dimension
{},
local_args
::
check
{});
parser
.
parse
(
argc
,
argv
);
const
std
::
string
input_source_file
{
parser
.
get
<
local_args
::
input_source_file
>
()};
const
std
::
string
input_target_file
{
parser
.
get
<
local_args
::
input_target_file
>
()};
if
(
!
input_source_file
.
empty
())
{
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Input source file
: "
<<
input_source_file
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Input source file: "
<<
input_source_file
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
}
const
int
tree_height
{
parser
.
get
<
args
::
tree_height
>
()};
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Tree height : "
<<
tree_height
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Tree height: "
<<
tree_height
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
const
int
group_size
{
parser
.
get
<
args
::
block_size
>
()};
const
auto
order
{
parser
.
get
<
args
::
order
>
()};
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Runtime order: "
<<
order
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Group Size
: "
<<
group_size
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
//
std::cout << cpp_tools::colors::blue << "<params> Group Size: " << group_size << cpp_tools::colors::reset << '\n';
const
auto
output_file
{
parser
.
get
<
local_args
::
output_file
>
()};
bool
check_direct
{
parser
.
exists
<
local_args
::
check
>
()};
if
(
!
output_file
.
empty
())
{
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Output file
: "
<<
output_file
<<
cpp_tools
::
colors
::
reset
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> Output file: "
<<
output_file
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
}
const
int
matrix_type
=
parser
.
get
<
local_args
::
newmatrix_kernel
>
();
const
int
matrix_type
{
0
};
//
= parser.get<local_args::newmatrix_kernel>();
const
int
dimension
=
parser
.
get
<
local_args
::
dimension
>
();
std
::
cout
<<
cpp_tools
::
colors
::
blue
<<
"<params> kernel type : "
<<
matrix_type
<<
cpp_tools
::
colors
::
reset
<<
'\n'
;
//
switch
(
matrix_type
)
{
...
...
@@ -451,60 +457,9 @@ auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
order
,
check_direct
,
output_file
);
}
break
;
// case 1:
// using options_case1 = scalfmm::options::uniform_<scalfmm::options::fft_>;
// using far_matrix_kernel_type = scalfmm::matrix_kernels::laplace::one_over_r;
// if(dimension == 1)
// {
// using interpolation_type =
// scalfmm::interpolation::interpolator<value_type, 1, far_matrix_kernel_type, options_case1>;
// using far_field_type = scalfmm::operators::far_field_operator<interpolation_type, true>;
// using fmm_operators_type = scalfmm::operators::fmm_operators<near_field_type, far_field_type>;
// fmm_run<1, value_type, fmm_operators_type>(input_source_file, input_target_file, tree_height, group_size,
// order, check_direct, output_file);
// }
// else if(dimension == 2)
// {
// using interpolation_type =
// scalfmm::interpolation::interpolator<value_type, 2, far_matrix_kernel_type, options>;
// using far_field_type = scalfmm::operators::far_field_operator<interpolation_type, true>;
// using near_matrix_kernel_type = scalfmm::matrix_kernels::laplace::grad_one_over_r<2>;
// using near_field_type = scalfmm::operators::near_field_operator<near_matrix_kernel_type>;
// using fmm_operators_type = scalfmm::operators::fmm_operators<near_field_type, far_field_type>;
// fmm_run<2, value_type, fmm_operators_type>(input_source_file, input_target_file, tree_height, group_size,
// order, check_direct, output_file);
// }
// else
// {
// using interpolation_type =
// scalfmm::interpolation::interpolator<value_type, 3, far_matrix_kernel_type, options>;
// using far_field_type = scalfmm::operators::far_field_operator<interpolation_type, true>;
// using near_field_type = scalfmm::matrix_kernels::laplace::grad_one_over_r<3>;
// using fmm_operators_type = scalfmm::operators::fmm_operators<near_field_type, far_field_type>;
// fmm_run<3, value_type, fmm_operators_type>(input_source_file, input_target_file, tree_height, group_size,
// order, check_direct, output_file);
// }
// break;
// case 2:
// fmm_run<3, value_type, scalfmm::matrix_kernels::laplace::val_grad_one_over_r<3>>(input_file, output_file,
// postreat); break;
// case 3:
// fmm_run<3, value_type, scalfmm::matrix_kernels::laplace::like_mrhs>(input_file, output_file, postreat);
// break;
// case 4:
// test_one_over_r2<value_type>(dimension, input_file, output_file, postreat);
// break;
// case 5:
// fmm_run<2, value_type, 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
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 5) ln in 2d"
<<
std
::
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment