Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DeviceSensitivities.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_DeviceSensitivities.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.64 $
40 //
41 // Revision Date : $Date: 2014/04/10 20:49:40 $
42 //
43 // Current Owner : $Author: dgbaur $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 #include <algorithm>
49 #include <vector>
50 #include <list>
51 
53 
54 #include <N_DEV_DeviceMgr.h>
55 #include <N_DEV_Algorithm.h>
56 
57 #include <N_UTL_OptionBlock.h>
58 #include <N_UTL_Param.h>
59 #include <N_UTL_Algorithm.h>
60 
61 namespace Xyce {
62 namespace Device {
63 
64 //-----------------------------------------------------------------------------
65 // Function : DeviceSensitivities::DeviceSensitivities
66 // Purpose : constructor
67 // Special Notes :
68 // Scope : private
69 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
70 // Creation Date : 7/15/02
71 //-----------------------------------------------------------------------------
73  DeviceMgr & device_manager,
74  const DeviceOptions & device_options)
75  : deviceManager_(device_manager),
76  deviceOptions_(device_options)
77 {}
78 
79 //-----------------------------------------------------------------------------
80 // Function : DeviceSensitivities::~DeviceSensitivities
81 // Purpose : destructor
82 // Special Notes : De-allocates all the devices pointed to by deviceArray
83 // Scope : public
84 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
85 // Creation Date : 7/15/02
86 //-----------------------------------------------------------------------------
88 {}
89 
90 //-----------------------------------------------------------------------------
91 // Function : DeviceSensitivites::registerSensParams
92 //
93 // Purpose : This function takes an option block, which contains a
94 // list of user-defined device parameters, and stores
95 // this list in a map. The map is the "deviceEntityMap",
96 // which maps a parameter string to a device entity (a
97 // device entity is either an instance or a model).
98 //
99 // Special Notes : The map is not complete at the end of this function - it
100 // has not filled in the other side(the dePtr side) of the map.
101 //
102 // Scope : public
103 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
104 // Creation Date : 7/15/02
105 //-----------------------------------------------------------------------------
106 bool DeviceSensitivities::registerSensParams(const Util::OptionBlock &option_block)
107 {
108  bool bsuccess = true;
109 
110 #ifdef Xyce_DEBUG_DEVICE
112  {
113  Xyce::dout() << "DeviceSensitivites::registerSensParams called!" <<std::endl;
114  }
115  int numSensParams = 0;
116 #endif
117 
118  for (std::list<Util::Param>::const_iterator iter = option_block.getParams().begin(); iter != option_block.getParams().end(); ++iter)
119  {
120  if ( std::string(iter->uTag(), 0, 5) == "PARAM") // this is a vector
121  {
122  const std::string &tag = iter->stringValue();
123 
124 #ifdef Xyce_DEBUG_DEVICE
125  Xyce::dout() << "name = " << iter->uTag() << " tag = " << tag << std::endl;
126  ++numSensParams;
127 #endif
128  }
129  }
130 
131 #ifdef Xyce_DEBUG_DEVICE
133  {
134  Xyce::dout() << "number of sensitivity parameters = "<< numSensParams << std::endl;
135  }
136 #endif
137 
138  return bsuccess;
139 }
140 
141 } // namespace Device
142 } // namespace Xyce