poisson.form

来自「Dolfin provide a high-performance linear」· FORM 代码 · 共 43 行

FORM
43
字号
# Copyright (C) 2006-2007 Kristiand B. Oelgaard and Anders Logg.# Licensed under the GNU LGPL Version 2.1.## First added:  2006-12-05# Last changed: 2007-05-29## The bilinear form a(v, u) and linear form L(v) for# Poisson's equation in a discontinuous Galerkin (DG)# formulation.## Compile this form with FFC: ffc -l dolfin Poisson.form# Elementselement = FiniteElement("Discontinuous Lagrange", "triangle", 1)# Test and trial functionsv = TestFunction(element)u = TrialFunction(element)f = Function(element)# Normal component, mesh size and right-hand siden = FacetNormal("triangle")h = MeshSize("triangle")# Neumann boundary conditionsgN = Function(element)# Parametersalpha = 4.0gamma = 8.0# Bilinear forma = dot(grad(v), grad(u))*dx \   - dot(avg(grad(v)), jump(u, n))*dS \   - dot(jump(v, n), avg(grad(u)))*dS \   + alpha/h('+')*dot(jump(v, n), jump(u, n))*dS \   - dot(grad(v), jump(u,n))*ds \   - dot(jump(v,n), grad(u))*ds \   + gamma/h*v*u*ds# Linear formL = v*f*dx + v*gN*ds

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?