Xyce  6.1
N_ANP_OutputMgrAdapter.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 // Filename : $RCSfile: N_ANP_OutputMgrAdapter.h,v $
26 //
27 // Purpose :
28 //
29 // Special Notes :
30 //
31 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
32 //
33 // Creation Date : 01/24/08
34 //
35 // Revision Information:
36 // ---------------------
37 //
38 // Revision Number: $Revision: 1.86 $
39 //
40 // Revision Date : $Date: 2015/10/27 19:24:39 $
41 //
42 // Current Owner : $Author: tvrusso $
43 //-----------------------------------------------------------------------------
44 
45 #ifndef Xyce_N_ANP_OutputMgrAdapter_h
46 #define Xyce_N_ANP_OutputMgrAdapter_h
47 
48 #include <Teuchos_SerialDenseMatrix.hpp>
49 
50 #include <N_ANP_fwd.h>
51 #include <N_DEV_fwd.h>
52 #include <N_IO_fwd.h>
53 #include <N_LAS_fwd.h>
54 #include <N_PDS_fwd.h>
55 #include <N_TOP_fwd.h>
56 #include <N_UTL_fwd.h>
57 
58 #include <N_UTL_Listener.h>
59 #include <N_ANP_StepEvent.h>
60 #include <N_LAS_BlockVector.h>
61 
62 namespace Xyce {
63 namespace Analysis {
64 
65 //-------------------------------------------------------------------------
66 // Class : OutputMgrAdapter
67 // Purpose : Inteface class for the output manager
68 // Special Notes :
69 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
70 // Creation Date : 01/24/08
71 //-------------------------------------------------------------------------
72 class OutputMgrAdapter : public Util::Listener<StepEvent>
73 {
74 public:
76  Parallel::Machine comm,
77  IO::OutputMgr & output_manager,
78  IO::Measure::Manager & measure_manager,
79  IO::FourierMgr & fourier_manager,
80  IO::ObjectiveManager & objective_manager,
81  Device::DeviceMgr & device_manager);
82 
83  virtual ~OutputMgrAdapter();
84 
85  Parallel::Machine getComm()
86  {
87  return comm_;
88  }
89 
90  IO::OutputMgr &getOutputManager()
91  {
92  return outputManager_;
93  }
94 
95  void setStepSweepVector(const Analysis::SweepVector &sweep_vector);
96 
97  void setDCSweepVector(const Analysis::SweepVector &sweep_vector);
98 
100  {
101  return stepSweepVector_;
102  }
103 
105  {
106  return dcSweepVector_;
107  }
108 
109  void setDCAnalysisStepNumber( int num )
110  {
111  dcAnalysisStepNumber_ = num;
112  }
113 
114  void setDCAnalysisMaxSteps( int num )
115  {
116  dcAnalysisMaxSteps_ = num;
117  }
118 
119  double getInitialOutputInterval() const;
120 
121  const IO::IntervalVector &getOutputIntervals() const;
122 
123  void notify(const StepEvent &event);
124 
125  void dumpRestart(
126  Parallel::Communicator & parallel_communicator,
127  Topo::Topology & topology,
128  Analysis::AnalysisManager & analysis_manager,
129  const std::string & job_name,
130  bool pack,
131  double current_time) const;
132 
133  void tranOutput(
134  double time, Linear::Vector & currSolutionPtr, Linear::Vector & stateVecPtr, Linear::Vector & storeVecPtr,
135  Linear::Vector & lead_current_vector,
136  Linear::Vector & junction_voltage_vector,
137  Linear::Vector & lead_current_dqdt_vector,
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  bool skipPrintLineOutput = false);
144 
145  void dcOutput(
146  int dcStepNumber,
147  Linear::Vector & currSolutionPtr, Linear::Vector & stateVecPtr, Linear::Vector & storeVecPtr,
148  Linear::Vector &lead_current_vector,
149  Linear::Vector &junction_voltage_vector,
150  Linear::Vector &lead_current_dqdt_vector,
151  std::vector<double> & objectiveVec_,
152  std::vector<double> & dOdpVec_,
153  std::vector<double> & dOdpAdjVec_,
154  std::vector<double> & scaled_dOdpVec_,
155  std::vector<double> & scaled_dOdpAdjVec_);
156 
157  void finishOutput();
158 
159  void outputMPDE(double time, const std::vector<double> &fast_time_points, const Linear::BlockVector &solution_vector);
160 
161  void outputHB(
162  const std::vector< double > & timePoints, const std::vector< double > & freqPoints,
163  const Linear::BlockVector & timeDomainSolnVec, const Linear::BlockVector & freqDomainSolnVecReal,
164  const Linear::BlockVector & freqDomainSolnVecImaginary, const Linear::BlockVector & timeDomainStoreVec,
165  const Linear::BlockVector & freqDomainStoreVecReal, const Linear::BlockVector & freqDomainStoreVecImaginary,
166  const Linear::BlockVector & timeDomainLeadCurrentVec, const Linear::BlockVector & freqDomainLeadCurrentVecReal,
167  const Linear::BlockVector & freqDomainLeadCurrentVecImaginary, const Linear::BlockVector & timeDomainJunctionVoltageVec,
168  const Linear::BlockVector & freqDomainJunctionVoltageVecReal, const Linear::BlockVector & freqDomainJunctionVoltageVecImaginary );
169 
170  void outputAC(double freq, const Linear::Vector & solnVecRealPtr, const Linear::Vector & solnVecImaginaryPtr);
171 
172  void outputNoise(
173  double freq, double totalOutputNoiseDens_, double totalInputNoiseDens_,
174  const std::vector<Xyce::Analysis::NoiseData*> & noiseDataVec_);
175 
176  // void outputROM(
177  // const Teuchos::SerialDenseMatrix<int, double>& Ghat, const Teuchos::SerialDenseMatrix<int, double>& Chat,
178  // const Teuchos::SerialDenseMatrix<int, double>& Bhat, const Teuchos::SerialDenseMatrix<int, double>& Lhat );
179 
180  // void outputROM(
181  // const Linear::Matrix& Ghat, const Linear::Matrix& Chat,
182  // const Teuchos::SerialDenseMatrix<int, double>& Bhat,
183  // const Teuchos::SerialDenseMatrix<int, double>& Lhat );
184 
185  void outputHomotopy( const std::vector<std::string> & paramNames, const std::vector<double> & paramVals, Linear::Vector & solnVecPtr );
186 
187 private:
188  Parallel::Machine comm_;
189  IO::OutputMgr & outputManager_;
190  IO::Measure::Manager & measureManager_;
191  IO::FourierMgr & fourierManager_;
192  IO::ObjectiveManager & objectiveManager_;
194 
195  Util::Op::Operator * tempOp_;
196 
199 
204 };
205 
207 {
208 public:
210  : outputManagerAdapter_(adapter)
211  {}
212 
213  virtual void outputMPDE(double time, const Linear::Vector *solution_vector)
214  {}
215 
216  virtual bool outputFunkyMPDE()
217  {
218  return false;
219  }
220 
221 protected:
223 };
224 
225 } // namespace Analysis
226 } // namespace Xyce
227 
228 #endif // Xyce_N_ANP_OutputMgrAdapter_h
void outputAC(double freq, const Linear::Vector &solnVecRealPtr, const Linear::Vector &solnVecImaginaryPtr)
OutputAdapter(OutputMgrAdapter &adapter)
Pure virtual class to augment a linear system.
virtual void outputMPDE(double time, const Linear::Vector *solution_vector)
void dumpRestart(Parallel::Communicator &parallel_communicator, Topo::Topology &topology, Analysis::AnalysisManager &analysis_manager, const std::string &job_name, bool pack, double current_time) const
OutputMgrAdapter(Parallel::Machine comm, IO::OutputMgr &output_manager, IO::Measure::Manager &measure_manager, IO::FourierMgr &fourier_manager, IO::ObjectiveManager &objective_manager, Device::DeviceMgr &device_manager)
const Analysis::SweepVector & getDCSweepVector() const
void outputHomotopy(const std::vector< std::string > &paramNames, const std::vector< double > &paramVals, Linear::Vector &solnVecPtr)
void setStepSweepVector(const Analysis::SweepVector &sweep_vector)
void outputMPDE(double time, const std::vector< double > &fast_time_points, const Linear::BlockVector &solution_vector)
void notify(const StepEvent &event)
void setDCSweepVector(const Analysis::SweepVector &sweep_vector)
void dcOutput(int dcStepNumber, Linear::Vector &currSolutionPtr, Linear::Vector &stateVecPtr, Linear::Vector &storeVecPtr, Linear::Vector &lead_current_vector, Linear::Vector &junction_voltage_vector, Linear::Vector &lead_current_dqdt_vector, std::vector< double > &objectiveVec_, std::vector< double > &dOdpVec_, std::vector< double > &dOdpAdjVec_, std::vector< double > &scaled_dOdpVec_, std::vector< double > &scaled_dOdpAdjVec_)
const Analysis::SweepVector & getStepSweepVector() const
std::vector< SweepParam > SweepVector
Definition: N_ANP_fwd.h:94
const IO::IntervalVector & getOutputIntervals() const
void outputNoise(double freq, double totalOutputNoiseDens_, double totalInputNoiseDens_, const std::vector< Xyce::Analysis::NoiseData * > &noiseDataVec_)
void outputHB(const std::vector< double > &timePoints, const std::vector< double > &freqPoints, const Linear::BlockVector &timeDomainSolnVec, const Linear::BlockVector &freqDomainSolnVecReal, const Linear::BlockVector &freqDomainSolnVecImaginary, const Linear::BlockVector &timeDomainStoreVec, const Linear::BlockVector &freqDomainStoreVecReal, const Linear::BlockVector &freqDomainStoreVecImaginary, const Linear::BlockVector &timeDomainLeadCurrentVec, const Linear::BlockVector &freqDomainLeadCurrentVecReal, const Linear::BlockVector &freqDomainLeadCurrentVecImaginary, const Linear::BlockVector &timeDomainJunctionVoltageVec, const Linear::BlockVector &freqDomainJunctionVoltageVecReal, const Linear::BlockVector &freqDomainJunctionVoltageVecImaginary)
void tranOutput(double time, Linear::Vector &currSolutionPtr, Linear::Vector &stateVecPtr, Linear::Vector &storeVecPtr, Linear::Vector &lead_current_vector, Linear::Vector &junction_voltage_vector, Linear::Vector &lead_current_dqdt_vector, std::vector< double > &objectiveVec_, std::vector< double > &dOdpVec_, std::vector< double > &dOdpAdjVec_, std::vector< double > &scaled_dOdpVec_, std::vector< double > &scaled_dOdpAdjVec_, bool skipPrintLineOutput=false)