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