%% FEATool Multiphysics Version 1.12.5, Build 20.10.289, Model M-Script file.
%% Created on 17-Oct-2020 20:32:31 with MATLAB 9.8.0.1359463 (R2020a) Update 1 PCWIN64.


%% Starting new model.
fea.sdim = { 'x', 'y', 'z' };
fea.geom = struct;
fea = addphys( fea, @conductivemediadc, { 'V' } );

%% Geometry operations.

%% 2D workplane
wpl = struct('p', [0,0,0], 'n', [0,0,1], 't', [1,0,0]);
fea_wpl.sdim = {'x', 'y'};
fea_wpl.geom = struct;

gobj = gobj_ellipse( [0 0], [.05], [.1], 'E1' );
fea_wpl = geom_add_gobj( fea_wpl, gobj );

gobj = gobj_extrude( fea_wpl.geom.objects{1}, 0.02, [0  0  1], wpl );
fea = geom_add_gobj( fea, gobj );
clear fea_wpl wpl

fea = geom_apply_chamfer( fea, 'EXT1', 0.005, [1 2 3 4 5 6] );
fea = geom_apply_chamfer( fea, 'CH1', 0.002, [1 10 11 12 13 14 2 3 4 5 6 7 8 9] );
gobj = gobj_block( [-2], [2], [-1], [1], [-1], [1], 'B1' );
fea = geom_add_gobj( fea, gobj );

%% Grid operations.
fea.grid = gridgen( fea, 'gridgen', 'gmsh', 'hmax', 0.21, 'nsm', 25 );

%% Geometry operations.
fea = geom_apply_transformation( fea, 'CH2', [ 0  0  0 ], [ 1   1  0.05], 0, [ 1  0  0 ], [2.13322e-05  1.78896e-05  0.01], true );

%% Grid operations.
fea.grid = gridgen( fea, 'gridgen', 'gmsh', 'hmax', 0.21, 'nsm', 25 );

