%% FEATool Multiphysics Version 1.12.4, Build 20.08.221, Model M-Script file.
%% Created on 30-Aug-2020 18:07:11 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.
gobj = gobj_block( [0], [1], [0], [1], [0], [1], 'B1' );
fea = geom_add_gobj( fea, gobj );
gobj = gobj_sphere( [.5 .5 .5], [.25], [1], 'S1' );
fea = geom_add_gobj( fea, gobj );
fea = geom_apply_formula( fea, 'B1-S1' );
gobj = gobj_sphere( [.5 .5 .5], [.05], [1], 'S2' );
fea = geom_add_gobj( fea, gobj );
fea = geom_apply_formula( fea, 'CS1+S2' );

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

disp ("Created objects:");
print_each_objects_tag (fea.geom)
disp ("see FEATool gui window for grid slice...");

% clear FEATool plot area
delete(setdiff(findall( ...
    findall(findall(0,'tag','featool_gui_main_window'),'type','axes')), ...
    findall(findall(0,'tag','featool_gui_main_window'),'type','axes')))
plotgrid( fea.grid, 'selcells', selcells(fea.grid, 'x<0.5') );

%% Geometry operations.

%% Grid operations.

