reset undo on # Define the mesh size #{size = 0.25e-3} # create points (vertex) create vertex 0 -0.015 0 create vertex 0 -0.004 0 create vertex 0 0.004 0 create vertex 0 0.015 0 create vertex 0.005 0.015 0 create vertex 0.005 0.004 0 create vertex 0.005 -0.004 0 create vertex 0.005 -0.015 0 create vertex 0.01 -0.015 0 create vertex 0.01 -0.004 0 create vertex 0.01 0.004 0 create vertex 0.01 0.015 0 create vertex 0.025 0.015 0 create vertex 0.025 0.004 0 create vertex 0.025 -0.004 0 create vertex 0.025 -0.015 0 # create lines from points create curve vertex 2 3 create curve vertex 3 6 create curve vertex 6 7 create curve vertex 7 2 create curve vertex 19 10 create curve vertex 10 11 create curve vertex 11 18 create curve vertex 17 4 create curve vertex 4 5 create curve vertex 5 12 create curve vertex 12 13 create curve vertex 13 14 create curve vertex 14 15 create curve vertex 15 16 create curve vertex 16 9 create curve vertex 9 8 create curve vertex 8 1 create curve vertex 1 2 # create surfaces from lines create surface curve 4 1 2 3 create surface curve 5 6 7 3 create surface curve 8 9 10 11 12 13 14 15 16 17 18 4 5 6 7 2 # create pseude 2d problem sweep surface 3 2 1 direction z distance 0.01 # merge and impring all imprint all merge all # mesh surface 1 to 3 size {size} mesh surface 1 to 3 curve with z_coord > 0 and z_coord <0.01 interval 1 mesh curve with z_coord > 0 and z_coord <0.01 mesh volume all # define the regions block 1 add volume 3 block 1 name "air" block 2 add volume 2 block 2 name "magnet" block 3 add volume 1 block 3 name "core" nodeset 1 add surface 5 6 7 11 12 13 nodeset 1 name "S_mantle_x_parallel" nodeset 2 add surface 8 9 10 nodeset 2 name "S_mantle_y_parallel" nodeset 3 add surface 1 2 3 nodeset 3 name "S_front" nodeset 4 add surface 20 25 30 nodeset 4 name "S_back" nodeset 5 add surface 4 14 27 nodeset 5 name "S_sym" # export export ansys cdb "./geometry-ue.cdb" overwrite