Am Montag, 16. Mai 2022, finden Wartungsarbeiten am Gitlab-Server (Update auf neue Version statt). Der Dienst wird daher am Montag für einige Zeit nicht verfügbar sein.
On Monday, May 16th 2022, the Gitlab server will be updated. The service will therefore not be accessible for some time on Monday.

Commit 56f1d33d authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

And more work on FETI-DP Stokes.

parent 1a2d274f
......@@ -762,17 +762,15 @@ namespace AMDiS {
{
FUNCNAME("PetscSolverFeti::createFetiKsp()");
MSG("START A\n");
// === Create FETI-DP solver object. ===
FetiData &data = (!enableStokesMode ? fetiData : fetiDataInterface);
data.mat_lagrange = &mat_lagrange;
data.subSolver = subdomain;
data.ksp_schur_primal = &ksp_schur_primal;
localDofMap.createVec(data.tmp_vec_b, nGlobalOverallInterior);
lagrangeMap.createVec(data.tmp_vec_lagrange);
primalDofMap.createVec(data.tmp_vec_primal);
fetiData.mat_lagrange = &mat_lagrange;
fetiData.subSolver = subdomain;
fetiData.ksp_schur_primal = &ksp_schur_primal;
localDofMap.createVec(fetiData.tmp_vec_b, nGlobalOverallInterior);
lagrangeMap.createVec(fetiData.tmp_vec_lagrange);
primalDofMap.createVec(fetiData.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(),
&fetiDataInterface, &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);
vecRhsInterface = getVecRhsCoarseByComponent(2);
vecSolInterface = getVecSolCoarseByComponent(2);
interfaceDofMap.createVec(vecRhsInterface);
interfaceDofMap.createVec(vecSolInterface);
Vec vecRhsArray[2] = {vecRhsInterface, vecRhsLagrange};
VecCreateNest(mpiCommGlobal, 2, PETSC_NULL, vecRhsArray, &vecRhs);
......
......@@ -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;
......
......@@ -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);
FetiDataInterface* data = static_cast<FetiDataInterface*>(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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment