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
4ef709eb
Commit
4ef709eb
authored
Apr 08, 2011
by
Thomas Witkowski
Browse files
Work on preconditioners for schur complement.
parent
753ff014
Changes
4
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/Global.h
View file @
4ef709eb
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include
<string>
#include
<string>
#include
<vector>
#include
<vector>
#include
<set>
#include
<fstream>
#include
<fstream>
#include
<math.h>
#include
<math.h>
#include
<iostream>
#include
<iostream>
...
@@ -80,6 +81,8 @@ namespace AMDiS {
...
@@ -80,6 +81,8 @@ namespace AMDiS {
/// Defines type for a vector of DOF pointers.
/// Defines type for a vector of DOF pointers.
typedef
std
::
vector
<
const
DegreeOfFreedom
*>
DofContainer
;
typedef
std
::
vector
<
const
DegreeOfFreedom
*>
DofContainer
;
typedef
std
::
set
<
const
DegreeOfFreedom
*>
DofContainerSet
;
/// Defines a type for global edge identification via its DOFs.
/// Defines a type for global edge identification via its DOFs.
typedef
std
::
pair
<
DegreeOfFreedom
,
DegreeOfFreedom
>
DofEdge
;
typedef
std
::
pair
<
DegreeOfFreedom
,
DegreeOfFreedom
>
DofEdge
;
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
4ef709eb
...
@@ -1649,20 +1649,21 @@ namespace AMDiS {
...
@@ -1649,20 +1649,21 @@ namespace AMDiS {
recvDofs
.
clear
();
recvDofs
.
clear
();
if
(
createBoundaryDofFlag
.
isSet
(
BOUNDARY_SUBOBJ_SORTED
))
{
if
(
createBoundaryDofFlag
.
isSet
(
BOUNDARY_SUBOBJ_SORTED
))
{
MSG
(
"WITH BOUNDARY SUBOBJ SORTED!
\n
"
);
DofContainer
dofs
;
DofContainer
dofs
;
for
(
int
geo
=
FACE
;
geo
>=
VERTEX
;
geo
--
)
{
for
(
int
geo
=
FACE
;
geo
>=
VERTEX
;
geo
--
)
{
boundaryDofInfo
.
nGeoDofs
[
static_cast
<
GeoIndex
>
(
geo
)]
=
0
;
std
::
set
<
const
DegreeOfFreedom
*>
&
dofSet
=
boundaryDofInfo
.
geoDofs
[
static_cast
<
GeoIndex
>
(
geo
)];
dofSet
.
clear
();
for
(
InteriorBoundary
::
iterator
it
(
myIntBoundary
);
!
it
.
end
();
++
it
)
{
for
(
InteriorBoundary
::
iterator
it
(
myIntBoundary
);
!
it
.
end
();
++
it
)
{
if
(
it
->
rankObj
.
subObj
==
geo
)
{
if
(
it
->
rankObj
.
subObj
==
geo
)
{
dofs
.
clear
();
dofs
.
clear
();
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
dofs
);
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
dofs
);
boundaryDofInfo
.
nGeoDofs
[
static_cast
<
GeoIndex
>
(
geo
)]
+=
dofs
.
size
();
DofContainer
&
tmp
=
sendDofs
[
it
.
getRank
()];
DofContainer
&
tmp
=
sendDofs
[
it
.
getRank
()];
tmp
.
insert
(
tmp
.
end
(),
dofs
.
begin
(),
dofs
.
end
());
tmp
.
insert
(
tmp
.
end
(),
dofs
.
begin
(),
dofs
.
end
());
dofSet
.
insert
(
dofs
.
begin
(),
dofs
.
end
());
}
}
}
}
}
}
...
@@ -1673,7 +1674,6 @@ namespace AMDiS {
...
@@ -1673,7 +1674,6 @@ namespace AMDiS {
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
recvDofs
[
it
.
getRank
()]);
recvDofs
[
it
.
getRank
()]);
}
else
{
}
else
{
MSG
(
"GAAAAAAANZ NORMAL!
\n
"
);
for
(
InteriorBoundary
::
iterator
it
(
myIntBoundary
);
!
it
.
end
();
++
it
)
for
(
InteriorBoundary
::
iterator
it
(
myIntBoundary
);
!
it
.
end
();
++
it
)
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
it
->
rankObj
.
el
->
getAllDofs
(
feSpace
,
it
->
rankObj
,
sendDofs
[
it
.
getRank
()]);
sendDofs
[
it
.
getRank
()]);
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
4ef709eb
...
@@ -48,7 +48,7 @@ namespace AMDiS {
...
@@ -48,7 +48,7 @@ namespace AMDiS {
struct
BoundaryDofInfo
struct
BoundaryDofInfo
{
{
map
<
GeoIndex
,
in
t
>
nG
eoDofs
;
map
<
GeoIndex
,
DofContainerSe
t
>
g
eoDofs
;
};
};
...
@@ -305,6 +305,11 @@ namespace AMDiS {
...
@@ -305,6 +305,11 @@ namespace AMDiS {
createBoundaryDofFlag
=
flag
;
createBoundaryDofFlag
=
flag
;
}
}
BoundaryDofInfo
&
getBoundaryDofInfo
()
{
return
boundaryDofInfo
;
}
protected:
protected:
/** \brief
/** \brief
* Determines the interior boundaries, i.e. boundaries between ranks, and stores
* Determines the interior boundaries, i.e. boundaries between ranks, and stores
...
...
AMDiS/src/parallel/PetscSolverSchur.cc
View file @
4ef709eb
...
@@ -44,15 +44,57 @@ namespace AMDiS {
...
@@ -44,15 +44,57 @@ namespace AMDiS {
}
}
}
}
nBoundaryDofs
=
boundaryDofs
.
size
();
nBoundaryDofs
=
boundaryDofs
.
size
();
mpi
::
getDofNumbering
(
mpiComm
,
nBoundaryDofs
,
mpi
::
getDofNumbering
(
mpiComm
,
nBoundaryDofs
,
rStartBoundaryDofs
,
nOverallBoundaryDofs
);
rStartBoundaryDofs
,
nOverallBoundaryDofs
);
int
counter
=
rStartBoundaryDofs
;
DofContainerSet
&
edgeDofs
=
meshDistributor
->
getBoundaryDofInfo
().
geoDofs
[
EDGE
];
DofContainerSet
&
vertexDofs
=
meshDistributor
->
getBoundaryDofInfo
().
geoDofs
[
VERTEX
];
int
nEdgeDofs
=
edgeDofs
.
size
();
int
nVertexDofs
=
vertexDofs
.
size
();
TEST_EXIT_DBG
(
nEdgeDofs
+
nVertexDofs
==
nBoundaryDofs
)
(
"Should not happen!
\n
"
);
int
rStartEdgeDofs
,
nOverallEdgeDofs
;
mpi
::
getDofNumbering
(
mpiComm
,
nEdgeDofs
,
rStartEdgeDofs
,
nOverallEdgeDofs
);
int
rStartVertexDofs
,
nOverallVertexDofs
;
mpi
::
getDofNumbering
(
mpiComm
,
nVertexDofs
,
rStartVertexDofs
,
nOverallVertexDofs
);
TEST_EXIT_DBG
(
nOverallEdgeDofs
+
nOverallVertexDofs
==
nOverallBoundaryDofs
)
(
"Should not happen!
\n
"
);
mapGlobalBoundaryDof
.
clear
();
mapGlobalBoundaryDof
.
clear
();
#if 1
{
int
counter
=
rStartEdgeDofs
;
for
(
DofContainerSet
::
iterator
it
=
edgeDofs
.
begin
();
it
!=
edgeDofs
.
end
();
++
it
)
mapGlobalBoundaryDof
[
meshDistributor
->
mapLocalToGlobal
(
**
it
)]
=
counter
++
;
}
{
int
counter
=
nOverallEdgeDofs
+
rStartVertexDofs
;
for
(
DofContainerSet
::
iterator
it
=
vertexDofs
.
begin
();
it
!=
vertexDofs
.
end
();
++
it
)
mapGlobalBoundaryDof
[
meshDistributor
->
mapLocalToGlobal
(
**
it
)]
=
counter
++
;
}
#else
{
int
counter
=
rStartBoundaryDofs
;
for
(
std
::
set
<
DegreeOfFreedom
>::
iterator
it
=
boundaryDofs
.
begin
();
for
(
std
::
set
<
DegreeOfFreedom
>::
iterator
it
=
boundaryDofs
.
begin
();
it
!=
boundaryDofs
.
end
();
++
it
)
it
!=
boundaryDofs
.
end
();
++
it
)
mapGlobalBoundaryDof
[
*
it
]
=
counter
++
;
mapGlobalBoundaryDof
[
*
it
]
=
counter
++
;
}
#endif
...
@@ -78,11 +120,13 @@ namespace AMDiS {
...
@@ -78,11 +120,13 @@ namespace AMDiS {
mpi
::
getDofNumbering
(
mpiComm
,
nInteriorDofs
,
mpi
::
getDofNumbering
(
mpiComm
,
nInteriorDofs
,
rStartInteriorDofs
,
nOverallInteriorDofs
);
rStartInteriorDofs
,
nOverallInteriorDofs
);
counter
=
rStartInteriorDofs
;
{
mapGlobalInteriorDof
.
clear
();
int
counter
=
rStartInteriorDofs
;
for
(
std
::
set
<
DegreeOfFreedom
>::
iterator
it
=
interiorDofs
.
begin
();
mapGlobalInteriorDof
.
clear
();
it
!=
interiorDofs
.
end
();
++
it
)
for
(
std
::
set
<
DegreeOfFreedom
>::
iterator
it
=
interiorDofs
.
begin
();
mapGlobalInteriorDof
[
*
it
]
=
counter
++
;
it
!=
interiorDofs
.
end
();
++
it
)
mapGlobalInteriorDof
[
*
it
]
=
counter
++
;
}
TEST_EXIT_DBG
(
nInteriorDofs
>
0
)(
"Should not happen!
\n
"
);
TEST_EXIT_DBG
(
nInteriorDofs
>
0
)(
"Should not happen!
\n
"
);
...
@@ -394,7 +438,7 @@ namespace AMDiS {
...
@@ -394,7 +438,7 @@ namespace AMDiS {
if
(
rankOnly
&&
!
meshDistributor
->
getIsRankDof
(
dofIt
.
getDOFIndex
()))
if
(
rankOnly
&&
!
meshDistributor
->
getIsRankDof
(
dofIt
.
getDOFIndex
()))
continue
;
continue
;
// Calculate global row index of the
dof
.
// Calculate global row index of the
DOF
.
DegreeOfFreedom
globalRowDof
=
DegreeOfFreedom
globalRowDof
=
meshDistributor
->
mapLocalToGlobal
(
dofIt
.
getDOFIndex
());
meshDistributor
->
mapLocalToGlobal
(
dofIt
.
getDOFIndex
());
...
...
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