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
406f3750
Commit
406f3750
authored
Jun 22, 2018
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding additional test for more consistent check on map anf ghost_get
parent
72d7780b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
4 deletions
+99
-4
src/Decomposition/CartDecomposition.hpp
src/Decomposition/CartDecomposition.hpp
+3
-3
src/Decomposition/tests/CartDecomposition_unit_test.cpp
src/Decomposition/tests/CartDecomposition_unit_test.cpp
+95
-0
src/Vector/vector_dist_comm.hpp
src/Vector/vector_dist_comm.hpp
+1
-1
No files found.
src/Decomposition/CartDecomposition.hpp
View file @
406f3750
...
...
@@ -1116,7 +1116,7 @@ public:
applyPointBC
(
pt
);
return
processorID_impl
(
p
);
return
processorID_impl
(
p
t
);
}
/*! \brief Given a point return in which processor the particle should go
...
...
@@ -1135,7 +1135,7 @@ public:
// Get the number of elements in the cell
return
processorID_impl
(
p
);
return
processorID_impl
(
p
t
);
}
/*! \brief Given a point return in which processor the particle should go
...
...
@@ -1152,7 +1152,7 @@ public:
Point
<
dim
,
T
>
pt
=
p
;
applyPointBC
(
pt
);
return
processorID_impl
(
p
);
return
processorID_impl
(
p
t
);
}
/*! \brief Get the periodicity on i dimension
...
...
src/Decomposition/tests/CartDecomposition_unit_test.cpp
View file @
406f3750
...
...
@@ -389,6 +389,101 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_check_cross_consistency_between_proc_idb
}
}
BOOST_AUTO_TEST_CASE
(
CartDecomposition_check_cross_consistency_between_proc_idbc_and_ghost2
)
{
// Vcluster
Vcluster
&
vcl
=
create_vcluster
();
CartDecomposition
<
3
,
double
>
dec
(
vcl
);
size_t
bc
[
3
]
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
// Physical domain
Box
<
3
,
double
>
box
(
{
-
0.01
,
-
0.01
,
0.0
},
{
0.01
,
0.01
,
0.003
});
Ghost
<
3
,
double
>
g
(
0.0015
);
dec
.
setGoodParameters
(
box
,
bc
,
g
,
512
);
dec
.
decompose
();
// Now we check the point
for
(
size_t
j
=
0
;
j
<
3
;
j
++
)
{
for
(
size_t
i
=
0
;
i
<
dec
.
getNSubDomain
()
;
i
++
)
{
Point
<
3
,
double
>
p1
;
Point
<
3
,
double
>
p2
;
p1
.
get
(
0
)
=
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
0
);
p1
.
get
(
1
)
=
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
1
);
p1
.
get
(
2
)
=
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
2
);
p2
=
p1
;
p2
.
get
(
j
)
=
std
::
nextafter
(
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
j
),
-
1.0
);
size_t
proc1
=
dec
.
processorIDBC
(
p1
);
size_t
proc2
=
dec
.
processorIDBC
(
p2
);
BOOST_REQUIRE
(
proc1
<
vcl
.
size
());
BOOST_REQUIRE
(
proc2
<
vcl
.
size
());
const
openfpm
::
vector
<
std
::
pair
<
size_t
,
size_t
>>
&
vp_id1
=
dec
.
template
ghost_processorID_pair
<
typename
CartDecomposition
<
3
,
double
>
::
lc_processor_id
,
typename
CartDecomposition
<
3
,
double
>::
shift_id
>
(
p1
,
UNIQUE
);
const
openfpm
::
vector
<
std
::
pair
<
size_t
,
size_t
>>
&
vp_id2
=
dec
.
template
ghost_processorID_pair
<
typename
CartDecomposition
<
3
,
double
>
::
lc_processor_id
,
typename
CartDecomposition
<
3
,
double
>::
shift_id
>
(
p2
,
UNIQUE
);
if
(
proc1
!=
proc2
)
{
if
(
vcl
.
rank
()
==
proc2
)
{
BOOST_REQUIRE
(
vp_id2
.
size
()
!=
0
);
BOOST_REQUIRE
(
vp_id1
.
size
()
==
0
);
}
if
(
vcl
.
rank
()
==
proc1
)
{
BOOST_REQUIRE
(
vp_id2
.
size
()
==
0
);
BOOST_REQUIRE
(
vp_id1
.
size
()
!=
0
);
}
}
p1
.
get
(
0
)
=
std
::
nextafter
(
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getHigh
(
0
),
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
0
));
p1
.
get
(
1
)
=
std
::
nextafter
(
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getHigh
(
1
),
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
1
));
p1
.
get
(
2
)
=
std
::
nextafter
(
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getHigh
(
2
),
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getLow
(
2
));
p2
=
p1
;
p2
.
get
(
j
)
=
std
::
nextafter
(
SpaceBox
<
3
,
double
>
(
dec
.
getSubDomains
().
get
(
i
)).
getHigh
(
j
),
1.0
);
proc1
=
dec
.
processorIDBC
(
p1
);
proc2
=
dec
.
processorIDBC
(
p2
);
BOOST_REQUIRE
(
proc1
<
vcl
.
size
());
BOOST_REQUIRE
(
proc2
<
vcl
.
size
());
const
openfpm
::
vector
<
std
::
pair
<
size_t
,
size_t
>>
&
vp_id3
=
dec
.
template
ghost_processorID_pair
<
typename
CartDecomposition
<
3
,
double
>
::
lc_processor_id
,
typename
CartDecomposition
<
3
,
double
>::
shift_id
>
(
p1
,
UNIQUE
);
const
openfpm
::
vector
<
std
::
pair
<
size_t
,
size_t
>>
&
vp_id4
=
dec
.
template
ghost_processorID_pair
<
typename
CartDecomposition
<
3
,
double
>
::
lc_processor_id
,
typename
CartDecomposition
<
3
,
double
>::
shift_id
>
(
p2
,
UNIQUE
);
if
(
proc1
!=
proc2
)
{
if
(
vcl
.
rank
()
==
proc2
)
{
BOOST_REQUIRE
(
vp_id4
.
size
()
!=
0
);
BOOST_REQUIRE
(
vp_id3
.
size
()
==
0
);
}
if
(
vcl
.
rank
()
==
proc1
)
{
BOOST_REQUIRE
(
vp_id4
.
size
()
==
0
);
BOOST_REQUIRE
(
vp_id3
.
size
()
!=
0
);
}
}
}
}
}
BOOST_AUTO_TEST_CASE
(
CartDecomposition_non_periodic_test_dist_grid
)
{
...
...
src/Vector/vector_dist_comm.hpp
View file @
406f3750
...
...
@@ -725,7 +725,7 @@ class vector_dist_comm
// Check if the particle is inside the domain
if
(
dec
.
getDomain
().
isInside
(
v_pos
.
get
(
key
))
==
true
)
{
p_id
=
dec
.
processorID
BC
(
v_pos
.
get
(
key
));}
{
p_id
=
dec
.
processorID
(
v_pos
.
get
(
key
));}
else
{
p_id
=
obp
::
out
(
key
,
v_cl
.
getProcessUnitID
());}
...
...
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