Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
argupta
openfpm_pdata
Commits
35c45da4
Commit
35c45da4
authored
7 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Adding missing files
parent
50670162
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openfpm_data
+1
-1
1 addition, 1 deletion
openfpm_data
src/Decomposition/tests/shift_vect_converter_tests.cpp
+123
-0
123 additions, 0 deletions
src/Decomposition/tests/shift_vect_converter_tests.cpp
with
124 additions
and
1 deletion
openfpm_data
@
449fca38
Subproject commit
d4dd11672cd49676ec60d500bc55c26202142ca6
Subproject commit
449fca38c77d9c4628637f1cdd4d7d2fa241f12e
This diff is collapsed.
Click to expand it.
src/Decomposition/tests/shift_vect_converter_tests.cpp
0 → 100644
+
123
−
0
View file @
35c45da4
/*
* shift_vect_converter_tests.cpp
*
* Created on: Feb 8, 2018
* Author: i-bird
*/
#define BOOST_TEST_DYN_LINK
#include
<boost/test/unit_test.hpp>
#include
"Space/Shape/Box.hpp"
#include
"Vector/map_vector.hpp"
#include
"Decomposition/shift_vect_converter.hpp"
BOOST_AUTO_TEST_SUITE
(
shift_vect_converter_tests_suite
)
BOOST_AUTO_TEST_CASE
(
shift_vect_converter_tests_use
)
{
{
Box
<
3
,
double
>
domain
({
0.0
,
0.0
,
0.0
},{
1.0
,
1.0
,
1.0
});
shift_vect_converter
<
3
,
double
>
svc
;
size_t
bc
[
3
]
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
openfpm
::
vector
<
Point
<
3
,
double
>>
sv
;
svc
.
generateShiftVectors
(
domain
,
bc
,
sv
);
BOOST_REQUIRE_EQUAL
(
sv
.
size
(),
27ul
);
// We test that the cominations generate the correct shift vectors
comb
<
3
>
cmb1
({
-
1
,
-
1
,
1
});
comb
<
3
>
cmb2
({
-
1
,
0
,
1
});
comb
<
3
>
cmb3
({
0
,
0
,
1
});
size_t
i
=
svc
.
linId
(
cmb1
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
0
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
1
],
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
2
],
1.0
);
i
=
svc
.
linId
(
cmb2
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
0
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
1
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
2
],
1.0
);
i
=
svc
.
linId
(
cmb3
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
0
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
1
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
2
],
0.0
);
}
{
openfpm
::
vector
<
Point
<
50
,
double
>>
sv
;
Box
<
50
,
double
>
domain
;
size_t
bc
[
50
];
for
(
size_t
i
=
0
;
i
<
50
;
i
++
)
{
domain
.
setLow
(
i
,
0.0
);
domain
.
setHigh
(
i
,
1.0
);
bc
[
i
]
=
NON_PERIODIC
;
}
bc
[
5
]
=
PERIODIC
;
bc
[
17
]
=
PERIODIC
;
bc
[
23
]
=
PERIODIC
;
shift_vect_converter
<
50
,
double
>
svc
;
svc
.
generateShiftVectors
(
domain
,
bc
,
sv
);
BOOST_REQUIRE_EQUAL
(
sv
.
size
(),
27ul
);
// We test that the cominations generate the correct shift vectors
comb
<
50
>
cmb1
;
comb
<
50
>
cmb2
;
comb
<
50
>
cmb3
;
cmb1
.
c
[
5
]
=
1
;
cmb1
.
c
[
17
]
=
-
1
;
cmb1
.
c
[
23
]
=
-
1
;
cmb2
.
c
[
5
]
=
1
;
cmb2
.
c
[
17
]
=
0
;
cmb2
.
c
[
23
]
=
-
1
;
cmb3
.
c
[
5
]
=
1
;
cmb3
.
c
[
17
]
=
0
;
cmb3
.
c
[
23
]
=
0
;
size_t
i
=
svc
.
linId
(
cmb1
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
5
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
6
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
17
],
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
23
],
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
24
],
0.0
);
i
=
svc
.
linId
(
cmb2
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
5
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
6
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
17
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
23
],
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
24
],
0.0
);
i
=
svc
.
linId
(
cmb3
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
5
],
-
1.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
6
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
17
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
23
],
0.0
);
BOOST_REQUIRE_EQUAL
(
sv
.
get
<
0
>
(
i
)[
24
],
0.0
);
}
}
BOOST_AUTO_TEST_SUITE_END
()
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