Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_NLS_ConductanceExtractor.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_NLS_ConductanceExtractor.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 03/03/06
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.20 $
40 //
41 // Revision Date : $Date: 2014/08/07 23:08:54 $
42 //
43 // Current Owner : $Author: dgbaur $
44 //-------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_NLS_ConductanceExtractor_h
47 #define Xyce_N_NLS_ConductanceExtractor_h
48 
49 // ---------- Standard Includes ----------
50 #include <vector>
51 
52 #include <Teuchos_RefCountPtr.hpp>
53 using Teuchos::RefCountPtr;
54 using Teuchos::rcp;
55 
56 #include <N_IO_fwd.h>
57 
58 #include <N_NLS_NonLinearSolver.h>
59 
60 class N_PDS_ParMap;
61 
62 namespace Xyce {
63 namespace Nonlinear {
64 
65 //-----------------------------------------------------------------------------
66 // Class : ConductanceExtractor
67 // Purpose :
68 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
69 // Creation Date : 03/03/06
70 //-----------------------------------------------------------------------------
71 
73 {
74 public:
76  N_TOP_Topology & top_,
77  N_IO_CmdParse & cp);
78 
80 
81  bool extract (
82  const std::map<std::string,double> & inputMap,
83  std::vector<double> & outputVector,
84  std::vector< std::vector<double> > & jacobian );
85 
86  bool extract (
87  const std::string & isoName,
88  std::vector< std::vector<double> > & jacobian );
89 
90 
91  bool setOptions(const N_UTL_OptionBlock& OB);
92 
93  // Method to register the package options manager
94  bool registerPkgOptionsMgr( N_IO_PkgOptionsMgr *pkgOptPtr );
95 
96 protected:
97 private:
98  bool setupIDs_( const std::map<std::string,double> & inputMap);
99  bool setup_dIdX_Vectors_();
100 
101  bool setupISO2_IDs_(const std::string & isoName);
102 
103  void printJacobian_ (
104  const std::map<std::string,double> & inputMap,
105  std::vector< std::vector<double> > & jacobian);
106 
107  void printPetraObjects_ (const std::string & varName);
108 
109  struct ConductanceExtractor_OptionsReg : public N_IO_PkgOptionsReg
110  {
112  : CE(ce)
113  {}
114 
115  bool operator()( const N_UTL_OptionBlock & options )
116  { return CE->setOptions( options ); }
117 
119  };
120 
121 public:
122 protected:
123 private:
126 
127  // temporary stuff, for use with iso devices:
128  std::map<std::string, double> varMap_;
129 
130  // GID variables
132  std::vector<int> currentGIDs_;
133  std::vector<int> currentLIDs_;
134  std::vector<int> vsrcPosGIDs_;
135  std::vector<int> vsrcPosLIDs_;
136 
137  // package references:
139  N_TOP_Topology & top_;
140  N_IO_CmdParse & commandLine_;
141  // package options manager
142  N_IO_PkgOptionsMgr * pkgOptMgrPtr_;
143 
144  // linear system data:
145  N_LAS_System * lasSysPtr_;
147  N_LOA_Loader * loaderPtr_;
148  N_LAS_Vector * rhsVectorPtr_;
149  N_LAS_Vector * dfdvVectorPtr_;
150  N_LAS_Vector * NewtonVectorPtr_;
151  N_LAS_Vector * dxdvVectorPtr_;
152  N_LAS_Solver * lasSolverPtr_;
153 
154  N_LAS_Vector * matrixDiagonalPtr_;
155 
156  std::vector<N_LAS_Vector*> dIdxPtrVector_;
157 
158  N_LAS_Matrix * jacobianMatrixPtr_;
159  N_LAS_Vector ** nextSolVectorPtrPtr_;
160  N_LAS_Vector ** currSolVectorPtrPtr_;
161  N_LAS_Vector * savedRHSVectorPtr_;
162  N_LAS_Vector * savedNewtonVectorPtr_;
163  N_LAS_Vector * gradVectorPtr_;
164 
165  N_LAS_Vector * columnVectorPtr_;
166  N_PDS_ParMap * columnMapPtr_;
167 };
168 
169 } // namespace Nonlinear
170 } // namespace Xyce
171 
173 
174 #endif
175