PetscTypes.h 1.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
26
27
28
/******************************************************************************
 *
 * 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>
29
30
31
#include <map>
#include <string>

32
33
34
35
36
namespace AMDiS {
  
  /// pair of nested matrices and blockmatrix
  struct PetscMatrix
  {
37
38
39
40
    PetscMatrix() : 
	 matrix(PETSC_NULL),
	 isNested(false)
	  {}
41
42
43
44
45
    
    std::vector<Mat> nestMat;
    Mat matrix;
    
    void destroy();
46
    bool isNested;
47
48
49
50
51
52
  };
  
  
  /// pair of nested vectors and blockvector
  struct PetscVector
  {
53
    PetscVector() : vector(PETSC_NULL), isNested(false) {}
54
55
56
57
58
    
    std::vector<Vec> nestVec;
    Vec vector;
    
    void destroy();
59
    bool isNested;
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  };
  
  
  /// 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