% addCell - Combine two geometries.
%
%   NewGM = addCell(GM1,GM2) creates nonempty cells inside GM1 using all
%   cells of GM2. All cells of geometry GM2 must appear inside one cell
%   of geometry GM1. The cells from GM1 retain their original IDs, while
%   the IDs of cells from GM2 start with N+1, where N is the number of
%   cells in GM1.
%   GM1 and GM2 are handles to 3-D geometry objects. NewGM is a handle
%   to the modified geometry object GM1.
%
%   Added cells modify a geometry, but they do not modify the mesh. After
%   adding cells, always call generateMesh. Creating a new mesh ensures
%   a proper mesh association with the new geometry.
%
%   Example: Add a cube inside another cube.
%
%       g1 = multicuboid(1,1,1);
%       g2 = multicuboid(0.5,0.5,0.5,'Zoffset',0.25);
%       newgm = addCell(g1,g2);
%       pdegplot(newgm,'CellLabels','on','EdgeLabels','on','FaceAlpha',0.7);
%
%   See also pde.DiscreteGeometry, pde.EquationModel/importGeometry,
%            pde.DiscreteGeometry/addVoid,
%            pde.EquationModel/generateMesh

% Copyright 2020 The MathWorks, Inc.
% Built-in function.
