MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
lapackwrap.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/libraries/libmbwrap/lapackwrap.h,v 1.19 2017/01/12 14:44:25 masarati Exp $ */
2 /*
3  * HmFe (C) is a FEM analysis code.
4  *
5  * Copyright (C) 1996-2017
6  *
7  * Marco Morandini <morandini@aero.polimi.it>
8  *
9  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
10  * via La Masa, 34 - 20156 Milano, Italy
11  * http://www.aero.polimi.it
12  *
13  * Changing this copyright notice is forbidden.
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17  *
18  */
19 /* December 2001
20  * Modified to add a matrix in row form and to implement methods
21  * to be used in the parallel MBDyn Solver.
22  *
23  * Copyright (C) 2001-2017
24  *
25  * Giuseppe Quaranta <quaranta@aero.polimi.it>
26  *
27  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
28  * via La Masa, 34 - 20156 Milano, Italy
29  * http://www.aero.polimi.it
30  *
31  */
32 /*
33  * MBDyn (C) is a multibody analysis code.
34  * http://www.mbdyn.org
35  *
36  * Copyright (C) 1996-2017
37  *
38  * Pierangelo Masarati <masarati@aero.polimi.it>
39  * Paolo Mantegazza <mantegazza@aero.polimi.it>
40  *
41  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
42  * via La Masa, 34 - 20156 Milano, Italy
43  * http://www.aero.polimi.it
44  *
45  * Changing this copyright notice is forbidden.
46  *
47  * This program is free software; you can redistribute it and/or modify
48  * it under the terms of the GNU General Public License as published by
49  * the Free Software Foundation (version 2 of the License).
50  *
51  *
52  * This program is distributed in the hope that it will be useful,
53  * but WITHOUT ANY WARRANTY; without even the implied warranty of
54  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55  * GNU General Public License for more details.
56  *
57  * You should have received a copy of the GNU General Public License
58  * along with this program; if not, write to the Free Software
59  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
60  */
61 
62 /*
63  * Lapack is used by permission; please read its Copyright,
64  * License and Availability note.
65  */
66 
67 #ifndef LapackSolutionManager_hh
68 #define LapackSolutionManager_hh
69 
70 #ifdef USE_LAPACK
71 
72 #include <iostream>
73 #include <vector>
74 
75 #include "myassert.h"
76 #include "mynewmem.h"
77 #include "ls.h"
78 #include "solman.h"
79 #include "fullmh.h"
80 
81 
82 /* LapackSolver - begin */
83 
84 class LapackSolver: public LinearSolver {
85 private:
86  integer iSize;
87  doublereal *pA;
88  doublereal *pB;
89  integer *piIPIV;
90 
91  void Factor(void);
92 
93 public:
94  LapackSolver(const integer &size, const doublereal &dPivot,
95  doublereal *pa, doublereal *pb);
96  ~LapackSolver(void);
97 
98  void Reset(void);
99  void Solve(void) const;
100 };
101 
102 /* LapackSolver - end */
103 
104 /* LapackSolutionManager - begin */
105 
106 class LapackSolutionManager: public SolutionManager {
107 protected:
108  mutable FullMatrixHandler A;
109 
110  mutable MyVectorHandler VH;
111 
112  /* Backward Substitution */
113  void BackSub(doublereal t_iniz = 0.);
114 
115 public:
116  LapackSolutionManager(integer Dim, doublereal dPivot = -1.);
117  virtual ~LapackSolutionManager(void);
118 #ifdef DEBUG
119  virtual void IsValid(void) const {
120  NO_OP;
121  };
122 #endif /* DEBUG */
123 
124  /* Inizializzatore generico */
125  virtual void MatrReset(void);
126 
127  /* Risolve il sistema Backward Substitution; fattorizza se necessario */
128  virtual void Solve(void);
129 
130  /* Rende disponibile l'handler per la matrice */
131  virtual MatrixHandler* pMatHdl(void) const;
132 
133  /* Rende disponibile l'handler per il termine noto */
134  virtual MyVectorHandler* pResHdl(void) const;
135 
136  /* Rende disponibile l'handler per la soluzione */
137  virtual MyVectorHandler* pSolHdl(void) const;
138 };
139 
140 /* LapackSolutionManager - end */
141 
142 #endif /* USE_LAPACK */
143 
144 #endif /* LapackSolutionManager_hh */
145 
virtual void Reset(void)
Definition: ls.cc:68
virtual VectorHandler * pResHdl(void) const =0
#define NO_OP
Definition: myassert.h:74
virtual MatrixHandler * pMatHdl(void) const =0
virtual void MatrReset(void)=0
virtual void Solve(void)=0
virtual void Solve(void) const =0
virtual VectorHandler * pSolHdl(void) const =0
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51