Xyce  6.1
N_ANP_DCSweep.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_ANP_DCSweep.h,v $
27 //
28 // Purpose : DC sweep analysis class
29 //
30 // Special Notes : Specify any "hidden" or subtle details of the class here.
31 // Portability details, error handling information, etc.
32 //
33 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
34 //
35 // Creation Date : 01/24/08
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.49.2.1 $
41 //
42 // Revision Date : $Date: 2015/04/02 18:20:06 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-----------------------------------------------------------------------------
46 
47 #ifndef Xyce_N_ANP_DCSweep_h
48 #define Xyce_N_ANP_DCSweep_h
49 
50 // ---------- Xyce Includes ----------
51 #include <N_ANP_fwd.h>
52 #include <N_TOP_fwd.h>
53 
54 #include <N_ANP_AnalysisBase.h>
55 #include <N_ANP_Factory.h>
56 #include <N_UTL_OptionBlock.h>
57 
58 namespace Xyce {
59 namespace Analysis {
60 
61 //-------------------------------------------------------------------------
62 // Class : DCSweep
63 // Purpose : Transient analysis class
64 // Special Notes :
65 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
66 // Creation Date : 01/24/08
67 //-------------------------------------------------------------------------
68 class DCSweep : public AnalysisBase
69 {
70 public:
71  DCSweep(
72  AnalysisManager & analysis_manager,
73  Nonlinear::Manager & nonlinear_manager,
74  Topo::Topology & topology,
75  HB * hb_analysis = 0); // HACK TO GET US MOVING FORWARD, should pass output adapter or something
76 
77  virtual ~DCSweep();
78 
79  void setTIAParams(const TimeIntg::TIAParams &tia_params) {
80  tiaParams_ = tia_params;
81  }
82 
84  return tiaParams_;
85  }
86 
88  return tiaParams_;
89  }
90 
91  bool setAnalysisParams(const Util::OptionBlock & paramsBlock); // override;
92  bool setTimeIntegratorOptions(const Util::OptionBlock &option_block);
93 
94  bool outputFailureStats(std::ostream &os);
95 
96  bool getDCOPFlag() const // override
97  {
98  return true;
99  }
100 
101  bool doRun(); // override;
102  bool doInit(); // override;
103  bool doLoopProcess(); // override;
104  bool doProcessSuccessfulStep(); // override;
105  bool doProcessFailedStep(); // override;
106  bool doFinish(); // override;
107  bool doHandlePredictor(); // override;
108 
109  // Two Level specific
110  bool twoLevelStep();
111 
112  void printStepHeader(std::ostream &os);
113  bool printLoopInfo(int start, int finish);
114 
115 private:
116  void dcSweepOutput();
117  void initializeSolution_();
118  void takeStep_ ();
119 
120 private:
124  Topo::Topology & topology_;
127 
129 
130  bool sensFlag_;
131 
134  std::vector<int> dcSweepFailures_;
135 
137 
138  std::vector<double> objectiveVec_;
139  std::vector<double> dOdpVec_;
140  std::vector<double> dOdpAdjVec_;
141  std::vector<double> scaled_dOdpVec_;
142  std::vector<double> scaled_dOdpAdjVec_;
143 };
144 
146  const std::string & netlist_filename,
147  IO::PkgOptionsMgr & options_manager,
148  AnalysisManager & analysis_manager,
149  Linear::System & linear_system,
150  Nonlinear::Manager & nonlinear_manager,
151  Topo::Topology & topology);
152 
153 } // namespace Analysis
154 } // namespace Xyce
155 
156 #endif
bool printLoopInfo(int start, int finish)
AnalysisManager & analysisManager_
std::vector< double > objectiveVec_
Pure virtual class to augment a linear system.
std::vector< double > dOdpVec_
OutputMgrAdapter & outputManagerAdapter_
void setTIAParams(const TimeIntg::TIAParams &tia_params)
Definition: N_ANP_DCSweep.h:79
std::vector< int > dcSweepFailures_
bool outputFailureStats(std::ostream &os)
std::vector< double > dOdpAdjVec_
const TimeIntg::TIAParams & getTIAParams() const
Definition: N_ANP_DCSweep.h:83
std::vector< double > scaled_dOdpAdjVec_
bool setTimeIntegratorOptions(const Util::OptionBlock &option_block)
Definition: N_ANP_DCSweep.C:99
Nonlinear::Manager & nonlinearManager_
DCSweep(AnalysisManager &analysis_manager, Nonlinear::Manager &nonlinear_manager, Topo::Topology &topology, HB *hb_analysis=0)
Definition: N_ANP_DCSweep.C:69
Loader::Loader & loader_
void printStepHeader(std::ostream &os)
std::vector< double > scaled_dOdpVec_
bool registerDCSweepFactory(const std::string &netlist_filename, IO::PkgOptionsMgr &options_manager, AnalysisManager &analysis_manager, Linear::System &linear_system, Nonlinear::Manager &nonlinear_manager, Topo::Topology &topology)
TimeIntg::TIAParams tiaParams_
Factory for creating analysis objects.
bool getDCOPFlag() const
Definition: N_ANP_DCSweep.h:96
std::vector< SweepParam > SweepVector
Definition: N_ANP_fwd.h:85
bool setAnalysisParams(const Util::OptionBlock &paramsBlock)
TimeIntg::TIAParams & getTIAParams()
Definition: N_ANP_DCSweep.h:87
Topo::Topology & topology_