# Difference between "DG" and "CG"?

**URL:** <https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313>\
**Category:** mathematics\
**Created:** [September 28, 2023, 12:07am UTC](https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313 "2023-09-28T00:07:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xi\_wang](https://avatars.discourse-cdn.com/v4/letter/x/8c91f0/32.png) [@xi\_wang](https://fenicsproject.discourse.group/u/xi_wang)\
**Post date:** [September 28, 2023, 12:07am UTC](https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313/1 "2023-09-28T00:07:18Z")

</div>

I saw the answer [P and CG](https://fenicsproject.discourse.group/t/difference-between-finite-elements/5975) but didn’t get the answer. And the Jacobian of transforming a standard element to a physical element is [computed using “DG” rather than “CG”](https://fenicsproject.discourse.group/t/problem-with-the-determinant-of-the-jacobian/12287/2), actually “CG” will give wrong results here. I am wondering why cannot “CG” element while “DG” can get the Jacobian and what are the differences between “CG” and “DG”?

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [September 28, 2023, 4:11am UTC](https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313/2 "2023-09-28T04:11:30Z")

</div>

CG encodes continuity between elements. (This the C, which stands for continuous)

The jacobian is defined per element. (If you look at non affine elements it is actually a non-constant function on each element).

For linear simplices (triangles and tetrahedrons) the jacobian is constant per cell

---

<div class="post-metadata">

**Author:** ![xi\_wang](https://avatars.discourse-cdn.com/v4/letter/x/8c91f0/32.png) [@xi\_wang](https://fenicsproject.discourse.group/u/xi_wang)\
**Post date:** [September 28, 2023, 6:44am UTC](https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313/3 "2023-09-28T06:44:02Z")

</div>

Thanks! After searching the web and GPT stuff, I still cannot find any formal definition about CG, could you send me some info about it? Websites, books, or blogs will all be helpful.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [September 28, 2023, 6:45am UTC](https://fenicsproject.discourse.group/t/difference-between-dg-and-cg/12313/4 "2023-09-28T06:45:29Z")

</div>

> **[DefElement: Lagrange](https://defelement.com/elements/lagrange.html)**
>
> An encyclopedia of finite element definitions

or section 3.3 of: [https://fenicsproject.org/pub/book/book/fenics-book-2011-06-14.pdf](https://fenicsproject.org/pub/book/book/fenics-book-2011-06-14.pdf)
