Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Backofen, Rainer
amdis
Commits
1746edf0
Commit
1746edf0
authored
Mar 15, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed class names.
parent
4e83eefc
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
237 additions
and
180 deletions
+237
-180
AMDiS/src/parallel/FeSpaceMapping.cc
AMDiS/src/parallel/FeSpaceMapping.cc
+181
-0
AMDiS/src/parallel/FeSpaceMapping.h
AMDiS/src/parallel/FeSpaceMapping.h
+16
-156
AMDiS/src/parallel/MeshDistributor.cc
AMDiS/src/parallel/MeshDistributor.cc
+1
-1
AMDiS/src/parallel/MeshDistributor.h
AMDiS/src/parallel/MeshDistributor.h
+3
-3
AMDiS/src/parallel/ParallelDebug.cc
AMDiS/src/parallel/ParallelDebug.cc
+5
-5
AMDiS/src/parallel/ParallelTypes.h
AMDiS/src/parallel/ParallelTypes.h
+1
-1
AMDiS/src/parallel/PeriodicMap.cc
AMDiS/src/parallel/PeriodicMap.cc
+3
-3
AMDiS/src/parallel/PeriodicMap.h
AMDiS/src/parallel/PeriodicMap.h
+1
-1
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+19
-5
AMDiS/src/parallel/PetscSolverFeti.h
AMDiS/src/parallel/PetscSolverFeti.h
+5
-5
AMDiS/src/parallel/PetscSolverFetiStructs.h
AMDiS/src/parallel/PetscSolverFetiStructs.h
+2
-0
No files found.
AMDiS/src/parallel/FeSpaceMapping.cc
View file @
1746edf0
...
...
@@ -102,4 +102,185 @@ namespace AMDiS {
else
MSG
(
" %d -> %d
\n
"
,
it
->
first
,
it
->
second
.
local
);
}
void
ParallelDofMapping
::
addFeSpace
(
const
FiniteElemSpace
*
feSpace
)
{
FUNCNAME
(
"ParallelDofMapping::addFeSpace()"
);
if
(
data
.
count
(
feSpace
))
data
.
find
(
feSpace
)
->
second
.
clear
();
else
data
.
insert
(
make_pair
(
feSpace
,
GlobalDofMap
(
mpiComm
)));
data
.
find
(
feSpace
)
->
second
.
setFeSpace
(
feSpace
);
}
int
ParallelDofMapping
::
getRankDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
)
{
FUNCNAME
(
"ParallelDofMapping::getRankDofs()"
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
fe
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
fe
[
i
]))(
"Cannot find FE space: %p
\n
"
,
fe
[
i
]);
result
+=
data
[
fe
[
i
]].
nRankDofs
;
}
return
result
;
}
int
ParallelDofMapping
::
getLocalDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
)
{
FUNCNAME
(
"ParallelDofMapping::getLocalDofs()"
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
fe
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
fe
[
i
]))(
"Cannot find FE space: %p
\n
"
,
fe
[
i
]);
result
+=
data
[
fe
[
i
]].
nLocalDofs
;
}
return
result
;
}
int
ParallelDofMapping
::
getOverallDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
)
{
FUNCNAME
(
"ParallelDofMapping::getOverallDofs()"
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
feSpaces
[
i
]))(
"Should not happen!
\n
"
);
result
+=
data
.
find
(
feSpaces
[
i
])
->
second
.
nOverallDofs
;
}
return
result
;
}
int
ParallelDofMapping
::
getStartDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
)
{
FUNCNAME
(
"ParallelDofMapping::getStartDofs()"
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
feSpaces
[
i
]))(
"Should not happen!
\n
"
);
result
+=
data
.
find
(
feSpaces
[
i
])
->
second
.
rStartDofs
;
}
return
result
;
}
void
ParallelDofMapping
::
init
(
MPI
::
Intracomm
*
m
,
vector
<
const
FiniteElemSpace
*>
&
fe
,
bool
needGlobalMapping
,
bool
bNonLocalDofs
)
{
FUNCNAME
(
"ParallelDofMapping::init()"
);
mpiComm
=
m
;
feSpaces
=
fe
;
hasNonLocalDofs
=
bNonLocalDofs
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
feSpacesUnique
.
insert
(
feSpaces
[
i
]);
addFeSpace
(
feSpaces
[
i
]);
data
[
feSpaces
[
i
]].
setNeedGlobalMapping
(
needGlobalMapping
);
data
[
feSpaces
[
i
]].
setNonLocalDofs
(
hasNonLocalDofs
);
}
}
void
ParallelDofMapping
::
update
()
{
FUNCNAME
(
"ParallelDofMapping::update()"
);
for
(
std
::
set
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
it
!=
feSpacesUnique
.
end
();
++
it
)
data
[
*
it
].
update
();
nRankDofs
=
getRankDofs
(
feSpaces
);
nLocalDofs
=
getLocalDofs
(
feSpaces
);
nOverallDofs
=
getOverallDofs
(
feSpaces
);
rStartDofs
=
getStartDofs
(
feSpaces
);
computeMatIndex
();
}
void
ParallelDofMapping
::
computeMatIndex
()
{
FUNCNAME
(
"ParallelDofMapping::computeMatIndex()"
);
dofToMatIndex
.
clear
();
int
offset
=
rStartDofs
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
map
<
DegreeOfFreedom
,
MultiIndex
>&
dofMap
=
data
[
feSpaces
[
i
]].
getMap
();
typedef
map
<
DegreeOfFreedom
,
MultiIndex
>::
iterator
ItType
;
for
(
ItType
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
if
(
data
[
feSpaces
[
i
]].
isRankDof
(
it
->
first
))
{
int
globalMatIndex
=
it
->
second
.
local
+
offset
;
dofToMatIndex
.
add
(
i
,
it
->
first
,
globalMatIndex
);
}
}
offset
+=
data
[
feSpaces
[
i
]].
nRankDofs
;
if
(
!
hasNonLocalDofs
)
continue
;
TEST_EXIT_DBG
(
sendDofs
!=
NULL
&&
recvDofs
!=
NULL
)
(
"No communicator given!
\n
"
);
StdMpi
<
vector
<
DegreeOfFreedom
>
>
stdMpi
(
*
mpiComm
);
for
(
DofComm
::
Iterator
it
(
*
sendDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
{
vector
<
DegreeOfFreedom
>
sendGlobalDofs
;
for
(;
!
it
.
endDofIter
();
it
.
nextDof
())
if
(
dofMap
.
count
(
it
.
getDofIndex
()))
sendGlobalDofs
.
push_back
(
dofToMatIndex
.
get
(
i
,
it
.
getDofIndex
()));
stdMpi
.
send
(
it
.
getRank
(),
sendGlobalDofs
);
}
for
(
DofComm
::
Iterator
it
(
*
recvDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
stdMpi
.
recv
(
it
.
getRank
());
stdMpi
.
startCommunication
();
{
for
(
DofComm
::
Iterator
it
(
*
recvDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
{
int
counter
=
0
;
for
(;
!
it
.
endDofIter
();
it
.
nextDof
())
{
if
(
dofMap
.
count
(
it
.
getDofIndex
()))
{
DegreeOfFreedom
d
=
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
++
];
dofToMatIndex
.
add
(
i
,
it
.
getDofIndex
(),
d
);
}
}
}
}
}
}
void
ParallelDofMapping
::
setDofComm
(
DofComm
&
pSend
,
DofComm
&
pRecv
)
{
FUNCNAME
(
"ParallelDofMapping::setDofComm()"
);
sendDofs
=
&
pSend
;
recvDofs
=
&
pRecv
;
for
(
std
::
set
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
it
!=
feSpacesUnique
.
end
();
++
it
)
data
[
*
it
].
setDofComm
(
pSend
,
pRecv
);
}
}
AMDiS/src/parallel/FeSpaceMapping.h
View file @
1746edf0
...
...
@@ -216,11 +216,10 @@ namespace AMDiS {
};
template
<
typename
T
>
class
FeSpaceData
class
ParallelDofMapping
{
public:
FeSpaceData
()
ParallelDofMapping
()
:
mpiComm
(
NULL
),
sendDofs
(
NULL
),
recvDofs
(
NULL
),
...
...
@@ -231,39 +230,18 @@ namespace AMDiS {
rStartDofs
(
-
1
)
{}
T
&
operator
[](
const
FiniteElemSpace
*
feSpace
)
inline
GlobalDofMap
&
operator
[](
const
FiniteElemSpace
*
feSpace
)
{
FUNCNAME
(
"
FeSpaceData
::operator[]()"
);
FUNCNAME
(
"
ParallelDofMapping
::operator[]()"
);
TEST_EXIT_DBG
(
data
.
count
(
feSpace
))(
"Should not happen!
\n
"
);
return
data
.
find
(
feSpace
)
->
second
;
}
void
addFeSpace
(
const
FiniteElemSpace
*
feSpace
)
{
FUNCNAME
(
"FeSpaceData::addFeSpace()"
);
if
(
data
.
count
(
feSpace
))
data
.
find
(
feSpace
)
->
second
.
clear
();
else
data
.
insert
(
make_pair
(
feSpace
,
T
(
mpiComm
)));
data
.
find
(
feSpace
)
->
second
.
setFeSpace
(
feSpace
);
}
int
getRankDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
)
{
FUNCNAME
(
"FeSpaceData::getRankDofs()"
);
void
addFeSpace
(
const
FiniteElemSpace
*
feSpace
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
fe
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
fe
[
i
]))(
"Cannot find FE space: %p
\n
"
,
fe
[
i
]);
result
+=
data
[
fe
[
i
]].
nRankDofs
;
}
return
result
;
}
int
getRankDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
);
inline
int
getRankDofs
()
{
...
...
@@ -272,18 +250,7 @@ namespace AMDiS {
return
nRankDofs
;
}
int
getLocalDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
)
{
FUNCNAME
(
"FeSpaceData::getLocalDofs()"
);
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
fe
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
fe
[
i
]))(
"Cannot find FE space: %p
\n
"
,
fe
[
i
]);
result
+=
data
[
fe
[
i
]].
nLocalDofs
;
}
return
result
;
}
int
getLocalDofs
(
vector
<
const
FiniteElemSpace
*>
&
fe
);
inline
int
getLocalDofs
()
{
...
...
@@ -292,16 +259,7 @@ namespace AMDiS {
return
nLocalDofs
;
}
int
getOverallDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
)
{
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
feSpaces
[
i
]))(
"Should not happen!
\n
"
);
result
+=
data
.
find
(
feSpaces
[
i
])
->
second
.
nOverallDofs
;
}
return
result
;
}
int
getOverallDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
);
inline
int
getOverallDofs
()
{
...
...
@@ -310,18 +268,9 @@ namespace AMDiS {
return
nOverallDofs
;
}
int
getStartDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
)
{
int
result
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
TEST_EXIT_DBG
(
data
.
count
(
feSpaces
[
i
]))(
"Should not happen!
\n
"
);
result
+=
data
.
find
(
feSpaces
[
i
])
->
second
.
rStartDofs
;
}
return
result
;
}
int
getStartDofs
(
vector
<
const
FiniteElemSpace
*>
&
feSpaces
);
int
getStartDofs
()
in
line
in
t
getStartDofs
()
{
TEST_EXIT_DBG
(
rStartDofs
>=
0
)(
"Should not happen!
\n
"
);
...
...
@@ -331,102 +280,13 @@ namespace AMDiS {
void
init
(
MPI
::
Intracomm
*
m
,
vector
<
const
FiniteElemSpace
*>
&
fe
,
bool
needGlobalMapping
,
bool
bNonLocalDofs
)
{
mpiComm
=
m
;
feSpaces
=
fe
;
hasNonLocalDofs
=
bNonLocalDofs
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
feSpacesUnique
.
insert
(
feSpaces
[
i
]);
addFeSpace
(
feSpaces
[
i
]);
data
[
feSpaces
[
i
]].
setNeedGlobalMapping
(
needGlobalMapping
);
data
[
feSpaces
[
i
]].
setNonLocalDofs
(
hasNonLocalDofs
);
}
}
void
update
()
{
for
(
std
::
set
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
it
!=
feSpacesUnique
.
end
();
++
it
)
data
[
*
it
].
update
();
nRankDofs
=
getRankDofs
(
feSpaces
);
nLocalDofs
=
getLocalDofs
(
feSpaces
);
nOverallDofs
=
getOverallDofs
(
feSpaces
);
rStartDofs
=
getStartDofs
(
feSpaces
);
computeMatIndex
();
}
bool
bNonLocalDofs
);
void
computeMatIndex
()
{
dofToMatIndex
.
clear
();
int
offset
=
rStartDofs
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
map
<
DegreeOfFreedom
,
MultiIndex
>&
dofMap
=
data
[
feSpaces
[
i
]].
getMap
();
typedef
map
<
DegreeOfFreedom
,
MultiIndex
>::
iterator
ItType
;
for
(
ItType
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
if
(
data
[
feSpaces
[
i
]].
isRankDof
(
it
->
first
))
{
int
globalMatIndex
=
it
->
second
.
local
+
offset
;
dofToMatIndex
.
add
(
i
,
it
->
first
,
globalMatIndex
);
}
}
offset
+=
data
[
feSpaces
[
i
]].
nRankDofs
;
if
(
!
hasNonLocalDofs
)
continue
;
TEST_EXIT_DBG
(
sendDofs
!=
NULL
&&
recvDofs
!=
NULL
)
(
"No communicator given!
\n
"
);
StdMpi
<
vector
<
DegreeOfFreedom
>
>
stdMpi
(
*
mpiComm
);
for
(
DofComm
::
Iterator
it
(
*
sendDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
{
vector
<
DegreeOfFreedom
>
sendGlobalDofs
;
for
(;
!
it
.
endDofIter
();
it
.
nextDof
())
if
(
dofMap
.
count
(
it
.
getDofIndex
()))
sendGlobalDofs
.
push_back
(
dofToMatIndex
.
get
(
i
,
it
.
getDofIndex
()));
stdMpi
.
send
(
it
.
getRank
(),
sendGlobalDofs
);
}
for
(
DofComm
::
Iterator
it
(
*
recvDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
stdMpi
.
recv
(
it
.
getRank
());
stdMpi
.
startCommunication
();
{
for
(
DofComm
::
Iterator
it
(
*
recvDofs
,
feSpaces
[
i
]);
!
it
.
end
();
it
.
nextRank
())
{
int
counter
=
0
;
for
(;
!
it
.
endDofIter
();
it
.
nextDof
())
{
if
(
dofMap
.
count
(
it
.
getDofIndex
()))
{
DegreeOfFreedom
d
=
stdMpi
.
getRecvData
(
it
.
getRank
())[
counter
++
];
dofToMatIndex
.
add
(
i
,
it
.
getDofIndex
(),
d
);
}
}
}
}
}
}
void
update
();
void
setDofComm
(
DofComm
&
pSend
,
DofComm
&
pRecv
)
{
sendDofs
=
&
pSend
;
recvDofs
=
&
pRecv
;
void
computeMatIndex
();
for
(
std
::
set
<
const
FiniteElemSpace
*>::
iterator
it
=
feSpacesUnique
.
begin
();
it
!=
feSpacesUnique
.
end
();
++
it
)
data
[
*
it
].
setDofComm
(
pSend
,
pRecv
);
}
void
setDofComm
(
DofComm
&
pSend
,
DofComm
&
pRecv
);
inline
int
getMatIndex
(
int
ithComponent
,
DegreeOfFreedom
d
)
{
...
...
@@ -435,7 +295,7 @@ namespace AMDiS {
inline
int
getLocalMatIndex
(
int
ithComponent
,
DegreeOfFreedom
d
)
{
FUNCNAME
(
"
FeSpaceData
::getLocalMatIndex()"
);
FUNCNAME
(
"
ParallelDofMapping
::getLocalMatIndex()"
);
TEST_EXIT_DBG
(
data
[
feSpaces
[
ithComponent
]].
isRankDof
(
d
))
(
"Should not happen!
\n
"
);
...
...
@@ -455,7 +315,7 @@ namespace AMDiS {
/// are also owned by this rank.
bool
hasNonLocalDofs
;
map
<
const
FiniteElemSpace
*
,
T
>
data
;
map
<
const
FiniteElemSpace
*
,
GlobalDofMap
>
data
;
vector
<
const
FiniteElemSpace
*>
feSpaces
;
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
1746edf0
...
...
@@ -2287,7 +2287,7 @@ namespace AMDiS {
TEST_EXIT_DBG
(
dofFeData
.
count
(
feSpace
))(
"Should not happen!
\n
"
);
for
(
DofMap
ping
::
iterator
it
=
dofFeData
[
feSpace
].
mapDofToGlobal
.
begin
();
for
(
DofMap
::
iterator
it
=
dofFeData
[
feSpace
].
mapDofToGlobal
.
begin
();
it
!=
dofFeData
[
feSpace
].
mapDofToGlobal
.
end
();
++
it
)
if
(
it
->
second
==
dof
)
return
it
->
first
;
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
1746edf0
...
...
@@ -70,10 +70,10 @@ namespace AMDiS {
DofIndexToBool
isRankDof
;
/// Maps local to global dof indices.
DofMap
ping
mapDofToGlobal
;
DofMap
mapDofToGlobal
;
/// Maps local dof indices to real dof indices.
DofMap
ping
mapLocalToDof
;
DofMap
mapLocalToDof
;
};
...
...
@@ -271,7 +271,7 @@ namespace AMDiS {
return
result
;
}
inline
DofMap
ping
&
getMapDofToGlobal
(
const
FiniteElemSpace
*
feSpace
)
inline
DofMap
&
getMapDofToGlobal
(
const
FiniteElemSpace
*
feSpace
)
{
FUNCNAME
(
"MeshDistributor::getMapDofToGlobal()"
);
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
1746edf0
...
...
@@ -203,7 +203,7 @@ namespace AMDiS {
for
(
PeriodicDofMap
::
iterator
it
=
otherMap
.
begin
();
it
!=
otherMap
.
end
();
++
it
)
{
for
(
DofMap
ping
::
iterator
dofIt
=
it
->
second
.
begin
();
for
(
DofMap
::
iterator
dofIt
=
it
->
second
.
begin
();
dofIt
!=
it
->
second
.
end
();
++
dofIt
)
{
if
(
dofMap
.
count
(
it
->
first
)
==
1
&&
dofMap
[
it
->
first
].
count
(
dofIt
->
first
)
==
1
)
{
...
...
@@ -222,7 +222,7 @@ namespace AMDiS {
for
(
PeriodicDofMap
::
iterator
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
for
(
DofMap
ping
::
iterator
dofIt
=
it
->
second
.
begin
();
for
(
DofMap
::
iterator
dofIt
=
it
->
second
.
begin
();
dofIt
!=
it
->
second
.
end
();
++
dofIt
)
{
if
(
it
->
second
[
dofIt
->
second
]
!=
dofIt
->
first
)
{
MSG
(
"[DBG] For boundary type %d: DOF %d -> %d, but %d -> %d!
\n
"
,
...
...
@@ -646,7 +646,7 @@ namespace AMDiS {
cout
<<
"====== DOF MAP LOCAL -> GLOBAL ====== "
<<
endl
;
for
(
DofMap
ping
::
iterator
it
=
pdb
.
dofFeData
[
feSpace
].
mapDofToGlobal
.
begin
();
for
(
DofMap
::
iterator
it
=
pdb
.
dofFeData
[
feSpace
].
mapDofToGlobal
.
begin
();
it
!=
pdb
.
dofFeData
[
feSpace
].
mapDofToGlobal
.
end
();
it
++
)
{
DegreeOfFreedom
localdof
=
-
1
;
if
(
pdb
.
dofFeData
[
feSpace
].
mapLocalToDof
.
count
(
it
->
first
)
>
0
)
...
...
@@ -686,7 +686,7 @@ namespace AMDiS {
const FiniteElemSpace* feSpace = pdb.feSpaces[0];
typedef map<DegreeOfFreedom, DegreeOfFreedom> DofMap
ping
;
typedef map<DegreeOfFreedom, DegreeOfFreedom> DofMap;
typedef map<DegreeOfFreedom, std::set<DegreeOfFreedom> > PeriodicDofMap;
if (rank == -1 || pdb.mpiRank == rank) {
...
...
@@ -701,7 +701,7 @@ namespace AMDiS {
cout << endl;
DegreeOfFreedom localdof = -1;
for (DofMap
ping
::iterator dofIt = pdb.dofFeData[feSpace].mapDofToGlobal.begin();
for (DofMap::iterator dofIt = pdb.dofFeData[feSpace].mapDofToGlobal.begin();
dofIt != pdb.dofFeData[feSpace].mapDofToGlobal.end(); ++dofIt)
if (dofIt->second == it->first)
localdof = dofIt->first;
...
...
AMDiS/src/parallel/ParallelTypes.h
View file @
1746edf0
...
...
@@ -49,7 +49,7 @@ namespace AMDiS {
typedef
map
<
int
,
DofContainer
>
RankToDofContainer
;
/// Defines a mapping type from DOF indices to DOF indices.
typedef
map
<
DegreeOfFreedom
,
DegreeOfFreedom
>
DofMap
ping
;
typedef
map
<
DegreeOfFreedom
,
DegreeOfFreedom
>
DofMap
;
/// Defines a mapping type from DOFs to boolean values.
typedef
map
<
const
DegreeOfFreedom
*
,
bool
>
DofToBool
;
...
...
AMDiS/src/parallel/PeriodicMap.cc
View file @
1746edf0
...
...
@@ -21,7 +21,7 @@ namespace AMDiS {
FUNCNAME
(
"PeriodicMap::add()"
);
for
(
PeriodicDofMap
::
iterator
it
=
newMap
.
begin
();
it
!=
newMap
.
end
();
++
it
)
for
(
DofMap
ping
::
iterator
dofIt
=
it
->
second
.
begin
();
for
(
DofMap
::
iterator
dofIt
=
it
->
second
.
begin
();
dofIt
!=
it
->
second
.
end
();
++
dofIt
)
add
(
feSpace
,
it
->
first
,
dofIt
->
second
,
dofIt
->
first
);
}
...
...
@@ -64,7 +64,7 @@ namespace AMDiS {
for
(
PeriodicDofMap
::
iterator
it
=
data
.
begin
();
it
!=
data
.
end
();
++
it
)
{
int
type
=
it
->
first
;
DofMap
ping
dofMap
=
it
->
second
;
DofMap
dofMap
=
it
->
second
;
SerUtil
::
serialize
(
out
,
type
);
SerUtil
::
serialize
(
out
,
dofMap
);
...
...
@@ -97,7 +97,7 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
mapSize
;
i
++
)
{
int
type
;
DofMap
ping
dofMap
;
DofMap
dofMap
;
SerUtil
::
deserialize
(
in
,
type
);
SerUtil
::
deserialize
(
in
,
dofMap
);
...
...
AMDiS/src/parallel/PeriodicMap.h
View file @
1746edf0
...
...
@@ -34,7 +34,7 @@ namespace AMDiS {
/// Maps a boundary type, i.e., a boundary identifier index, to a periodic
/// DOF mapping.
typedef
std
::
map
<
BoundaryType
,
DofMap
ping
>
PeriodicDofMap
;
typedef
std
::
map
<
BoundaryType
,
DofMap
>
PeriodicDofMap
;
/// Different FE spaces may have different DOFs on the same mesh. Thus we
/// need to have a periodic DOF mapping for each FE space.
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
1746edf0
...
...
@@ -150,8 +150,9 @@ namespace AMDiS {
VecGetArray
(
data
->
tmp_vec_b
,
&
local_b
);
VecGetArray
(
data
->
tmp_vec_duals0
,
&
local_duals
);
for
(
int
i
=
nLocalB
-
nLocalDuals
,
j
=
0
;
i
<
nLocalB
;
i
++
,
j
++
)
local_duals
[
j
]
=
local_b
[
i
];
for
(
map
<
int
,
int
>::
iterator
it
=
data
->
localToDualMap
.
begin
();
it
!=
data
->
localToDualMap
.
end
();
++
it
)
local_duals
[
it
->
second
]
=
local_b
[
it
->
first
];
VecRestoreArray
(
data
->
tmp_vec_b
,
&
local_b
);
VecRestoreArray
(
data
->
tmp_vec_duals0
,
&
local_duals
);
...
...
@@ -167,8 +168,9 @@ namespace AMDiS {
VecGetArray
(
data
->
tmp_vec_b
,
&
local_b
);
VecGetArray
(
data
->
tmp_vec_duals1
,
&
local_duals
);
for
(
int
i
=
nLocalB
-
nLocalDuals
,
j
=
0
;
i
<
nLocalB
;
i
++
,
j
++
)
local_b
[
i
]
=
local_duals
[
j
];
for
(
map
<
int
,
int
>::
iterator
it
=
data
->
localToDualMap
.
begin
();
it
!=
data
->
localToDualMap
.
end
();
++
it
)
local_b
[
it
->
first
]
=
local_duals
[
it
->
second
];
VecRestoreArray
(
data
->
tmp_vec_b
,
&
local_b
);
VecRestoreArray
(
data
->
tmp_vec_duals0
,
&
local_duals
);
...
...
@@ -700,6 +702,18 @@ namespace AMDiS {
fetiLumpedPreconData
.
mat_lagrange_scaled
=
&
mat_lagrange_scaled
;
fetiLumpedPreconData
.
mat_duals_duals
=
&
mat_duals_duals
;
for
(
unsigned
int
i
=
0
;
i
<
feSpaces
.
size
();
i
++
)
{
map
<
DegreeOfFreedom
,
MultiIndex
>
&
dualMap
=
dualDofMap
[
feSpaces
[
i
]].
getMap
();
for
(
map
<
DegreeOfFreedom
,
MultiIndex
>::
iterator
it
=
dualMap
.
begin
();
it
!=
dualMap
.
end
();
++
it
)
{
DegreeOfFreedom
d
=
it
->
first
;
int
matIndexLocal
=
localDofMap
.
getLocalMatIndex
(
i
,
d
);
int
matIndexDual
=
dualDofMap
.
getLocalMatIndex
(
i
,
d
);
fetiLumpedPreconData
.
localToDualMap
[
matIndexLocal
]
=
matIndexDual
;
}
}
VecCreateMPI
(
PETSC_COMM_WORLD
,
localDofMap
.
getRankDofs
(),
localDofMap
.
getOverallDofs
(),
...
...
@@ -1104,7 +1118,7 @@ namespace AMDiS {
int
rowIndex
=
dualDofMap
.
getLocalMatIndex
(
i
,
*
cursor
);
MatSetValues
(
mat_duals_duals
,
1
,
&
rowIndex
,
colsLocal
.
size
(),
&
(
colsLocal
[
0
]),
&
(
valuesLocal
[
0
]),
INSERT_VALUES
);
}
}
break
;
default:
break
;
...
...
AMDiS/src/parallel/PetscSolverFeti.h
View file @
1746edf0
...
...
@@ -158,21 +158,21 @@ namespace AMDiS {
protected:
/// Mapping from primal DOF indices to a global index of primals.
FeSpaceData
<
GlobalDofMap
>
primalDofMap
;
ParallelDofMapping
primalDofMap
;
/// Mapping from dual DOF indices to a global index of duals.
FeSpaceData
<
GlobalDofMap
>
dualDofMap
;
ParallelDofMapping
dualDofMap
;
/// Stores to each dual DOF index the index of the first Lagrange
/// constraint that is assigned to this DOF.
FeSpaceData
<
GlobalDofMap
>
lagrangeMap
;
ParallelDofMapping
lagrangeMap
;
/// Index for each non primal DOF to the global index of B variables.
FeSpaceData
<
GlobalDofMap
>
localDofMap
;
ParallelDofMapping
localDofMap
;
/// Mapping of pure local DOF indices, thus no primal and no dual DOFs are
/// in this map. Is used for the Dirichlet preconditioner only.
FeSpaceData
<
GlobalDofMap
>
interiorDofMap
;
ParallelDofMapping
interiorDofMap
;