Xyce  6.1
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-2015 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.33 $
40 //
41 // Revision Date : $Date: 2015/04/08 19:18:29 $
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 <N_IO_fwd.h>
53 
54 #include <N_NLS_NonLinearSolver.h>
56 
57 class N_PDS_ParMap;
58 
59 namespace Xyce {
60 namespace Nonlinear {
61 
62 //-----------------------------------------------------------------------------
63 // Class : ConductanceExtractor
64 // Purpose :
65 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
66 // Creation Date : 03/03/06
67 //-----------------------------------------------------------------------------
68 
70 {
71 public:
72  ConductanceExtractor (NonLinearSolver &nonlinear_solver, Topo::Topology & topology);
73 
75 
76  bool extract(
77  const std::map<std::string,double> & inputMap,
78  std::vector<double> & outputVector,
79  std::vector< std::vector<double> > & jacobian);
80 
81  bool extract (
82  const std::string & isoName,
83  std::vector< std::vector<double> > & jacobian );
84 
85 
86  bool setOptions(const Util::OptionBlock& OB);
87 
88 private:
89  bool setupIDs_( const std::map<std::string, double> & inputMap);
90  bool setup_dIdX_Vectors_();
91 
92  bool setupISO2_IDs_(const std::string & isoName);
93 
94  void printJacobian_ (
95  const std::map<std::string,double> & inputMap,
96  std::vector< std::vector<double> > & jacobian);
97 
98  void printPetraObjects_ (const std::string & varName);
99 
100 private:
102 
103  // temporary stuff, for use with iso devices:
104  std::map<std::string, double> varMap_;
105 
106  // GID variables
108  std::vector<int> currentGIDs_;
109  std::vector<int> currentLIDs_;
110  std::vector<int> vsrcPosGIDs_;
111  std::vector<int> vsrcPosLIDs_;
112 
113  // package references:
115  Topo::Topology & top_;
116 
117  // linear system data:
118  Linear::System * lasSysPtr_;
120  Linear::Vector * rhsVectorPtr_;
121  Linear::Vector * dfdvVectorPtr_;
122  Linear::Vector * NewtonVectorPtr_;
123  Linear::Vector * dxdvVectorPtr_;
124  Linear::Solver * lasSolverPtr_;
125 
126  Linear::Vector * matrixDiagonalPtr_;
127 
128  std::vector<Linear::Vector*> dIdxPtrVector_;
129 
130  Linear::Matrix * jacobianMatrixPtr_;
131  Linear::Vector ** nextSolVectorPtrPtr_;
132  Linear::Vector ** currSolVectorPtrPtr_;
133  Linear::Vector * savedRHSVectorPtr_;
134  Linear::Vector * savedNewtonVectorPtr_;
135  Linear::Vector * gradVectorPtr_;
136 
137  Linear::Vector * columnVectorPtr_;
138  N_PDS_ParMap * columnMapPtr_;
139 };
140 
141 } // namespace Nonlinear
142 } // namespace Xyce
143 
144 #endif
145 
void printJacobian_(const std::map< std::string, double > &inputMap, std::vector< std::vector< double > > &jacobian)
Pure virtual class to augment a linear system.
Loader::NonlinearEquationLoader * loaderPtr_
bool extract(const std::map< std::string, double > &inputMap, std::vector< double > &outputVector, std::vector< std::vector< double > > &jacobian)
ConductanceExtractor(NonLinearSolver &nonlinear_solver, Topo::Topology &topology)
bool setOptions(const Util::OptionBlock &OB)
bool setupIDs_(const std::map< std::string, double > &inputMap)
std::vector< Linear::Vector * > dIdxPtrVector_
bool setupISO2_IDs_(const std::string &isoName)
void printPetraObjects_(const std::string &varName)