Skip to content
GitLab
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
56f1d33d
Commit
56f1d33d
authored
Aug 23, 2012
by
Thomas Witkowski
Browse files
And more work on FETI-DP Stokes.
parent
1a2d274f
Changes
4
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
56f1d33d
...
...
@@ -762,17 +762,15 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createFetiKsp()"
);
MSG
(
"START A
\n
"
);
// === Create FETI-DP solver object. ===
F
etiData
&
data
=
(
!
enableStokesMode
?
fetiData
:
fetiDataInterface
)
;
data
.
mat_lagrange
=
&
mat_lagrange
;
data
.
subSolver
=
subdomain
;
data
.
ksp_schur_primal
=
&
ksp_schur_primal
;
localDofMap
.
createVec
(
d
ata
.
tmp_vec_b
,
nGlobalOverallInterior
);
lagrangeMap
.
createVec
(
d
ata
.
tmp_vec_lagrange
);
primalDofMap
.
createVec
(
d
ata
.
tmp_vec_primal
);
f
etiData
.
mat_lagrange
=
&
mat_lagrange
;
fetiData
.
subSolver
=
subdomain
;
fetiData
.
ksp_schur_primal
=
&
ksp_schur_primal
;
localDofMap
.
createVec
(
fetiD
ata
.
tmp_vec_b
,
nGlobalOverallInterior
);
lagrangeMap
.
createVec
(
fetiD
ata
.
tmp_vec_lagrange
);
primalDofMap
.
createVec
(
fetiD
ata
.
tmp_vec_primal
);
if
(
enableStokesMode
==
false
)
{
MatCreateShell
(
mpiCommGlobal
,
...
...
@@ -783,34 +781,15 @@ namespace AMDiS {
&
fetiData
,
&
mat_feti
);
MatShellSetOperation
(
mat_feti
,
MATOP_MULT
,
(
void
(
*
)(
void
))
petscMultMatFeti
);
}
else
{
MSG
(
"TEST A0
\n
"
);
fetiDataInterface
.
mat_interior_interface
=
getMatInteriorCoarseByComponent
(
2
);
MSG
(
"TEST A1
\n
"
);
fetiDataInterface
.
mat_interface_interior
=
getMatCoarseInteriorByComponent
(
2
);
MSG
(
"TEST A2
\n
"
);
fetiDataInterface
.
mat_primal_interface
=
getMatCoarse
(
0
,
1
);
fetiDataInterface
.
mat_interface_primal
=
getMatCoarse
(
1
,
0
);
MSG
(
"TEST A3
\n
"
);
}
else
{
MatCreateShell
(
mpiCommGlobal
,
interfaceDofMap
.
getRankDofs
()
+
lagrangeMap
.
getRankDofs
(),
interfaceDofMap
.
getRankDofs
()
+
lagrangeMap
.
getRankDofs
(),
interfaceDofMap
.
getOverallDofs
()
+
lagrangeMap
.
getOverallDofs
(),
interfaceDofMap
.
getOverallDofs
()
+
lagrangeMap
.
getOverallDofs
(),
&
fetiData
Interface
,
&
mat_feti
);
&
fetiData
,
&
mat_feti
);
MatShellSetOperation
(
mat_feti
,
MATOP_MULT
,
(
void
(
*
)(
void
))
petscMultMatFetiInterface
);
MSG
(
"TEST A2
\n
"
);
}
KSPCreate
(
mpiCommGlobal
,
&
ksp_feti
);
...
...
@@ -921,8 +900,6 @@ namespace AMDiS {
default:
break
;
}
MSG
(
"END A
\n
"
);
}
...
...
@@ -1476,8 +1453,8 @@ namespace AMDiS {
MatGetVecs
(
mat_lagrange
,
PETSC_NULL
,
&
vecRhsLagrange
);
MatGetVecs
(
mat_lagrange
,
PETSC_NULL
,
&
vecSolLagrange
);
vecRhsI
nterface
=
getVecRhsCoarseByComponent
(
2
);
vecSolI
nterface
=
getVecSolCoarseByComponent
(
2
);
i
nterface
DofMap
.
createVec
(
vecRhsInterface
);
i
nterface
DofMap
.
createVec
(
vecSolInterface
);
Vec
vecRhsArray
[
2
]
=
{
vecRhsInterface
,
vecRhsLagrange
};
VecCreateNest
(
mpiCommGlobal
,
2
,
PETSC_NULL
,
vecRhsArray
,
&
vecRhs
);
...
...
AMDiS/src/parallel/PetscSolverFeti.h
View file @
56f1d33d
...
...
@@ -262,9 +262,6 @@ namespace AMDiS {
/// Data for MatMult operation in matrix \ref mat_feti
FetiData
fetiData
;
/// Data for MatMult operation in matrix \ref mat_feti when using Stokes mode
FetiDataInterface
fetiDataInterface
;
/// Defines which preconditioner should be used to solve the reduced
/// FETI-DP system.
FetiPreconditioner
fetiPreconditioner
;
...
...
AMDiS/src/parallel/PetscSolverFetiOperators.cc
View file @
56f1d33d
...
...
@@ -87,11 +87,17 @@ namespace AMDiS {
double
wtime
=
MPI
::
Wtime
();
Vec
x_interface
,
x_lagrange
,
y_interface
,
y_lagrange
;
VecNestGetSubVec
(
x
,
0
,
&
x_interface
);
VecNestGetSubVec
(
x
,
1
,
&
x_lagrange
);
VecNestGetSubVec
(
y
,
0
,
&
y_interface
);
VecNestGetSubVec
(
y
,
1
,
&
y_lagrange
);
void
*
ctx
;
MatShellGetContext
(
mat
,
&
ctx
);
FetiData
Interface
*
data
=
static_cast
<
FetiData
Interface
*>
(
ctx
);
FetiData
*
data
=
static_cast
<
FetiData
*>
(
ctx
);
MatMultTranspose
(
*
(
data
->
mat_lagrange
),
x
,
data
->
tmp_vec_b
);
MatMultTranspose
(
*
(
data
->
mat_lagrange
),
x
_lagrange
,
data
->
tmp_vec_b
);
double
wtime01
=
MPI
::
Wtime
();
data
->
subSolver
->
solveGlobal
(
data
->
tmp_vec_b
,
data
->
tmp_vec_b
);
...
...
@@ -114,9 +120,9 @@ namespace AMDiS {
data
->
subSolver
->
solveGlobal
(
data
->
tmp_vec_b
,
data
->
tmp_vec_b
);
FetiTimings
::
fetiSolve01
+=
(
MPI
::
Wtime
()
-
wtime01
);
MatMult
(
*
(
data
->
mat_lagrange
),
data
->
tmp_vec_b
,
y
);
MatMult
(
*
(
data
->
mat_lagrange
),
data
->
tmp_vec_b
,
y
_lagrange
);
VecAXPBY
(
y
,
1.0
,
1.0
,
data
->
tmp_vec_lagrange
);
VecAXPBY
(
y
_lagrange
,
1.0
,
1.0
,
data
->
tmp_vec_lagrange
);
FetiTimings
::
fetiSolve
+=
(
MPI
::
Wtime
()
-
wtime
);
...
...
AMDiS/src/parallel/PetscSolverFetiStructs.h
View file @
56f1d33d
...
...
@@ -72,15 +72,6 @@ namespace AMDiS {
};
/// Extends the FETI-DP data set with interface variables (thus is used when
/// Stokes mode is enabled).
struct
FetiDataInterface
:
FetiData
{
Mat
mat_interior_interface
,
mat_interface_interior
;
Mat
mat_primal_interface
,
mat_interface_primal
;
};
struct
FetiDirichletPreconData
{
/// Matrix of scaled Lagrange variables.
Mat
*
mat_lagrange_scaled
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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