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.23 $
40 //
41 // Revision Date : $Date: 2015/07/02 13:00:10 $
42 //
43 // Current Owner : $Author: dgbaur $
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_PDS_fwd.h>
56 #include <N_UTL_fwd.h>
57 
58 #include <N_UTL_Param.h>
59 
60 namespace Xyce {
61 namespace Analysis {
62 
63 //-----------------------------------------------------------------------------
64 // Class : SweepParam
65 //
66 // Purpose : This class contains basic parameter data for parameter
67 // sweeps, for a single parameter. If there are multiple
68 // parameters in the sweep, each one gets a class like
69 // this.
70 //
71 // Special Notes : "Step" here refers to steps in a parameter sweep loop,
72 // not time steps or DC sweep steps.
73 //
74 //
75 // Creator : Eric Keiter, SNL
76 // Creation Date : 10/31/03
77 //-----------------------------------------------------------------------------
79 {
80 public:
81  // Default constructor.
82  SweepParam () :
83  name(""),
84  type("LIN"),
85  startVal(0.0),
86  stopVal(0.0),
87  stepVal(0.0),
88  stepMult(0.0),
89  currentVal(0.0),
90  numSteps(0),
91  count(-1),
92  maxStep(0),
93  interval(1),
94  outerStepNumber(0),
95  sweepResetFlag_(false),
97  {}
98 
99  // Destructor
101  {}
102 
103  bool updateCurrentVal (int stepNumber);
105 
106  std::string name;
107  std::string type;
108 
109  double startVal;
110  double stopVal;
111  double stepVal;
112  double stepMult;
113 
114  double currentVal;
115 
116  int numSteps;
117 
118  int count;
119  int maxStep;
120  int interval;
121 
123 
124  std::vector<double> valList;
125 
126  private:
129 
130 };
131 
132 typedef std::vector<SweepParam> SweepVector;
133 
134 //-----------------------------------------------------------------------------
135 // Function : SweepParam::operator<<
136 // Purpose : "<<" operator
137 // Special Notes :
138 // Scope : public
139 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
140 // Creation Date : 7/02/03
141 //-----------------------------------------------------------------------------
142 ///
143 ///
144 ///
145 /// @invariant
146 ///
147 /// @param os
148 /// @param sp
149 ///
150 /// @return
151 ///
152 std::ostream & operator<<(std::ostream & os, const SweepParam & sp);
153 
154 
155 //-----------------------------------------------------------------------------
156 // Function : parseSweepParams
157 // Purpose :
158 // Special Notes :
159 // Scope : public
160 // Creator : David G. Baur Raytheon Sandia National Laboratories 1355
161 // Creation Date : Wed Oct 1 09:19:28 2014
162 //-----------------------------------------------------------------------------
163 ///
164 /// Populate the sweep params from the parameter list.
165 ///
166 /// @invariant
167 ///
168 /// @param sweep_param sweep parameters objec t populate
169 /// @param first begin iterator of the parameter list
170 /// @param last end iterator of the parameter list
171 ///
172 SweepParam parseSweepParams(Util::ParamList::const_iterator first, Util::ParamList::const_iterator last);
173 
174 bool updateSweepParams(Loader::Loader &loader, int step_count, std::vector<SweepParam>::iterator begin, std::vector<SweepParam>::iterator end, bool overrideOriginal);
175 int setupSweepLoop(Parallel::Machine comm, Loader::Loader &loader, std::vector<SweepParam>::iterator begin, std::vector<SweepParam>::iterator end);
176 
177 } // namespace Analysis
178 } // namespace Xyce
179 
180 #endif // Xyce_N_ANP_SweepParam_h
int setupSweepLoop(Parallel::Machine comm, Loader::Loader &loader, std::vector< SweepParam >::iterator begin, std::vector< SweepParam >::iterator end)
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)
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:94