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


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

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

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

68
    PetscSolver* subSolver;
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

    /// 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.
91 92 93
    Vec tmp_vec_interior;

    map<int, int> localToDualMap;
94 95 96 97 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.
    Vec tmp_vec_b;

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

    map<int, int> localToDualMap;
110 111 112 113 114 115 116 117 118 119 120 121
  };


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

}

#endif