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
d8a17f14
Commit
d8a17f14
authored
Aug 28, 2012
by
Thomas Witkowski
Browse files
Fixed Lumped preconditioner issue.
parent
82a26536
Changes
4
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
d8a17f14
...
...
@@ -23,9 +23,9 @@ namespace AMDiS {
{
FUNCNAME
(
"DofToMatIndex::getReverse()"
);
for
(
map
<
int
,
map
<
DegreeOfFreedom
,
int
>
>::
iterator
it0
=
data
.
begin
();
for
(
map
<
int
,
boost
::
container
::
flat_
map
<
DegreeOfFreedom
,
int
>
>::
iterator
it0
=
data
.
begin
();
it0
!=
data
.
end
();
++
it0
)
for
(
map
<
DegreeOfFreedom
,
int
>::
iterator
it1
=
it0
->
second
.
begin
();
for
(
boost
::
container
::
flat_
map
<
DegreeOfFreedom
,
int
>::
iterator
it1
=
it0
->
second
.
begin
();
it1
!=
it0
->
second
.
end
();
++
it1
)
if
(
it1
->
second
==
rowIndex
)
{
component
=
it0
->
first
;
...
...
AMDiS/src/parallel/ParallelDofMapping.h
View file @
d8a17f14
...
...
@@ -29,6 +29,8 @@
#include
<set>
#include
<petsc.h>
#include
<petscis.h>
#include
<boost/container/flat_map.hpp>
#include
<boost/container/flat_set.hpp>
#include
"AMDiS_fwd.h"
#include
"parallel/DofComm.h"
...
...
@@ -92,7 +94,8 @@ namespace AMDiS {
private:
/// The mapping data. For each system component there is a specific map that
/// maps global DOF indices to global matrix indices.
map
<
int
,
map
<
DegreeOfFreedom
,
int
>
>
data
;
// map<int, map<DegreeOfFreedom, int> > data;
map
<
int
,
boost
::
container
::
flat_map
<
DegreeOfFreedom
,
int
>
>
data
;
};
...
...
@@ -273,7 +276,7 @@ namespace AMDiS {
DofMap
dofMap
;
/// Set of all DOFs that are in mapping but are not owned by the rank.
st
d
::
set
<
DegreeOfFreedom
>
nonRankDofs
;
boo
st
::
container
::
flat_
set
<
DegreeOfFreedom
>
nonRankDofs
;
/// If true, a global index mapping will be computed for all DOFs.
bool
needGlobalMapping
;
...
...
AMDiS/src/parallel/ParallelTypes.h
View file @
d8a17f14
...
...
@@ -23,6 +23,7 @@
#include
<vector>
#include
<set>
#include
<map>
#include
<boost/container/flat_map.hpp>
#include
"BoundaryObject.h"
#include
"Global.h"
#include
"parallel/InteriorBoundary.h"
...
...
@@ -72,7 +73,8 @@ namespace AMDiS {
int
local
,
global
;
};
typedef
std
::
map
<
DegreeOfFreedom
,
MultiIndex
>
DofMap
;
// typedef std::map<DegreeOfFreedom, MultiIndex> DofMap;
typedef
boost
::
container
::
flat_map
<
DegreeOfFreedom
,
MultiIndex
>
DofMap
;
typedef
vector
<
MeshStructure
>
MeshCodeVec
;
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
d8a17f14
...
...
@@ -1395,7 +1395,7 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createPreconditionerMatrix()"
);
if
(
fetiPreconditioner
!
=
FETI_NONE
)
if
(
fetiPreconditioner
=
=
FETI_NONE
)
return
;
double
wtime
=
MPI
::
Wtime
();
...
...
@@ -1460,6 +1460,9 @@ namespace AMDiS {
const
FiniteElemSpace
*
rowFeSpace
=
feSpaces
[
rowComponent
];
const
FiniteElemSpace
*
colFeSpace
=
feSpaces
[
colComponent
];
if
(
enableStokesMode
&&
(
rowFeSpace
==
fullInterface
||
colFeSpace
==
fullInterface
))
continue
;
traits
::
col
<
Matrix
>::
type
col
(
dofMat
->
getBaseMatrix
());
traits
::
const_value
<
Matrix
>::
type
value
(
dofMat
->
getBaseMatrix
());
...
...
@@ -1469,51 +1472,49 @@ namespace AMDiS {
if
(
isPrimal
(
rowFeSpace
,
*
cursor
))
continue
;
colsLocal
.
clear
();
colsLocalOther
.
clear
();
valuesLocal
.
clear
();
valuesLocalOther
.
clear
();
// Traverse all columns.
for
(
icursor_type
icursor
=
begin
<
nz
>
(
cursor
),
icend
=
end
<
nz
>
(
cursor
);
icursor
!=
icend
;
++
icursor
)
{
if
(
isPrimal
(
colFeSpace
,
col
(
*
icursor
)))
continue
;
if
(
!
isDual
(
rowFeSpace
,
*
cursor
))
{
if
(
!
isDual
(
colFeSpace
,
col
(
*
icursor
)))
{
int
colIndex
=
interiorDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocal
.
push_back
(
colIndex
);
valuesLocal
.
push_back
(
value
(
*
icursor
));
}
else
{
int
colIndex
=
dualDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocalOther
.
push_back
(
colIndex
);
valuesLocalOther
.
push_back
(
value
(
*
icursor
));
}
}
else
{
if
(
!
isDual
(
colFeSpace
,
col
(
*
icursor
)))
{
int
colIndex
=
interiorDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocalOther
.
push_back
(
colIndex
);
valuesLocalOther
.
push_back
(
value
(
*
icursor
));
}
else
{
int
colIndex
=
dualDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocal
.
push_back
(
colIndex
);
valuesLocal
.
push_back
(
value
(
*
icursor
));
}
}
}
// for each nnz in row
// === Set matrix values for preconditioner ===
switch
(
fetiPreconditioner
)
{
case
FETI_DIRICHLET
:
colsLocal
.
clear
();
colsLocalOther
.
clear
();
valuesLocal
.
clear
();
valuesLocalOther
.
clear
();
// Traverse all columns.
for
(
icursor_type
icursor
=
begin
<
nz
>
(
cursor
),
icend
=
end
<
nz
>
(
cursor
);
icursor
!=
icend
;
++
icursor
)
{
if
(
isPrimal
(
colFeSpace
,
col
(
*
icursor
)))
continue
;
if
(
!
isDual
(
rowFeSpace
,
*
cursor
))
{
if
(
!
isDual
(
colFeSpace
,
col
(
*
icursor
)))
{
int
colIndex
=
interiorDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocal
.
push_back
(
colIndex
);
valuesLocal
.
push_back
(
value
(
*
icursor
));
}
else
{
int
colIndex
=
dualDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocalOther
.
push_back
(
colIndex
);
valuesLocalOther
.
push_back
(
value
(
*
icursor
));
}
}
else
{
if
(
!
isDual
(
colFeSpace
,
col
(
*
icursor
)))
{
int
colIndex
=
interiorDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocalOther
.
push_back
(
colIndex
);
valuesLocalOther
.
push_back
(
value
(
*
icursor
));
}
else
{
int
colIndex
=
dualDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocal
.
push_back
(
colIndex
);
valuesLocal
.
push_back
(
value
(
*
icursor
));
}
}
}
// for each nnz in row
if
(
!
isDual
(
rowFeSpace
,
*
cursor
))
{
int
rowIndex
=
interiorDofMap
.
getLocalMatIndex
(
rowComponent
,
*
cursor
);
...
...
@@ -1532,18 +1533,38 @@ namespace AMDiS {
MatSetValues
(
mat_duals_interior
,
1
,
&
rowIndex
,
colsLocalOther
.
size
(),
&
(
colsLocalOther
[
0
]),
&
(
valuesLocalOther
[
0
]),
INSERT_VALUES
);
}
break
;
case
FETI_LUMPED
:
if
(
isDual
(
rowFeSpace
,
*
cursor
))
{
int
rowIndex
=
dualDofMap
.
getLocalMatIndex
(
rowComponent
,
*
cursor
);
MatSetValues
(
mat_duals_duals
,
1
,
&
rowIndex
,
colsLocal
.
size
(),
&
(
colsLocal
[
0
]),
&
(
valuesLocal
[
0
]),
INSERT_VALUES
);
}
if
(
!
isDual
(
rowFeSpace
,
*
cursor
))
continue
;
colsLocal
.
clear
();
valuesLocal
.
clear
();
// Traverse all columns.
for
(
icursor_type
icursor
=
begin
<
nz
>
(
cursor
),
icend
=
end
<
nz
>
(
cursor
);
icursor
!=
icend
;
++
icursor
)
{
if
(
!
isDual
(
colFeSpace
,
col
(
*
icursor
)))
continue
;
int
colIndex
=
dualDofMap
.
getLocalMatIndex
(
colComponent
,
col
(
*
icursor
));
colsLocal
.
push_back
(
colIndex
);
valuesLocal
.
push_back
(
value
(
*
icursor
));
}
int
rowIndex
=
dualDofMap
.
getLocalMatIndex
(
rowComponent
,
*
cursor
);
MatSetValues
(
mat_duals_duals
,
1
,
&
rowIndex
,
colsLocal
.
size
(),
&
(
colsLocal
[
0
]),
&
(
valuesLocal
[
0
]),
INSERT_VALUES
);
break
;
default:
break
;
}
}
}
}
}
...
...
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