# How to insert anomalies in a cylindrical mesh?

**URL:** <https://simpeg.discourse.group/t/how-to-insert-anomalies-in-a-cylindrical-mesh/35>\
**Category:** Getting Started\
**Created:** [January 15, 2020, 3:35pm UTC](https://simpeg.discourse.group/t/how-to-insert-anomalies-in-a-cylindrical-mesh/35 "2020-01-15T15:35:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcbarreto](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/jcbarreto/32/108_2.png) [@jcbarreto](https://simpeg.discourse.group/u/jcbarreto)\
**Post date:** [January 15, 2020, 3:35pm UTC](https://simpeg.discourse.group/t/how-to-insert-anomalies-in-a-cylindrical-mesh/35/1 "2020-01-15T15:35:53Z")

</div>

How can I insert anomalies in a cylindrical mesh?

---

<div class="post-metadata">

**Author:** ![lheagy](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/lheagy/32/6_2.png) [@lheagy](https://simpeg.discourse.group/u/lheagy)\
**Post date:** [January 19, 2020, 5:34pm UTC](https://simpeg.discourse.group/t/how-to-insert-anomalies-in-a-cylindrical-mesh/35/2 "2020-01-19T17:34:04Z")

</div>

In this case, you need to find the indices of the cell-centered grid where you want the anomaly to be located and you can then change the model values at that location. This notebook shows an example where we input a sphere: [https://github.com/simpeg/em-notebooks/blob/master/notebooks/TDEM\_vmd\_sounding\_over\_sphere.ipynb](https://github.com/simpeg/em-notebooks/blob/master/notebooks/TDEM_vmd_sounding_over_sphere.ipynb)

```auto
# create a vector that has one entry for every cell center
sigma = sig_air*np.ones(mesh.nC) # start by defining the conductivity of the air everwhere
sigma[mesh.gridCC[:,2] < 0.] = sig_halfspace # assign halfspace cells below the earth

sigma_background = sigma.copy()

# indices of the sphere (where (x-x0)**2 + (z-z0)**2 <= R**2)
sphere_ind = (mesh.gridCC[:,0]**2 + (mesh.gridCC[:,2] - sphere_z)**2) <= sphere_radius**2 
sigma[sphere_ind] = sig_sphere # assign the conductivity of the sphere

```
