Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DopeInfo.h
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_DopeInfo.h,v $
27 //
28 // Purpose : This file contains the PDE device instance base class.
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 05/15/01
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.15.2.1 $
40 //
41 // Revision Date : $Date: 2014/02/26 20:16:31 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_DEV_DopeInfo_h
47 #define Xyce_N_DEV_DopeInfo_h
48 
49 // ---------- Standard Includes ----------
50 #include <N_UTL_Misc.h>
51 
52 // ---------- Xyce Includes ----------
53 #include <N_DEV_fwd.h>
54 #include <N_DEV_Const.h>
55 #include <N_DEV_CompositeParam.h>
56 
57 namespace Xyce {
58 namespace Device {
59 
60 //-----------------------------------------------------------------------------
61 // Class : N_DEV_DopeInfo
62 // Purpose : Doping region information.
63 // Special Notes :
64 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
65 // Creation Date : 03/28/03
66 //-----------------------------------------------------------------------------
67 class DopeInfo : public CompositeParam
68 {
69  friend class ParametricData<DopeInfo>;
70 
71 public:
73 
74  DopeInfo();
75  bool processParam(Param & ndParam, std::string & param, DevicePDEInstance & di);
76  void processParams();
77 
78  void setupInfo(
79  std::vector<double> & CVec,
80  std::vector<double> & CdonorVec,
81  std::vector<double> & CacceptorVec,
82  std::vector<double> & xVec, DeviceSupport & devSup);
83 
84  void setupInfo2d(
85  std::vector<double> & CVec,
86  std::vector<double> & CdonorVec,
87  std::vector<double> & CacceptorVec,
88  std::vector<double> & xVec, std::vector<double> &yVec, DeviceSupport & devSup);
89 
90  static double nsdep(double x, double W, double Dt);
91  static double ngdep(double x, double y, double W, double ax, double ay);
92  static double ngdep2(double x, double y, double ax, double ay);
93  static double erf(double x);
94 
95  static void readDopingFile(std::string & filename, std::vector<double> & xloc,
96  std::vector<double> & nvec, std::vector<double> & y2, DeviceSupport & devSup);
97 
98  static void readDopingFile(std::string & filename, std::vector<double> & xloc,
99  std::vector<double> & nvec, std::vector<double> & y2_n,
100  std::vector<double> & pvec, std::vector<double> & y2_p, DeviceSupport & devSup);
101 
102 public:
103  std::string name; // this is also the index into the map.
104  std::string type; // p-type or n-type
105  std::string funcType; // uniform, step, gaussian.
106  std::string speciesName; // boron, phosphorus, etc.
107  std::string fileName; // doping file.
108  std::string exprString; // if expression based, store here.
109 
110  // location params:
111  double xmin;
112  double xmax;
113  bool xminGiven;
114  bool xmaxGiven;
115 
116  double xloc;
117  double xwidth;
118 
119  double ymin;
120  double ymax;
121  bool yminGiven;
122  bool ymaxGiven;
123 
124  double yloc;
125  double ywidth;
126 
127  double Nmax; // maximum magnitude
128  double Nmin; // minimum magnitude
129 
130  // sometimes having a really high doping hurts convergence.
131  // This lets the user set truncate it.
132  double Nmax_chop;
134 
135  int flatX;
136  int flatY;
137 
138  // arrays for spline fitting, if specified from file:
139  std::vector<double> xlocVec;
140  std::vector<double> dopeVec;
141  std::vector<double> y2Vec;
142  std::vector<double> splintDopeVec;
143 };
144 
145 // inline functions
146 //-----------------------------------------------------------------------------
147 // Function : DopeInfo::operator<<
148 // Purpose : "<<" operator
149 // Special Notes :
150 // Scope : public
151 // Creator : Eric R. Keiter, 9233, SNL, Parallel Computational Sciences
152 // Creation Date : 03/31/03
153 //-----------------------------------------------------------------------------
154 inline std::ostream & operator<<(std::ostream & os, const DopeInfo & di)
155 {
156  os << di.name << ":\n";
157  os << " type = " << di.type << "\n";
158  os << " funcType = " << di.funcType << "\n";
159 
160  if (di.funcType == "expression")
161  {
162  os << " exp. string = " << di.exprString << "\n";
163  }
164 
165  os << " xloc = " << di.xloc << "\n";
166  os << " xwidth = " << di.xwidth << "\n";
167  os << " yloc = " << di.yloc << "\n";
168  os << " ywidth = " << di.ywidth << "\n";
169 
170  os << " Nmax = " << di.Nmax << "\n";
171  os << " Nmin = " << di.Nmin << "\n";
172 
173  os << " flatX = " << di.flatX << "\n";
174  os << " flatY = " << di.flatY << "\n";
175 
176  os << std::endl;
177 
178  return os;
179 }
180 
181 } // namespace Device
182 } // namespace Xyce
183 
185 
186 #endif
187