# Visualizing a mesh-wise quantity

**URL:** <https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458>\
**Category:** Visualization\
**Created:** [March 4, 2021, 1:54am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458 "2021-03-04T01:54:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_McBane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sean_mcbane/32/4580_2.png) [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Post date:** [March 4, 2021, 1:54am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/1 "2021-03-04T01:54:13Z")

</div>

My problem is as follows: I want to visualize a quantity which varies over a domain, but is piecewise constant over subdomains, each of which has its own mesh. I’ve been doing this by saving the value as cell-centered values in a multiblock VTK file but this is much more expensive than necessary. How could I efficiently visualize this quantity (probably using Makie)?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 4, 2021, 2:45am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/2 "2021-03-04T02:45:46Z")

</div>

What do you expect from this visualization? Interactivity, handling millions of cells, …

---

<div class="post-metadata">

**Author:** ![Sean\_McBane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sean_mcbane/32/4580_2.png) [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Post date:** [March 4, 2021, 2:49am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/3 "2021-03-04T02:49:15Z")

</div>

I’d like to be able to record a movie consisting of a few hundreds of frames in a reasonable time. The point is I’d like to represent each domain as a filled polygon with a color mapping to the variable value, but right now I don’t have a better way to handle it than assigning a value to each cell. I’d like to extract the boundary of each subdomain from the mesh as a polygon. The number of subdomains right now is from a few hundred to ~10000.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 4, 2021, 2:51am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/4 "2021-03-04T02:51:12Z")

</div>

Kind of like a map? GIS?

---

<div class="post-metadata">

**Author:** ![Sean\_McBane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sean_mcbane/32/4580_2.png) [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Post date:** [March 4, 2021, 2:54am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/5 "2021-03-04T02:54:39Z")

</div>

The visualization I’m getting at looks something like this

 ![rho_pp](https://global.discourse-cdn.com/julialang/original/3X/9/c/9cb9d469807fb9f85ffaba947f496ff1dd9fa80f.png)  
Each of the joints and struts in this picture has ~800 elements so as the scale of this gets larger it becomes quite expensive to plot a cell centered variable. For visualizations like this one, though, the variable I’m interested in is piecewise constant over each of those domains.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 4, 2021, 2:55am UTC](https://discourse.julialang.org/t/visualizing-a-mesh-wise-quantity/56458/6 "2021-03-04T02:55:21Z")

</div>

Graph visualization? I believe there is a specialized library for that.
