Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_2DPDEModel.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_2DPDEModel.C,v $
27 //
28 // Purpose : This file contains a lot of the
29 // implementation of the model class for the two
30 // dimensional PDE based semiconductor device.
31 //
32 // Special Notes :
33 //
34 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
35 //
36 // Creation Date : 07/05/03
37 //
38 // Revision Information:
39 // ---------------------
40 //
41 // Revision Number: $Revision: 1.24 $
42 //
43 // Revision Date : $Date: 2014/03/19 17:23:30 $
44 //
45 // Current Owner : $Author: tvrusso $
46 //-------------------------------------------------------------------------
47 
48 #include <Xyce_config.h>
49 
50 
51 // ---------- Standard Includes ----------
52 #include <iostream>
53 
54 // ---------- Xyce Includes ----------
55 #include <N_DEV_2DPDE.h>
56 #include <N_DEV_SolverState.h>
57 #include <N_DEV_ExternData.h>
58 #include <N_DEV_DeviceOptions.h>
59 
60 namespace Xyce {
61 namespace Device {
62 namespace TwoDPDE {
63 
65 {}
66 
67 //-----------------------------------------------------------------------------
68 // Function : Model::processParams
69 // Purpose :
70 // Special Notes :
71 // Scope : public
72 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
73 // Creation Date : 6/03/02
74 //-----------------------------------------------------------------------------
76 {
77  return true;
78 }
79 
80 //----------------------------------------------------------------------------
81 // Function : Model::processInstanceParams
82 // Purpose :
83 // Special Notes :
84 // Scope : public
85 // Creator : Dave Shirely, PSSI
86 // Creation Date : 03/23/06
87 //----------------------------------------------------------------------------
89 {
90 
91  std::vector<Instance*>::iterator iter;
92  std::vector<Instance*>::iterator first = instanceContainer.begin();
93  std::vector<Instance*>::iterator last = instanceContainer.end();
94 
95  for (iter=first; iter!=last; ++iter)
96  {
97  (*iter)->processParams();
98  }
99 
100  return true;
101 }
102 
103 //-----------------------------------------------------------------------------
104 // Function : Model::Model
105 // Purpose : model block constructor
106 // Special Notes :
107 // Scope : public
108 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
109 // Creation Date : 11/14/01
110 //-----------------------------------------------------------------------------
111 
113  const Configuration & configuration,
114  const ModelBlock & MB,
115  const FactoryBlock & factory_block)
116  : DevicePDEModel(MB, configuration.getModelParameters(), factory_block)
117 {
118  processParams();
119 }
120 
121 //-----------------------------------------------------------------------------
122 // Function : Model::Model
123 // Purpose : destructor
124 // Special Notes :
125 // Scope : public
126 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
127 // Creation Date : 11/14/01
128 //-----------------------------------------------------------------------------
130 {
131  std::vector<Instance*>::iterator iter;
132  std::vector<Instance*>::iterator first = instanceContainer.begin();
133  std::vector<Instance*>::iterator last = instanceContainer.end();
134 
135  for (iter=first; iter!=last; ++iter)
136  {
137  delete (*iter);
138  }
139 
140 }
141 
142 //-----------------------------------------------------------------------------
143 // Function : Model::printOutInstances
144 // Purpose : debugging tool.
145 // Special Notes :
146 // Scope : public
147 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
148 // Creation Date : 11/14/01
149 //-----------------------------------------------------------------------------
150 std::ostream &Model::printOutInstances(std::ostream &os) const
151 {
152  std::vector<Instance*>::const_iterator iter;
153  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
154  std::vector<Instance*>::const_iterator last = instanceContainer.end();
155 
156  int i;
157  os << "\n";
158  os << " name model name Parameters" << "\n";
159  for (i = 0, iter = first; iter != last; ++iter, ++i)
160  {
161  os << " " << i << ": " << (*iter)->getName() << " ";
162  os << getName();
163  //os << " C = " << (*iter)-> C;
164  //os << " IC = " << (*iter)->IC;
165  os << "\n";
166  }
167  os << std::endl;
168 
169  return os;
170 }
171 
172 //-----------------------------------------------------------------------------
173 // Function : Model::forEachInstance
174 // Purpose :
175 // Special Notes :
176 // Scope : public
177 // Creator : David Baur
178 // Creation Date : 2/4/2014
179 //-----------------------------------------------------------------------------
180 /// Apply a device instance "op" to all instances associated with this
181 /// model
182 ///
183 /// @param[in] op Operator to apply to all instances.
184 ///
185 ///
186 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
187 {
188  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
189  op(*it);
190 }
191 
192 
193 } // namespace TwoDPDE
194 } // namespace Device
195 } // namespace Xyce