Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_Source.C
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-2014 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_DEV_Source.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 02/28/00
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.30 $
40 //
41 // Revision Date : $Date: 2014/04/03 19:19:24 $
42 //
43 // Current Owner : $Author: dgbaur $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 
49 // N_DEV_Source
50 #include <N_DEV_Source.h>
51 
52 // Class N_DEV_Source
53 #include <N_DEV_SourceData.h>
54 
55 #include <N_DEV_SolverState.h>
56 
57 namespace Xyce {
58 namespace Device {
59 
60 // SourceInstance
61 //-----------------------------------------------------------------------------
62 // Function : SourceInstance::SourceInstance
63 // Purpose : constructor
64 // Special Notes :
65 // Scope : public
66 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
67 // Creation Date : 3/16/00
68 //-----------------------------------------------------------------------------
70  const InstanceBlock & IB,
71  ParametricData<void> & parametric_data,
72  const FactoryBlock & factory_block)
73  : DeviceInstance(IB, parametric_data, factory_block),
74  tranSourceData_(0),
75  acSourceData_(0),
76  dcSourceData_(0),
77  sourceType(_SIN_DATA)
78 {}
79 
80 
81 //-----------------------------------------------------------------------------
82 // Function : SourceInstance::~SourceInstance
83 // Purpose : destructor
84 // Special Notes :
85 // Scope : public
86 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
87 // Creation Date : 3/16/00
88 //-----------------------------------------------------------------------------
90 {}
91 
92 
93 //-----------------------------------------------------------------------------
94 // Function : SourceInstance::setFastSourceFlag
95 // Purpose :
96 // Special Notes :
97 // Scope : public
98 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
99 // Creation Date : 03/27/04
100 //-----------------------------------------------------------------------------
102 {
103  if (tranSourceData_ != 0)
104  {
106  }
107 }
108 
109 //-----------------------------------------------------------------------------
110 // Function : SourceInstance::getFastSourceFlag
111 // Purpose :
112 // Special Notes :
113 // Scope : public
114 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
115 // Creation Date : 04/1/04
116 //-----------------------------------------------------------------------------
118 {
119  bool flag=false;
120  if (tranSourceData_ != 0)
121  {
123  }
124  return flag;
125 }
126 
127 //-----------------------------------------------------------------------------
128 // Function : SourceInstance::period
129 // Purpose : Time period of periodic sources
130 // Special Notes :
131 // Scope : public
132 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
133 // Creation Date : 03/31/04
134 //-----------------------------------------------------------------------------
136 {
137  double per = 0.0;
138  if (tranSourceData_ != 0)
139  {
140  per = tranSourceData_->period();
141  }
142  return per;
143 }
144 
145 //-----------------------------------------------------------------------------
146 // Function : SourceInstance::getResetFlag
147 // Purpose :
148 // Special Notes :
149 // Scope : public
150 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
151 // Creation Date : 07/30/04
152 //-----------------------------------------------------------------------------
154 {
155  if (tranSourceData_ != 0)
156  {
158  }
159  return true;
160 }
161 
162 //-----------------------------------------------------------------------------
163 // Function : SourceInstance::getInstanceBreakPoints
164 // Purpose :
165 // Special Notes :
166 // Scope : public
167 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
168 // Creation Date : 02/05/06
169 //-----------------------------------------------------------------------------
171  (std::vector<N_UTL_BreakPoint> &breakPointTimes)
172 {
173  bool fastSourceFlag = false;
174 
175  if (getSolverState().blockAnalysisFlag == false)
176  {
177  fastSourceFlag = getFastSourceFlag();
178  }
179 
180  bool tmpBool = true;
181  if (!fastSourceFlag && tranSourceData_ != 0)
182  {
183  tmpBool = tranSourceData_->getBreakPoints(breakPointTimes);
184  }
185  return tmpBool;
186 }
187 
188 //-----------------------------------------------------------------------------
189 // Function : SourceInstance::updateSource
190 // Purpose :
191 // Special Notes :
192 // Scope : public
193 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
194 // Creation Date : 02/05/06
195 //-----------------------------------------------------------------------------
197 {
198  if (tranSourceData_ != 0)
199  {
201  }
202  if (dcSourceData_ != 0)
203  {
205  }
206  if (acSourceData_ != 0)
207  {
209  }
210  return true;
211 }
212 
213 } // namespace Device
214 } // namespace Xyce