PetscSolverFetiStructs.h 3.15 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ==  http://www.amdis-fem.org                                              ==
// ==                                                                        ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.



/** \file PetscSolverFetiStructs.h */

#ifndef AMDIS_PETSC_SOLVER_FETI_STRUCTS_H
#define AMDIS_PETSC_SOLVER_FETI_STRUCTS_H

namespace AMDiS {

  class PetscSolverFeti;

  /** \brief
   * This structure is used when defining the MatShell operation for solving 
   * primal schur complement. \ref petscMultMatSchurPrimal
   */
  struct SchurPrimalData {
    /// Pointers to the matrix containing the primal variables.
    Mat *mat_primal_primal;
   
    /// Coupling matrices between the primal and the B variables.
    Mat *mat_primal_b, *mat_b_primal;

    /// Temporal vector on the B variables.
    Vec tmp_vec_b;

    /// Temporal vecor in the primal variables.
    Vec tmp_vec_primal;

    PetscSolverFeti *fetiSolver;
  };


  /** \brief
   * This structure is used when defining the FETI-DP operator for solving 
   * the system matrix reduced to the Lagrange multipliers.
   * \ref petscMultMatFeti
   */
  struct FetiData {
    /// Coupling matrices between the primal and the B variables.
    Mat *mat_primal_b, *mat_b_primal;

    /// Matrix of Lagrange variables.
    Mat *mat_lagrange;

    /// Temporal vectors on the B variables.
    Vec tmp_vec_b;

    /// Temporal vector on the primal variables.
    Vec tmp_vec_primal;

    /// Temporal vector on the lagrange variables.
    Vec tmp_vec_lagrange;

    PetscSolverFeti *fetiSolver;

    /// Pointer to the solver of the schur complement on the primal variables.
    KSP *ksp_schur_primal;
  };


  struct FetiDirichletPreconData {
    /// Matrix of scaled Lagrange variables.
    Mat *mat_lagrange_scaled;

    Mat *mat_interior_interior, *mat_duals_duals, *mat_interior_duals, *mat_duals_interior;

    /// Pointer to the solver for \ref PetscSolverFeti::mat_bb.
    KSP *ksp_interior;

    /// Temporal vector on the B variables.
    Vec tmp_vec_b;

    /// Temporal vector on the dual variables.
    Vec tmp_vec_duals0, tmp_vec_duals1;
    
    /// Temporal vector on the interior variables.
    Vec tmp_vec_interior;    
  };


  struct FetiLumpedPreconData {
    /// Matrix of scaled Lagrange variables.
    Mat *mat_lagrange_scaled;

    Mat *mat_duals_duals;

    /// Temporal vector on the B variables.
    Vec tmp_vec_b;

    /// Temporal vector on the dual variables.
    Vec tmp_vec_duals0, tmp_vec_duals1;
  };


  typedef enum {
    FETI_NONE = 0,
    FETI_DIRICHLET = 1,
    FETI_LUMPED = 2
  } FetiPreconditioner;

}

#endif