PetscSolverFetiStructs.h 3.65 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
  /** \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;
66
67

    bool nestedVec;
68
69
70
  };


71
72
73
74
75
76
77
78
79
  /** \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;

80
81
82
    ///
    Mat *mat_augmented_lagrange;

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

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
92
93
    Vec tmp_vec_interface;

94
    PetscSolver* subSolver;
95
96
97
98

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


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

105
106
107
    Mat *mat_interior_interior, *mat_duals_duals;

    Mat *mat_interior_duals, *mat_duals_interior;
108
109
110
111
112
113
114
115
116
117
118

    /// 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.
119
120
121
    Vec tmp_vec_interior;

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


  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
132
    Vec tmp_vec_b0;
133
134
135

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

    map<int, int> localToDualMap;
138
139
140
  };


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

    PetscSolver* subSolver;
146
147

    Vec h2vec;
Thomas Witkowski's avatar
Thomas Witkowski committed
148
149

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

151
    KSP ksp_mass;
Thomas Witkowski's avatar
Thomas Witkowski committed
152
153
154
  };


155
156
157
158
  struct FetiKspData {
    Vec draft;
  };

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

}

#endif