Xyce  6.1
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-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_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.67.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:20:09 $
42 //
43 // Current Owner : $Author: tvrusso $
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_FeatureTest.h>
58 #include <N_UTL_OptionBlock.h>
59 #include <N_UTL_Algorithm.h>
60 #include <N_UTL_Diagnostic.h>
61 #include <N_UTL_Param.h>
62 
63 namespace Xyce {
64 namespace Device {
65 
66 //-----------------------------------------------------------------------------
67 // Function : DeviceSensitivities::DeviceSensitivities
68 // Purpose : constructor
69 // Special Notes :
70 // Scope : private
71 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
72 // Creation Date : 7/15/02
73 //-----------------------------------------------------------------------------
75  DeviceMgr & device_manager,
76  const DeviceOptions & device_options)
77  : deviceManager_(device_manager),
78  deviceOptions_(device_options)
79 {}
80 
81 //-----------------------------------------------------------------------------
82 // Function : DeviceSensitivities::~DeviceSensitivities
83 // Purpose : destructor
84 // Special Notes : De-allocates all the devices pointed to by deviceArray
85 // Scope : public
86 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
87 // Creation Date : 7/15/02
88 //-----------------------------------------------------------------------------
90 {}
91 
92 //-----------------------------------------------------------------------------
93 // Function : DeviceSensitivites::registerSensParams
94 //
95 // Purpose : This function takes an option block, which contains a
96 // list of user-defined device parameters, and stores
97 // this list in a map. The map is the "deviceEntityMap",
98 // which maps a parameter string to a device entity (a
99 // device entity is either an instance or a model).
100 //
101 // Special Notes : The map is not complete at the end of this function - it
102 // has not filled in the other side(the dePtr side) of the map.
103 //
104 // Scope : public
105 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
106 // Creation Date : 7/15/02
107 //-----------------------------------------------------------------------------
108 bool DeviceSensitivities::registerSensParams(const Util::OptionBlock &option_block)
109 {
110  bool bsuccess = true;
111 
112  if (DEBUG_DEVICE && isActive(Diag::SENS_PARAMETERS))
113  {
114  Xyce::dout() << "DeviceSensitivites::registerSensParams called!" <<std::endl;
115  }
116  int numSensParams = 0;
117 
118  for (Util::ParamList::const_iterator iter = option_block.begin(); iter != option_block.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  if (DEBUG_DEVICE)
125  {
126  Xyce::dout() << "name = " << iter->uTag() << " tag = " << tag << std::endl;
127  ++numSensParams;
128  }
129  }
130  }
131 
132  if (DEBUG_DEVICE && isActive(Diag::SENS_PARAMETERS))
133  {
134  Xyce::dout() << "number of sensitivity parameters = "<< numSensParams << std::endl;
135  }
136 
137  return bsuccess;
138 }
139 
140 } // namespace Device
141 } // namespace Xyce
Pure virtual class to augment a linear system.
DeviceSensitivities(DeviceMgr &device_manager, const DeviceOptions &device_options)
Device::DeviceMgr & deviceManager_
Definition: N_ANP_HB.C:2068
bool registerSensParams(const Util::OptionBlock &option_block)