Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
ce3ea440
Commit
ce3ea440
authored
Mar 28, 2011
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in parallel code for coupled problems.
parent
a551ea4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
AMDiS/src/DOFMatrix.cc
AMDiS/src/DOFMatrix.cc
+3
-1
AMDiS/src/parallel/MeshDistributor.cc
AMDiS/src/parallel/MeshDistributor.cc
+30
-14
AMDiS/src/parallel/MeshDistributor.h
AMDiS/src/parallel/MeshDistributor.h
+8
-1
No files found.
AMDiS/src/DOFMatrix.cc
View file @
ce3ea440
...
...
@@ -183,7 +183,9 @@ namespace AMDiS {
{
FUNCNAME
(
"DOFMatrix::addElementMatrix()"
);
TEST_EXIT_DBG
(
inserter
)(
"DOFMatrix is not in insertion mode"
);
TEST_EXIT_DBG
(
inserter
)(
"DOFMatrix is not in insertion mode
\n
"
);
TEST_EXIT_DBG
(
rowFeSpace
)(
"Have now rowFeSpace!
\n
"
);
inserter_type
&
ins
=
*
inserter
;
// === Get indices mapping from local to global matrix indices. ===
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
ce3ea440
...
...
@@ -62,6 +62,7 @@ namespace AMDiS {
MeshDistributor
::
MeshDistributor
()
:
probStat
(
0
),
initialized
(
false
),
name
(
"parallel"
),
feSpace
(
NULL
),
mesh
(
NULL
),
...
...
@@ -163,6 +164,8 @@ namespace AMDiS {
#if (DEBUG != 0)
ParallelDebug
::
writeDebugFile
(
*
this
,
debugOutputDir
+
"mpi-dbg"
,
"dat"
);
#endif
initialized
=
true
;
return
;
}
...
...
@@ -320,6 +323,8 @@ namespace AMDiS {
// === Remove periodic boundary conditions in sequential problem definition. ===
removePeriodicBoundaryConditions
();
initialized
=
true
;
}
...
...
@@ -412,6 +417,12 @@ namespace AMDiS {
}
probStat
.
push_back
(
probVec
);
// If the mesh distributor is already initialized, don't forgett to set rank
// DOFs object to the matrices and vectors of the added stationary problem.
if
(
initialized
)
setRankDofs
(
probVec
);
}
...
...
@@ -623,22 +634,27 @@ namespace AMDiS {
}
void
MeshDistributor
::
setRankDofs
()
void
MeshDistributor
::
setRankDofs
(
ProblemVec
*
probVec
)
{
for
(
unsigned
int
i
=
0
;
i
<
probStat
.
size
();
i
++
)
{
int
nComponents
=
probStat
[
i
]
->
getNumComponents
();
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
for
(
int
k
=
0
;
k
<
nComponents
;
k
++
)
if
(
probStat
[
i
]
->
getSystemMatrix
(
j
,
k
))
probStat
[
i
]
->
getSystemMatrix
(
j
,
k
)
->
setRankDofs
(
isRankDof
);
int
nComponents
=
probVec
->
getNumComponents
();
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
if
(
probVec
->
getSystemMatrix
(
i
,
j
))
probVec
->
getSystemMatrix
(
i
,
j
)
->
setRankDofs
(
isRankDof
);
TEST_EXIT_DBG
(
probVec
->
getRhs
()
->
getDOFVector
(
i
))(
"No RHS vector!
\n
"
);
TEST_EXIT_DBG
(
probVec
->
getSolution
()
->
getDOFVector
(
i
))(
"No solution vector!
\n
"
);
probVec
->
getRhs
()
->
getDOFVector
(
i
)
->
setRankDofs
(
isRankDof
);
probVec
->
getSolution
()
->
getDOFVector
(
i
)
->
setRankDofs
(
isRankDof
);
}
}
TEST_EXIT_DBG
(
probStat
[
i
]
->
getRhs
()
->
getDOFVector
(
j
))(
"No RHS vector!
\n
"
);
TEST_EXIT_DBG
(
probStat
[
i
]
->
getSolution
()
->
getDOFVector
(
j
))(
"No solution vector!
\n
"
);
probStat
[
i
]
->
getRhs
()
->
getDOFVector
(
j
)
->
setRankDofs
(
isRankDof
);
probStat
[
i
]
->
getSolution
()
->
getDOFVector
(
j
)
->
setRankDofs
(
isRankDof
);
}
}
void
MeshDistributor
::
setRankDofs
()
{
for
(
unsigned
int
i
=
0
;
i
<
probStat
.
size
();
i
++
)
setRankDofs
(
probStat
[
i
]);
}
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
ce3ea440
...
...
@@ -346,6 +346,10 @@ namespace AMDiS {
*/
void
repartitionMesh
();
/// Sets \ref isRankDof to all matrices and rhs vectors in a given
/// stationary problem.
void
setRankDofs
(
ProblemVec
*
probVec
);
/// Sets \ref isRankDof to all matrices and rhs vectors in all stationary problems.
void
setRankDofs
();
...
...
@@ -419,9 +423,12 @@ namespace AMDiS {
}
protected:
///
///
List of all stationary problems that are managed by this mesh distributor.
vector
<
ProblemVec
*>
probStat
;
/// If true, the mesh distributor is already initialized;
bool
initialized
;
/// The rank of the current process.
int
mpiRank
;
...
...
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