PetscSolverFetiStructs.h 3.63 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
// ============================================================================
// ==                                                                        ==
// == 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

26
#include <map>
27
#include "parallel/PetscSolver.h"
28

29
30
namespace AMDiS {

31
32
  using namespace std;

33
34
35
36
37
38
39
40
41
42
43
44
45
  class PetscSolverFeti;

  /** \brief
   * This structure is used when defining the MatShell operation for solving 
   * primal schur complement. \ref petscMultMatSchurPrimal
   */
  struct SchurPrimalData {
    /// Temporal vector on the B variables.
    Vec tmp_vec_b;

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

46
    PetscSolver* subSolver;
47
48
49
  };


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  /** \brief
   *
   */
  struct SchurPrimalAugmentedData {
    /// Temporal vectors on the B variables.
    Vec tmp_vec_b0, tmp_vec_b1;

    Vec tmp_vec_primal;

    Vec tmp_vec_lagrange;

    Mat *mat_lagrange;

    Mat *mat_augmented_lagrange;

    PetscSolver* subSolver;
  };


69
70
71
72
73
74
75
76
77
  /** \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 {
    /// Matrix of Lagrange variables.
    Mat *mat_lagrange;

78
79
80
    ///
    Mat *mat_augmented_lagrange;

81
    /// Temporal vectors on the B variables.
Thomas Witkowski's avatar
Thomas Witkowski committed
82
    Vec tmp_vec_b0, tmp_vec_b1;
83
84

    /// Temporal vector on the primal variables.
Thomas Witkowski's avatar
Thomas Witkowski committed
85
    Vec tmp_vec_primal0, tmp_vec_primal1;
86
87
88
89

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

Thomas Witkowski's avatar
Thomas Witkowski committed
90
91
    Vec tmp_vec_interface;

92
    PetscSolver* subSolver;
93
94
95
96

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


99
100
101
102
  struct FetiDirichletPreconData {
    /// Matrix of scaled Lagrange variables.
    Mat *mat_lagrange_scaled;

103
104
105
    Mat *mat_interior_interior, *mat_duals_duals;

    Mat *mat_interior_duals, *mat_duals_interior;
106
107
108
109
110
111
112
113
114
115
116

    /// 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.
117
118
119
    Vec tmp_vec_interior;

    map<int, int> localToDualMap;
120
121
122
123
124
125
126
127
128
129
  };


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

    Mat *mat_duals_duals;

    /// Temporal vector on the B variables.
Thomas Witkowski's avatar
Thomas Witkowski committed
130
    Vec tmp_vec_b0;
131
132
133

    /// Temporal vector on the dual variables.
    Vec tmp_vec_duals0, tmp_vec_duals1;
Thomas Witkowski's avatar
Thomas Witkowski committed
134
135

    map<int, int> localToDualMap;
136
137
138
  };


Thomas Witkowski's avatar
Thomas Witkowski committed
139
140
141
142
143
  struct FetiInterfaceLumpedPreconData : public FetiLumpedPreconData {
    /// Temporal vectors on the B variables.
    Vec tmp_vec_b1;

    PetscSolver* subSolver;
144
145

    Vec h2vec;
Thomas Witkowski's avatar
Thomas Witkowski committed
146
147

    Vec tmp_primal;
Thomas Witkowski's avatar
Thomas Witkowski committed
148

149
    KSP ksp_mass;
Thomas Witkowski's avatar
Thomas Witkowski committed
150
151
152
  };


153
154
155
156
  struct FetiKspData {
    Vec draft;
  };

157
158
159
160
161
162
163
164
165
  typedef enum {
    FETI_NONE = 0,
    FETI_DIRICHLET = 1,
    FETI_LUMPED = 2
  } FetiPreconditioner;

}

#endif