Remove some cells from a mesh

Hi everyone!
Is there a way to remove arbitrary number of cells from a mesh? To add some context, I need this to “mimic” a domain with some holes.

Thanks!

I had a similar issue with including a void into a SimPEG model. I combined the model with the void space (concatenated the two text files ) and then re-gridded the data using nearest neighbor algorithm based on the chosen mesh. Make sure, you have smaller cells around the void spaces.

Thanks for your response. Would you be able to share your script (if it’s not private)? Would really appreciate it.

  1. combine the two models by appending them together
  2. Create a tensor mesh (or any other mesh)

hx = [(dx, npad_x, -exp_x), (dx, ncx), (dx, npad_x, exp_x)]
hy = [(dy, npad_y, -exp_y), (dy, ncy), (dy, npad_y, exp_y)]
hz = [(dpz, npad_z1, -exp_z1), (dz, ncz), (dpz, npad_z2, exp_z2)]

padding_widths_x = (dx*exp_x**(np.arange(npad_y) + 1))
total_padding_width_x = padding_widths_x.sum()

mesh = TensorMesh([hx, hy, hz], x0=[x0, y0, z0])
cc = mesh.gridCC
3. Check the cell centers to make sure to enough cell density around the voids using cc.
4. grid the models into a new model
gridded_density_new = gd( (cmb_model[:,0], cmb_model[:,1], cmb_model[:,2]), cmb_model[:,3],
(cc[:,0], cc[:,1], cc[:,2] ), method=‘nearest’)

  1. Then follow the gravity example to add the topography into the gridded model