Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_Specie.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_Specie.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
33 //
34 // Creation Date : 07/27/2006
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.8.2.1 $
40 //
41 // Revision Date : $Date: 2014/02/26 20:16:30 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef N_DEV_Specie_H
47 #define N_DEV_Specie_H
48 
49 #include <N_UTL_Misc.h>
50 
51 #ifdef HAVE_CMATH
52 #include <cmath>
53 #else
54 #include <math.h>
55 #endif
56 
57 #include <string>
58 #include <N_DEV_Const.h>
59 
60 namespace Xyce {
61 namespace Device {
62 
63 class Specie
64 {
65 public:
66  Specie(std::string name, double diff_prefac, double act_energy,
67  int charge_state)
68  : Name(name),
69  DiffusionPrefactor(diff_prefac),
70  ActivationEnergy(act_energy),
71  ChargeState(charge_state)
72  {
73  } ;
74 
75  inline const std::string & getName() const {return (Name); };
76  inline void setName(std::string &name) {Name = name;};
77  inline int getChargeState() {return (ChargeState);};
78  inline void setChargeState(int chargestate) {ChargeState=chargestate;};
79  inline double getDiffPrefactor() {return(DiffusionPrefactor);} ;
80  inline void setDiffPrefactor(double p) {DiffusionPrefactor=p;};
81  inline double getActEnergy() {return(ActivationEnergy);};
82  inline void setActEnergy(double Energy) {ActivationEnergy=Energy;};
83  double getDiffusionCoefficient(double Temperature);
84 private:
85  std::string Name;
89 };
90 
91 //-----------------------------------------------------------------------------
92 // Function : Specie::getDiffusionCoefficient
93 // Purpose : Accessor
94 // Special Notes :
95 // Scope : public
96 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
97 // Creation Date : 7/27/06
98 //-----------------------------------------------------------------------------
99 inline double Specie::getDiffusionCoefficient(double Temperature)
100 {
101  return DiffusionPrefactor*exp(-ActivationEnergy/(CONSTboltz*Temperature/CONSTQ));
102 }
103 
104 } // namespace Device
105 } // namespace Xyce
106 
107 #endif