PetscSolverSchur.h 2.38 KB
Newer Older
Thomas Witkowski's avatar
Thomas Witkowski committed
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
// ============================================================================
// ==                                                                        ==
// == 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 PetscSolverSchur.h */

#include "parallel/PetscSolver.h"

#ifndef AMDIS_PETSC_SOLVER_SCHUR_H
#define AMDIS_PETSC_SOLVER_SCHUR_H

namespace AMDiS {

  using namespace std;


#ifdef HAVE_PETSC_DEV
  class PetscSolverSchur : public PetscSolver
  {
  public:
    PetscSolverSchur() 
      : PetscSolver()
    {}

41
42
43
    void fillPetscMatrix(Matrix<DOFMatrix*> *mat);

    void fillPetscRhs(SystemVector *vec);
Thomas Witkowski's avatar
Thomas Witkowski committed
44
45
46

    void solvePetscMatrix(SystemVector &vec, AdaptInfo *adaptInfo);

47
48
49
    void destroyMatrixData()
    {}

Thomas Witkowski's avatar
Thomas Witkowski committed
50
51
    Flag getBoundaryDofRequirement()
    {
52
53
54
      return 
	MeshDistributor::BOUNDARY_SUBOBJ_SORTED |
	MeshDistributor::BOUNDARY_FILL_INFO_SEND_DOFS;
Thomas Witkowski's avatar
Thomas Witkowski committed
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
    }
    
  protected:
    void updateDofData(int nComponents);

    /// Takes a DOF matrix and sends the values to the global PETSc matrix.
    void setDofMatrix(DOFMatrix* mat, int dispMult = 1, 
		      int dispAddRow = 0, int dispAddCol = 0);

    /// Takes a DOF vector and sends its values to a given PETSc vector.
    void setDofVector(Vec& petscVec, DOFVector<double>* vec, 
		      int disMult = 1, int dispAdd = 0, bool rankOnly = false);

  protected:
    int nBoundaryDofs;

    int rStartBoundaryDofs;

    int nOverallBoundaryDofs;

    std::set<DegreeOfFreedom> boundaryDofs;

    map<DegreeOfFreedom, DegreeOfFreedom> mapGlobalBoundaryDof;

    int nInteriorDofs;

    int rStartInteriorDofs;

    int nOverallInteriorDofs;

    std::set<DegreeOfFreedom> interiorDofs;    

    map<DegreeOfFreedom, DegreeOfFreedom> mapGlobalInteriorDof;

    Mat matA11, matA12, matA21, matA22;

    IS interiorIs, boundaryIs;
  };
#endif

}

#endif