Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
bb4cedea
Commit
bb4cedea
authored
Jul 18, 2010
by
Thomas Witkowski
Browse files
And fixed second bug provided by Sebastian (dirichlet bc in parallel code).
parent
e82f87e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/ProblemVec.cc
View file @
bb4cedea
...
...
@@ -1186,11 +1186,12 @@ namespace AMDiS {
new
DirichletBC
(
type
,
b
,
componentSpaces
[
row
],
componentSpaces
[
col
],
false
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
{
if
(
i
==
col
)
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
else
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
}
if
(
rhs
)
rhs
->
getDOFVector
(
row
)
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
...
...
@@ -1213,11 +1214,12 @@ namespace AMDiS {
DirichletBC
*
dirichletNotApply
=
new
DirichletBC
(
type
,
vec
,
false
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
{
if
(
i
==
col
)
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
else
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
}
if
(
rhs
)
rhs
->
getDOFVector
(
row
)
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
bb4cedea
...
...
@@ -73,10 +73,13 @@ namespace AMDiS {
TEST_EXIT
(
mesh
)(
"No mesh has been defined for mesh distribution!
\n
"
);
// If the problem has been already read from a file, we need only to remove
// periodic boundary conditions (if there are some).
// If the problem has been already read from a file, we need only to set
// isRankDofs to all matrices and rhs vector and to remove periodic
// boundary conditions (if there are some).
if
(
deserialized
)
{
setRankDofs
();
removePeriodicBoundaryConditions
();
return
;
}
...
...
@@ -177,20 +180,7 @@ namespace AMDiS {
/// === Set DOF rank information to all matrices and vectors. ===
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
);
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
);
}
}
setRankDofs
();
// === Remove periodic boundary conditions in sequential problem definition. ===
...
...
@@ -413,6 +403,25 @@ namespace AMDiS {
}
void
MeshDistributor
::
setRankDofs
()
{
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
);
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
::
removePeriodicBoundaryConditions
()
{
// Remove periodic boundaries in boundary manager on matrices and vectors.
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
bb4cedea
...
...
@@ -324,6 +324,9 @@ namespace AMDiS {
*/
void
writePartitioningMesh
(
std
::
string
filename
);
/// Sets \ref isRankDof to all matrices and rhs vectors in all stationary problems.
void
setRankDofs
();
/// Removes all periodic boundary condition information from all matrices and
/// vectors of all stationary problems and from the mesh itself.
void
removePeriodicBoundaryConditions
();
...
...
Write
Preview
Supports
Markdown
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