# Faster Computation

**URL:** <https://forum.dynamobim.com/t/faster-computation/44193>\
**Category:** Uncategorized\
**Created:** [December 9, 2019, 4:06am UTC](https://forum.dynamobim.com/t/faster-computation/44193 "2019-12-09T04:06:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![saju\_autodesk](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/saju_autodesk/32/61838_2.png) [@saju\_autodesk](https://forum.dynamobim.com/u/saju_autodesk)\
**Post date:** [December 9, 2019, 4:06am UTC](https://forum.dynamobim.com/t/faster-computation/44193/1 "2019-12-09T04:06:31Z")

</div>

I have two lists of bounding box each 300 and 700 counts, I want to run a bounding box intersects to find if they intersect ,

What trick should i use to make the process faster,Is there a way to allocate some resources ect…?

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [December 9, 2019, 1:40pm UTC](https://forum.dynamobim.com/t/faster-computation/44193/2 "2019-12-09T13:40:10Z")

</div>

From my point of view when using high density of geometry i would see the following being the way i would take things to reduce computation(Higher compute time to lowest)

Out of the box  
Code Block  
Python  
C# Node

Note:  
It is also sometimes better to utilise revit geometry in python/c# instead of re-creating them in dynamo as this will help with compute resources.  
For python and c# do not forget to dispose!

> **[DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo/wiki/Zero-Touch-Plugin-Development#dispose--using-statement)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

> **[DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo/wiki/Efficiently-Working-With-Large-Data-Sets-In-Dynamo)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

Are you using Revit elements for this because have a look at BimMorph package because it has a intersect node within that will help to reduce computation workload.

Information:

> **[Bimorph Nodes V2.1 Released for Dynamo BIM](https://bimorph.com/bimorph-nodes-v2-1-released/)**
>
> BimorphNodes v2.1 package for Dynamo BIM has been released! This article explores the new ultra-efficient clash detection and geometry intersection nodes

  

> **[Bimorph Nodes V2.2 adds Holistic Link Element Clash Detection](https://bimorph.com/bimorph-nodes-v2-2-supports-holistic-linked-element-clash-detection/)**
>
> Bimorph Nodes v2.2 adds new LinkElement nodes and holistic support for linked element clash detection by solving major Revit API limitations

---

<div class="post-metadata">

**Author:** ![stillgotme](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stillgotme](https://forum.dynamobim.com/u/stillgotme)\
**Post date:** [December 10, 2019, 6:39am UTC](https://forum.dynamobim.com/t/faster-computation/44193/3 "2019-12-10T06:39:06Z")

</div>

check out element filter collection in the revit api, they have some sick built in class detection function that are the fastest way to check if element is clashing. thats what bimorph nodes are built from 😃 i think.

---

<div class="post-metadata">

**Author:** ![saju\_autodesk](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/saju_autodesk/32/61838_2.png) [@saju\_autodesk](https://forum.dynamobim.com/u/saju_autodesk)\
**Post date:** [December 10, 2019, 6:56am UTC](https://forum.dynamobim.com/t/faster-computation/44193/4 "2019-12-10T06:56:02Z")

</div>

I have already tried Bimorph nodes and python too,both gave a significant difference yet what I have is a dynamo geometry and I don’t want to create unnecessary revit elements just for the sake of clash detection,Also I couldn’t find any node that does this faster calculation on dynamo geometries,let me know if there is any.

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [December 10, 2019, 11:53am UTC](https://forum.dynamobim.com/t/faster-computation/44193/5 "2019-12-10T11:53:12Z")

</div>

No worries I was highlighting the revit and dynamo geometry because sometimes people will grab geometry from revit with a node which will re-create it as a dynamo geometry and create a memory overhead. then they would re-create the changes in revit but if you can code it all with just revit api this will help with computation overheads.

Just to help of something i do even if it is dynamo geometry to then create something, it may be best to use python to limit all the preview/creation overheads for each node and each item in the node.

Lets say you are after using numbers to create a box and a set of numbers to create a ball, they are all positioned on set coordinates with what is not clashing being the out put therefore you would do the following in python:

1. Create the points from coordinates.
2. Create rectangle from points and numbers.
3. Create ball from coordinates and numbers.
4. Dispose all point info
5. Get the geometry that is left.
6. Dispose rectangle and ball geometric information
7. Repeat steps 1 to 6 for each time it is needed
8. Output all the geometry for each instance that is being checked

---

<div class="post-metadata">

**Author:** ![saju\_autodesk](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/saju_autodesk/32/61838_2.png) [@saju\_autodesk](https://forum.dynamobim.com/u/saju_autodesk)\
**Post date:** [December 10, 2019, 3:25pm UTC](https://forum.dynamobim.com/t/faster-computation/44193/6 "2019-12-10T15:25:44Z")

</div>

@Brendan_Cassidy,  
Sorry i have made you to make so many assumptions,I should have added some more information,my bad.

This can be treated as a continuation to my post here:

> [@Boosting geometric calculation speed](https://forum.dynamobim.com/t/boosting-geometric-calculation-speed/43201/4):
>
> @Ewan_Opie thanks,It really helps but I am still programming to create a sphere on each point and calculating the intersection,you have any idea to minimize the time to create unwanted geometries. I don’t see a node in the package which gives bool results for geometry to geometry intersection or boundingbox to boundingbox intersection will be happy to see @Thomas_Mahon adding this to package though. The best I am able to do now is convert all curves to model element run the clash and delete la…

The Actual problem here is i had to cross product lacing to find adjacent lines (connected lines) of each point which is really a time consuming computation,initially i was searching for some way where i can avoid other lines that are really far from the point.  
But realised later that to do so i have to first run distance to node with cross product lacing.

Currently I am using point inside bbox which gives the most faster results among the options i have.

But this node still runs with cross product,since I couldn’t find any better idea i was looking for options for allocating resource  
I have learnt sometime back that GPU can perform faster at small calculations that the CPU as the number of cores is large ,so i wanted to know if we have any way to allocate this task to GPU and pipeline it back to the main flow.?

One more question i have is that does dynamo make use of GPU for core computation or just to render the work canvas and such supporting stuffs? Well thats a question for another thread.!

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [December 16, 2019, 2:06am UTC](https://forum.dynamobim.com/t/faster-computation/44193/7 "2019-12-16T02:06:42Z")

</div>

Dynamo only uses the gpu for visualization. If you’d like to look into gpu compute, you’ll first need to pick a platform. If you’ve got an nvidia card, then you should try cuda because it’s more widely used. Otherwise your best bet is OpenCL. Each comes with its own syntax and wrappers for other languages.

The next problem is that there aren’t any open source geometry kernels that I know of, that use gpu compute, so you’ll probably have to write your own.

---

<div class="post-metadata">

**Author:** ![saju\_autodesk](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/saju_autodesk/32/61838_2.png) [@saju\_autodesk](https://forum.dynamobim.com/u/saju_autodesk)\
**Post date:** [December 16, 2019, 2:11am UTC](https://forum.dynamobim.com/t/faster-computation/44193/8 "2019-12-16T02:11:34Z")

</div>

Thats simply beyond my abilities and knowledge for now , thanks for the reply…!
