Xyce  6.1
N_DEV_RegionData.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_RegionData.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL
33 //
34 // Creation Date : 07/19/06
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.16.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 // ---------- Standard Includes ----------
49 #include <iostream>
50 #include <N_UTL_Math.h>
51 
52 // ---------- Xyce Includes ----------
53 #include <N_DEV_Const.h>
54 #include <N_DEV_DeviceEntity.h>
55 #include <N_DEV_RegionData.h>
56 #include <N_UTL_ExtendedString.h>
57 
58 namespace Xyce {
59 namespace Device {
60 
61 template<>
63 {
64  // Set up map for double precision variables:
65  addPar("AREA", 1.0e+15, &RegionData::area);
66  addPar("XLOC", 0.0, &RegionData::xloc);
67 
68  // Set up map for non-double precision variables:
69  addPar("NAME", std::string("none"), &RegionData::name);
70  addPar("TYPE", std::string("none"), &RegionData::type);
71  addPar("FILE", std::string(""), &RegionData::reactionFile);
72 }
73 
75  static ParametricData<RegionData> parMap;
76 
77  return parMap;
78 }
79 
80 //-----------------------------------------------------------------------------
81 // RegionData functions:
82 //
83 //-----------------------------------------------------------------------------
84 // Function : RegionData::RegionData
85 // Purpose : constructor
86 // Special Notes :
87 // Scope : public
88 // Creator : Eric Keiter, SNL
89 // Creation Date : 8/24/06
90 //-----------------------------------------------------------------------------
92  CompositeParam (getParametricData()),
93  name("RXNREGION"),
94  outName("RXNREGION"),
95  type("JUNCTION"),
96  reactionFile("reaction_spec_full"),
97  area(1.0e-4),
98  xloc(1.83e-4),
99  doNothing(false)
100 {}
101 
102 //-----------------------------------------------------------------------------
103 // Function : RegionData::processParams
104 // Purpose :
105 // Special Notes :
106 // Scope : public
107 // Creator : Eric Keiter, SNL
108 // Creation Date : 8/24/06
109 //-----------------------------------------------------------------------------
111 {
112  ParameterMap::const_iterator p_i = getParameterMap().find("TYPE");
113  const Descriptor &p = *(*p_i).second;
114  ExtendedString tmp = p.value<std::string>(*this);
115  p.value<std::string>(*this) = tmp.toLower();
116 }
117 
118 //-----------------------------------------------------------------------------
119 // Function : RegionData::operator<<
120 // Purpose : "<<" operator
121 // Special Notes : doesn't print everything.
122 // Scope : public
123 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
124 // Creation Date : 5/23/05
125 //-----------------------------------------------------------------------------
126 std::ostream & operator<<(std::ostream & os, const RegionData & rd)
127 {
128  os << " Region Data: name = " << rd.name <<
129  " x=" << rd.xloc <<
130  " reaction file = " << rd.reactionFile <<
131  " type = " << rd.type <<
132  std::endl;
133 
134  return os;
135 }
136 
137 } // namespace Device
138 } // namespace Xyce
Pure virtual class to augment a linear system.
static ParametricData< RegionData > & getParametricData()
const T & value(const ParameterBase &entity) const
Returns the value of the parameter for the entity.
Definition: N_DEV_Pars.h:871
Class Descriptor describes the parameters stored in the ParametricData parameter map.
Definition: N_DEV_Pars.h:546
ParametricData()
Constructs the parameter data map.
Definition: N_DEV_Pars.h:1392
void processParams()
processParams post processes the parameters that have been set in the object of the derived class...
Manages parameter binding for class C.
Definition: N_DEV_Pars.h:214
CompositeParam is the base class for classes that wish to only manage the processing of parameter dat...
const ParameterMap & getParameterMap() const
getParameterMap returns the parameter map which describes the parameters.
std::ostream & operator<<(std::ostream &os, const Configuration &configuration)
Definition: N_DEV_Dump.C:134