Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_MatrixLoadData.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2014 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_MatrixLoadData.h,v $
27 //
28 // Purpose :
29 //
30 //
31 // Special Notes :
32 //
33 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
34 //
35 // Creation Date : 04/30/02
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.18 $
41 //
42 // Revision Date : $Date: 2014/02/24 23:49:14 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-----------------------------------------------------------------------------
46 
47 
48 #ifndef Xyce_N_DEV_MatrixLoadData_h
49 #define Xyce_N_DEV_MatrixLoadData_h
50 
51 #include <vector>
52 
53 // ---------- Xyce Includes ----------
54 #include <N_UTL_Misc.h>
55 
56 namespace Xyce {
57 namespace Device {
58 
59 class colData;
60 class valData;
61 
62 //-----------------------------------------------------------------------------
63 // Class : MatrixLoadData
64 // Purpose :
65 // Special Notes :
66 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
67 // Creation Date : 4/30/02
68 //-----------------------------------------------------------------------------
70 {
71 public:
72  MatrixLoadData ();
73 
74  MatrixLoadData (const MatrixLoadData & right);
75 
76  ~MatrixLoadData ();
77 
78  bool initializeAll (int isizeTmp = 100);
79 
80  void resizeTestJacSolData(int size);
81  void resizeTestJacQData(int size);
82  void resizeTestJacStateData(int size);
83 
84 public:
85  int isize;
87 
88  // temporary jacobian load structures:
89  std::vector<int> cols;
90  std::vector<double> vals;
91  std::vector<double> Qvals;
92 
93  // temporary numerical jacobian load structures:
94  std::vector<valData> val_local;
95  std::vector<valData> Qval_local;
96  std::vector<colData> col_local;
97  std::vector<int> row_local;
98  std::vector<int> internalFlag;
99 
100  // Structures used by the "testJacobian" function.
101  std::vector<std::vector<double> > numJac;
102  std::vector< std::vector<double> > saveJac;
103  std::vector< std::vector<double> > devJac;
104  std::vector< std::vector<double> > diffJac;
105  std::vector< std::vector<double> > relJac;
106 
107  std::vector<std::vector<double> > numJacQ;
108  std::vector< std::vector<double> > saveJacQ;
109  std::vector< std::vector<double> > devJacQ;
110  std::vector< std::vector<double> > diffJacQ;
111  std::vector< std::vector<double> > relJacQ;
112 
113  std::vector<std::vector<int> > status;
114  std::vector<std::vector<int> > stencil;
115  std::vector<std::vector<int> > statusQ;
116 
117  std::vector<double> saveRHS;
118  std::vector<double> pertRHS;
119  std::vector<double> origRHS;
120  std::vector<double> saveQ;
121  std::vector<double> pertQ;
122  std::vector<double> origQ;
123 
124  std::vector<double> saveSoln;
125  std::vector<double> pertSoln;
126  std::vector<double> saveCurrSoln;
127 
128  std::vector<double> saveLastState;
129  std::vector<double> saveCurrState;
130  std::vector<double> saveNextState;
131  std::vector<double> saveStateDerivs;
132 };
133 
134 //-----------------------------------------------------------------------------
135 // Class : colData
136 // Purpose : This class contains a vector of column indices.
137 // Special Notes :
138 // Creator : Eric Keiter
139 // Creation Date : 04/23/02
140 //-----------------------------------------------------------------------------
141 class colData
142 {
143 public:
144  colData (int isizeTmp = 100):
145  isize(isizeTmp), col()
146  { col.reserve(isizeTmp); }
147 
148 public:
149  int isize;
150  std::vector<int> col;
151 };
152 
153 //-----------------------------------------------------------------------------
154 // Class : valData
155 // Purpose : This class contains a vector of value indices.
156 // Special Notes :
157 // Creator : Eric Keiter
158 // Creation Date : 04/30/02
159 //-----------------------------------------------------------------------------
160 class valData
161 {
162 private:
163 protected:
164 public:
165  valData (int isizeTmp = 100):
166  isize(isizeTmp), val() { val.reserve(isizeTmp); }
167 
168 private:
169 protected:
170 public:
171  int isize;
172  std::vector<double> val;
173 };
174 
175 } // namespace Device
176 } // namespace Xyce
177 
179 
180 #endif
181