Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
bf567029
Commit
bf567029
authored
Apr 30, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One more MPI test.
parent
37e0d38c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
test/mpi/src/test0004.cc
test/mpi/src/test0004.cc
+79
-0
No files found.
test/mpi/src/test0004.cc
0 → 100644
View file @
bf567029
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE 0004
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <AMDiS.h>
using
namespace
AMDiS
;
using
namespace
std
;
/*
-
*/
BOOST_AUTO_TEST_CASE
(
amdis_mpi_feti_multilevel
)
{
BOOST_REQUIRE
(
MPI
::
COMM_WORLD
.
Get_size
()
==
16
);
ProblemStat
ellipt
(
"ellipt"
);
ellipt
.
initialize
(
INIT_ALL
);
MeshDistributor
*
meshDist
=
MeshDistributor
::
globalMeshDistributor
;
meshDist
->
initParallelization
();
const
FiniteElemSpace
*
feSpace
=
ellipt
.
getFeSpace
();
vector
<
const
FiniteElemSpace
*>
feSpaces
;
feSpaces
.
push_back
(
feSpace
);
Mesh
*
mesh
=
ellipt
.
getMesh
();
mesh
->
dofCompress
();
BOOST_REQUIRE
(
mesh
->
getNumberOfLeaves
()
==
4
);
BOOST_REQUIRE
(
meshDist
->
getMeshLevelData
().
getLevelNumber
()
==
2
);
BOOST_REQUIRE
(
feSpace
->
getAdmin
()
->
getUsedSize
()
==
5
);
MeshLevelData
&
levelData
=
meshDist
->
getMeshLevelData
();
DofComm
::
LevelDataType
&
sendDofs
=
meshDist
->
getDofComm
().
getSendDofs
();
DofComm
::
LevelDataType
&
recvDofs
=
meshDist
->
getDofComm
().
getRecvDofs
();
ParallelDofMapping
dofMap
;
dofMap
.
init
(
levelData
,
feSpaces
,
feSpaces
,
true
,
true
);
dofMap
.
setDofComm
(
meshDist
->
getDofComm
());
dofMap
.
clear
();
Spreadsheet
sheet
;
sheet
.
read
(
"data/data0004a"
);
vector
<
vector
<
double
>
>
&
data
=
sheet
.
getData
();
for
(
unsigned
int
i
=
0
;
i
<
data
.
size
();
i
++
)
{
if
(
data
[
i
][
0
]
!=
MPI
::
COMM_WORLD
.
Get_rank
())
continue
;
int
level
=
data
[
i
][
1
];
int
nSendDofs
=
data
[
i
][
2
];
int
nRecvDofs
=
data
[
i
][
3
];
int
compareSendDofs
=
meshDist
->
getDofComm
().
getNumberDofs
(
sendDofs
,
level
,
feSpace
);
int
compareRecvDofs
=
meshDist
->
getDofComm
().
getNumberDofs
(
recvDofs
,
level
,
feSpace
);
TEST_EXIT
(
nSendDofs
==
compareSendDofs
)
(
"Wrong number of SEND DOFs in level %d: %d %d
\n
"
,
level
,
nSendDofs
,
compareSendDofs
);
TEST_EXIT
(
nRecvDofs
==
compareRecvDofs
)
(
"Wrong number of RECV DOFs in level %d: %d %d
\n
"
,
level
,
nRecvDofs
,
compareRecvDofs
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
AMDiS
::
init
(
argc
,
argv
,
"./init/test0004.dat.2d"
);
boost
::
unit_test
::
unit_test_main
(
&
init_unit_test
,
argc
,
argv
);
AMDiS
::
finalize
();
}
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