Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_pdata
Commits
50670162
Commit
50670162
authored
7 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Adding missing file
parent
97dadefb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Vector/tests/vector_dist_util_unit_tests.hpp
+57
-0
57 additions, 0 deletions
src/Vector/tests/vector_dist_util_unit_tests.hpp
with
57 additions
and
0 deletions
src/Vector/tests/vector_dist_util_unit_tests.hpp
0 → 100644
+
57
−
0
View file @
50670162
/*
* vector_dist_util_unit_tests.hpp
*
* Created on: Feb 14, 2018
* Author: i-bird
*/
#ifndef SRC_VECTOR_TESTS_VECTOR_DIST_UTIL_UNIT_TESTS_HPP_
#define SRC_VECTOR_TESTS_VECTOR_DIST_UTIL_UNIT_TESTS_HPP_
/*! \brief Count local and non local
*
* \param vd distributed vector
* \param it iterator
* \param bc boundary conditions
* \param box domain box
* \param dom_ext domain + ghost box
* \param l_cnt local particles counter
* \param nl_cnt non local particles counter
* \param n_out out of domain + ghost particles counter
*
*/
template
<
unsigned
int
dim
,
typename
vector_dist
>
inline
void
count_local_n_local
(
vector_dist
&
vd
,
vector_dist_iterator
&
it
,
size_t
(
&
bc
)[
dim
]
,
Box
<
dim
,
float
>
&
box
,
Box
<
dim
,
float
>
&
dom_ext
,
size_t
&
l_cnt
,
size_t
&
nl_cnt
,
size_t
&
n_out
)
{
const
CartDecomposition
<
dim
,
float
>
&
ct
=
vd
.
getDecomposition
();
while
(
it
.
isNext
())
{
auto
key
=
it
.
get
();
// Check if it is in the domain
if
(
box
.
isInsideNP
(
vd
.
getPos
(
key
))
==
true
)
{
// Check if local
if
(
ct
.
isLocalBC
(
vd
.
getPos
(
key
),
bc
)
==
true
)
l_cnt
++
;
else
nl_cnt
++
;
}
else
{
nl_cnt
++
;
}
Point
<
dim
,
float
>
xp
=
vd
.
getPos
(
key
);
// Check that all particles are inside the Domain + Ghost part
if
(
dom_ext
.
isInside
(
xp
)
==
false
)
n_out
++
;
++
it
;
}
}
#endif
/* SRC_VECTOR_TESTS_VECTOR_DIST_UTIL_UNIT_TESTS_HPP_ */
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