Skip to content
Snippets Groups Projects
Commit 2eeb5654 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Work on FETI-DP method.

parent 3509ab94
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,6 @@ namespace AMDiS { ...@@ -89,7 +89,6 @@ namespace AMDiS {
petscSolver->fillPetscRhs(rhs); petscSolver->fillPetscRhs(rhs);
#if 0 #if 0
processMemUsage(vm, rss); processMemUsage(vm, rss);
MSG("STAGE 2\n"); MSG("STAGE 2\n");
......
This diff is collapsed.
...@@ -33,6 +33,8 @@ namespace AMDiS { ...@@ -33,6 +33,8 @@ namespace AMDiS {
#ifdef HAVE_PETSC_DEV #ifdef HAVE_PETSC_DEV
class PetscSolverFeti;
/** \brief /** \brief
* This structure is used when defining the MatShell operation for solving * This structure is used when defining the MatShell operation for solving
* primal schur complement. \ref petscMultMatSchurPrimal * primal schur complement. \ref petscMultMatSchurPrimal
...@@ -50,8 +52,7 @@ namespace AMDiS { ...@@ -50,8 +52,7 @@ namespace AMDiS {
/// Temporal vecor in the primal variables. /// Temporal vecor in the primal variables.
Vec tmp_vec_primal; Vec tmp_vec_primal;
/// Pointer to the solver for \ref PetscSolverFeti::mat_bb. PetscSolverFeti *fetiSolver;
KSP *ksp_b;
}; };
...@@ -76,8 +77,7 @@ namespace AMDiS { ...@@ -76,8 +77,7 @@ namespace AMDiS {
/// Temporal vector on the primal variables. /// Temporal vector on the primal variables.
Vec tmp_vec_primal; Vec tmp_vec_primal;
/// Pointer to the solver for \ref PetscSolverFeti::mat_bb. PetscSolverFeti *fetiSolver;
KSP *ksp_b;
/// Pointer to the solver of the schur complement on the primal variables. /// Pointer to the solver of the schur complement on the primal variables.
KSP *ksp_schur_primal; KSP *ksp_schur_primal;
...@@ -125,6 +125,34 @@ namespace AMDiS { ...@@ -125,6 +125,34 @@ namespace AMDiS {
} FetiPreconditioner; } FetiPreconditioner;
struct FetiStatisticsData
{
/// Number of application of the FETI-DP operator.
int nFetiApply;
/// Time for solving the reduced FETI system.
double timeFetiApply;
/// Number of application of the Schur primal operator.
int nSchurPrimalApply;
/// Time for appling the Schur primal operator.
double timeSchurPrimalApply;
/// Number of solution of the Schur primal system.
int nSchurPrimalSolve;
/// Time for solving the Schur primal system.
double timeSchurPrimalSolve;
/// Number of solution of the local subdomain problems.
int nLocalSolve;
/// Time for solving the local subdomain problems.
double timeLocalSolve;
};
/** \brief /** \brief
* FETI-DP implementation based on PETSc. * FETI-DP implementation based on PETSc.
*/ */
...@@ -156,6 +184,8 @@ namespace AMDiS { ...@@ -156,6 +184,8 @@ namespace AMDiS {
MeshDistributor::BOUNDARY_FILL_INFO_RECV_DOFS; MeshDistributor::BOUNDARY_FILL_INFO_RECV_DOFS;
} }
void solveLocalProblem(Vec &rhs, Vec &sol);
protected: protected:
/// After mesh changes, or if the solver is called the first time, this /// After mesh changes, or if the solver is called the first time, this
/// function creates all matrix and vector objects with the approriated /// function creates all matrix and vector objects with the approriated
...@@ -212,15 +242,6 @@ namespace AMDiS { ...@@ -212,15 +242,6 @@ namespace AMDiS {
Vec &vec_sol_primal, Vec &vec_sol_primal,
SystemVector &vec); SystemVector &vec);
/** \brief
* Solves the FETI-DP system globally, thus without reducing it to the
* Lagrange multipliers. This should be used for debugging only to test
* if the FETI-DP system is setup correctly.
*
* \param[out] vec Solution DOF vectors.
*/
void solveFetiMatrix(SystemVector &vec);
/** \brief /** \brief
* Solves the FETI-DP system with reducing it first to the Lagrange * Solves the FETI-DP system with reducing it first to the Lagrange
* multipliers. This is what one expects when using the FETI-DP methid :) * multipliers. This is what one expects when using the FETI-DP methid :)
...@@ -229,6 +250,10 @@ namespace AMDiS { ...@@ -229,6 +250,10 @@ namespace AMDiS {
*/ */
void solveReducedFetiMatrix(SystemVector &vec); void solveReducedFetiMatrix(SystemVector &vec);
void resetStatistics();
void printStatistics();
protected: protected:
/// Number of components in the PDE to be solved. /// Number of components in the PDE to be solved.
int nComponents; int nComponents;
...@@ -262,7 +287,7 @@ namespace AMDiS { ...@@ -262,7 +287,7 @@ namespace AMDiS {
/// Index for each non primal variables to the global index of /// Index for each non primal variables to the global index of
/// B variables. /// B variables.
DofMapping globalIndexB; DofMapping globalIndexB, localIndexB;
/// Number of non primal, thus B, variables on rank and globally. /// Number of non primal, thus B, variables on rank and globally.
int nRankB, nOverallB, rStartB; int nRankB, nOverallB, rStartB;
...@@ -287,6 +312,11 @@ namespace AMDiS { ...@@ -287,6 +312,11 @@ namespace AMDiS {
/// variables, \ref mat_b_b /// variables, \ref mat_b_b
KSP ksp_b; KSP ksp_b;
/// 0: Solve the Schur complement on primal variables with iterative solver.
/// 1: Create the Schur complement matrix explicitly and solve it with a
/// direct solver.
int schurPrimalSolver;
/// PETSc solver object to solve the Schur complement on the /// PETSc solver object to solve the Schur complement on the
/// primal variables. /// primal variables.
KSP ksp_schur_primal; KSP ksp_schur_primal;
...@@ -329,6 +359,9 @@ namespace AMDiS { ...@@ -329,6 +359,9 @@ namespace AMDiS {
// Number of local nodes that are duals. // Number of local nodes that are duals.
int nLocalDuals; int nLocalDuals;
public:
static FetiStatisticsData fetiStatistics;
}; };
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment