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.18 $
40 //
41 // Revision Date : $Date: 2014/02/24 23:49:24 $
42 //
43 // Current Owner : $Author: tvrusso $
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 //-----------------------------------------------------------------------------
63 // Class : N_NLS_ConductanceExtractor
64 // Purpose :
65 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
66 // Creation Date : 03/03/06
67 //-----------------------------------------------------------------------------
68 
70 {
71 public:
73  N_TOP_Topology & top_,
74  N_IO_CmdParse & cp);
75 
77 
78  bool extract (
79  const std::map<std::string,double> & inputMap,
80  std::vector<double> & outputVector,
81  std::vector< std::vector<double> > & jacobian );
82 
83  bool extract (
84  const std::string & isoName,
85  std::vector< std::vector<double> > & jacobian );
86 
87 
88  bool setOptions(const N_UTL_OptionBlock& OB);
89 
90  // Method to register the package options manager
91  bool registerPkgOptionsMgr( N_IO_PkgOptionsMgr *pkgOptPtr );
92 
93 protected:
94 private:
95  bool setupIDs_( const std::map<std::string,double> & inputMap);
96  bool setup_dIdX_Vectors_();
97 
98  bool setupISO2_IDs_(const std::string & isoName);
99 
100  void printJacobian_ (
101  const std::map<std::string,double> & inputMap,
102  std::vector< std::vector<double> > & jacobian);
103 
104  void printPetraObjects_ (const std::string & varName);
105 
106  struct N_NLS_ConductanceExtractor_OptionsReg : public N_IO_PkgOptionsReg
107  {
109  : CE(ce)
110  {}
111 
112  bool operator()( const N_UTL_OptionBlock & options )
113  { return CE->setOptions( options ); }
114 
116  };
117 
118 public:
119 protected:
120 private:
123 
124  // temporary stuff, for use with iso devices:
125  std::map<std::string, double> varMap_;
126 
127  // GID variables
129  std::vector<int> currentGIDs_;
130  std::vector<int> currentLIDs_;
131  std::vector<int> vsrcPosGIDs_;
132  std::vector<int> vsrcPosLIDs_;
133 
134  // package references:
136  N_TOP_Topology & top_;
137  N_IO_CmdParse & commandLine_;
138  // package options manager
139  N_IO_PkgOptionsMgr * pkgOptMgrPtr_;
140 
141  // linear system data:
142  N_LAS_System * lasSysPtr_;
144  N_LOA_Loader * loaderPtr_;
145  N_LAS_Vector * rhsVectorPtr_;
146  N_LAS_Vector * dfdvVectorPtr_;
147  N_LAS_Vector * NewtonVectorPtr_;
148  N_LAS_Vector * dxdvVectorPtr_;
149  N_LAS_Solver * lasSolverPtr_;
150 
151  N_LAS_Vector * matrixDiagonalPtr_;
152 
153  std::vector<N_LAS_Vector*> dIdxPtrVector_;
154 
155  N_LAS_Matrix * jacobianMatrixPtr_;
156  N_LAS_Vector ** nextSolVectorPtrPtr_;
157  N_LAS_Vector ** currSolVectorPtrPtr_;
158  N_LAS_Vector * savedRHSVectorPtr_;
159  N_LAS_Vector * savedNewtonVectorPtr_;
160  N_LAS_Vector * gradVectorPtr_;
161 
162  N_LAS_Vector * columnVectorPtr_;
163  N_PDS_ParMap * columnMapPtr_;
164 };
165 
166 #endif
167