PetscTypes.h 1.6 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
 * Authors: 
 * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * This file is part of AMDiS
 *
 * See also license.opensource.txt in the distribution.
 * 
 ******************************************************************************/


#ifndef AMDIS_PETSCTYPES_H
#define AMDIS_PETSCTYPES_H

#include <vector>
#include <petsc.h>
#include <petscmat.h> 
#include <petscvec.h>
 
namespace AMDiS {
  
  /// pair of nested matrices and blockmatrix
  struct PetscMatrix
  {
    PetscMatrix() : matrix(PETSC_NULL) {}
    
    std::vector<Mat> nestMat;
    Mat matrix;
    
    void destroy();
  };
  
  
  /// pair of nested vectors and blockvector
  struct PetscVector
  {
    PetscVector() : vector(PETSC_NULL), createNestedVector(false) {}
    
    std::vector<Vec> nestVec;
    Vec vector;
    
    void destroy();
    bool createNestedVector;
  };
  
  
  /// structure for parameter mapping
  struct PetscParameters
  {
    std::map<std::string,bool> matSolverPackage;
    std::map<std::string,std::string> solverMap;
    std::map<std::string,std::string> preconMap;
    std::map<std::string,bool> emptyParam;
    
    PetscParameters();
  };

}

#endif // AMDIS_PETSCTYPES_H