PetscSolverFetiStructs.h 3.21 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
  };


  /** \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;

    /// Temporal vectors on the B variables.
Thomas Witkowski's avatar
Thomas Witkowski committed
60
    Vec tmp_vec_b0, tmp_vec_b1;
61 62

    /// Temporal vector on the primal variables.
Thomas Witkowski's avatar
Thomas Witkowski committed
63
    Vec tmp_vec_primal0, tmp_vec_primal1;
64 65 66 67

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

Thomas Witkowski's avatar
Thomas Witkowski committed
68 69
    Vec tmp_vec_interface;

70
    PetscSolver* subSolver;
71 72 73 74

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


77 78 79 80
  struct FetiDirichletPreconData {
    /// Matrix of scaled Lagrange variables.
    Mat *mat_lagrange_scaled;

81 82 83
    Mat *mat_interior_interior, *mat_duals_duals;

    Mat *mat_interior_duals, *mat_duals_interior;
84 85 86 87 88 89 90 91 92 93 94

    /// 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.
95 96 97
    Vec tmp_vec_interior;

    map<int, int> localToDualMap;
98 99 100 101 102 103 104 105 106 107
  };


  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
108
    Vec tmp_vec_b0;
109 110 111

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

    map<int, int> localToDualMap;
114 115 116
  };


Thomas Witkowski's avatar
Thomas Witkowski committed
117 118 119 120 121 122 123 124
  struct FetiInterfaceLumpedPreconData : public FetiLumpedPreconData {
    /// Temporal vectors on the B variables.
    Vec tmp_vec_b1;

    PetscSolver* subSolver;
  };


125 126 127 128 129 130 131 132 133
  typedef enum {
    FETI_NONE = 0,
    FETI_DIRICHLET = 1,
    FETI_LUMPED = 2
  } FetiPreconditioner;

}

#endif