# Integrate 3D solution along an axis with dolfinx

**URL:** <https://fenicsproject.discourse.group/t/integrate-3d-solution-along-an-axis-with-dolfinx/11682>\
**Category:** Uncategorized\
**Created:** [July 7, 2023, 4:41am UTC](https://fenicsproject.discourse.group/t/integrate-3d-solution-along-an-axis-with-dolfinx/11682 "2023-07-07T04:41:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huy\_Tuong\_Cao](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/huy_tuong_cao/32/5238_2.png) [@Huy\_Tuong\_Cao](https://fenicsproject.discourse.group/u/Huy_Tuong_Cao)\
**Post date:** [July 7, 2023, 4:41am UTC](https://fenicsproject.discourse.group/t/integrate-3d-solution-along-an-axis-with-dolfinx/11682/1 "2023-07-07T04:41:13Z")

</div>

I’m looking for a fast method to integrate a solution u(x,y,z) of a Poisson equation in a 3D domain along one of its axis such that I can obtain a 2D map: g(x,y) = \int\_{z\_0}^{z\_1} u(x,y,z) dz . Currently I am evaluating u(x,y,z) on a regular grid using the `compute_colliding_cell` method as in [this membrane deflection example](https://jsdokken.com/dolfinx-tutorial/chapter1/membrane_code.html) , then just numerically integrated over this regular grid. However, this currently takes a while to evaluate u over the large 3d grid so I wonder if there is a more efficient way to perform this integration.

---

<div class="post-metadata">

**Author:** ![belmont](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@belmont](https://fenicsproject.discourse.group/u/belmont)\
**Post date:** [July 12, 2023, 12:13pm UTC](https://fenicsproject.discourse.group/t/integrate-3d-solution-along-an-axis-with-dolfinx/11682/2 "2023-07-12T12:13:15Z")

</div>

In 3D problems based in the discussion [here](https://fenicsproject.discourse.group/t/line-integral-of-vector-field/11165/8) there doesn’t seem to be another way yet, unless I totally misunderstand. Still, if anyone has more input I am also in the answer to this.
