Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_pdata
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_pdata
Commits
e6c1f026
Commit
e6c1f026
authored
Mar 20, 2018
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AMR struct
parent
f6575514
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
openfpm_data
openfpm_data
+1
-1
src/Amr/grid_dist_amr.hpp
src/Amr/grid_dist_amr.hpp
+2
-2
src/Amr/grid_dist_amr_unit_tests.cpp
src/Amr/grid_dist_amr_unit_tests.cpp
+42
-0
No files found.
openfpm_data
@
f5278c6f
Subproject commit
63cf342df7a5c97e126f2d677c4ffdabbea3d6ae
Subproject commit
f5278c6f76f2209939801230320f69190a62793d
src/Amr/grid_dist_amr.hpp
View file @
e6c1f026
...
...
@@ -643,8 +643,8 @@ public:
{
#ifdef SE_CLASS1
if
(
key
.
getLvl
()
>=
getNLvl
()
-
1
)
{
std
::
cerr
<<
__FILE__
<<
":"
<<
__LINE__
<<
" error: we are already at the
last level, we cannot go one level down
"
<<
std
::
endl
;}
if
(
key
.
getLvl
()
==
0
)
{
std
::
cerr
<<
__FILE__
<<
":"
<<
__LINE__
<<
" error: we are already at the
top level, we cannot go one level up
"
<<
std
::
endl
;}
#endif
...
...
src/Amr/grid_dist_amr_unit_tests.cpp
View file @
e6c1f026
...
...
@@ -429,6 +429,8 @@ void Test3D_amr_domain_ghost_it(grid & amr_g, Box<3,float> & domain, size_t coar
fact
*=
8
;
}
std
::
cout
<<
"Test g_sz: "
<<
g_sz
[
0
]
<<
" "
<<
g_sz
[
1
]
<<
" "
<<
g_sz
[
2
]
<<
std
::
endl
;
amr_g
.
initLevels
(
n_lvl
,
g_sz
);
size_t
total_all_level
=
0
;
...
...
@@ -458,6 +460,8 @@ void Test3D_amr_domain_ghost_it(grid & amr_g, Box<3,float> & domain, size_t coar
++
it
;
}
std
::
cout
<<
count
<<
std
::
endl
;
size_t
tot
=
(
amr_g
.
getGridInfoVoid
(
i
).
size
(
0
)
+
2
)
*
(
amr_g
.
getGridInfoVoid
(
i
).
size
(
1
)
+
2
)
*
(
amr_g
.
getGridInfoVoid
(
i
).
size
(
2
)
+
2
);
...
...
@@ -472,6 +476,7 @@ void Test3D_amr_domain_ghost_it(grid & amr_g, Box<3,float> & domain, size_t coar
BOOST_REQUIRE_EQUAL
(
tot
,
count
);
}
size_t
amr_cnt
=
0
;
bool
match
=
true
;
auto
it2
=
amr_g
.
getDomainGhostIterator
(
i
);
...
...
@@ -482,10 +487,12 @@ void Test3D_amr_domain_ghost_it(grid & amr_g, Box<3,float> & domain, size_t coar
match
&=
amr_g
.
template
get
<
0
>(
i
,
key
)
==
key_g
.
get
(
0
);
total_all_level
++
;
amr_cnt
++
;
++
it2
;
}
BOOST_REQUIRE_EQUAL
(
amr_cnt
,
count
);
BOOST_REQUIRE_EQUAL
(
match
,
true
);
}
...
...
@@ -661,4 +668,39 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_test_background_value )
}
BOOST_AUTO_TEST_CASE
(
grid_dist_amr_get_domain_ghost_check
)
{
// Domain
Box
<
3
,
float
>
domain3
({
0.0
,
0.0
,
0.0
},{
1.0
,
1.0
,
1.0
});
Ghost
<
3
,
long
int
>
g
(
1
);
sgrid_dist_amr
<
3
,
float
,
aggregate
<
long
int
,
long
int
,
long
int
>>
amr_g2
(
domain3
,
g
);
size_t
g_sz
[
3
]
=
{
4
,
4
,
4
};
amr_g2
.
initLevels
(
4
,
g_sz
);
// This point is on a ghost
grid_dist_key_dx
<
3
>
key
(
0
,
grid_key_dx
<
3
>
({
0
,
0
,
0
}));
amr_g2
.
template
insert
<
0
>(
1
,
key
)
=
555
;
auto
dgit
=
amr_g2
.
getDomainGhostIterator
();
int
cnt
=
0
;
while
(
dgit
.
isNext
())
{
auto
key
=
dgit
.
get
();
cnt
++
;
++
dgit
;
}
BOOST_REQUIRE_EQUAL
(
cnt
,
1
);
}
BOOST_AUTO_TEST_SUITE_END
()
Write
Preview
Markdown
is supported
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