# "Vectorial" jumps and averages - Discontinuous Galerkin

**URL:** <https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097>\
**Category:** General Discussion\
**Created:** [April 11, 2024, 12:16pm UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097 "2024-04-11T12:16:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aubium](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Aubium](https://community.freefem.org/u/Aubium)\
**Post date:** [April 11, 2024, 12:16pm UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097/1 "2024-04-11T12:16:43Z")

</div>

Greetings fellow members,

If i’m correct, jump() and average() functions give the jump and mean value of a given function at an edge for discontinuous Galerkin schemes. But how to retrieve these fundamental quantities when working with a vector of functions ? I tried something like jump([u1,u2]) but this doesn’t seem to work. Any idea ?

Best regards.

---

<div class="post-metadata">

**Author:** ![larismartins](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/larismartins/32/2712_2.png) [@larismartins](https://community.freefem.org/u/larismartins)\
**Post date:** [April 15, 2024, 9:27am UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097/2 "2024-04-15T09:27:26Z")

</div>

Hi, you need to do

```auto
[jump(u1), jump(u2)] 

```

for vectorial functions. The same applies to the mean/average function.

---

<div class="post-metadata">

**Author:** ![Aubium](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Aubium](https://community.freefem.org/u/Aubium)\
**Post date:** [April 15, 2024, 9:46am UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097/3 "2024-04-15T09:46:43Z")

</div>

Thank you !

So for the average of curl(u) = [average(1st component of curl u), average(2nd omponent of curl u),average(3rd component of curl u)] ?

Is it possible to access theses components with sth like curl(u)[i] where i=0,1,2 in a macro ? For example :

macro Curl(ux,uy,uz) [dy(uz)-dz(uy),…  
macro avgCurl(ux,uy,uz) [average(Curl(ux,uy,uz)[0],…

Thank you, and best of luck.

---

<div class="post-metadata">

**Author:** ![larismartins](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/larismartins/32/2712_2.png) [@larismartins](https://community.freefem.org/u/larismartins)\
**Post date:** [April 15, 2024, 10:26am UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097/4 "2024-04-15T10:26:09Z")

</div>

Yes, for the mean value you should use

```auto
[mean(u1), mean(u2), mean(u3)]

```

and these functions must me in intalledges, then you can access the result through

```auto
u1[][i]

```

but I’m not sure if the macro will work, I never tried before.

---

<div class="post-metadata">

**Author:** ![Aubium](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Aubium](https://community.freefem.org/u/Aubium)\
**Post date:** [April 15, 2024, 1:10pm UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097/5 "2024-04-15T13:10:21Z")

</div>

Thank you so much, and best of luck !
