#################################################################### # Import doping from Tecplot format # # Inputs: # filename: name of file in Tecplot format # zonename: name of the zone in the Tecplot file with the data # of interest # nodedata labels: names of data within zones must be set below # # (c) 2012, 2015 Lumerical Solutions, Inc. #################################################################### # # Set the inptus (filename and zonename) here # filename = 'example_diode_tecplot.dat'; zonename = 'Silicon'; newproject; # # List the available zones and data in the file # note: these 2 lines are not required for the doping import # ?"Available zones: " + tecplotread(filename); ?"Data in zone " + zonename + ": " + tecplotread(filename,zonename); # # Read in the finite element mesh # Note the units of the grid. Data may have to be flipped/re-oriented # t = tecplotread(filename,zonename,'FETriangle'); x = 1e-6*tecplotread(filename,zonename,'X [um]'); # convert to SI from um to m y = 1e-6*tecplotread(filename,zonename,'Y [um]'); # convert to SI, invert # # Names of the node data corresponding to the desired doping concentrations # Note the units of the concentrations # NA_name = 'NA [1/cm3]'; ND_name = 'ND [1/cm3]'; # # Read in the node data for the doping, and convert to SI units # NA = 1e6*tecplotread(filename,zonename,NA_name); # convert to SI (cm^-3 --> m^-3) ND = 1e6*tecplotread(filename,zonename,ND_name); # convert to SI (cm^-3 --> m^-3) # # Optional visualization of imported data (create unstructured dataset # with y-normal view) # ds = unstructureddataset('import',x,matrix(length(x),1),y,t); ds.addattribute('NA',NA); ds.addattribute('ND',ND); ds.addattribute('N',ND-NA); #visualize(ds); # # Add the doping regions to the layout # ?"Adding doping region " + ND_name; ds_n = unstructureddataset('import',x,matrix(length(x),1),y,t); ds_n.addattribute('N',ND); # name 'N' required for import addimportdope; set("name",ND_name); set("dopant type","n"); # n-type for donors set("x",0); set("y",0); set("z",0); importdataset(ds_n); # attaches doping data to object ?"Adding doping region " + NA_name; ds_p = unstructureddataset('import',x,matrix(length(x),1),y,t); ds_p.addattribute('N',NA); # name 'N' required for import addimportdope; set("name",NA_name); set("dopant type","p"); # p-type for acceptors set("x",0); set("y",0); set("z",0); importdataset(ds_p); # attaches doping data to object ?"Extracting structure"; extractstructure(ds); set("name",zonename); set("material","Si (Silicon)"); set("x",0); set("y",0); set("z",0); ?"Done.";