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
9d529e78
Commit
9d529e78
authored
Feb 09, 2018
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing setBackgroundValue
parent
3b25e2ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
openfpm_data
openfpm_data
+1
-1
src/Amr/grid_dist_amr.hpp
src/Amr/grid_dist_amr.hpp
+6
-0
src/Amr/grid_dist_amr_unit_tests.cpp
src/Amr/grid_dist_amr_unit_tests.cpp
+11
-0
No files found.
openfpm_data
@
63a78e33
Subproject commit
b4e271e7a435bc6b4522f02926a114a63617f9ba
Subproject commit
63a78e33be8766030b2424e5f86c82e5e3e021ff
src/Amr/grid_dist_amr.hpp
View file @
9d529e78
...
...
@@ -67,6 +67,9 @@ class grid_dist_amr<dim,St,T,AMR_IMPL_TRIVIAL,Decomposition,Memory,device_grid>
//! Moving offsets
openfpm
::
vector
<
openfpm
::
vector
<
offset_mv
<
dim
>>>
mv_off
;
// background level
T
bck
;
/*! \brief Initialize the others levels
*
* \param n_lvl number of levels
...
...
@@ -81,6 +84,7 @@ class grid_dist_amr<dim,St,T,AMR_IMPL_TRIVIAL,Decomposition,Memory,device_grid>
{
g_sz_lvl
[
j
]
=
(
g_sz_lvl
[
j
]
-
1
)
*
2
+
1
;}
gd_array
.
add
(
grid_dist_id
<
dim
,
St
,
T
,
Decomposition
,
Memory
,
device_grid
>
(
gd_array
.
get
(
0
).
getDecomposition
(),
g_sz_lvl
,
g_int
));
gd_array
.
last
().
setBackgroundValue
(
bck
);
}
// Here we calculate the offset to move one level up and one level down
...
...
@@ -528,6 +532,8 @@ public:
{
for
(
size_t
i
=
0
;
i
<
getNLvl
()
;
i
++
)
{
gd_array
.
get
(
i
).
setBackgroundValue
(
bv
);}
meta_copy
<
T
>::
meta_copy_
(
bv
,
bck
);
}
/*! \brief delete all the points in the grid
...
...
src/Amr/grid_dist_amr_unit_tests.cpp
View file @
9d529e78
...
...
@@ -524,6 +524,17 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_test_background_value )
long
int
bck2
=
amr_g2
.
get
<
2
>
(
2
,
key
);
BOOST_REQUIRE_EQUAL
(
bck2
,
-
123
);
// Now we insert that point and we check the subsequent point
amr_g2
.
insert
<
0
>
(
2
,
key
)
=
5
;
grid_dist_key_dx
<
3
>
key2
(
0
,
grid_key_dx
<
3
>
({
1
,
0
,
0
}));
bck0
=
amr_g2
.
get
<
0
>
(
2
,
key2
);
BOOST_REQUIRE_EQUAL
(
bck0
,
-
57
);
bck1
=
amr_g2
.
get
<
1
>
(
2
,
key2
);
BOOST_REQUIRE_EQUAL
(
bck1
,
-
90
);
bck2
=
amr_g2
.
get
<
2
>
(
2
,
key2
);
BOOST_REQUIRE_EQUAL
(
bck2
,
-
123
);
}
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