def createMesh(device, region): devsim.create_2d_mesh(mesh="dog") devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0.5e-5, ps=1e-8) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=-1e-8, ps=1e-8) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1.001e-5, ps=1e-8) devsim.add_2d_region(mesh="dog", material="Si", region=region) devsim.add_2d_region(mesh="dog", material="Si", region="air1", xl=-1e-8, xh=0) devsim.add_2d_region(mesh="dog", material="Si", region="air2", xl=1.0e-5, xh=1.001e-5) devsim.add_2d_contact(mesh="dog", name="top", region=region, yl=0.8e-5, yh=1e-5, xl=0, xh=0, bloat=1e-10, material="metal") devsim.add_2d_contact(mesh="dog", name="bot", region=region, xl=1e-5, xh=1e-5, bloat=1e-10, material="metal") devsim.finalize_mesh(mesh="dog") devsim.create_device(mesh="dog", device=device)
devsim.create_2d_mesh( mesh="dog") devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=-0.001, ps=0.001) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=xmin, ps=0.1) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=xmax, ps=0.1) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=ymin, ps=0.1) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=ymax, ps=0.1) #in order to capture interfaces devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=+1.001, ps=0.001) # color triangles not nodes or edges # error if region doesn't have any triangles # last add_region has highest precedence # allow use of names or tags # check my parser to verify that adding is possible (via dynamic_cast) # note this region won't have equation numbers devsim.add_2d_region( mesh="dog", material="gas", region="gas1", yl=-.001, yh=0.0) devsim.add_2d_region( mesh="dog", material="gas", region="gas2", yl=1.0, yh=1.001) devsim.add_2d_region( mesh="dog", material="Oxide", region="r0", xl=xmin, xh=xmax, yl=ymid1, yh=ymin) devsim.add_2d_region( mesh="dog", material="Silicon", region="r1", xl=xmin, xh=xmax, yl=ymid2, yh=ymid1) devsim.add_2d_region( mesh="dog", material="Silicon", region="r2", xl=xmin, xh=xmax, yl=ymid2, yh=ymax) #warn when leftover triangles are not encapsulated by region # not specifying bounding box means all intersecting nodes #bounding box is optional devsim.add_2d_interface( mesh="dog", name="i0", region0="r0", region1="r1") devsim.add_2d_interface( mesh="dog", name="i1", region0="r1", region1="r2", xl=0, xh=1, yl=ymid2, yh=ymid2, bloat=1.0e-10) devsim.add_2d_contact( mesh="dog", name="top", region="r0", yl=ymin, yh=ymin, bloat=1.0e-10, material="metal") devsim.add_2d_contact( mesh="dog", name="bot", region="r2", yl=ymax, yh=ymax, bloat=1.0e-10, material="metal") #contact can only apply interface devsim.finalize_mesh( mesh="dog") devsim.create_device(mesh="dog", device=device)
region = "MyRegion" #### #### Meshing #### devsim.create_2d_mesh(mesh="dog") devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=-1e-8, ps=1e-8) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1.001e-5, ps=1e-8) devsim.add_2d_region(mesh="dog", material="Si", region=region) devsim.add_2d_region(mesh="dog", material="Si", region="air1", xl=-1e-8, xh=0) devsim.add_2d_region(mesh="dog", material="Si", region="air2", xl=1.0e-5, xh=1.001e-5) devsim.add_2d_contact(mesh="dog", name="top", region=region, xl=0, xh=0, bloat=1e-10, material="metal") devsim.add_2d_contact(mesh="dog",
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=ymax, ps=5.0) device = device region = "air" devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmin, ps=5) devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x1, ps=2) devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x2, ps=0.05) devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x3, ps=0.05) devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x4, ps=2) devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmax, ps=5) devsim.add_2d_region(mesh=device, material="gas", region="air", yl=ymin, yh=ymax, xl=xmin, xh=xmax) devsim.add_2d_region(mesh=device, material="metal", region="m1", yl=y1, yh=y2, xl=x1, xh=x4) devsim.add_2d_region(mesh=device, material="metal", region="m2", yl=y3, yh=y4,
devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_oxide_mid, ps=y_oxide_mid_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_bulk_top, ns=y_oxide_mid_spacing, ps=y_channel_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_diffusion, ps=y_diffusion_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_bulk_mid, ps=y_bulk_mid_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_bulk_bottom, ns=y_bulk_bottom_spacing, ps=max_y_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="y", pos=y_device_bottom, ps=max_y_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_center, ps=x_channel_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_gate_left, ps=x_channel_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_bulk_left, ps=x_diffusion_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_gate_right, ps=x_channel_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_bulk_right, ps=x_diffusion_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_device_right, ps=max_x_spacing) devsim.add_2d_mesh_line(mesh="mos", dir="x", pos=x_device_left, ps=max_x_spacing) devsim.add_2d_region(mesh="mos", material="Air" , region="air") devsim.add_2d_region(mesh="mos", material="Silicon", region="bulk", xl=x_bulk_left, xh=x_bulk_right, yl=y_bulk_bottom, yh=y_bulk_top) devsim.add_2d_region(mesh="mos", material="Silicon", region="gate", xl=x_gate_left, xh=x_gate_right, yl=y_oxide_top, yh=y_gate_top) devsim.add_2d_region(mesh="mos", material="Oxide" , region="oxide", xl=x_gate_left, xh=x_gate_right, yl=y_bulk_top, yh=y_oxide_top) devsim.add_2d_contact(mesh="mos", name="gate", region="gate", yl=y_gate_top, yh=y_gate_top, material="metal") devsim.add_2d_contact(mesh="mos", name="body", region="bulk", yl=y_bulk_bottom, yh=y_bulk_bottom, material="metal") devsim.add_2d_contact(mesh="mos", name="source", region="bulk", yl=y_bulk_top, yh=y_bulk_top, xl=x_device_left, xh=x_gate_left, material="metal") devsim.add_2d_contact(mesh="mos", name="drain" , region="bulk", yl=y_bulk_top, yh=y_bulk_top, xl=x_gate_right, xh=x_device_right, material="metal") devsim.add_2d_interface(mesh="mos", name="gate_oxide", region0="gate", region1="oxide") devsim.add_2d_interface(mesh="mos", name="bulk_oxide", region0="bulk", region1="oxide") devsim.finalize_mesh(mesh="mos") devsim.create_device(mesh="mos", device=device)