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
Aland, Sebastian
amdis
Commits
694a35a3
Commit
694a35a3
authored
Jun 11, 2012
by
Thomas Witkowski
Browse files
Bugfix in petsc solver global matrix with periodic bc.
parent
fe7df386
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFMatrix.cc
View file @
694a35a3
...
...
@@ -238,10 +238,10 @@ namespace AMDiS {
if
(
condition
->
applyBoundaryCondition
())
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
dofMap
->
isRankDof
(
rowIndices
[
i
]))
{
if
(
dofMap
->
isRankDof
(
rowIndices
[
i
]))
{
applyDBCs
.
insert
(
row
);
// dirichletDofs.push_back(row);
}
}
#else
applyDBCs
.
insert
(
row
);
#endif
...
...
AMDiS/src/DirichletBC.cc
View file @
694a35a3
...
...
@@ -76,9 +76,9 @@ namespace AMDiS {
if
(
dofVec
)
value
=
(
*
dofVec
)[
dofIndices
[
i
]];
//
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
//
vector->setDirichletDofValue(dofIndices[i], value);
//
#else
//#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// vector->setDirichletDofValue(dofIndices[i], value);
//#else
(
*
vector
)[
dofIndices
[
i
]]
=
value
;
//#endif
}
...
...
AMDiS/src/Element.cc
View file @
694a35a3
...
...
@@ -92,7 +92,7 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
EDGE
);
i
++
)
dof
[
mesh
->
getNode
(
EDGE
)
+
i
]
=
mesh
->
getDof
(
EDGE
);
if
(
mesh
->
getNumberOfDofs
(
FACE
))
if
(
mesh
->
getDim
()
==
3
&&
mesh
->
getNumberOfDofs
(
FACE
))
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
FACE
);
i
++
)
dof
[
mesh
->
getNode
(
FACE
)
+
i
]
=
mesh
->
getDof
(
FACE
);
...
...
AMDiS/src/Mesh.h
View file @
694a35a3
...
...
@@ -160,6 +160,7 @@ namespace AMDiS {
/// Returns nDof[i] of the mesh
inline
const
int
getNumberOfDofs
(
int
i
)
const
{
TEST_EXIT_DBG
(
i
<=
dim
)(
"Wrong index: %d %d
\n
"
,
i
,
dim
);
return
nDof
[
i
];
}
...
...
@@ -181,12 +182,10 @@ namespace AMDiS {
return
node
[
i
];
}
/** \brief
* Allocates the number of DOFs needed at position and registers the DOFs
* at the DOFAdmins. The number of needed DOFs is the sum over the needed
* DOFs of all DOFAdmin objects belonging to this mesh.
* The return value is a pointer to the first allocated DOF.
*/
/// Allocates the number of DOFs needed at position and registers the DOFs
/// at the DOFAdmins. The number of needed DOFs is the sum over the needed
/// DOFs of all DOFAdmin objects belonging to this mesh.
/// The return value is a pointer to the first allocated DOF.
DegreeOfFreedom
*
getDof
(
GeoIndex
position
);
/// Returns *(\ref admin[i]) of the mesh
...
...
@@ -195,26 +194,20 @@ namespace AMDiS {
return
*
(
admin
[
i
]);
}
/** \brief
* Creates a DOFAdmin with name lname. nDof specifies how many DOFs
* are needed at the different positions (see \ref DOFAdmin::nrDOF).
* A pointer to the created DOFAdmin is returned.
*/
/// Creates a DOFAdmin with name lname. nDof specifies how many DOFs
/// are needed at the different positions (see \ref DOFAdmin::nrDOF).
/// A pointer to the created DOFAdmin is returned.
const
DOFAdmin
*
createDOFAdmin
(
string
lname
,
DimVec
<
int
>
nDof
);
/** \brief
* Returns the size of \ref admin which is the number of the DOFAdmins
* belonging to this mesh
*/
/// Returns the size of \ref admin which is the number of the DOFAdmins
/// belonging to this mesh
const
int
getNumberOfDOFAdmin
()
const
{
return
admin
.
size
();
}
/** \brief
* Returns the size of \ref macroElements which is the number of
* of macro elements of this mesh
*/
/// Returns the size of \ref macroElements which is the number of
/// of macro elements of this mesh
const
int
getNumberOfMacros
()
const
{
return
macroElements
.
size
();
...
...
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
694a35a3
...
...
@@ -340,7 +340,6 @@ namespace AMDiS {
// DOFs in the first FE spaces is the smalled global index of a DOF that is
// owned by the rank.
int
offset
=
rStartDofs
;
// === Create the matrix indices for all component FE spaces. ===
...
...
@@ -358,7 +357,7 @@ namespace AMDiS {
dofToMatIndex
.
add
(
i
,
it
->
first
,
globalMatIndex
);
}
}
// Increase the offset for the next FE space by the number of DOFs owned
// by the rank in the current FE space.
offset
+=
data
[
feSpaces
[
i
]].
nRankDofs
;
...
...
@@ -399,7 +398,7 @@ namespace AMDiS {
stdMpi
.
recv
(
rank
);
}
stdMpi
.
startCommunication
();
for
(
DofComm
::
Iterator
it
(
dofComm
->
getRecvDofs
(),
0
,
feSpaces
[
i
]);
...
...
@@ -461,9 +460,13 @@ namespace AMDiS {
for
(;
!
it
.
endDofIter
();
it
.
nextDof
())
if
(
dofMap
.
count
(
it
.
getDofIndex
()))
{
if
(
globalIndex
)
{
TEST_EXIT_DBG
(
counter
+
2
<=
stdMpi
.
getRecvData
(
it
.
getRank
()).
size
())
(
"Should not happen!
\n
"
);
dofToMatIndex
.
add
(
i
,
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
++
],
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
++
]);
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
],
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
+
1
]);
counter
+=
2
;
}
else
{
dofToMatIndex
.
add
(
i
,
it
.
getDofIndex
(),
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
++
]);
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
694a35a3
...
...
@@ -989,12 +989,13 @@ namespace AMDiS {
int
localPetscRowIdx
=
petscRowIdx
-
rankStartIndex
;
TEST_EXIT_DBG
(
localPetscRowIdx
>=
0
&&
localPetscRowIdx
<
nRankRows
)
(
"Should not happen!
\n
Debug info:
localRowIdx
= %d globalRowIndx = %d petscRowIdx = %d localPetscRowIdx = %d rStart = %d
nC
ompontens = %d nRankRows = %d
\n
"
,
(
"Should not happen!
\n
Debug info:
DOF
= %d globalRowIndx = %d petscRowIdx = %d localPetscRowIdx = %d rStart = %d
c
ompontens = %d
from %d
nRankRows = %d
\n
"
,
*
cursor
,
(
*
interiorMap
)[
feSpaces
[
i
]][
*
cursor
].
global
,
petscRowIdx
,
localPetscRowIdx
,
rankStartIndex
,
i
,
nComponents
,
nRankRows
);
...
...
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