DEVSIM Manual
Abstract
DEVSIM TCAD Semiconductor Device Simulator Documentation
Full text
DEVSIM Manual Release 2.10.0 DEVSIM LLC
Contents Contents vi List of Figures vii List of Tables viii 1 Front matter 1 1.1 Contact ........................................... 1 1.2 Copyright .......................................... 1 1.3 Citing this work ....................................... 1 1.4 Contributing ......................................... 1 1.5 Documentation license ................................... 2 1.6 Documentation source ................................... 2 1.7 Software license ...................................... 2 1.8 Third party licenses .................................... 2 1.9 Disclaimer .......................................... 2 1.10 Trademark .......................................... 2 2 Release notes 3 2.1 Introduction ......................................... 3 2.2 Version 2.10.0 ....................................... 3 2.2.1 Regression results ................................. 3 2.2.2 Available platform builds .............................. 3 macOS ....................................... 3 Windows ...................................... 4 Linux ........................................ 4 2.2.3 Python Version ................................... 4 2.2.4 Contact Normal Model ............................... 4 2.2.5 Documentation ................................... 4 2.3 Version 2.9.1 ........................................ 4 2.4 Version 2.9.0 ........................................ 5 2.4.1 Windows Python support ............................. 5 2.4.2 VTK writer ..................................... 5 2.4.3 Clang build on Windows .............................. 5 2.5 Version 2.8.4 ........................................ 5 2.5.1 Serialization of equation command ........................ 5 2.5.2 Simulation Matrix .................................. 5 i
2.5.3 macOS Build .................................... 5 2.6 Version 2.8.3 ........................................ 6 2.6.1 Linux support .................................... 6 2.6.2 Clang format .................................... 6 2.6.3 Get equation command .............................. 6 2.6.4 Exception propagation ............................... 6 2.7 Version 2.8.2 ........................................ 6 2.7.1 Documentation refactor .............................. 6 2.8 Version 2.8.1 ........................................ 6 2.8.1 Help files ...................................... 6 2.8.2 Database command removal ........................... 7 2.9 Version 2.8.0 ........................................ 7 2.9.1 Python scripts ................................... 7 2.9.2 Data output ..................................... 7 Reduction in data file sizes ............................ 7 FLOOPS data file output ............................. 8 2.9.3 Platform support .................................. 8 Windows build issue ................................ 8 Centos 7 end of life ................................ 8 2.10 Previous releases ..................................... 8 3 Getting started 9 3.1 Introduction ......................................... 9 3.2 Getting help ......................................... 9 3.3 Supported platforms .................................... 10 3.4 Install Python ........................................ 10 3.4.1 Create virtual environment ............................ 10 Anaconda ...................................... 10 Using venv ..................................... 11 3.5 Install DEVSIM ....................................... 11 3.5.1 Install ........................................ 11 3.5.2 Test ......................................... 11 3.5.3 Running DEVSIM ................................. 12 3.6 Building from source .................................... 12 3.7 Install external software tools ............................... 12 3.7.1 Meshing ....................................... 12 Gmsh ........................................ 12 Other meshers ................................... 12 3.7.2 Visualization .................................... 13 3.7.3 Math libraries .................................... 13 BLAS and LAPACK ................................ 13 Intel MKL Pardiso ................................ 13 4 User interface 14 4.1 Starting DEVSIM ...................................... 14 4.2 Directory structure ..................................... 14 4.3 Python language ...................................... 15 4.3.1 Introduction ..................................... 15 ii
4.3.2 DEVSIM commands ................................ 15 4.3.3 Unicode support .................................. 15 4.4 Error handling ........................................ 15 4.4.1 Exceptions ..................................... 15 4.4.2 Fatal errors ..................................... 15 4.4.3 Floating point exceptions ............................. 16 4.4.4 Solver errors .................................... 16 4.4.5 Example ....................................... 16 4.5 Verbosity .......................................... 16 4.6 Command help ....................................... 17 4.7 Parallelization ........................................ 17 4.7.1 Model evaluation .................................. 17 4.7.2 Long operations .................................. 17 4.7.3 External math libraries ............................... 17 4.8 Reset simulator ....................................... 18 4.9 Array type input and output ................................ 18 5 Equation and models 19 5.1 Overview .......................................... 19 5.1.1 Structures ...................................... 23 5.2 Bulk models ......................................... 23 5.2.1 Node models .................................... 23 5.2.2 Edge models .................................... 24 5.2.3 Element edge models ............................... 25 5.2.4 Model derivatives .................................. 26 5.2.5 Conversions between model types ........................ 26 5.2.6 Equation assembly ................................. 27 5.3 Interface ........................................... 27 5.3.1 Interface models .................................. 27 5.3.2 Interface model derivatives ............................ 29 5.3.3 Interface equation assembly ........................... 29 5.4 Contact ........................................... 30 5.4.1 Contact models ................................... 30 5.4.2 Contact model derivatives ............................. 30 5.4.3 Contact equation assembly ............................ 31 5.5 Custom matrix assembly .................................. 31 5.6 Cylindrical coordinate systems .............................. 32 5.7 Notes ............................................ 33 5.7.1 Interface ....................................... 33 Interace equation coupling ............................ 33 Interface and contact surface area ........................ 33 Skip nodes shared with contact .......................... 33 5.7.2 Element assembly ................................. 33 5.7.3 Edge volume model ................................ 34 5.7.4 Element pair from edge model .......................... 34 6 Parameters 35 6.1 Parameters ......................................... 35 iii
6.2 Environment variables ................................... 36 6.3 Notes ............................................ 37 7 Circuits 38 7.1 Overview .......................................... 38 7.2 Circuit elements ...................................... 38 7.3 Connecting devices .................................... 38 7.4 Clearing circuit ....................................... 39 8 Meshing 40 8.1 1D mesher ......................................... 40 8.2 2D mesher ......................................... 41 8.3 Using an external mesher ................................. 42 8.3.1 Gmsh ........................................ 42 8.3.2 Custom mesh loading using scripting ...................... 43 8.4 Loading and saving results ................................ 43 8.5 Mesh processing ...................................... 43 8.6 Notes ............................................ 43 8.6.1 Contacts ...................................... 43 Contact material .................................. 43 Create contacts from interface .......................... 43 8.6.2 Device and mesh deletion commands ...................... 44 8.6.3 Periodic boundary conditions ........................... 44 9 Solver and numerics 45 9.1 Overview .......................................... 45 9.2 Solution methods ...................................... 45 9.2.1 DC analysis ..................................... 45 9.2.2 AC analysis ..................................... 46 9.2.3 Noise and sensitivity analysis ........................... 46 9.2.4 Transient analysis ................................. 46 9.3 Extended precision ..................................... 47 9.3.1 Platform dependence ............................... 47 9.3.2 How to control ................................... 47 9.3.3 Kahan summation in extended precision mode ................. 47 9.4 Floating point exceptions ................................. 47 9.4.1 FPE checking during external solve ....................... 47 9.4.2 Additional Information ............................... 48 9.5 Solver and math library selection ............................. 48 9.5.1 Available libraries .................................. 48 Intel Math Kernel Library ............................. 48 UMFPACK 5.1 solver ................................ 48 Custom solver ................................... 48 SuperLU ....................................... 48 9.5.2 Automatic direct solver selection ......................... 49 9.5.3 BLAS/LAPACK library selection .......................... 49 9.5.4 Default math search path ............................. 50 9.5.5 Determine loaded math libraries ......................... 50 iv
9.6 Custom direct solver .................................... 50 9.7 Diagnostics ......................................... 50 9.7.1 Problem node identification ............................ 50 9.7.2 Convergence information ............................. 51 9.8 Symbolic factorization reuse ................................ 51 9.9 Notes ............................................ 51 9.9.1 Convergence tests ................................. 51 9.9.2 Simulation matrix .................................. 52 9.9.3 Get matrix and rhs for external use ........................ 52 9.9.4 Transient analysis ................................. 52 10 SYMDIFF 53 10.1 Overview .......................................... 53 10.2 Syntax ............................................ 53 10.2.1 Variables and numbers .............................. 53 10.2.2 Basic expressions ................................. 54 10.2.3 Functions ...................................... 55 10.2.4 Commands ..................................... 57 10.2.5 User functions ................................... 57 10.2.6 Macro assignment ................................. 58 10.3 Invoking SYMDIFF from DEVSIM ............................. 59 10.3.1 Equation parser .................................. 59 10.3.2 Evaluating external math ............................. 59 10.3.3 Models ....................................... 60 11 Visualization and post processing 61 11.1 Introduction ......................................... 61 11.2 Visualization software ................................... 61 11.2.1 Overview ...................................... 61 11.2.2 Using ParaView ................................... 61 11.2.3 Using VisIt ..................................... 62 11.3 Reducing file sizes ..................................... 62 11.4 Post processing ....................................... 62 11.4.1 Index information .................................. 62 11.4.2 Element node list .................................. 62 12 Examples 63 12.1 Included examples ..................................... 63 12.2 Test scripts ......................................... 65 12.3 Related projects ...................................... 65 12.3.1 Source code .................................... 65 12.3.2 Examples ...................................... 66 12.3.3 Regression results ................................. 66 12.4 Mobile app ......................................... 66 12.5 Third party libraries ..................................... 67 13 Simple Examples 68 13.1 Capacitor .......................................... 68 v
13.1.1 Overview ...................................... 68 13.1.2 1D capacitor .................................... 68 Equations ...................................... 68 Creating the mesh ................................. 69 Setting device parameters ............................. 69 Creating the models ................................ 69 Contact boundary conditions ........................... 71 Setting the boundary conditions ......................... 71 Running the simulation .............................. 72 13.1.3 2D capacitor .................................... 72 Defining the mesh ................................. 72 Setting up the models ............................... 74 Fields for visualization ............................... 75 Running the simulation .............................. 76 13.2 Diode ............................................ 78 13.2.1 Overview ...................................... 78 13.2.2 1D diode ...................................... 78 Using the python packages ............................ 78 Creating the mesh ................................. 78 Physical models and parameters ......................... 79 Plotting the result .................................. 81 14 Command Reference 84 14.1 Circuit commands ..................................... 84 14.2 Equation commands .................................... 86 14.3 Geometry commands ................................... 90 14.4 Material commands .................................... 91 14.5 Meshing commands .................................... 93 14.6 Model commands ..................................... 99 14.7 Solver commands .....................................114 Bibliography 116 Index 117 vi
List of Figures 5.1 Mesh elements in 2D .................................... 20 5.2 Edge model constructs in 2D ............................... 21 5.3 Element edge model constructs in 2D .......................... 22 5.4 Interface constructs in 2D. Interface node pairs are located at each •. The SurfaceArea model is used to integrate flux term models. ............... 28 5.5 Contact constructs in 2D. ................................. 30 12.1 Simulation result for solving for the magnetic potential and field. The coloring is by the Z component of the magnetic potential, and the stream traces are for components of magnetic field. .................................. 64 13.1 Capacitance simulation result. The coloring is by Potential, and the stream traces are for components of ElectricField........................... 77 13.2 Carrier density versus position in 1D diode. ....................... 81 13.3 Potential and electric field versus position in 1D diode. ................. 82 13.4 Electron and hole current and recombination. ...................... 83 vii
List of Tables 1.1 Contact ........................................... 1 2.1 Added documentation files ................................ 7 3.1 Current platforms for DEVSIM ................................ 10 3.2 Python distributions .................................... 10 4.1 Directory structure for DEVSIM ............................... 14 5.1 Node models defined on each region of a device .................... 24 5.2 Edge models defined on each region of a device .................... 25 5.3 Element edge models defined on each region of a device ............... 25 5.4 Required derivatives for equation assembly. model is the name of the model being evaluated, and variable is one of the solution variables being solved at each node . 26 5.5 Required derivatives for interface equation assembly. The node model name nodemodel and its derivatives nodemodel:variable are suffixed with @r0 and @r1 to denote which region on the interface is being referred to .............. 27 6.1 Parameters controlling program behavior ........................ 36 6.2 Environment controlling program behavior ........................ 36 10.1 Basic expressions involving unary, binary, and logical operators ............ 54 10.2 Predefined functions .................................... 55 10.3 Error functions ....................................... 56 10.4 Fermi Integral functions .................................. 56 10.5 Gauss-Fermi Integral functions .............................. 56 10.6 Commands ......................................... 57 10.7 Commands for user functions ............................... 57 11.1 Open source visualization tools .............................. 61 12.1 Examples Distributed with DEVSIM ............................ 63 13.1 Python package files .................................... 78 viii
DEVSIM Manual, Release 2.10.0 Table 2.1: Added documentation files File Purpose BUILD.md Building from source CODE_OF_CONDUCT.md Code of conduct TEST.md Testing instructions 2.8.2 Database command removal The material database has been removed. •devsim.create_db •devsim.open_db •devsim.close_db •devsim.save_db •devsim.add_db_entry •devsim.get_db_entry This feature was only being used in the bioapp1 examples, and those tests have been updated. This also removes the binary dependence on SQLite. 2.9 Version 2.8.0 2.9.1 Python scripts Based on a contribution by [@simbilod](https://github.com/simbilod), all of the Python scripts have been reformatted. The build system was also updated to enforce Python script modifications are properly formatted when submitted to the project. 2.9.2 Data output Reduction in data file sizes Based on a contribution by [@simbilod](https://github.com/simbilod)devsim.write_devices() (page 98) now supports reducing the file size of data files by allowing users to specify a callback function to reduce data usage. In this example, only the NetDoping field is written to the Tecplot data file. devsim.write_devices( file="mesh2d_reduced.tec", type="tecplot", (continues on next page) 2.9. Version 2.8.0 7
DEVSIM Manual, Release 2.10.0 (continued from previous page) include_test=lambda x: x in ("NetDoping",), ) FLOOPS data file output The floops option for devsim.write_devices() (page 98) has been removed. 2.9.3 Platform support Windows build issue During testing, it was found the Visual Studio 2022 builds were failing a test related to threading. This was found to be a problem with version 17.10, but not version 17.9. This affects the build automation, but should not affect the binary releases. Centos 7 end of life This is the last version to support Centos 7 before its end of life on June 30, 2024. After this date we will be moving to the AlmaLinux 8 based manylinux_2_28. 2.10 Previous releases For older release notes, please refer to the Version 2.8.1 manual located at https://doi.org/10.5281/ zenodo.12211919. The latest version is available from https://doi.org/10.5281/zenodo.4583208. 2.10. Previous releases 8
Chapter 3 Getting started 3.1 Introduction DEVSIM is a technology computer-aided design (TCAD) software for semiconductor device simulation. While geared toward this application, it may be used where the control volume approach is appropriate for solving systems of partial-differential equations (PDE’s) on a static mesh. After introducing DEVSIM, the rest of the manual discusses the key components of the system, and instructions for their use. The primary goal of DEVSIM is to give the user as much flexibility and control as possible. In this regard, few models are coded into the program binary. They are implemented in human-readable scripts that can be modified if necessary. DEVSIM has a scripting language interface (User interface (page 14)). This provides control structures and language syntax in a consistent and intuitive manner. The user is provided an environment where they can implement new models on their own. This is without requiring extensive vendor support or use of compiled programming languages. SYMDIFF (SYMDIFF (page 53)) is the symbolic expression parser used to allow the formulation of device equations in terms of models and parameters. Using symbolic differentiation, the required partial derivatives can be generated, or provided by the user. DEVSIM then assembles these equations over the mesh. 3.2 Getting help Please see Contact (page 1) for project contact information. The most responsive method is to contact the online forum at https://forum.devsim.org. Additional information, with links to documentation is available at https://devsim.org. Additional documentation files released with the simulator are presented at https://pypi.org/project/devsim/. 9
DEVSIM Manual, Release 2.10.0 3.3 Supported platforms DEVSIM is compiled and tested on the platforms in Table 3.1. Table 3.1: Current platforms for DEVSIM Platform Architecture OS Version Microsoft Windows x64 Microsoft Windows 10 Linux x86_64, aarch64 Red Hat Enterprise Linux 8 (AlmaLinux 8 compatible) Apple macOS arm64 macOS 14.7.6 (Sonoma) These are the minimum supported platforms, and also expected to work on newer versions of these operating systems. If you require a version on a different software platform, please contact us Contact (page 1). 3.4 Install Python APython version of 3.7 or higher is needed to run DEVSIM. This requirement is often met by the default installations of the above systems. In addition, it is possible to download other Python versions online. Popular distributions of Python are listed in Table 3.2. Table 3.2: Python distributions Vendor Path Website Anaconda $CONDA_PREFIX https://www.anaconda.com Python.org $VIRTUAL_ENV https://python.org 3.4.1 Create virtual environment Creating a virtual environment is needed so DEVSIM may necessary math libraries, as discussed in Default math search path (page 50). The numpy package is also recommended to ensure that needed math libraries are available. Anaconda Using the conda package manager in an Anaconda, a virtual environment is created using. conda create -n denv python numpy conda activate denv where denv is the name of the environment. If you are using a x64 or x86_64 based system, you may install the Intel Math Kernel Library with the Pardiso Solver. 3.3. Supported platforms 10
DEVSIM Manual, Release 2.10.0 conda install mkl Using venv For other Python distributions, the requisite packages may be installed by using a venv based virtual environment. python3 -mvenv denv source denv/bin/activate pip install numpy where denv is the name of directory containing the environment. If you are using a x64 or x86_64 based system, you may install the Intel Math Kernel Library with the Pardiso Solver. pip install mkl 3.5 Install DEVSIM 3.5.1 Install DEVSIM is available from PyPI (https://pypi.org/project/devsim/) using pip. To install this package for your platform: pip install devsim Please see the devsim_data/INSTALL.md file in the distribution for more information. This files may be found in the prefix directory for your chosen environment listed in Table 3.2. 3.5.2 Test To ensure a proper installation, please type the following at a Python prompt. >>> import devsim Searching DEVSIM_MATH_LIBS="libopenblas.dylib:liblapack.dylib:libblas.dylib" Loading "libopenblas.dylib": ALL BLAS/LAPACK LOADED Skipping liblapack.dylib Skipping libblas.dylib loading UMFPACK 5.1 as direct solver Note that there will be an error if no math libraries are available. >>> import devsim Searching DEVSIM_MATH_LIBS="libopenblas.so:liblapack.so:libblas.so" Loading "libopenblas.so": MISSING DLL (continues on next page) 3.5. Install DEVSIM 11
DEVSIM Manual, Release 2.10.0 (continued from previous page) Loading "liblapack.so": MISSING DLL Loading "libblas.so": MISSING DLL Error loading math libraries. Please install a suitable BLAS/LAPACK library and␣ ,→set DEVSIM_MATH_LIBS. Alternatively, install the Intel MKL. libblas.so: cannot open shared object file: No such file or directory Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/venv/lib/python3.8/site-packages/devsim/__init__.py", line 8,␣ ,→in <module> from .devsim_py3 import * RuntimeError: Issues initializing DEVSIM. 3.5.3 Running DEVSIM See User interface (page 14) for instructions on how to invoke DEVSIM. 3.6 Building from source Building from source is possible, and is useful when you want to extend the simulator, use compiler optimizations, or port to a new platform. See the BUILD.md file in the project files for more information. 3.7 Install external software tools 3.7.1 Meshing Gmsh Gmsh [2] is available from https://gmsh.info.DEVSIM is able to import triangular or tetrahedral meshes from this application. More information is in Gmsh (page 42). Other meshers It is also possible to import other mesh formats by writing a converter in Python, as described in Custom mesh loading using scripting (page 43). 3.6. Building from source 12
DEVSIM Manual, Release 2.10.0 3.7.2 Visualization See Visualization software (page 61) for a listing of available meshing tools, which are known to work with DEVSIM. 3.7.3 Math libraries BLAS and LAPACK These are the basic linear algebra routines used in DEVSIM and their selection is described in BLAS/LAPACK library selection (page 49). Intel MKL Pardiso This library may be installed and selected using the instructions in Available libraries (page 48). 3.7. Install external software tools 13
Chapter 4 User interface 4.1 Starting DEVSIM Refer to Supported platforms (page 10) for instructions on how to install DEVSIM. Once installed, DEVSIM may be invoked using the following command devsim is loaded by calling import devsim from Python. Many of the examples in the distribution rely on the python_packages module, which is available by using: import devsim.python_packages 4.2 Directory structure ADEVSIM directory is created with the following sub directories listed in Directory structure for DEVSIM (page 14). Table 4.1: Directory structure for DEVSIM devsim_data contains project documentation files devsim_data/doc product documentation devsim_data/examples example scripts devsim_data/testing additional examples used for testing This may be found using the virtual environment path specified in Table 3.2. 14
DEVSIM Manual, Release 2.10.0 4.3 Python language 4.3.1 Introduction Python is the scripting language employed as the text interface to DEVSIM. Documentation and tutorials for the language are available from [1]. A paper discussing the general benefits of using scripting languages may be found in [5]. 4.3.2 DEVSIM commands All of commands are in the devsim namespace. In order to invoke a command, the command should be prefixed with devsim., or the following may be placed at the beginning of the script: from devsim import * 4.3.3 Unicode support Internally, DEVSIM uses UTF-8 encoding, and expects model equations and saved mesh files to be written using this encoding. Care should be taken when using non-ASCII characters in names for visualization using the tools in Visualization and post processing (page 61), as this character set may not be supported in these third-party tools. 4.4 Error handling 4.4.1 Exceptions When a syntax error occurs in a Python script an exception may be thrown. If it is uncaught, then DEVSIM will terminate. An exception that is thrown by DEVSIM is of the type devsim.error. It may be caught, and a message may be extracted to determine the issue. 4.4.2 Fatal errors When DEVSIM enters a state in which it may not recover. The interpreter will throw a devsim.error exception with a message DEVSIM FATAL. At this point DEVSIM may enter an inconsistent state, so it is suggested not to attempt to continue script execution if this occurs. In rare situations, the program may behave in an erratic manner, print a message, such as UNEXPECTED or terminate abruptly. Please report this using the contact information in Contact (page 1). 4.3. Python language 15
DEVSIM Manual, Release 2.10.0 4.4.3 Floating point exceptions During model evaluation, DEVSIM will attempt to detect floating point issues and return an error with some diagnostic information printed to the screen, such as the symbolic expression being evaluated. Floating point errors may be characterized as invalid, division by zero, and numerical overflow. This is considered to be a fatal error. 4.4.4 Solver errors When using the devsim.solve() (page 114), the solver may not converge and a message will be printed and an exception may be thrown. The solution will be restored to its previous value before the simulation began. This exception may be caught and the bias conditions may be changed so the simulation may be continued. 4.4.5 Example More helpful exception information returned to Python if the error is considered fatal. This can be used to decide if the simulation can be restarted. Note that if this occurs during a solve, it is necessary for the user to restore the previous circuit and device solutions if a restart is desired. In addition, model evaluation is reset so that no false cyclic dependencies are reported after an error. In this example code below, the previously DEVSIM FATAL error string will now provide the context that a floating point exception occurred and be handled in Python. try: self.solve() except error as msg: m = str(msg) if 'Convergence failure'in m: self.set_vapp(last_bias) elif'floating point exception'in m: self.set_vapp(last_bias) self.restore_callback(self.is_circuit) else: raise 4.5 Verbosity The set_parameter() may be used to set the verbosity globally, per device, or per region. Setting the debug_level parameter to info results in the default level of information to the screen. Setting this option to verbose or any other name results in more information to the screen which may be useful for debugging. The following example sets the default level of debugging for the entire simulation, except that the gate region will have additional debugging information. 4.5. Verbosity 16
DEVSIM Manual, Release 2.10.0 5.1.1 Structures Devices Adevice refers to a discrete structure being simulated. It is composed of the following types of objects. Regions Aregion defines a portion of the device of a specific material. Each region has its own system of equations being solved. Interfaces An interface connects two regions together. At the interfaces, equations are specified to account for how the flux in each device region crosses the region boundary. Contacts Acontact specifies the boundary conditions required for device simulation. It also specifies how terminal currents are are integrated into an external circuit. 5.2 Bulk models 5.2.1 Node models Node models may be specified in terms of other node models, mathematical functions, and parameters on the device. The simplest model is the node solution, and it represents the solution variables being solved for. Node models automatically created for a region are listed in Node models defined on each region of a device (page 24). In this example, we present an implementation of Shockley Read Hall recombination [4]. USRH="-ElectronCharge*(Electrons*Holes - n_i^2)/(taup*(Electrons + n1) \ + taun*(Holes + p1))") dUSRHdn="simplify(diff(%s , Electrons))" %USRH dUSRHdp="simplify(diff(%s , Holes))" %USRH devsim.node_model(device='MyDevice', region='MyRegion', name="USRH", equation=USRH) devsim.node_model(device='MyDevice', region='MyRegion', name="USRH:Electrons", equation=dUSRHdn) devsim.node_model(device='MyDevice', region='MyRegion', name="USRH:Holes", equation=dUSRHdp) The first model specified, USRH, is the recombination model itself. The derivatives with respect to electrons and holes are USRH:Electrons and USRH:Holes, respectively. In this particular example Electrons and Holes have already been defined as solution variables. The remaining variables in the equation have already been specified as parameters. The diff function tells the equation parser to take the derivative of the original expression, with respect to the variable specified as the second argument. During equation assembly, these derivatives are required in order to converge upon a solution. The simplify function tells the expression parser to attempt to simplify the expression as much as possible. 5.2. Bulk models 23
DEVSIM Manual, Release 2.10.0 Table 5.1: Node models defined on each region of a device Node Model Description AtContactNode Evaluates to 1 if node is a contact node, otherwise 0 NodeVolume The volume of the node. Used for volume integration of node models on nodes in mesh NSurfaceNormal_x The surface normal to points on the interface (2D and 3D) NSurfaceNormal_y The surface normal to points on the interface (2D and 3D) NSurfaceNormal_z The surface normal to points on the interface (3D) SurfaceArea The surface area of a node on interface nodes, otherwise 0 ContactSurfaceArea The surface area of a node on contact nodes, otherwise 0 ContactNSurfaceNormal_x The surface normal to points on the contact (2D and 3D) ContactNSurfaceNormal_y The surface normal to points on the contact (2D and 3D) ContactNSurfaceNormal_z The surface normal to points on the contact (3D) coordinate_index Coordinate index of the node on the device node_index Index of the node in the region xx position of the node yy position of the node zz position of the node 5.2.2 Edge models Edge models may be specified in terms of other edge models, mathematical functions, and parameters on the device. In addition, edge models may reference node models defined on the ends of the edge. As depicted in Edge model constructs in 2D (page 21), edge models are with respect to the two nodes on the edge, n0 and n1. For example, to calculate the electric field on the edges in the region, the following scheme is employed: devsim.edge_model(device="device", region="region", name="ElectricField", equation="(Potential@n0 - Potential@n1)*EdgeInverseLength") devsim.edge_model(device="device", region="region", name="ElectricField:Potential@n0", equation="EdgeInverseLength") devsim.edge_model(device="device", region="region", name="ElectricField:Potential@n1", equation="-EdgeInverseLength") In this example, EdgeInverseLength is a built-in model for the inverse length between nodes on an edge. Potential@n0 and Potential@n1 is the Potential node solution on the nodes at the end of the edge. These edge quantities are created using the devsim.edge_from_node_model() (page 102). In addition, the devsim.edge_average_model() (page 102) can be used to create edge models in terms of node model quantities. Edge models automatically created for a region are listed in Edge models defined on each region of a device (page 25). 5.2. Bulk models 24
DEVSIM Manual, Release 2.10.0 Table 5.2: Edge models defined on each region of a device Edge Model Description EdgeCouple The length of the perpendicular bisector of an element edge. Used to perform surface integration of edge models on edges in mesh. EdgeNodeVolume The volume for each node on an edge. Used to perform volume integration of edge models on edges in mesh. EdgeInverseLength Inverse of the EdgeLength. EdgeLength The distance between the two nodes of an edge edge_index Index of the edge on the region unitx x component of the unit vector along an edge unity y component of the unit vector along an edge (2D and 3D) unitz z component of the unit vector along an edge (3D only) 5.2.3 Element edge models Element edge models are used when the edge quantitites cannot be specified entirely in terms of the quantities on both nodes of the edge, such as when the carrier mobility is dependent on the normal electric field. In 2D, element edge models are evaluated on each triangle edge. As depicted in Element edge model constructs in 2D (page 22), edge models are with respect to the three nodes on each triangle edge and are denoted as en0,en1, and en2. Derivatives are with respect to each node on the triangle. In 3D, element edge models are evaluated on each tetrahedron edge. Derivatives are with respect to the nodes on both triangles on the tetrahedron edge. Element edge models automatically created for a region are listed in Element edge models defined on each region of a device (page 25). As an alternative to treating integrating the element edge model with respect to ElementEdgeCouple, the integration may be performed with respect to ElementNodeVolume. See devsim.equation() (page 87) for more information. Table 5.3: Element edge models defined on each region of a device Element Edge Model Description ElementEdgeCouple The length of the perpendicular bisector of an edge. Used to perform surface integration of element edge model on element edge in the mesh. ElementNodeVolume The node volume at either end of each element edge. 5.2. Bulk models 25
DEVSIM Manual, Release 2.10.0 5.2.4 Model derivatives To converge upon the solution, derivatives are required with respect to each of the solution variables in the system. DEVSIM will look for the required derivatives. For a model model, the derivatives with respect to solution variable variable are presented in Required derivatives for equation assembly. model is the name of the model being evaluated, and variable is one of the solution variables being solved at each node (page 26). Table 5.4: Required derivatives for equation assembly. model is the name of the model being evaluated, and variable is one of the solution variables being solved at each node Model Type Derivatives Required Node Model model:variable Edge Model model:variable@n0,model:variable@n1 Element Edge Model model:variable@en0,model:variable@en1, model:variable@en2,model:variable@en3 (3D) 5.2.5 Conversions between model types The devsim.edge_from_node_model() (page 102) is used to create edge models referring to the nodes connecting the edge. For example, the edge models Potential@n0 and Potential@n1 refer to the Potential node model on each end of the edge. The devsim.edge_average_model() (page 102) creates an edge model which is either the arithmetic mean, geometric mean, gradient, or negative of the gradient of the node model on each edge. When an edge model is referred to in an element edge model expression, the edge values are implicity converted into element edge values during expression evaluation. In addition, derivatives of the edge model with respect to the nodes of an element edge are required, they are converted as well. For example, edgemodel:variable@n0 and edgemodel:variable@n1 are implicitly converted to edgemodel:variable@en0 and edgemodel:variable@en1, respectively. The devsim.element_from_edge_model() (page 104) is used to create directional components of an edge model over an entire element. The derivative option is used with this command to create the derivatives with respect to a specific node model. The devsim.element_from_node_model() (page 105) is used to create element edge models referring to each node on the element of the element edge. 5.2. Bulk models 26
DEVSIM Manual, Release 2.10.0 5.2.6 Equation assembly Bulk equations are specified in terms of the node, edge, and element edge models using the devsim.equation() (page 87). Node models are integrated with respect to the node volume. Edge models are integrated with the perpendicular bisectors along the edge onto the nodes on either end. Element edge models are treated as flux terms and are integrated with respect to ElementEdgeCouple using the element_model option. Alternatively, they may be treated as source terms and are integrated with respect to ElementNodeVolume using the volume_node0_model and volume_node1_model option. In this example, we are specifying the Potential Equation in the region to consist of a flux term named PotentialEdgeFlux and to not have any node volume terms. devsim.equation(device="device", region="region", name="PotentialEquation", variable_name="Potential", edge_model="PotentialEdgeFlux", variable_update="log_damp" ) In addition, the solution variable coupled with this equation is Potential and it will be updated using logarithmic damping. Table 5.5: Required derivatives for interface equation assembly. The node model name nodemodel and its derivatives nodemodel:variable are suffixed with @r0 and @r1 to denote which region on the interface is being referred to Model Type Model Name Derivatives Required Node Model (region 0) nodemodel@r0 nodemodel:variable@r0 Node Model (region 1) nodemodel@r1 nodemodel:variable@r1 Interface Node Model inodemodel inodemodel:variable@r0, inodemodel:variable@r1 5.3 Interface 5.3.1 Interface models Interface constructs in 2D. Interface node pairs are located at each \bullet. The SurfaceArea model is used to integrate flux term models. (page 28) depicts an interface in DEVSIM. It is a collection of overlapping nodes existing in two regions, r0 and r1. Interface models are node models specific to the interface being considered. They are unique from bulk node models, in the sense that they may refer to node models on both sides of the interface. They are specified using the devsim.interface_model() (page 109). Interface models may refer to node models or parameters on either side of the interface using the syntax nodemodel@r0 and nodemodel@r1 to refer to the node model in the first and second regions of the interface. The naming convention for node models, interface node models, and their derivatives are shown in 5.3. Interface 27
DEVSIM Manual, Release 2.10.0 r1 r0 SurfaceArea Fig. 5.4: Interface constructs in 2D. Interface node pairs are located at each •. The SurfaceArea model is used to integrate flux term models. 5.3. Interface 28
DEVSIM Manual, Release 2.10.0 Required derivatives for interface equation assembly. The node model name nodemodel and its derivatives nodemodel:variable are suffixed with @r0 and @r1 to denote which region on the interface is being referred to (page 27). devsim.interface_model(device="device", interface="interface", name="continuousPotential", equation="Potential@r0-Potential@r1") 5.3.2 Interface model derivatives For a given interface model, model, the derivatives with respect to the variable variable in the regions are •model:variable@r0 •model:variable@r1 devsim.interface_model(device="device", interface="interface", name="continuousPotential:Potential@r0", equation="1") devsim.interface_model(device="device", interface="interface", name="continuousPotential:Potential@r1", equation="-1") 5.3.3 Interface equation assembly There are three types of interface equations considered in DEVSIM. They are both activated using the devsim.interface_equation() (page 90). In the first form, continuous, the equations for the nodes on both sides of the interface are integrated with respect to their volumes and added into the same equation. An additional equation is then specified to relate the variables on both sides. In this example, continuity in the potential solution across the interface is enforced, using the continuousPotential model defined in the previous section. devsim.interface_equation(device="device", interface="interface", name= ,→"PotentialEquation", interface_model="continuousPotential",type="continuous") In the second form, fluxterm, a flux term is integrated over the surface area of the interface and added to the first region, and subtracted from the second. In the third form, hybrid, equations for nodes on both sides of the interface are added into the equation for the node in the first region. The equation for the node on the second interface is integrated in the second region, and the fluxterm is subracted in the second region. 5.3. Interface 29
DEVSIM Manual, Release 2.10.0 5.4 Contact circuit_node Fig. 5.5: Contact constructs in 2D. 5.4.1 Contact models Contact constructs in 2D. (page 30) depicts how a contact is treated in a simulation. It is a collection of nodes on a region. During assembly, the specified models form an equation, which replaces the equation applied to these nodes for a bulk node. Contact models are equivalent to node and edge models, and are specified using the devsim. contact_node_model() (page 99) and the devsim.contact_edge_model() (page 99), respectively. The key difference is that the models are only evaluated on the contact nodes for the contact specified. 5.4.2 Contact model derivatives The derivatives are equivalent to the discussion in Model derivatives (page 26). If external circuit boundary conditions are being used, the model model derivative with respect to the circuit node node name should be specified as model:node. 5.4. Contact 30
DEVSIM Manual, Release 2.10.0 5.4.3 Contact equation assembly The devsim.contact_equation() (page 86) is used to specify the boundary conditions on the contact nodes. The models specified replace the models specified for bulk equations of the same name. For example, the node model specified for the contact equation is assembled on the contact nodes, instead of the node model specified for the bulk equation. Contact equation models not specified are not assembled, even if the model exists on the bulk equation for the region attached to the contact. As an example devsim.contact_equation(device="device", contact="contact", name="PotentialEquation ,→", node_model="contact_bc", edge_charge_model="DField") Current models refer to the instantaneous current flowing into the device. Charge models refer to the instantaneous charge at the contact. During a transient, small-signal or ac simulation, the time derivative is taken so that the net current into a circuit node is I(t) = i(t)+ ∂q(t) ∂t where iis the integrated current and qis the integrated charge. 5.5 Custom matrix assembly The devsim.custom_equation() (page 87) command is used to register callbacks to be called during matrix and right hand side assembly. The Python procedure should expect to receive two arguments and return two lists and a boolean value. For example a procedure named myassemble registered with devsim.custom_equation(name="test1", procedure="myassemble") expects two arguments def myassemble(what, timemode): . . . return rcv, rv, True where what may be passed as one of MATRIXONLY RHS MATRIXANDRHS and timemode may be passed as one of 5.5. Custom matrix assembly 31
DEVSIM Manual, Release 2.10.0 DC TIME When timemode is DC, the time-independent part of the equation is returned. When timemode is TIME, the time-derivative part of the equation is returned. The simulator will scale the timederivative terms with the proper frequency or time scale. The return value from the procedure must return two lists and a boolean value of the form [1 1 1.0 2 2 1.0 1 2 -1.0 2 1 -1.0 2 2 1.0], [1 1.0 2 1.0 2 -1.0], True where the length of the first list is divisible by 3 and contains the row, column, and value to be assembled into the matrix. The second list is divisible by 2 and contains the right hand side entries. Either list may be empty. The boolean value denotes whether the matrix and right hand side entries should be row permutated. A value of True should be used for assembling bulk equations, and a value of False should be used for assembling contact and interface boundary conditions. The devsim.get_circuit_equation_number() (page 85) may be used to get the equation numbers corresponding to circuit node names. The devsim.get_equation_numbers() (page 89) may be used to find the equation number corresponding to each node index in a region. The matrix and right hand side entries should be scaled by the NodeVolume if they are assembled into locations in a device region as volume integration. 5.6 Cylindrical coordinate systems In 2D, models representing the edge couples, surface areas and node volumes may be generated using the following commands: •devsim.cylindrical_edge_couple() (page 99) •devsim.cylindrical_node_volume() (page 100) •devsim.cylindrical_surface_area() (page 100) In order to change the integration from the default models to cylindrical models, the following parameters may be set set_parameter(name="node_volume_model", value="CylindricalNodeVolume") set_parameter(name="edge_couple_model", value="CylindricalEdgeCouple") set_parameter(name="edge_node0_volume_model", value="CylindricalEdgeNodeVolume@n0") set_parameter(name="edge_node1_volume_model", value="CylindricalEdgeNodeVolume@n1") set_parameter(name="element_edge_couple_model", value="ElementCylindricalEdgeCouple") set_parameter(name="element_node0_volume_model", (continues on next page) 5.6. Cylindrical coordinate systems 32
DEVSIM Manual, Release 2.10.0 The circuit node names may be used in any model expression on the regions and interfaces. However, the simulator will only take derivatives with respect to circuit nodes names on models used to compose the contact equation. 7.4 Clearing circuit The devsim.delete_circuit() (page 85) command may be used to remove the circuit completely. 7.4. Clearing circuit 39
Chapter 8 Meshing 8.1 1D mesher DEVSIM has an internal 1D mesher and the proper sequence of commands follow in this example. devsim.create_1d_mesh(mesh="cap") devsim.add_1d_mesh_line(mesh="cap", pos=0, ps=0.1, tag="top") devsim.add_1d_mesh_line(mesh="cap", pos=0.5, ps=0.1, tag="mid") devsim.add_1d_mesh_line(mesh="cap", pos=1, ps=0.1, tag="bot") devsim.add_1d_contact(mesh="cap", name="top", tag="top", material="metal") devsim.add_1d_contact(mesh="cap", name="bot", tag="bot", material="metal") devsim.add_1d_interface(mesh="cap", name="MySiOx", tag="mid") devsim.add_1d_region(mesh="cap", material="Si", region="MySiRegion", tag1="top", tag2="mid") devsim.add_1d_region(mesh="cap", material="Ox", region="MyOxRegion", tag1="mid", tag2="bot") devsim.finalize_mesh(mesh="cap") devsim.create_device(mesh="cap", device="device") The devsim.create_1d_mesh() (page 96) is first used to initialize the specification of a new mesh by the name specified with the command option. The devsim.add_1d_mesh_line() (page 93) is used to specify the end points of the 1D structure, as well as the location of points where the spacing changes. The command is used to create reference labels used for specifying the contacts, interfaces and regions. The devsim.add_1d_contact() (page 93), devsim.add_1d_interface() (page 93) and devsim. add_1d_region() (page 93) are used to specify the contacts, interfaces and regions for the device. Once the meshing commands have been completed, the devsim.finalize_mesh() (page 98) is called to create a mesh structure and then devsim.create_device() (page 96) is used to create a device using the mesh. 40
DEVSIM Manual, Release 2.10.0 8.2 2D mesher Similar to the 1D mesher, the 2D mesher uses a sequence of non-terminating mesh lines are specified in both the x and y directions to specify a mesh structure. As opposed to using tags, the regions are specified using devsim.add_2d_region() (page 95) as box coordinates on the mesh coordinates. The contacts and interfaces are specified using boxes, however it is best to ensure the the interfaces and contacts encompass only one line of points. devsim.create_2d_mesh(mesh="cap") devsim.add_2d_mesh_line(mesh="cap",dir="y", pos=-0.001, ps=0.001) devsim.add_2d_mesh_line(mesh="cap",dir="x", pos=xmin, ps=0.1) devsim.add_2d_mesh_line(mesh="cap",dir="x", pos=xmax, ps=0.1) devsim.add_2d_mesh_line(mesh="cap",dir="y", pos=ymin, ps=0.1) devsim.add_2d_mesh_line(mesh="cap",dir="y", pos=ymax, ps=0.1) devsim.add_2d_mesh_line(mesh="cap",dir="y", pos=+1.001, ps=0.001) devsim.add_2d_region(mesh="cap", material="gas", region="gas1", yl=-.001, yh=0.0) devsim.add_2d_region(mesh="cap", material="gas", region="gas2", yl=1.0, yh=1.001) devsim.add_2d_region(mesh="cap", material="Oxide", region="r0", xl=xmin, xh=xmax, yl=ymid1, yh=ymin) devsim.add_2d_region(mesh="cap", material="Silicon", region="r1", xl=xmin, xh=xmax, yl=ymid2, yh=ymid1) devsim.add_2d_region(mesh="cap", material="Silicon", region="r2", xl=xmin, xh=xmax, yl=ymid2, yh=ymax) devsim.add_2d_interface(mesh="cap", name="i0", region0="r0", region1="r1") devsim.add_2d_interface(mesh="cap", name="i1", region0="r1", region1="r2", xl=0, xh=1, yl=ymid2, yh=ymid2, bloat=1.0e-10) devsim.add_2d_contact(mesh="cap", name="top", region="r0", yl=ymin, yh=ymin, bloat=1.0e-10, material="metal") devsim.add_2d_contact(mesh="cap", name="bot", region="r2", yl=ymax, yh=ymax, bloat=1.0e-10, material="metal") devsim.finalize_mesh(mesh="cap") devsim.create_device(mesh="cap", device="device") In the current implementation of the software, it is necessary to create a region on both sides of the contact in order to create a contact using devsim.add_2d_contact() (page 94) or an interface using devsim.add_2d_interface() (page 94). Once the meshing commands have been completed, the devsim.finalize_mesh() (page 98) is called to create a mesh structure and then devsim.create_device() (page 96) is used to create a device using the mesh. 8.2. 2D mesher 41
DEVSIM Manual, Release 2.10.0 8.3 Using an external mesher 8.3.1 Gmsh The Gmsh meshing software (see Gmsh (page 12)) can be used to create a 1D, 2D, or 3D mesh suitable for use in DEVSIM.DEVSIM supports reading version 2.2 meshes from Gmsh. In order to write this format, it is necessary to specify the mesh format when writing out a mesh file. From the gmsh command line, use the -format msh2 option. When creating the mesh file using the software, use physical group names to map the difference entities in the resulting mesh file to a group name. In this example, a MOS structure is read in: devsim.create_gmsh_mesh(file="gmsh_mos2d.msh", mesh="mos2d") devsim.add_gmsh_region(mesh="mos2d" gmsh_name="bulk", region="bulk", material="Silicon") devsim.add_gmsh_region(mesh="mos2d" gmsh_name="oxide", region="oxide", material="Silicon") devsim.add_gmsh_region(mesh="mos2d" gmsh_name="gate", region="gate", material="Silicon") devsim.add_gmsh_contact(mesh="mos2d" gmsh_name="drain_contact", region="bulk", name="drain", material="metal") devsim.add_gmsh_contact(mesh="mos2d" gmsh_name="source_contact", region="bulk", name="source", material="metal") devsim.add_gmsh_contact(mesh="mos2d" gmsh_name="body_contact", region="bulk", name="body", material="metal") devsim.add_gmsh_contact(mesh="mos2d" gmsh_name="gate_contact", region="gate", name="gate", material="metal") devsim.add_gmsh_interface(mesh="mos2d" gmsh_name="gate_oxide_interface", region0="gate", region1="oxide", name="gate_oxide") devsim.add_gmsh_interface(mesh="mos2d" gmsh_name="bulk_oxide_interface", region0="bulk", region1="oxide", name="bulk_oxide") devsim.finalize_mesh(mesh="mos2d") devsim.create_device(mesh="mos2d", device="mos2d") Once the meshing commands have been completed, the devsim.finalize_mesh() (page 98) is called to create a mesh structure and then devsim.create_device() (page 96) is used to create a device using the mesh. 8.3. Using an external mesher 42
DEVSIM Manual, Release 2.10.0 8.3.2 Custom mesh loading using scripting It is also possible to arbitrarily load a mesh from a Python using the devsim.create_gmsh_mesh() (page 97). This is explained in the Notes section of the command. In addition, please see the testing/pythonmesh1d script for a simple demonstration script. These meshes may only contain points, lines, triangles, and tetrahedra. Hybrid meshes or uniform meshes containing other elements are not supported at this time. 8.4 Loading and saving results The devsim.write_devices() (page 98) is used to create an ASCII file suitable for saving data for restarting the simulation later. The devsim format encodes structural information, as well as the commands necessary for generating the models and equations used in the simulation. The devsim_data format is used for storing numerical information for use in other programs for analysis. The devsim.load_devices() (page 98) is then used to reload the device data for restarting the simulation. 8.5 Mesh processing See Examples (page 63) for examples involving mesh processing. 8.6 Notes 8.6.1 Contacts Contact material Contacts requires a material setting (e.g. metal). This is for informational purposes. Contact models still look up parameter values based on the region they are located. Create contacts from interface The devsim.create_contact_from_interface() (page 96) may be used to create a contact at the location of an interface. This is useful when contact boundary conditions are needed for a region connected to the interface. 8.4. Loading and saving results 43
DEVSIM Manual, Release 2.10.0 8.6.2 Device and mesh deletion commands The devsim.delete_device() (page 98) command makes it possible to delete devices so they will no longer be solved in the simulation. Any parameters set on the device are also removed from the system. The devsim.delete_mesh() (page 98) command makes it possible to delete meshes. Once a mesh has been deleted, it is no longer possible to create devices from it using the devsim. create_device() (page 96) command. 8.6.3 Periodic boundary conditions The devsim.create_interface_from_nodes() (page 97) command makes it possible to create an interface with non coincident nodes. This enables the use of periodic boundary conditions. 8.6. Notes 44
Chapter 9 Solver and numerics 9.1 Overview DEVSIM offers a range of simulation algorithms. DC The DC operating point analysis is useful for performing steady-state simulation for a different bias conditions. AC At each DC operating point, a small-signal AC analysis may be performed. An AC source is provided through a circuit and the response is then simulated. This is useful for both quasi-static capacitance simulation, as well as RF simulation. Noise/Sensitivity Noise analysis may be used to evaluate how internal noise sources are observed in the terminal currents of the device or circuit. Using this method, it is also possible to simulate how the device response changes when device parameters are changed. Transient DEVSIM is able to simulate the nonlinear transient behavior of devices, when the bias conditions change with time. 9.2 Solution methods DEVSIM uses Newton methods to solve the system of PDE’s. All of the analyses are performed using the devsim.solve() (page 114). 9.2.1 DC analysis A DC analysis is performed using the devsim.solve() (page 114). solve(type="dc", absolute_error=1.0e10, relative_error=1e-7 maximum_iterations=30) 45
DEVSIM Manual, Release 2.10.0 9.2.2 AC analysis An AC analysis is performed using the devsim.solve() (page 114). A circuit voltage source is required to set the AC source. 9.2.3 Noise and sensitivity analysis An noise analysis is performed using the devsim.solve() (page 114) command. A circuit node is specified in order to find its sensitivity to changes in the bulk quantities of each device. If the circuit node is named V1.I. A noise simulation is performed using: solve(type="noise", frequency=1e5, output_node="V1.I") Noise and sensitivity analysis is performed using the devsim.solve() (page 114). If the equation begin solved is PotentialEquation, the names of the scalar impedance field is then: •V1.I_PotentialEquation_real •V1.I_PotentialEquation_imag and the vector impedance fields evaluated on the nodes are •V1.I_PotentialEquation_real_gradx •V1.I_PotentialEquation_imag_gradx •V1.I_PotentialEquation_real_grady (2D and 3D) •V1.I_PotentialEquation_imag_grady (2D and 3D) •V1.I_PotentialEquation_real_gradz (3D only) •V1.I_PotentialEquation_imag_gradz (3D only) 9.2.4 Transient analysis Transient analysis is performed using the devsim.solve() (page 114). DEVSIM supports timeintegration of the device PDE’s. The three methods are supported are: • BDF1 • TRBDF • BDF2 9.2. Solution methods 46
DEVSIM Manual, Release 2.10.0 9.3 Extended precision 9.3.1 Platform dependence Extended precision is available on all binaries. For Linux x86_64, this uses the 128-bit precision available with the GCC compilers. On other platforms, x64,arm64,aarch64, the cpp_bin_float_quad type is used from the boost libraries, and is similar to 128-bit precision. 9.3.2 How to control The following new parameters are available: •extended_solver, extended precision matrix for Newton and linear solver •extended_model, extended precision model evaluation •extended_equation, extended precision equation assembly Default geometric models, are also calculated with extended precision. devsim.set_parameter(name ="extended_solver", value=True) devsim.set_parameter(name ="extended_model", value=True) devsim.set_parameter(name ="extended_equation", value=True) 9.3.3 Kahan summation in extended precision mode The kahan3 and kahan4 functions use the Kahan summation algorithm for extended precision model evaluation. With this change, better than 128-bit floating precision is available when extended precision is enabled. devsim.set_parameter(name = "extended_model", value=True) The testing/kahan_float128.py script demonstrates this. 9.4 Floating point exceptions 9.4.1 FPE checking during external solve On arm64 and aarch64 platforms, the software does not check for floating point exceptions (FPEs) during usage of the direct solver. During testing, it was discovered that FPEs were occuring during factorization for both the SuperLU and the UMFPACK 5.1. Removing this check allows more of the tests to run through to completion. 9.3. Extended precision 47
DEVSIM Manual, Release 2.10.0 9.4.2 Additional Information Please see Floating point exceptions (page 16). 9.5 Solver and math library selection 9.5.1 Available libraries Intel Math Kernel Library A specific version is not required when loading the Intel Math Kernel Library. This method is the default for x64 and x86_64 systems. Instructions for installing in a Python virtual environment are given in Create virtual environment (page 10). UMFPACK 5.1 solver The UMFPACK 5.1 solver is now available as a shared library distributed with the software. It is licensed under the terms of the LGPL 2.1 and our version is hosted here: https://github.com/devsim/umfpack_lgpl Please note that this version uses a scheme to detect the BLAS/LAPACK libraries being used by DEVSIM, as described in BLAS/LAPACK library selection (page 49). In order to use this library, a shim script is provided to load UMFPACK 5.1 and set it as the solver. Please see this example: python -mdevsim.umfpack.umfshim ssac_cap.py Custom solver Please see Custom direct solver (page 50) for more information. SuperLU SuperLU is no longer available as a solver in the binary distributions of DEVSIM. It is available for custom applications, which would require a custom build of the software. 9.5. Solver and math library selection 48
DEVSIM Manual, Release 2.10.0 It is important to note since values are based on double precision arithmetic, testing for equality with values other than 0.0 may yield unexpected results. 10.2.3 Functions Table 10.2: Predefined functions Function Description acosh(exp1) Inverse Hyperbolic Cosine asinh(exp1) Inverse Hyperbolic Sine atanh(exp1) Inverse Hyperbolic Tangent cosh(exp1) Hyperbolic Cosine sinh(exp1) Hyperbolic Sine tanh(exp1) Hyperbolic Tangent B(exp1) Bernoulli Function dBdx(exp1) derivative of Bernoulli function dot2d(exp1x, exp1y, exp2x, exp2y) exp1x*exp2x+exp1y*exp2y exp(exp1) exponent ifelse(test, exp1, exp2) if test is true, then evaluate exp1, otherwise exp2 if(test, exp) if test is true, then evaluate exp, otherwise 0 log(exp1) natural log max(exp1, exp2) maximum of the two arguments min(exp1, exp2) minimum of the two arguments pow(exp1, exp2) take exp1 to the power of exp2 sgn(exp1) sign function step(exp1) unit step function kahan3(exp1, exp2, exp3) Extended precision addition of arguments kahan4(exp1, exp2, exp3, exp4) Extended precision addition of arguments vec_max maximum of all the values over the entire region or interface vec_min minimum of all the values over the entire region or interface vec_sum sum of all the values over the entire region or interface 10.2. Syntax 55
DEVSIM Manual, Release 2.10.0 Table 10.3: Error functions Function Description erfc(exp1) complementary error function derfcdx(exp1) derivative of complementary error function erfc_inv(exp1) inverse complementary error function derfc_invdx(exp1) derivative of inverse complementary error function erf(exp1) error function derfdx(exp1) derivative error function erf_inv(exp1) inverse error function derf_invdx(exp1) derivative of inverse error function Table 10.4: Fermi Integral functions Function Description Fermi(exp1) Fermi Integral dFermidx(exp1) derivative of Fermi Integral InvFermi(exp1) inverse of the Fermi Integral dInvFermidx(exp1) derivative of InvFermi Integral Table 10.5: Gauss-Fermi Integral functions gfi(exp1, exp2) Gauss-Fermi Integral dgfidx(exp1, exp2) Derivative of Gauss-Fermi Integral with respect to first argument igfi(exp1, exp2) Inverse Gauss-Fermi Integral digfidx(exp1, exp2) Derivative of Inverse Gauss-Fermi Integral with respect to first argument In Predefined functions (page 55) are the built in functions of SYMDIFF. Note that the pow function uses the ,operator to separate arguments. In addition an expression like pow(a,b+y) is equivalent to an expression like a^(b+y). Both exp and log are provided since many derivative expressions can be expressed in terms of these two functions. It is possible to nest expressions within functions and vice-versa. Error functions (page 56) lists the error functions, derivatives, and inverses. Fermi Integral functions (page 56) lists the Fermi functions, and are based on the Joyce-Dixon Approximation [3]. The Gauss-Fermi functions are listed in Gauss-Fermi Integral functions (page 56), based on [6]. 10.2. Syntax 56
DEVSIM Manual, Release 2.10.0 10.2.4 Commands Table 10.6: Commands Command Description diff(obj1, var) Take derivative of obj1 with respect to variable var expand(obj) Expand out all multiplications into a sum of products help Print description of commands scale(obj) Get constant factor sign(obj) Get sign as 1or -1 simplify(obj) Simplify as much as possible subst(obj1,obj2,obj3) substitute obj3 for obj2 into obj1 unscaledval(obj) Get value without constant scaling unsignedval(obj) Get unsigned value Commands are shown in Commands (page 57). While they appear to have the same form as functions, they are special in the sense that they manipulate expressions and are never present in the expression which results. For example, note the result of the following command >diff(a*b, b) a 10.2.5 User functions Table 10.7: Commands for user functions Command Description clear(name) Clears the name of a user function declare(name(arg1, arg2, ...)) declare function name taking dummy arguments arg1,arg2, . . . . Derivatives assumed to be 0 define(name(arg1, arg2, ...), obj1, obj2, ...) declare function name taking arguments arg1,arg2, . . . having corresponding derivatives obj1,obj2, . . . Commands for specifying and manipulating user functions are listed in Commands for user functions (page 57). They are used in order to define new user function, as well as the derivatives of the functions with respect to the user variables. For example, the following expression defines a function named fwhich takes one argument. > define(f(x), 0.5*x) The list after the function protoype is used to define the derivatives with respect to each of the independent variables. Once defined, the function may be used in any other expression. In additions the any expression can be used as an arguments. For example: 10.2. Syntax 57
DEVSIM Manual, Release 2.10.0 > diff(f(x*y),x) ((0.5 * (x * y)) * y) > simplify((0.5 * (x * y)) * y) (0.5 * x * (y^2)) The chain rule is applied to ensure that the derivative is correct. This can be expressed as ∂ ∂xf(u,v,...) = ∂u ∂x·∂ ∂uf(u,v,...)+ ∂v ∂x·∂ ∂vf(u,v,...)+... The declare command is required when the derivatives of two user functions are based on one another. For example: > declare(cos(x)) cos(x) > define(sin(x),cos(x)) sin(x) > define(cos(x),-sin(x)) cos(x) When declared, a functions derivatives are set to 0, unless specified with a define command. It is now possible to use these expressions as desired. > diff(sin(cos(x)),x) (cos(cos(x)) * (-sin(x))) > simplify(cos(cos(x)) * (-sin(x))) (-cos(cos(x)) * sin(x)) 10.2.6 Macro assignment The use of macro assignment allows the substitution of expressions into new expressions. Every time a command is successfully used, the resulting expression is assigned to a special macro definition, $_. In this example, the result of the each command is substituted into the next. > a+b (a + b) > $_-b ((a + b) - b) > simplify($_) a In addition to the default macro definition, it is possible to specify a variable identifier by using the $character followed by an alphanumeric string beginning with a letter. In addition to letters and numbers, a _character may be used as well. A macro which has not previously assigned will implicitly use 0as its value. This example demonstrates the use of macro assignment. 10.2. Syntax 58
DEVSIM Manual, Release 2.10.0 > $a1 = a + b (a + b) > $a2 = a - b (a - b) > simplify($a1+$a2) (2 * a) 10.3 Invoking SYMDIFF from DEVSIM 10.3.1 Equation parser The devsim.symdiff() (page 112) should be used when defining new functions to the parser. Since you do not specify regions or interfaces, it considers all strings as being independent variables, as opposed to models. Model commands (page 99) presents commands which have the concepts of models. A ;should be used to separate each statement. This is a sample invocation from DEVSIM %symdiff(expr="subst(dog * cat, dog, bear)") (bear *cat) 10.3.2 Evaluating external math The devsim.register_function() (page 111) is used to evaluate functions declared or defined within SYMDIFF.APython procedure may then be used taking the same number of arguments. For example: from math import cos from math import sin symdiff(expr="declare(sin(x))") symdiff(expr="define(cos(x), -sin(x))") symdiff(expr="define(sin(x), cos(x))") register_function(name="cos", nargs=1) register_function(name="sin", nargs=1) The cos and sin function may then be used for model evaluation. For improved efficiency, it is possible to create procedures written in C or C++ and load them into Python. 10.3. Invoking SYMDIFF from DEVSIM 59
DEVSIM Manual, Release 2.10.0 10.3.3 Models When used withing the model commands discussed in Model commands (page 99), DEVSIM has been extended to recognize model names in the expressions. In this situation, the derivative of a model named, model, with respect to another model, variable, is then model:variable. During the element assembly process, DEVSIM evaluates all models of an equation together. While the expressions in models and their derivatives are independent, the software uses a caching scheme to ensure that redundant calculations are not performed. It is recommended, however, that users developing their own models investigate creating intermediate models in order to improve their understanding of the equations that they wish to be assembled. 10.3. Invoking SYMDIFF from DEVSIM 60
Chapter 11 Visualization and post processing 11.1 Introduction DEVSIM is able to create files for visualization tools. Information about acquiring these tools are presented in Install external software tools (page 12). 11.2 Visualization software 11.2.1 Overview The tools in Table 11.1 can read the file Tecplot and VTK Formats. Table 11.1: Open source visualization tools ParaView visualization tool available at https://paraview.org. VisIt visualization tool available from https://visit-dav.github. io/visit-website/ 11.2.2 Using ParaView The devsim.write_devices() (page 98) is used to create an ASCII file suitable for use in ParaView. Edge quantities are interpolated onto the node positions in the resulting structure. Element edge quantities are interpolated onto the centers of each triangle or tetrahedron in the mesh. write_devices(file="mos_2d_dd",type="vtk") One vtu file per device region will be created, as well as a vtm file which may be used to load all of the device regions into ParaView. 61
DEVSIM Manual, Release 2.10.0 11.2.3 Using VisIt VisIt supports reading the Tecplot and ParaView formats. When using the vtk option on the devsim.write_devices() (page 98), a file with a visit filename extension is created to load the files created for ParaView. 11.3 Reducing file sizes Based on a contribution by [@simbilod](https://github.com/simbilod)devsim.write_devices() (page 98) now supports reducing the file size of data files by allowing users to specify a callback function to reduce data usage. In this example, only the NetDoping field is written to the Tecplot data file. devsim.write_devices( file="mesh2d_reduced.tec", type="tecplot", include_test=lambda x: x in ("NetDoping",), ) 11.4 Post processing DEVSIM has several commands for getting information on the mesh. Those related to post processing are described in Model commands (page 99) and Geometry commands (page 90). See Loading and saving results (page 43) for information about loading and saving mesh information to a file. 11.4.1 Index information The coordinate_index and node_index are default node models created on a region (Table 5.1}). The edge_index is a default edge models created on a region Table 5.2. 11.4.2 Element node list The devsim.get_element_node_list() (page 90) retrieves a list of nodes for every element on a region,contact,orinterface. 11.3. Reducing file sizes 62
Chapter 12 Examples 12.1 Included examples The following example directories are contained in the distribution. Some of them are described in Simple Examples (page 68). Table 12.1: Examples Distributed with DEVSIM Directory Description capacitance These are 1D and 2D capacitor simulations, using the internal mesher. A description of these examples is presented in Capacitor (page 68). diode This is a collection of 1D, 2D, and 3D diode structures using the internal mesher, as well as Gmsh. These examples are discussed in Diode (page 78). bioapp1 This is a biosensor application. vector_potential This is a 2D magnetic field simulation solving for the magnetic potential. The simulation script is vector_potential/twowire.py A simulation result for two wires conducting current is shown in Fig. 12.1. mobility This is an advanced example using electric field dependendent mobility models. plotting Example using a Python notebook. There is 3D visualization using pyvista. 63
DEVSIM Manual, Release 2.10.0 x y -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 Frame 001 30 Jul 2011 twowire Fig. 12.1: Simulation result for solving for the magnetic potential and field. The coloring is by the Z component of the magnetic potential, and the stream traces are for components of magnetic field. 12.1. Included examples 64
DEVSIM Manual, Release 2.10.0 Contact boundary conditions We then create the contact models and equations. We use the Python for loop construct and variable substitutions to create a unique model for each contact, contact1_bc and contact2_bc. ### ### Contact models and equations ### for cin ("contact1","contact2"): contact_node_model(device=device, contact=c, name="%s _bc" %c, equation="Potential - %s _bias" %c) contact_node_model(device=device, contact=c, name="%s _bc:Potential" %c, equation="1") contact_equation(device=device, contact=c, name="PotentialEquation", node_model="%s _bc" %c, edge_charge_model="DField") In this example, the contact bias is applied through parameters named contact1_bias and contact2_bias. When applying the boundary conditions through circuit nodes, models with respect to their names and their derivatives would be required. Setting the boundary conditions ### ### Set the contact ### set_parameter(device=device, region=region, name="contact1_bias", value=1.0e-0) set_parameter(device=device, region=region, name="contact2_bias", value=0.0) ### ### Solve ### solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) ### ### Print the charge on the contacts ### for cin ("contact1","contact2"): print("contact: %s charge: %1.5e " %(c, get_contact_charge(device=device, contact=c, equation="PotentialEquation ,→"))) 13.1. Capacitor 71
DEVSIM Manual, Release 2.10.0 Running the simulation We run the simulation and see the results. contact2 (region: MyRegion) (contact: contact1) (contact: contact2) Region "MyRegion" on device "MyDevice" has equations 0:10 Device "MyDevice" has equations 0:10 number of equations 11 Iteration: 0 Device: "MyDevice" RelError: 1.00000e+00 AbsError: 1.00000e+00 Region: "MyRegion" RelError: 1.00000e+00 AbsError: 1.00000e+00 Equation: "PotentialEquation" RelError: 1.00000e+00 AbsError: 1.00000e+00 Iteration: 1 Device: "MyDevice" RelError: 2.77924e-16 AbsError: 1.12632e-16 Region: "MyRegion" RelError: 2.77924e-16 AbsError: 1.12632e-16 Equation: "PotentialEquation" RelError: 2.77924e-16 AbsError: 1.12632e-16 contact: contact1 charge: 3.45150e-13 contact: contact2 charge: -3.45150e-13 Which corresponds to our expected result of 3.451510−13 F/cm2for a homogenous capacitor. 13.1.3 2D capacitor This example is called cap2d.py and is located in the examples/capacitance directory distributed with DEVSIM. This file uses the same physics as the 1D example, but with a 2D structure. The mesh is built using the DEVSIM internal mesher. An air region exists with two electrodes in the simulation domain. Defining the mesh from devsim import * device="MyDevice" region="MyRegion" xmin=-25 x1 =-24.975 x2 =-2 x3 =2 x4 =24.975 xmax=25.0 ymin=0.0 (continues on next page) 13.1. Capacitor 72
DEVSIM Manual, Release 2.10.0 (continued from previous page) y1 =0.1 y2 =0.2 y3 =0.8 y4 =0.9 ymax=50.0 create_2d_mesh(mesh=device) add_2d_mesh_line(mesh=device, dir="y", pos=ymin, ps=0.1) add_2d_mesh_line(mesh=device, dir="y", pos=y1 , ps=0.1) add_2d_mesh_line(mesh=device, dir="y", pos=y2 , ps=0.1) add_2d_mesh_line(mesh=device, dir="y", pos=y3 , ps=0.1) add_2d_mesh_line(mesh=device, dir="y", pos=y4 , ps=0.1) add_2d_mesh_line(mesh=device, dir="y", pos=ymax, ps=5.0) device=device region="air" add_2d_mesh_line(mesh=device, dir="x", pos=xmin, ps=5) add_2d_mesh_line(mesh=device, dir="x", pos=x1 , ps=2) add_2d_mesh_line(mesh=device, dir="x", pos=x2 , ps=0.05) add_2d_mesh_line(mesh=device, dir="x", pos=x3 , ps=0.05) add_2d_mesh_line(mesh=device, dir="x", pos=x4 , ps=2) add_2d_mesh_line(mesh=device, dir="x", pos=xmax, ps=5) add_2d_region(mesh=device, material="gas" , region="air", yl=ymin, yh=ymax,␣ ,→xl=xmin, xh=xmax) add_2d_region(mesh=device, material="metal", region="m1" , yl=y1 , yh=y2 , xl=x1␣ ,→, xh=x4) add_2d_region(mesh=device, material="metal", region="m2" , yl=y3 , yh=y4 , xl=x2␣ ,→, xh=x3) # must be air since contacts don't have any equations add_2d_contact(mesh=device, name="bot", region="air", material="metal", yl=y1,␣ ,→yh=y2, xl=x1, xh=x4) add_2d_contact(mesh=device, name="top", region="air", material="metal", yl=y3,␣ ,→yh=y4, xl=x2, xh=x3) finalize_mesh(mesh=device) create_device(mesh=device, device=device) 13.1. Capacitor 73
DEVSIM Manual, Release 2.10.0 Setting up the models ### ### Set parameters on the region ### set_parameter(device=device, region=region, name="Permittivity", value=3.9*8.85e- ,→14) ### ### Create the Potential solution variable ### node_solution(device=device, region=region, name="Potential") ### ### Creates the Potential@n0 and Potential@n1 edge model ### edge_from_node_model(device=device, region=region, node_model="Potential") ### ### Electric field on each edge, as well as its derivatives with respect to ### the potential at each node ### edge_model(device=device, region=region, name="ElectricField", equation="(Potential@n0 - Potential@n1)*EdgeInverseLength") edge_model(device=device, region=region, name="ElectricField:Potential@n0", equation="EdgeInverseLength") edge_model(device=device, region=region, name="ElectricField:Potential@n1", equation="-EdgeInverseLength") ### ### Model the D Field ### edge_model(device=device, region=region, name="DField", equation="Permittivity*ElectricField") edge_model(device=device, region=region, name="DField:Potential@n0", equation="diff(Permittivity*ElectricField, Potential@n0)") edge_model(device=device, region=region, name="DField:Potential@n1", equation="-DField:Potential@n0") ### ### Create the bulk equation ### (continues on next page) 13.1. Capacitor 74
DEVSIM Manual, Release 2.10.0 (continued from previous page) equation(device=device, region=region, name="PotentialEquation", variable_name="Potential", edge_model="DField", variable_update="default") ### ### Contact models and equations ### for cin ("top","bot"): contact_node_model(device=device, contact=c, name="%s _bc" %c, equation="Potential - %s _bias" %c) contact_node_model(device=device, contact=c, name="%s _bc:Potential" %c, equation="1") contact_equation(device=device, contact=c, name="PotentialEquation", node_model="%s _bc" %c, edge_charge_model="DField") ### ### Set the contact ### set_parameter(device=device, name="top_bias", value=1.0e-0) set_parameter(device=device, name="bot_bias", value=0.0) edge_model(device=device, region="m1", name="ElectricField", equation="0") edge_model(device=device, region="m2", name="ElectricField", equation="0") node_model(device=device, region="m1", name="Potential", equation="bot_bias;") node_model(device=device, region="m2", name="Potential", equation="top_bias;") solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30, solver_type="direct") Fields for visualization Before writing the mesh out for visualization, the element_from_edge_model is used to calculate the electric field at each triangle center in the mesh. The components are the ElectricField_x and ElectricField_y. element_from_edge_model(edge_model="ElectricField", device=device, region=region) print(get_contact_charge(device=device, contact="top", equation="PotentialEquation ,→")) print(get_contact_charge(device=device, contact="bot", equation="PotentialEquation (continues on next page) 13.1. Capacitor 75
DEVSIM Manual, Release 2.10.0 (continued from previous page) ,→")) write_devices(file="cap2d.msh",type="devsim") write_devices(file="cap2d.dat",type="tecplot") Running the simulation Creating Region air Creating Region m1 Creating Region m2 Adding 8281 nodes Adding 23918 edges with 22990 duplicates removed Adding 15636 triangles with 0 duplicate removed Adding 334 nodes Adding 665 edges with 331 duplicates removed Adding 332 triangles with 0 duplicate removed Adding 162 nodes Adding 321 edges with 159 duplicates removed Adding 160 triangles with 0 duplicate removed Contact bot in region air with 334 nodes Contact top in region air with 162 nodes Region "air" on device "MyDevice" has equations 0:8280 Region "m1" on device "MyDevice" has no equations. Region "m2" on device "MyDevice" has no equations. Device "MyDevice" has equations 0:8280 number of equations 8281 Iteration: 0 Device: "MyDevice" RelError: 1.00000e+00 AbsError: 1.00000e+00 Region: "air" RelError: 1.00000e+00 AbsError: 1.00000e+00 Equation: "PotentialEquation" RelError: 1.00000e+00 AbsError: 1.00000e+00 Iteration: 1 Device: "MyDevice" RelError: 1.25144e-12 AbsError: 1.73395e-13 Region: "air" RelError: 1.25144e-12 AbsError: 1.73395e-13 Equation: "PotentialEquation" RelError: 1.25144e-12 AbsError: 1.73395e-13 3.35017166004e-12 -3.35017166004e-12 A visualization of the results is shown in Capacitance simulation result. The coloring is by Potential, and the stream traces are for components of ElectricField. (page 77). 13.1. Capacitor 76
DEVSIM Manual, Release 2.10.0 x y -6 -4 -2 0 2 4 6 0 2 4 6 8 10 Frame 001 25 Jul 2011 MyDevice Fig. 13.1: Capacitance simulation result. The coloring is by Potential, and the stream traces are for components of ElectricField. 13.1. Capacitor 77
DEVSIM Manual, Release 2.10.0 13.2 Diode 13.2.1 Overview The diode examples are located in the examples/diode. They demonstrate the use of packages located in the python_packages directory to simulate drift-diffusion using the Scharfetter-Gummel method [9]. 13.2.2 1D diode Using the python packages For these examples, python modules are provided to supply the appropriate model and parameter settings. A listing is shown in Python package files (page 78). The devsim.python_packages module is part of the distribution. The example files in the DEVSIM distribution set the path properly when loading modules. Table 13.1: Python package files model_create Creation of models and their derivatives ramp Ramping bias and automatic stepping simple_dd Functions for calculating bulk electron and hole current simple_physics Functions for setting up device physics For this example, diode_1d.py, the following line is used to import the relevant physics. from devsim import * from simple_physics import * Creating the mesh This creates a mesh 10−5cm long with a junction located at the midpoint. The name of the device is MyDevice with a single region names MyRegion. The contacts on either end are called top and bot. def createMesh(device, region): create_1d_mesh(mesh="dio") add_1d_mesh_line(mesh="dio", pos=0, ps=1e-7, tag="top") add_1d_mesh_line(mesh="dio", pos=0.5e-5, ps=1e-9, tag="mid") add_1d_mesh_line(mesh="dio", pos=1e-5, ps=1e-7, tag="bot") add_1d_contact (mesh="dio", name="top", tag="top", material="metal") add_1d_contact (mesh="dio", name="bot", tag="bot", material="metal") add_1d_region (mesh="dio", material="Si", region=region, tag1="top", tag2="bot ,→") finalize_mesh(mesh="dio") (continues on next page) 13.2. Diode 78
DEVSIM Manual, Release 2.10.0 (continued from previous page) create_device(mesh="dio", device=device) device="MyDevice" region="MyRegion" createMesh(device, region) Physical models and parameters #### #### Set parameters for 300 K #### SetSiliconParameters(device, region, 300) set_parameter(device=device, region=region, name="taun", value=1e-8) set_parameter(device=device, region=region, name="taup", value=1e-8) #### #### NetDoping #### CreateNodeModel(device, region, "Acceptors","1.0e18*step(0.5e-5-x)") CreateNodeModel(device, region, "Donors","1.0e18*step(x-0.5e-5)") CreateNodeModel(device, region, "NetDoping","Donors-Acceptors") print_node_values(device=device, region=region, name="NetDoping") #### #### Create Potential, Potential@n0, Potential@n1 #### CreateSolution(device, region, "Potential") #### #### Create potential only physical models #### CreateSiliconPotentialOnly(device, region) #### #### Set up the contacts applying a bias #### for iin get_contact_list(device=device): set_parameter(device=device, name=GetContactBiasName(i), value=0.0) CreateSiliconPotentialOnlyContact(device, region, i) #### #### Initial DC solution (continues on next page) 13.2. Diode 79
DEVSIM Manual, Release 2.10.0 (continued from previous page) #### solve(type="dc", absolute_error=1.0, relative_error=1e-12, maximum_iterations=30) #### #### drift diffusion solution variables #### CreateSolution(device, region, "Electrons") CreateSolution(device, region, "Holes") #### #### create initial guess from dc only solution #### set_node_values(device=device, region=region, name="Electrons", init_from="IntrinsicElectrons") set_node_values(device=device, region=region, name="Holes", init_from="IntrinsicHoles") ### ### Set up equations ### CreateSiliconDriftDiffusion(device, region) for iin get_contact_list(device=device): CreateSiliconDriftDiffusionAtContact(device, region, i) ### ### Drift diffusion simulation at equilibrium ### solve(type="dc", absolute_error=1e10, relative_error=1e-10, maximum_iterations=30) #### #### Ramp the bias to 0.5 Volts #### v=0.0 while v<0.51: set_parameter(device=device, name=GetContactBiasName("top"), value=v) solve(type="dc", absolute_error=1e10, relative_error=1e-10, maximum_ ,→iterations=30) PrintCurrents(device, "top") PrintCurrents(device, "bot") v+= 0.1 #### #### Write out the result #### write_devices(file="diode_1d.dat",type="tecplot") 13.2. Diode 80
DEVSIM Manual, Release 2.10.0 •node_model (str , optional ) – Name of the node model being integrated at each node at this contact devsim.custom_equation(name,procedure) Custom equation assembly. See Custom matrix assembly (page 31) for a description of how the function should be structured. Parameters •name (str ) – Name of the custom equation being created •procedure (str ) – The procedure to be called devsim.delete_contact_equation(device,contact,name) This command deletes an equation from a contact. Parameters •device (str ) – The selected device •contact (str ) – Contact on which to apply this command •name (str ) – Name of the contact equation being deleted devsim.delete_equation(device,region,name) This command deletes an equation from a region. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the equation being deleted devsim.delete_interface_equation(device,interface,name) This command deletes an equation from an interface. Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command •name (str ) – Name of the interface equation being deleted devsim.equation(device,region,name,variable_name,node_model,edge_model, edge_volume_model,time_node_model,element_model, volume_node0_model,volume_node1_model,variable_update) Specify an equation to solve on a device Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the equation being created 14.2. Equation commands 87
DEVSIM Manual, Release 2.10.0 •variable_name (str ) – Name of the node solution being solved •node_model (str , optional ) – Name of the node model being integrated at each node in the device volume •edge_model (str , optional ) – Name of the edge model being integrated over each edge in the device volume •edge_volume_model (str , optional ) – Name of the edge model being integrated over the volume of each edge in the device volume •time_node_model (str , optional ) – Name of the time dependent node_model being integrated at each node in the device volume •element_model (str , optional ) – Name of the element model being integrated over each edge in the device volume •volume_node0_model (str , optional ) – Name of the element model being integrated over the volume of node 0 of each edge on the contact •volume_node1_model (str , optional ) – Name of the element model being integrated over the volume of node 1 of each edge on the contact •variable_update ({'default','log_damp','positive'}) – update type for circuit variable Notes The integration variables can be changed in 2D for cylindrical coordinate systems by setting the appropriate parameters as described in Cylindrical coordinate systems (page 32). In order to set the node volumes for integration of the edge_volume_model, it is possible to do something like this: devsim.edge_model(device=”device”, region=”region”, name=”EdgeNodeVolume”, equation=”0.5*SurfaceArea*EdgeLength”) devsim.set_parameter(name=”edge_node0_volume_model”, value=”EdgeNodeVolume”) devsim.set_parameter(name=”edge_node1_volume_model”, value=”EdgeNodeVolume”) devsim.get_contact_equation_command(device,contact,name) This command gets the options used when creating this contact equation. Parameters •device (str ) – The selected device •contact (str ) – Contact on which to apply this command •name (str ) – Name of the contact equation being command options returned devsim.get_contact_equation_list(device,contact) This command gets a list of equations on the specified contact. 14.2. Equation commands 88
DEVSIM Manual, Release 2.10.0 Parameters •device (str ) – The selected device •contact (str ) – Contact on which to apply this command devsim.get_equation_command(device,region,name) This command gets the options used when creating this equation. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the equation being command options returned devsim.get_equation_list(device,region) This command gets a list of equations on the specified region. Parameters •device (str ) – The selected device •region (str ) – The selected region devsim.get_equation_numbers(device,region,equation,variable) Returns a list of the equation numbers corresponding to each node in a region. Values are only valid when during the course of a solve. Parameters •device (str ) – The selected device •region (str ) – The selected region •equation (str , optional ) – Name of the equation •variable (str , optional ) – Name of the variable devsim.get_interface_equation_command(device,interface,name) This command gets the options used when creating this interface equation. Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command •name (str ) – Name of the interface equation being command options returned devsim.get_interface_equation_list(device,interface) This command gets a list of equations on the specified interface. Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command 14.2. Equation commands 89
DEVSIM Manual, Release 2.10.0 devsim.interface_equation(device,interface,name,name0,name1,interface_model,type) Command to specify an equation at an interface Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command •name (str ) – Name of the interface equation being created •name0 (str , optional ) – Name of the equation coupling in region 0 being created (default ‘name’) •name1 (str , optional ) – Name of the equation coupling in region 1 being created (default ‘name’) •interface_model (str ) – When specified, the bulk equations on both sides of the interface are integrated together. This model is then used to specify how nodal quantities on both sides of the interface are balanced •type ({'continuous','fluxterm','hybrid'} required ) – Specifies the type of boundary condition 14.3 Geometry commands Commands for getting information about the device structure. devsim.get_contact_list(device) Gets a list of contacts on a device. Parameters device (str ) – The selected device devsim.get_device_list() Gets a list of devices on the simulation. devsim.get_element_node_list(device,region,contact,interface,reorder) Gets a list of nodes for each element on a device, region, contact, or interface. Parameters •device (str ) – The selected device •region (str ) – The selected region •contact (str , optional ) – If specified, gets the element nodes for the contact on the specified region •interface (str , optional ) – If specified, gets the element nodes for the interface on the specified region •reorder (bool , optional ) – If specified, reorders the element nodes in a manner compatible in meshing software (default False) 14.3. Geometry commands 90
DEVSIM Manual, Release 2.10.0 devsim.get_interface_list(device) Gets a list of interfaces on a device. Parameters device (str ) – The selected device devsim.get_region_list(device,contact,interface) Gets a list of regions on a device, contact, or interface. Parameters •device (str ) – The selected device •contact (str , optional ) – If specified, gets the name of the region belonging to this contact on the device •interface (str , optional ) – If specified, gets the name of the regions belonging to this interface on the device devsim.reset_devsim() Resets all data for clean restart. 14.4 Material commands Commands for manipulating parameters and material properties devsim.get_dimension(device) Get the dimension of the device Parameters device (str , optional ) – The selected device devsim.get_material(device,region,contact) Returns the material for the specified region Parameters •device (str , optional ) – The selected device •region (str , optional ) – The selected region •contact (str , optional ) – Contact on which to apply this command devsim.get_parameter(device,region,name) Get a parameter on a region, device, or globally. Parameters •device (str , optional ) – The selected device •region (str , optional ) – The selected region •name (str ) – Name of the parameter name being retrieved 14.4. Material commands 91
DEVSIM Manual, Release 2.10.0 Notes Note that the device and region options are optional. If the region is not specified, the parameter is retrieved for the entire device. If the device is not specified, the parameter is retrieved for all devices. If the parameter is not found on the region, it is retrieved on the device. If it is not found on the device, it is retrieved over all devices. devsim.get_parameter_list(device,region) Get list of parameter names on region, device, or globally Parameters •device (str , optional ) – The selected device •region (str , optional ) – The selected region Notes Note that the device and region options are optional. If the region is not specified, the parameter is retrieved for the entire device. If the device is not specified, the parameter is retrieved for all devices. Unlike the devsim.getParameter(), parameter names on the the device are not retrieved if they do not exist on the region. Similarly, the parameter names over all devices are not retrieved if they do not exist on the device. devsim.set_material(device,region,contact,material) Sets the new material for a region Parameters •device (str , optional ) – The selected device •region (str , optional ) – The selected region •contact (str , optional ) – Contact on which to apply this command •material (str ) – New material name devsim.set_parameter(device,region,name,value) Set a parameter on region, device, or globally Parameters •device (str , optional ) – The selected device •region (str , optional ) – The selected region •name (str ) – Name of the parameter name being retrieved •value (any ) – value to set for the parameter 14.4. Material commands 92
DEVSIM Manual, Release 2.10.0 Notes Note that the device and region options are optional. If the region is not specified, the parameter is set for the entire device. If the device is not specified, the parameter is set for all devices. 14.5 Meshing commands Commands for reading and writing meshes devsim.add_1d_contact(material,mesh,name,tag) Add a contact to a 1D mesh Parameters •material (str ) – material for the contact being created •mesh (str ) – Mesh to add the contact to •name (str ) – Name for the contact being created •tag (str ) – Text label for the position to add the contact devsim.add_1d_interface(mesh,tag,name) Add an interface to a 1D mesh Parameters •mesh (str ) – Mesh to add the interface to •tag (str ) – Text label for the position to add the interface •name (str ) – Name for the interface being created devsim.add_1d_mesh_line(mesh,tag,pos,ns,ps) Add a mesh line to a 1D mesh Parameters •mesh (str ) – Mesh to add the line to •tag (str , optional ) – Text label for the position •pos (str ) – Position for the mesh point •ns (Float , optional ) – Spacing from this point in the negative direction (default ps value) •ps (Float ) – Spacing from this point in the positive direction devsim.add_1d_region(mesh,tag1,tag2,region,material) Add a region to a 1D mesh Parameters •mesh (str ) – Mesh to add the line to 14.5. Meshing commands 93
DEVSIM Manual, Release 2.10.0 •tag1 (str ) – Text label for the position bounding the region being added •tag2 (str ) – Text label for the position bounding the region being added •region (str ) – Name for the region being created •material (str ) – Material for the region being created devsim.add_2d_contact(name,material,mesh,region,xl,xh,yl,yh,bloat) Add an interface to a 2D mesh Parameters •name (str ) – Name for the contact being created •material (str ) – material for the contact being created •mesh (str ) – Mesh to add the contact to •region (str ) – Name of the region included in the contact •xl (Float , optional ) – x position for corner of bounding box (default -MAXDOUBLE) •xh (Float , optional ) – x position for corner of bounding box (default +MAXDOUBLE) •yl (Float , optional ) – y position for corner of bounding box (default -MAXDOUBLE) •yh (Float , optional ) – y position for corner of bounding box (default +MAXDOUBLE) •bloat (Float , optional ) – Extend bounding box by this amount when search for mesh to include in region (default 1e-10) devsim.add_2d_interface(mesh,name,region0,region1,xl,xh,yl,yh,bloat) Add an interface to a 2D mesh Parameters •mesh (str ) – Mesh to add the interface to •name (str ) – Name for the interface being created •region0 (str ) – Name of the region included in the interface •region1 (str ) – Name of the region included in the interface •xl (Float , optional ) – x position for corner of bounding box (default -MAXDOUBLE) •xh (Float , optional ) – x position for corner of bounding box (default +MAXDOUBLE) •yl (Float , optional ) – y position for corner of bounding box (default -MAXDOUBLE) 14.5. Meshing commands 94
DEVSIM Manual, Release 2.10.0 •yh (Float , optional ) – y position for corner of bounding box (default +MAXDOUBLE) •bloat (Float , optional ) – Extend bounding box by this amount when search for mesh to include in region (default 1e-10) devsim.add_2d_mesh_line(mesh,pos,ns,ps) Add a mesh line to a 2D mesh Parameters •mesh (str ) – Mesh to add the line to •pos (str ) – Position for the mesh point •ns (Float ) – Spacing from this point in the negative direction •ps (Float ) – Spacing from this point in the positive direction devsim.add_2d_region(mesh,region,material,xl,xh,yl,yh,bloat) Add a region to a 2D mesh Parameters •mesh (str ) – Mesh to add the region to •region (str ) – Name for the region being created •material (str ) – Material for the region being created •xl (Float , optional ) – x position for corner of bounding box (default -MAXDOUBLE) •xh (Float , optional ) – x position for corner of bounding box (default +MAXDOUBLE) •yl (Float , optional ) – y position for corner of bounding box (default -MAXDOUBLE) •yh (Float , optional ) – y position for corner of bounding box (default +MAXDOUBLE) •bloat (Float , optional ) – Extend bounding box by this amount when search for mesh to include in region (default 1e-10) devsim.add_gmsh_contact(gmsh_name,material,mesh,name,region) Create a mesh to import a Gmsh mesh Parameters •gmsh_name (str ) – physical group name in the Gmsh file •material (str ) – material for the contact being created •mesh (str ) – name of the mesh being generated •name (str ) – name of the contact begin created •region (str ) – region that the contact is attached to 14.5. Meshing commands 95
DEVSIM Manual, Release 2.10.0 devsim.add_gmsh_interface(gmsh_name,mesh,name,region0,region1) Create an interface for an imported Gmsh mesh Parameters •gmsh_name (str ) – physical group name in the Gmsh file •mesh (str ) – name of the mesh being generated •name (str ) – name of the interface begin created •region0 (str ) – first region that the interface is attached to •region1 (str ) – second region that the interface is attached to devsim.add_gmsh_region(gmsh_name,mesh,region,material) Create a region for an imported Gmsh mesh Parameters •gmsh_name (str ) – physical group name in the Gmsh file •mesh (str ) – name of the mesh being generated •region (str ) – name of the region begin created •material (str ) – material for the region being created devsim.create_1d_mesh(mesh) Create a mesh to create a 1D device Parameters mesh (str ) – name of the 1D mesh being created devsim.create_2d_mesh(mesh) Create a mesh to create a 2D device Parameters mesh (str ) – name of the 2D mesh being created devsim.create_contact_from_interface(device,region,interface,material,name) Creates a contact on a device from an existing interface Parameters •device (str ) – The selected device •region (str ) – The selected region •interface (str ) – Interface on which to apply this command •material (str ) – material for the contact being created •name (str ) – name of the contact begin created devsim.create_device(mesh,device) Create a device from a mesh Parameters 14.5. Meshing commands 96
DEVSIM Manual, Release 2.10.0 devsim.edge_from_node_model(device,region,node_model) For a node model, creates an 2 edge models referring to the node model value at both ends of the edge. Parameters •device (str ) – The selected device •region (str ) – The selected region •node_model (str ) – The node model from which we are creating the edge model Notes For example, to calculate electric field: devsim.edge_from_node_model(device=device, region=region, node_model=”Potential”) devsim.edge_model(device,region,name,equation,display_type) Creates an edge model based on an equation Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the edge model being created •equation (str ) – Equation used to describe the edge model being created •display_type ({'scalar','nodisplay','vector'}) – Option for output display in graphical viewer Notes The vector option uses an averaging scheme for the edge values projected in the direction of each edge. For a given model, model, the generated components in the visualization files is: •model_x_onNode •model_y_onNode •model_z_onNode (3D) This averaging scheme does not produce accurate results, and it is recommended to use the devsim.element_from_edge_model() (page 104) to create components better suited for visualization. See Visualization and post processing (page 61) for more information about creating data files for external visualization programs. 14.6. Model commands 103
DEVSIM Manual, Release 2.10.0 devsim.edge_solution(device,region,name) Create node model whose values are set. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the solution being created devsim.element_from_edge_model(device,region,edge_model,derivative) Creates element edge models from an edge model Parameters •device (str ) – The selected device •region (str ) – The selected region •edge_model (str ) – The edge model from which we are creating the element model •derivative (str , optional ) – The variable we are taking with respect to edge_model Notes For an edge model emodel, creates an element models referring to the directional components on each edge of the element: •emodel_x •emodel_y If the derivative variable option is specified, the emodel@n0 and emodel@n1 are used to create: •emodel_x:variable@en0 •emodel_y:variable@en0 •emodel_x:variable@en1 •emodel_y:variable@en1 •emodel_x:variable@en2 •emodel_y:variable@en2 in 2D for each node on a triangular element. and •emodel_x:variable@en0 •emodel_y:variable@en0 •emodel_z:variable@en0 •emodel_x:variable@en1 14.6. Model commands 104
DEVSIM Manual, Release 2.10.0 •emodel_y:variable@en1 •emodel_z:variable@en1 •emodel_x:variable@en2 •emodel_y:variable@en2 •emodel_z:variable@en2 •emodel_x:variable@en3 •emodel_y:variable@en3 •emodel_z:variable@en3 in 3D for each node on a tetrahedral element. The suffix en0 refers to the first node on the edge of the element and en1 refers to the second node. en2 and en3 specifies the derivatives with respect the variable at the nodes opposite the edges on the element being considered. devsim.element_from_node_model(device,region,node_model) Creates element edge models from a node model Parameters •device (str ) – The selected device •region (str ) – The selected region •node_model (str ) – The node model from which we are creating the edge model Notes This command creates an element edge model from a node model so that each corner of the element is represented. A node model, nmodel, would be be accessible as •nmodel@en0 •nmodel@en1 •nmodel@en2 •nmodel@en3 (3D) where en0, and en1 refers to the nodes on the element’s edge. In 2D, en2 refers to the node on the triangle node opposite the edge. In 3D, en2 and en3 refers to the nodes on the nodes off the element edge on the tetrahedral element. devsim.element_model(device,region,name,equation,display_type) Create a model evaluated on element edges. Parameters •device (str ) – The selected device 14.6. Model commands 105
DEVSIM Manual, Release 2.10.0 •region (str ) – The selected region •name (str ) – Name of the element edge model being created •equation (str ) – Equation used to describe the element edge model being created •display_type ({'scalar','nodisplay'}) – Option for output display in graphical viewer devsim.element_pair_from_edge_model(device,region,edge_model,derivative) Creates element edge models from an edge model Parameters •device (str ) – The selected device •region (str ) – The selected region •edge_model (str ) – The edge model from which we are creating the element model •derivative (str , optional ) – The variable we are taking with respect to edge_model Notes For an edge model emodel, creates an element models referring to the directional components on each edge of the element: •emodel_node0_x •emodel_node0_y •emodel_node1_x •emodel_node1_y If the derivative variable option is specified, the emodel@n0 and emodel@n1 are used to create: •emodel_node0_x:variable@en0 •emodel_node0_y:variable@en0 •emodel_node0_x:variable@en1 •emodel_node0_y:variable@en1 •emodel_node0_x:variable@en2 •emodel_node0_y:variable@en2 •emodel_node1_x:variable@en0 •emodel_node1_y:variable@en0 •emodel_node1_x:variable@en1 14.6. Model commands 106
DEVSIM Manual, Release 2.10.0 •emodel_node1_y:variable@en1 •emodel_node1_x:variable@en2 •emodel_node1_y:variable@en2 in 2D for each node on a triangular element. and •emodel_node0_x:variable@en0 •emodel_node0_y:variable@en0 •emodel_node0_z:variable@en0 •emodel_node0_x:variable@en1 •emodel_node0_y:variable@en1 •emodel_node0_z:variable@en1 •emodel_node0_x:variable@en2 •emodel_node0_y:variable@en2 •emodel_node0_z:variable@en2 •emodel_node0_x:variable@en3 •emodel_node0_y:variable@en3 •emodel_node0_z:variable@en3 •emodel_node1_x:variable@en0 •emodel_node1_y:variable@en0 •emodel_node1_z:variable@en0 •emodel_node1_x:variable@en1 •emodel_node1_y:variable@en1 •emodel_node1_z:variable@en1 •emodel_node1_x:variable@en2 •emodel_node1_y:variable@en2 •emodel_node1_z:variable@en2 •emodel_node1_x:variable@en3 •emodel_node1_y:variable@en3 •emodel_node1_z:variable@en3 in 3D for each node on a tetrahedral element. The label node0 and node1 refer to the node on the edge for which the element field average was performed. For example, node0 signifies that all edges connected to node0 where used to calculate the element field. 14.6. Model commands 107
DEVSIM Manual, Release 2.10.0 The suffix en0 refers to the first node on the edge of the element and en1 refers to the second node. en2 and en3 specifies the derivatives with respect the variable at the nodes opposite the edges on the element being considered. devsim.element_solution(device,region,name) Create node model whose values are set. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the solution being created devsim.get_edge_model_list(device,region) Returns a list of the edge models on the device region Parameters •device (str ) – The selected device •region (str ) – The selected region devsim.get_edge_model_values(device,region,name) Get the edge model values calculated at each edge. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the edge model values being returned as a list devsim.get_element_model_list(device,region) Returns a list of the element edge models on the device region Parameters •device (str ) – The selected device •region (str ) – The selected region devsim.get_element_model_values(device,region,name) Get element model values at each element edge Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the element edge model values being returned as a list 14.6. Model commands 108
DEVSIM Manual, Release 2.10.0 devsim.get_interface_model_list(device,interface) Returns a list of the interface models on the interface Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command devsim.get_interface_model_values(device,interface,name) Gets interface model values evaluated at each interface node. Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command •name (str ) – Name of the interface model values being returned as a list devsim.get_node_model_list(device,region) Returns a list of the node models on the device region Parameters •device (str ) – The selected device •region (str ) – The selected region devsim.get_node_model_values(device,region,name) Get node model values evaluated at each node in a region. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the node model values being returned as a list devsim.interface_model(device,interface,equation) Create an interface model from an equation. Parameters •device (str ) – The selected device •interface (str ) – Interface on which to apply this command •equation (str ) – Equation used to describe the interface node model being created devsim.interface_normal_model(device,region,interface) Creates edge models whose components are based on direction and distance to an interface Parameters •device (str ) – The selected device 14.6. Model commands 109
DEVSIM Manual, Release 2.10.0 •region (str ) – The selected region •interface (str ) – Interface on which to apply this command Notes This model creates the following edge models: •iname_distance •iname_normal_x (2D and 3D) •iname_normal_y (2D and 3D) •iname_normal_z (3D only) where iname is the name of the interface. The normals are of the closest node on the interface. The sign is toward the interface. devsim.node_model(device,region,name,equation,display_type) Create a node model from an equation. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the node model being created •equation (str ) – Equation used to describe the node model being created •display_type ({'scalar','nodisplay'}) – Option for output display in graphical viewer devsim.node_solution(device,region,name) Create node model whose values are set. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the solution being created devsim.print_edge_values(device,region,name) Print edge values for debugging. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the edge model values being printed to the screen 14.6. Model commands 110
DEVSIM Manual, Release 2.10.0 devsim.print_element_values(device,region,name) Print element values for debugging. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the element edge model values being printed to the screen devsim.print_node_values(device,region,name) Print node values for debugging. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the node model values being printed to the screen devsim.register_function(name,nargs,procedure) This command is used to register a new Python procedure for evaluation by SYMDIFF. Parameters •name (str ) – Name of the function •nargs (str ) – Number of arguments to the function •procedure (str ) – The procedure to be called devsim.set_edge_values(device,region,name,init_from,values) Set edge model values from another edge model, or a list of values. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the edge model being initialized •init_from (str , optional ) – Node model we are using to initialize the edge solution •values (list , optional ) – List of values for each edge in the region. devsim.set_element_values(device,region,name,init_from,values) Set element model values from another element model, or a list of values. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the element model being initialized 14.6. Model commands 111
DEVSIM Manual, Release 2.10.0 •init_from (str , optional ) – Node model we are using to initialize the element solution •values (list , optional ) – List of values for each element in the region. devsim.set_node_value(device,region,name,index,value) A uniform value is used if index is not specified. Note that equation based node models will lose this value if their equation is recalculated. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the node model being whose value is being set •index (int ) – Index of node being set •value (Float ) – Value of node being set devsim.set_node_values(device,region,name,init_from,values) Set node model values from another node model, or a list of values. Parameters •device (str ) – The selected device •region (str ) – The selected region •name (str ) – Name of the node model being initialized •init_from (str , optional ) – Node model we are using to initialize the node solution •values (list , optional ) – List of values for each node in the region. devsim.symdiff(expr) This command returns an expression. All strings are treated as independent variables. It is primarily used for defining new functions to the parser. Parameters expr (str ) – Expression to send to SYMDIFF devsim.vector_element_model(device,region,element_model) Create vector components from an element edge model Parameters •device (str ) – The selected device •region (str ) – The selected region •element_model (str ) – The element model for which we are calculating the vector components 14.6. Model commands 112
DEVSIM Manual, Release 2.10.0 V vector_element_model() (in module devsim), 112 vector_gradient() (in module devsim), 113 W write_devices() (in module devsim), 98 Index 119