Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-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_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.12 $
40 //
41 // Revision Date : $Date: 2014/02/24 23:49:15 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 
49 // ---------- Standard Includes ----------
50 
51 #include <N_UTL_Misc.h>
52 #include <N_UTL_Xyce.h>
53 #include <N_DEV_DeviceEntity.h>
54 
55 #ifdef Xyce_DEBUG_DEVICE
56 #include <iostream>
57 #endif
58 
59 #ifdef HAVE_CMATH
60 #include <cmath>
61 #else
62 #include <math.h>
63 #endif
64 
65 #ifdef Xyce_DEBUG_DEVICE
66 #ifdef HAVE_CSTDIO
67 #include <cstdio>
68 #else
69 #include <stdio.h>
70 #endif
71 #endif
72 
73 // ---------- Xyce Includes ----------
74 #include <N_DEV_Const.h>
75 #include <N_DEV_RegionData.h>
76 
77 
78 namespace Xyce {
79 namespace Device {
80 
81 template<>
83 {
84  // Set up map for double precision variables:
85  addPar("AREA", 1.0e+15, &RegionData::area);
86  addPar("XLOC", 0.0, &RegionData::xloc);
87 
88  // Set up map for non-double precision variables:
89  addPar("NAME", std::string("none"), &RegionData::name);
90  addPar("TYPE", std::string("none"), &RegionData::type);
91  addPar("FILE", std::string(""), &RegionData::reactionFile);
92 }
93 
95  static ParametricData<RegionData> parMap;
96 
97  return parMap;
98 }
99 
100 //-----------------------------------------------------------------------------
101 // RegionData functions:
102 //
103 //-----------------------------------------------------------------------------
104 // Function : RegionData::RegionData
105 // Purpose : constructor
106 // Special Notes :
107 // Scope : public
108 // Creator : Eric Keiter, SNL
109 // Creation Date : 8/24/06
110 //-----------------------------------------------------------------------------
112  CompositeParam (getParametricData()),
113  name("RXNREGION"),
114  outName("RXNREGION"),
115  type("JUNCTION"),
116  reactionFile("reaction_spec_full"),
117  area(1.0e-4),
118  xloc(1.83e-4),
119  doNothing(false)
120 {}
121 
122 //-----------------------------------------------------------------------------
123 // Function : RegionData::processParams
124 // Purpose :
125 // Special Notes :
126 // Scope : public
127 // Creator : Eric Keiter, SNL
128 // Creation Date : 8/24/06
129 //-----------------------------------------------------------------------------
131 {
132  ParameterMap::const_iterator p_i = getParameterMap().find("TYPE");
133  const Descriptor &p = *(*p_i).second;
134  ExtendedString tmp = p.value<std::string>(*this);
135  p.value<std::string>(*this) = tmp.toLower();
136 }
137 
138 #ifdef Xyce_DEBUG_DEVICE
139 //-----------------------------------------------------------------------------
140 // Function : RegionData::operator<<
141 // Purpose : "<<" operator
142 // Special Notes : doesn't print everything.
143 // Scope : public
144 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
145 // Creation Date : 5/23/05
146 //-----------------------------------------------------------------------------
147 std::ostream & operator<<(std::ostream & os, const RegionData & rd)
148 {
149  os << " Region Data: name = " << rd.name <<
150  " x=" << rd.xloc <<
151  " reaction file = " << rd.reactionFile <<
152  " type = " << rd.type <<
153  std::endl;
154 
155  return os;
156 }
157 #endif
158 
159 } // namespace Device
160 } // namespace Xyce