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
iwr
amdis
Commits
a276473c
Commit
a276473c
authored
Oct 22, 2012
by
Thomas Witkowski
Browse files
And now really fixed, go ahead to write productive codes....
parent
8b8abdb5
Changes
7
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/MatrixNnzStructure.cc
View file @
a276473c
...
@@ -138,7 +138,7 @@ namespace AMDiS {
...
@@ -138,7 +138,7 @@ namespace AMDiS {
// === Iterate on all DOFs of the row mapping. ===
// === Iterate on all DOFs of the row mapping. ===
DofMap
::
iterator
rowIt
=
rowDofMap
[
rowComp
].
begin
();
DofMap
::
iterator
rowIt
=
rowDofMap
[
rowComp
].
begin
();
DofMap
::
iterator
rowEndIt
=
rowDofMap
[
col
Comp
].
end
();
DofMap
::
iterator
rowEndIt
=
rowDofMap
[
row
Comp
].
end
();
for
(;
rowIt
!=
rowEndIt
;
++
rowIt
)
{
for
(;
rowIt
!=
rowEndIt
;
++
rowIt
)
{
// Go to the corresponding matrix row (note, both the mapping and the
// Go to the corresponding matrix row (note, both the mapping and the
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
a276473c
...
@@ -137,7 +137,9 @@ namespace AMDiS {
...
@@ -137,7 +137,9 @@ namespace AMDiS {
{
{
FUNCNAME
(
"MeshDistributor::getFeSpace()"
);
FUNCNAME
(
"MeshDistributor::getFeSpace()"
);
TEST_EXIT_DBG
(
i
<
uniqueFeSpaces
.
size
())(
"Should not happen!
\n
"
);
TEST_EXIT_DBG
(
i
<
uniqueFeSpaces
.
size
())
(
"Try to access FE space %d, but have only %d FE spaces!
\n
"
,
i
,
uniqueFeSpaces
.
size
());
return
uniqueFeSpaces
[
i
];
return
uniqueFeSpaces
[
i
];
}
}
...
...
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
View file @
a276473c
...
@@ -117,7 +117,7 @@ namespace AMDiS {
...
@@ -117,7 +117,7 @@ namespace AMDiS {
// Mesh has been changed, recompute interior DOF mapping.
// Mesh has been changed, recompute interior DOF mapping.
vector
<
const
FiniteElemSpace
*>
feSpaces
=
getComponentFeSpaces
(
seqMat
);
vector
<
const
FiniteElemSpace
*>
feSpaces
=
getComponentFeSpaces
(
seqMat
);
interiorMap
->
setComputeMatIndex
(
!
localMatrix
);
interiorMap
->
setComputeMatIndex
(
!
localMatrix
);
interiorMap
->
update
(
feSpaces
);
interiorMap
->
update
();
int
nMat
=
uniqueCoarseMap
.
size
()
+
1
;
int
nMat
=
uniqueCoarseMap
.
size
()
+
1
;
nnz
.
resize
(
nMat
);
nnz
.
resize
(
nMat
);
...
...
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
a276473c
...
@@ -175,8 +175,8 @@ namespace AMDiS {
...
@@ -175,8 +175,8 @@ namespace AMDiS {
bool
isNonLocal
,
bool
isNonLocal
,
MeshLevelData
&
levelData
)
MeshLevelData
&
levelData
)
{
{
feSpaces
=
f
1
;
feSpaces
=
f
0
;
feSpacesUnique
=
f
0
;
feSpacesUnique
=
f
1
;
for
(
vector
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
for
(
vector
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
it
!=
feSpacesUnique
.
end
();
++
it
)
{
it
!=
feSpacesUnique
.
end
();
++
it
)
{
addFeSpace
(
*
it
,
levelData
);
addFeSpace
(
*
it
,
levelData
);
...
@@ -203,8 +203,8 @@ namespace AMDiS {
...
@@ -203,8 +203,8 @@ namespace AMDiS {
bool
isNonLocal
,
bool
isNonLocal
,
MeshLevelData
&
levelData
)
MeshLevelData
&
levelData
)
{
{
feSpaces
=
f
1
;
feSpaces
=
f
0
;
feSpacesUnique
=
f
0
;
feSpacesUnique
=
f
1
;
for
(
unsigned
int
component
=
0
;
component
<
feSpaces
.
size
();
component
++
)
{
for
(
unsigned
int
component
=
0
;
component
<
feSpaces
.
size
();
component
++
)
{
addComponent
(
component
,
feSpaces
[
component
],
levelData
);
addComponent
(
component
,
feSpaces
[
component
],
levelData
);
...
@@ -367,31 +367,12 @@ namespace AMDiS {
...
@@ -367,31 +367,12 @@ namespace AMDiS {
nLocalDofs
=
computeLocalDofs
();
nLocalDofs
=
computeLocalDofs
();
nOverallDofs
=
computeOverallDofs
();
nOverallDofs
=
computeOverallDofs
();
rStartDofs
=
computeStartDofs
();
rStartDofs
=
computeStartDofs
();
// And finally, compute the matrix indices.
// And finally, compute the matrix indices.
computeMatIndex
(
needMatIndexFromGlobal
);
computeMatIndex
(
needMatIndexFromGlobal
);
}
}
void
ParallelDofMapping
::
update
(
vector
<
const
FiniteElemSpace
*>&
fe
)
{
FUNCNAME
(
"ParallelDofMapping::update()"
);
ERROR_EXIT
(
"DAS MUSS ICH MIR MAL UEBERLEGEN!
\n
"
);
// for (vector<const FiniteElemSpace*>::iterator it = fe.begin();
// it != fe.end(); ++it)
// if (find(feSpacesUnique.begin(), feSpacesUnique.end(), *it) ==
// feSpacesUnique.end())
// ERROR_EXIT("Wrong FE space!\n");
// feSpaces = fe;
update
();
}
void
ParallelDofMapping
::
computeMatIndex
(
bool
globalIndex
)
void
ParallelDofMapping
::
computeMatIndex
(
bool
globalIndex
)
{
{
FUNCNAME
(
"ParallelDofMapping::computeMatIndex()"
);
FUNCNAME
(
"ParallelDofMapping::computeMatIndex()"
);
...
...
AMDiS/src/parallel/ParallelDofMapping.h
View file @
a276473c
...
@@ -404,7 +404,7 @@ namespace AMDiS {
...
@@ -404,7 +404,7 @@ namespace AMDiS {
bool
end
()
bool
end
()
{
{
return
(
it
!
=
data
->
feSpacesUnique
.
end
());
return
(
it
=
=
data
->
feSpacesUnique
.
end
());
}
}
void
next
()
void
next
()
...
@@ -441,7 +441,7 @@ namespace AMDiS {
...
@@ -441,7 +441,7 @@ namespace AMDiS {
bool
end
()
bool
end
()
{
{
return
(
it
!
=
data
->
feSpaces
.
end
());
return
(
it
=
=
data
->
feSpaces
.
end
());
}
}
void
next
()
void
next
()
...
@@ -539,7 +539,7 @@ namespace AMDiS {
...
@@ -539,7 +539,7 @@ namespace AMDiS {
bool
end
()
bool
end
()
{
{
return
(
it
!
=
data
->
feSpaces
.
end
());
return
(
it
=
=
data
->
feSpaces
.
end
());
}
}
void
next
()
void
next
()
...
@@ -706,9 +706,6 @@ namespace AMDiS {
...
@@ -706,9 +706,6 @@ namespace AMDiS {
/// Update the mapping.
/// Update the mapping.
void
update
();
void
update
();
/// Update the mapping.
void
update
(
vector
<
const
FiniteElemSpace
*>&
feSpaces
);
/// Returns the global matrix index of a given DOF for a given
/// Returns the global matrix index of a given DOF for a given
/// component number.
/// component number.
inline
int
getMatIndex
(
int
ithComponent
,
DegreeOfFreedom
d
)
inline
int
getMatIndex
(
int
ithComponent
,
DegreeOfFreedom
d
)
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
a276473c
...
@@ -260,7 +260,7 @@ namespace AMDiS {
...
@@ -260,7 +260,7 @@ namespace AMDiS {
MSG
(
"FETI-DP data created on mesh level %d
\n
"
,
meshLevel
);
MSG
(
"FETI-DP data created on mesh level %d
\n
"
,
meshLevel
);
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponentFeSpaces
().
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponentFeSpaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getFeSpace
(
i
);
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
get
Component
FeSpace
(
i
);
MSG
(
"FETI-DP data for %d-ith component (FE space %p):
\n
"
,
i
,
feSpace
);
MSG
(
"FETI-DP data for %d-ith component (FE space %p):
\n
"
,
i
,
feSpace
);
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
a276473c
...
@@ -164,7 +164,7 @@ namespace AMDiS {
...
@@ -164,7 +164,7 @@ namespace AMDiS {
bool
isColCoarse
=
isCoarseSpace
(
colComponent
,
col
(
*
icursor
));
bool
isColCoarse
=
isCoarseSpace
(
colComponent
,
col
(
*
icursor
));
if
(
isColCoarse
==
false
)
if
(
isColCoarse
==
false
)
if
((
*
interiorMap
)[
dofMat
->
getColFeSpace
()
].
isSet
(
col
(
*
icursor
))
==
false
)
if
((
*
interiorMap
)[
colComponent
].
isSet
(
col
(
*
icursor
))
==
false
)
continue
;
continue
;
if
(
isColCoarse
==
isRowCoarse
)
{
if
(
isColCoarse
==
isRowCoarse
)
{
...
@@ -199,7 +199,7 @@ namespace AMDiS {
...
@@ -199,7 +199,7 @@ namespace AMDiS {
&
(
colsOther
[
0
]),
&
(
valuesOther
[
0
]),
ADD_VALUES
);
&
(
colsOther
[
0
]),
&
(
valuesOther
[
0
]),
ADD_VALUES
);
}
}
}
else
{
}
else
{
if
((
*
interiorMap
)[
dofMat
->
getRowFeSpace
()
].
isSet
(
*
cursor
)
==
false
)
if
((
*
interiorMap
)[
rowComponent
].
isSet
(
*
cursor
)
==
false
)
continue
;
continue
;
int
localRowIndex
=
int
localRowIndex
=
...
@@ -384,10 +384,10 @@ namespace AMDiS {
...
@@ -384,10 +384,10 @@ namespace AMDiS {
VecGetArray
(
getVecSolInterior
(),
&
vecPointer
);
VecGetArray
(
getVecSolInterior
(),
&
vecPointer
);
int
c
=
0
;
int
c
=
0
;
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
component
=
0
;
component
<
nComponents
;
component
++
)
{
DOFVector
<
double
>
&
dv
=
*
(
vec
.
getDOFVector
(
i
));
DOFVector
<
double
>
&
dv
=
*
(
vec
.
getDOFVector
(
component
));
DofMap
&
d
=
(
*
interiorMap
)[
dv
.
getFeSpace
()
].
getMap
();
DofMap
&
d
=
(
*
interiorMap
)[
component
].
getMap
();
for
(
DofMap
::
iterator
it
=
d
.
begin
();
it
!=
d
.
end
();
++
it
)
for
(
DofMap
::
iterator
it
=
d
.
begin
();
it
!=
d
.
end
();
++
it
)
if
(
it
->
second
.
local
!=
-
1
)
if
(
it
->
second
.
local
!=
-
1
)
dv
[
it
->
first
]
=
vecPointer
[
c
++
];
dv
[
it
->
first
]
=
vecPointer
[
c
++
];
...
@@ -627,7 +627,7 @@ namespace AMDiS {
...
@@ -627,7 +627,7 @@ namespace AMDiS {
cend
=
end
<
row
>
(
seqMat
->
getBaseMatrix
());
cursor
!=
cend
;
++
cursor
)
{
cend
=
end
<
row
>
(
seqMat
->
getBaseMatrix
());
cursor
!=
cend
;
++
cursor
)
{
// Global index of the current row DOF.
// Global index of the current row DOF.
MultiIndex
rowMultiIndex
;
MultiIndex
rowMultiIndex
;
if
((
*
interiorMap
)[
rowFe
].
find
(
*
cursor
,
rowMultiIndex
)
==
false
)
if
((
*
interiorMap
)[
nRowMat
].
find
(
*
cursor
,
rowMultiIndex
)
==
false
)
continue
;
continue
;
int
globalRowDof
=
rowMultiIndex
.
global
;
int
globalRowDof
=
rowMultiIndex
.
global
;
...
@@ -649,7 +649,7 @@ namespace AMDiS {
...
@@ -649,7 +649,7 @@ namespace AMDiS {
// Global index of the current column index.
// Global index of the current column index.
MultiIndex
colMultiIndex
;
MultiIndex
colMultiIndex
;
if
((
*
interiorMap
)[
colFe
].
find
(
col
(
*
icursor
),
colMultiIndex
)
==
false
)
if
((
*
interiorMap
)[
nColMat
].
find
(
col
(
*
icursor
),
colMultiIndex
)
==
false
)
continue
;
continue
;
int
globalColDof
=
colMultiIndex
.
global
;
int
globalColDof
=
colMultiIndex
.
global
;
...
@@ -707,7 +707,7 @@ namespace AMDiS {
...
@@ -707,7 +707,7 @@ namespace AMDiS {
for
(
icursor_type
icursor
=
begin
<
nz
>
(
cursor
),
icend
=
end
<
nz
>
(
cursor
);
for
(
icursor_type
icursor
=
begin
<
nz
>
(
cursor
),
icend
=
end
<
nz
>
(
cursor
);
icursor
!=
icend
;
++
icursor
)
{
icursor
!=
icend
;
++
icursor
)
{
// Global index of the current column index.
// Global index of the current column index.
int
globalColDof
=
(
*
interiorMap
)[
colFe
][
col
(
*
icursor
)].
global
;
int
globalColDof
=
(
*
interiorMap
)[
nColMat
][
col
(
*
icursor
)].
global
;
// Ignore all zero entries, expect it is a diagonal entry.
// Ignore all zero entries, expect it is a diagonal entry.
if
(
value
(
*
icursor
)
==
0.0
&&
globalRowDof
!=
globalColDof
)
if
(
value
(
*
icursor
)
==
0.0
&&
globalRowDof
!=
globalColDof
)
...
@@ -781,7 +781,7 @@ namespace AMDiS {
...
@@ -781,7 +781,7 @@ namespace AMDiS {
DOFVector
<
double
>::
Iterator
dofIt
(
vec
,
USED_DOFS
);
DOFVector
<
double
>::
Iterator
dofIt
(
vec
,
USED_DOFS
);
for
(
dofIt
.
reset
();
!
dofIt
.
end
();
++
dofIt
)
{
for
(
dofIt
.
reset
();
!
dofIt
.
end
();
++
dofIt
)
{
if
(
rankOnly
&&
!
(
*
interiorMap
)[
feSpace
].
isRankDof
(
dofIt
.
getDOFIndex
()))
if
(
rankOnly
&&
!
(
*
interiorMap
)[
nRowVec
].
isRankDof
(
dofIt
.
getDOFIndex
()))
continue
;
continue
;
if
(
isCoarseSpace
(
nRowVec
,
dofIt
.
getDOFIndex
()))
{
if
(
isCoarseSpace
(
nRowVec
,
dofIt
.
getDOFIndex
()))
{
...
@@ -790,12 +790,12 @@ namespace AMDiS {
...
@@ -790,12 +790,12 @@ namespace AMDiS {
int
index
=
rowCoarseSpace
->
getMatIndex
(
nRowVec
,
dofIt
.
getDOFIndex
());
int
index
=
rowCoarseSpace
->
getMatIndex
(
nRowVec
,
dofIt
.
getDOFIndex
());
VecSetValue
(
vecCoarse
,
index
,
*
dofIt
,
ADD_VALUES
);
VecSetValue
(
vecCoarse
,
index
,
*
dofIt
,
ADD_VALUES
);
}
else
{
}
else
{
if
((
*
interiorMap
)[
feSpace
].
isSet
(
dofIt
.
getDOFIndex
())
==
false
)
if
((
*
interiorMap
)[
nRowVec
].
isSet
(
dofIt
.
getDOFIndex
())
==
false
)
continue
;
continue
;
// Calculate global row index of the DOF.
// Calculate global row index of the DOF.
DegreeOfFreedom
globalRowDof
=
DegreeOfFreedom
globalRowDof
=
(
*
interiorMap
)[
feSpace
][
dofIt
.
getDOFIndex
()].
global
;
(
*
interiorMap
)[
nRowVec
][
dofIt
.
getDOFIndex
()].
global
;
// Get PETSc's mat index of the row DOF.
// Get PETSc's mat index of the row DOF.
int
index
=
0
;
int
index
=
0
;
...
...
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