File: MixedGradient.py

package info (click to toggle)
fenics-ffcx 1%3A0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 964 kB
  • sloc: python: 7,534; ansic: 194; makefile: 58
file content (11 lines) | stat: -rw-r--r-- 350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from ufl import (FiniteElement, MixedElement, TestFunctions, TrialFunctions,
                 ds, grad, inner, triangle)

element1 = FiniteElement("DG", triangle, 1)
element2 = FiniteElement("DGT", triangle, 1)
element = MixedElement(element1, element2)

u = TrialFunctions(element)[0]
v = TestFunctions(element)[0]

a = inner(grad(u), grad(v)) * ds