Xyce  6.1
N_DEV_DeviceInterfaceNode.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-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_DeviceInterfaceNode.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 07/08/03
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.19.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:20:12 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_DEV_DeviceInterfaceNode_h
47 #define Xyce_N_DEV_DeviceInterfaceNode_h
48 
49 #include <N_LAS_fwd.h>
50 
51 namespace Xyce {
52 namespace Device {
53 
54 //-----------------------------------------------------------------------------
55 // Class : DeviceInterfaceNode
56 // Purpose : This class contains information about a single circuit node
57 // which is connected to a single device electrode.
58 // Special Notes :
59 // Creator : Eric Keiter
60 // Creation Date : 04/23/02
61 //-----------------------------------------------------------------------------
63 {
64 public:
66  eName(""), nName(""),index(-1), gid(-1), given(false),
68  stateC(-1), stateC_owned(true), currentSum(0.0), area(0.0),
69  chargeSum(0.0),
70  Vckt(0.0), Vckt_ramp(0.0), Vckt_ramp_old(0.0),
71  Vckt_old(0.0), Vckt_final(0.0), Vckt_deltaC(0.0), Vckt_delta(0.0),
72  Vckt_orig(0.0),
73  dIdVckt(0.0),
74  dQdVckt(0.0),
75  neumannBCFlagV(false),
76  neumannBCFlagN(false),
77  neumannBCFlagP(false),
79  dxdvPtr(NULL),
80  dxdvAllocated(false),
81  numCrossTerms(0),
82  material ("neutral"),
83  materialGiven(false),
84  oxideBndryFlag(false),
85  oxthick(0.0),
86  oxcharge(0.0)
87  {
88  Vcol.reserve(20);
89  Ncol.reserve(20);
90  Pcol.reserve(20);
91  areaVector.reserve(20);
92  };
93 
94 public:
95  std::string eName; // device electrode name. Should be in all upper case.
96  std::string nName; // circuit node name.
97 
98  int index; // index w.r.t. the order it was listed in the netlist.
99 
100  int labelIndex; // index into the label array.
101 
102  int gid; // global ID of the circuit node. This is the global
103  // solution vector index. (used like a Vrowarray entry)
104 
105  int lid; // local ID of the circuit node.
106  int lidOffset; // diagonal col in the ckt node matrix row. DMA only.
107 
108  std::vector<int> crossOffsets; // columns for the other ckt nodes.
109 
110  bool given; // did the user specify this node or not. If not, the
111  // device electrode with be (probably) connected to gnd.
112 
113 
115  // the mesh index for a single point on the
116  // mesh that is part of this electrode.
117 
118  // The "gid" Vcol, Ncol, and Pcol are only really used during the setup
119  // phase, when setting up (row, col) pairs.
120  // As such, they might not be needed.
121  std::vector<int> Vcol; // column array
122  std::vector<int> Ncol; // column array
123  std::vector<int> Pcol; // column array
124 
125  // geometrical stuff:
126  double area; // total area for the edge.
127  std::vector<double> areaVector; // area for each edge node
128 
129  // state variable stuff:
130  double currentSum; // sum of currents, to be stored as a state variable.
131  int stateC; // state variable index, current.
133 
134  // capacitance related stuff
135  double chargeSum; // total charge on the electrode.
136 
137  //local id's (offsets)
139 
140  // number of mesh points for this boundary.
142 
143  // from the circuit node:
144  double Vckt;
145 
146  // Vckt, before voltage limiting.
147  double Vckt_orig;
148 
149  // derivative information needed for the 2-level Newton.
150  double dIdVckt; // derivative of currentSum w.r.t. Vckt.
151  double dQdVckt; // derivative of chargeSum w.r.t. Vckt.
152 
153  std::vector<double> dFdVckt; // deriv. of residual w.r.t. Vckt.
154  std::vector<int> neighborNodes; // nodes neighboring this boundary.
155 
156  std::vector<double> dQdX; // deriv. of chargeSum w.r.t. PDE solution vars.
157  std::vector<double> dIdX; // deriv. of currentSum w.r.t. PDE solution vars.
158  std::vector<int> dIdXcols; // nodes neighboring this boundary.
159 
160  std::vector<int> dIdXoffset; // If running with DMA, use this instead of
161  // dIdXcols.
162 
164 
165  // equilibrium voltage at this electrode (if the applied voltage is
166  // zero, there is still an internal voltage drop).
167  std::vector<double> VequVec;
168 
169  // boundary conditions to be imposed on V,n and p.
170  std::vector<double> VbcVec;
171  std::vector<double> nnbcVec;
172  std::vector<double> npbcVec;
173 
174  // dxdv vector:
175  Linear::Vector * dxdvPtr;
177 
178  // this map is between mesh node ID's and the indices of VbcVec
179  std::map<int,int> meshGlobalToLocal;
180 
181  // These BC variables are only used for Continuation NL solves.
182  // first 3 are w.r.t change in Vckt between ckt iterations. Big change
183  double Vckt_old; // ckt value from the previous Newton solve.
184  double Vckt_final; // eventual ckt voltage value for the current solve.
185  double Vckt_delta; // total change in the Vckt. (Vckt_final-Vckt_old)
186 
187  // next 3, w.r.t change between continuation solves. small change
188  double Vckt_deltaC; // incremental, intermediate change in the Vckt.
189  double Vckt_ramp; // current intermediate value of Vckt used during
190  // continuation.
191  double Vckt_ramp_old; // old intermediate value of Vckt used during
192  // continuation.
193 
194  // neumann BC flag;
198 
199  // material information:
200  std::string material;
203  double oxthick;
204  double oxcharge;
205 };
206 
207 } // namespace Device
208 } // namespace Xyce
209 
210 #endif // Xyce_N_DEV_DeviceInterfaceNode_h
Pure virtual class to augment a linear system.