Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_NumericalJacobian.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_NumericalJacobian.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric Keiter
33 //
34 // Creation Date : 4/30/02
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.27 $
40 //
41 // Revision Date : $Date: 2014/03/19 17:23:27 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-------------------------------------------------------------------------
45 
46 #ifndef N_DEV_NUMERICAL_JACOBIAN_H
47 #define N_DEV_NUMERICAL_JACOBIAN_H
48 
49 // ---------- Standard Includes ----------
50 #include <list>
51 #include <vector>
52 #include <iosfwd>
53 
54 // ---------- Xyce Includes ----------
55 #include <N_UTL_Xyce.h>
56 #include <N_DEV_fwd.h>
57 
58 // ---------- Forward Declarations ----------
59 class index_pair;
60 
61 namespace Xyce {
62 namespace Device {
63 
64 class colData;
65 class valData;
66 
67 //-----------------------------------------------------------------------------
68 // Class : NumericalJacobian
69 // Purpose :
70 // Special Notes :
71 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
72 // Creation Date : 4/30/02
73 //-----------------------------------------------------------------------------
75 {
76 public:
78  MatrixLoadData & mlData1,
79  const SolverState &ss1,
80  const ExternData &ed1,
81  const DeviceOptions & do1);
82 
83  NumericalJacobian (const NumericalJacobian & right);
84 
86 
87  bool testDAEMatrices
88  ( DeviceInstance & instance, const std::vector<std::string> & nameVec);
89 
90  void loadLocalDAEVectors (DeviceInstance & instance);
91 
92  void printJacobian_
93  ( std::ostream & os,
94  DeviceInstance & instance,
95  const std::vector<std::string> & nameVec,
96  bool failed);
97 
98  void testDebugHead
99  ( DeviceInstance & instance,
100  const std::vector<std::string> & nameVec,
101  int i, double dX);
102 
103  void testDebugOut
104  ( DeviceInstance & instance,
105  const std::vector<std::string> & nameVec,
106  int i,int j);
107 
108  void testDebugTail
109  ( DeviceInstance & instance, const std::vector<std::string> & nameVec);
110 
111  void mergeTest ( DeviceInstance & instance, const std::vector<std::string> & nameVec);
112 
113 public:
115 
116  std::vector<int> & cols;
117  std::vector<double> & vals;
118  std::vector<double> & Qvals;
119 
120  std::vector<valData> & val_local;
121  std::vector<valData> & Qval_local;
122  std::vector<colData> & col_local;
123  std::vector<int> & row_local;
124  std::vector<int> & internalFlag;
125 
129 
130  int maxCols;
131 };
132 
133 } // namespace Device
134 } // namespace Xyce
135 
137 
138 #endif