# Implement 1D integral in 3D simulation

**URL:** <https://community.freefem.org/t/implement-1d-integral-in-3d-simulation/3740>\
**Category:** Feature Request\
**Created:** [February 10, 2025, 6:59am UTC](https://community.freefem.org/t/implement-1d-integral-in-3d-simulation/3740 "2025-02-10T06:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![usiu5555](https://avatars.discourse-cdn.com/v4/letter/u/e19adc/32.png) [@usiu5555](https://community.freefem.org/u/usiu5555)\
**Post date:** [February 10, 2025, 6:59am UTC](https://community.freefem.org/t/implement-1d-integral-in-3d-simulation/3740/1 "2025-02-10T06:59:39Z")

</div>

Sometimes in simulations, we would want to reduce the dimensionality of a domain. For example in grain boundary diffusion (see [https://www.doi.org/10.1088/1361-651x/ab1624](https://www.doi.org/10.1088/1361-651x/ab1624)), when considering the effect of diffusion on the effectively 2D grain boundary, a weak form results in a 1D integral at the surface’s boundary. Even though the integral is 1D, it represents a 2D integral (same as int\_2d f(x) dxdy = delta\_y int\_1d f(x)dx).

Professor [François Bouchut](https://community.freefem.org/u/fb77) in the thread [https://community.freefem.org/t/effectively-1d-flux-boundary-condition-in-3d-simulation/3723](https://community.freefem.org/t/effectively-1d-flux-boundary-condition-in-3d-simulation/3723) helped me implement such phenomena in a simplified scenario where the 1D integrals were manually calculated and added to the algebraic system. Due to the manual calculation of integrals, the solution is limited to simple cases. Utilizing the function `int1D` would help to implement advanced simulations involving similar phenomena, such as triple phase boundary source terms or 1D heat source and boundary in heat transfer.

This functionality is available in commercial software (I have checked COMSOL [documentation](https://doc.comsol.com/5.5/doc/com.comsol.help.heat/heat_ug_ht_features.09.089.html)), which could be an additional reason to implement it in FreeFEM.
