Xyce  6.1
N_ANP_SweepParam.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_SweepParam.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric Keiter
33 //
34 // Creation Date : 9/4/04
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.19.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:20:06 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_ANP_SweepParam_h
47 #define Xyce_N_ANP_SweepParam_h
48 
49 #include <iosfwd>
50 #include <string>
51 #include <vector>
52 
53 #include <N_ANP_fwd.h>
54 #include <N_LOA_fwd.h>
55 #include <N_UTL_fwd.h>
56 
57 namespace Xyce {
58 namespace Analysis {
59 
60 //-----------------------------------------------------------------------------
61 // Class : SweepParam
62 //
63 // Purpose : This class contains basic parameter data for parameter
64 // sweeps, for a single parameter. If there are multiple
65 // parameters in the sweep, each one gets a class like
66 // this.
67 //
68 // Special Notes : "Step" here refers to steps in a parameter sweep loop,
69 // not time steps or DC sweep steps.
70 //
71 //
72 // Creator : Eric Keiter, SNL
73 // Creation Date : 10/31/03
74 //-----------------------------------------------------------------------------
76 {
77 public:
78  // Default constructor.
79  SweepParam () :
80  name(""),
81  type("LIN"),
82  startVal(0.0),
83  stopVal(0.0),
84  stepVal(0.0),
85  stepMult(0.0),
86  currentVal(0.0),
87  numSteps(0),
88  count(-1),
89  maxStep(0),
90  interval(1),
91  outerStepNumber(0),
92  sweepResetFlag_(false),
94  {}
95 
96  // Destructor
98  {}
99 
100  bool updateCurrentVal (int stepNumber);
102 
103  std::string name;
104  std::string type;
105 
106  double startVal;
107  double stopVal;
108  double stepVal;
109  double stepMult;
110 
111  double currentVal;
112 
113  int numSteps;
114 
115  int count;
116  int maxStep;
117  int interval;
118 
120 
121  std::vector<double> valList;
122 
123  private:
126 
127 };
128 
129 typedef std::vector<SweepParam> SweepVector;
130 
131 //-----------------------------------------------------------------------------
132 // Function : SweepParam::operator<<
133 // Purpose : "<<" operator
134 // Special Notes :
135 // Scope : public
136 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
137 // Creation Date : 7/02/03
138 //-----------------------------------------------------------------------------
139 ///
140 ///
141 ///
142 /// @invariant
143 ///
144 /// @param os
145 /// @param sp
146 ///
147 /// @return
148 ///
149 std::ostream & operator<<(std::ostream & os, const SweepParam & sp);
150 
151 
152 //-----------------------------------------------------------------------------
153 // Function : parseSweepParams
154 // Purpose :
155 // Special Notes :
156 // Scope : public
157 // Creator : David G. Baur Raytheon Sandia National Laboratories 1355
158 // Creation Date : Wed Oct 1 09:19:28 2014
159 //-----------------------------------------------------------------------------
160 ///
161 /// Populate the sweep params from the parameter list.
162 ///
163 /// @invariant
164 ///
165 /// @param sweep_param sweep parameters objec t populate
166 /// @param first begin iterator of the parameter list
167 /// @param last end iterator of the parameter list
168 ///
169 SweepParam parseSweepParams(Util::ParamList::const_iterator first, Util::ParamList::const_iterator last);
170 
171  bool updateSweepParams(Loader::Loader &loader, int step_count, std::vector<SweepParam>::iterator begin, std::vector<SweepParam>::iterator end, bool overrideOriginal=false);
172 int setupSweepLoop(Loader::Loader &loader, std::vector<SweepParam>::iterator begin, std::vector<SweepParam>::iterator end);
173 
174 } // namespace Analysis
175 } // namespace Xyce
176 
177 #endif // Xyce_N_ANP_SweepParam_h
bool updateCurrentVal(int stepNumber)
Pure virtual class to augment a linear system.
bool updateSweepParams(Loader::Loader &loader, int step_count, std::vector< SweepParam >::iterator begin, std::vector< SweepParam >::iterator end, bool overrideOriginal=false)
Util::JSON & operator<<(Util::JSON &json, const StatCounts &s)
std::vector< double > valList
SweepParam parseSweepParams(Util::ParamList::const_iterator first, Util::ParamList::const_iterator last)
Populate the sweep params from the parameter list.
std::vector< SweepParam > SweepVector
Definition: N_ANP_fwd.h:85
int setupSweepLoop(Loader::Loader &loader, std::vector< SweepParam >::iterator begin, std::vector< SweepParam >::iterator end)