# Difference in time response between zones and grid point during subcontact cycling

**URL:** <https://forum.itascainternational.com/t/difference-in-time-response-between-zones-and-grid-point-during-subcontact-cycling/1770>\
**Category:** 3DEC\
**Tags:** python\
**Created:** [October 22, 2024, 3:40am UTC](https://forum.itascainternational.com/t/difference-in-time-response-between-zones-and-grid-point-during-subcontact-cycling/1770 "2024-10-22T03:40:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExMaramb](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ExMaramb](https://forum.itascainternational.com/u/ExMaramb)\
**Post date:** [October 22, 2024, 3:40am UTC](https://forum.itascainternational.com/t/difference-in-time-response-between-zones-and-grid-point-during-subcontact-cycling/1770/1 "2024-10-22T03:40:41Z")

</div>

Hey everyone,

I have the following routine to assign pp to subcontacts:

for sbc in it.block.subcontact.list():  
pos\_sc=sbc.pos()  
gp\_n=it.block.gridpoint.near(pos\_sc)  
gp\_pp=gp\_n.pp()  
sbc.set\_pp(gp\_pp)

For some reason (after running a few other routines), this routine takes more than 5 hours to complete. However, using zones instead of gridpoints, i.e:

gp\_n=it.block.zone.near(pos\_sc)

makes this function change from 5 hours to less than a minute… Is there a logical reason for this?

Regards!

---

<div class="post-metadata">

**Author:** ![jhazzard](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jhazzard](https://forum.itascainternational.com/u/jhazzard)\
**Post date:** [October 23, 2024, 3:14pm UTC](https://forum.itascainternational.com/t/difference-in-time-response-between-zones-and-grid-point-during-subcontact-cycling/1770/2 "2024-10-23T15:14:02Z")

</div>

It seems that zone.near is fast because it uses cell space logic. gp.near does not, so it is slow.

We can fix this and make it fast, but in the short term, you probably don’t need it. Every subcontact has a vertex associated with it. The FISH function you want is block.subcontact.gp (in python it would be it.block.subcontact.gp
