# Can implement Discontinuous Galerkin for divergence term?

**URL:** <https://community.freefem.org/t/can-implement-discontinuous-galerkin-for-divergence-term/1813>\
**Category:** General Discussion\
**Created:** [June 16, 2022, 2:08pm UTC](https://community.freefem.org/t/can-implement-discontinuous-galerkin-for-divergence-term/1813 "2022-06-16T14:08:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emeseron](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@emeseron](https://community.freefem.org/u/emeseron)\
**Post date:** [June 16, 2022, 2:08pm UTC](https://community.freefem.org/t/can-implement-discontinuous-galerkin-for-divergence-term/1813/1 "2022-06-16T14:08:38Z")

</div>

Hello everyone,  
I am trying to write a code where the divergence term appears in DG formulation, that is,

- int\_{O} p div(u) + int\_{O} {p}[u\*n],  
where O is a domain, p is pressure, u is velocity, div is divergence operator, {.} is the average operator, [.] is the jump operator, and n is the normal vector.

In the code, I am writing the above integrals as follows:

- int2d(Th)(p\*(dx(u1)+dy(u2)) + intalledges(Th)(jump(u1_N.x+u2_N.y)\*mean(p)/nTonEdge);

But when I start the code, this message appears:

"To Day in bilinear form with discontinous Galerkin (2d):  
test or unkown function must be defined on the same FEspace,  
and the matrix is not symmetric.  
To do other case in a future (F. Hecht) dec. 2003 ERROR "BUG ??? A FAIRE/ TO DO (see F. hecht) “0”

What am I doing wrong?  
Any help is welcome  
Best regards
