DOLFIN User Manual - FEniCS Project
DOLFIN User Manual - FEniCS Project DOLFIN User Manual - FEniCS Project
DOLFIN User ManualHoffman, Jansson, Logg, WellsThe right-hand side f of (7.1) is similarly specified by defining a new subclassof Function, which we here will name MyFunction, and overloading theevaluation operator:class MyFunction : public Function{real operator() (const Point& p) const{return p.x*p.z*sin(p.y);}};with the source f(x, y, z) = xz sin(y).7.8 Initial value problemsA time dependent problem has to be discretized in time manually, and theresulting variational form is then discretized in space using FFC similarly toa stationary problem, with the solution at previous time steps provided asdata to the form file.For example, the form file Heat.form for the heat equation discretized intime with the implicit Euler method, takes the form:v = BasisFunction(scalar) # test functionU1 = BasisFunction(scalar) # value at next time stepU0 = Function(scalar) # value at previous time stepf = Function(scalar) # source termk = Constant() # time stepa = v*U1*dx + k*v.dx(i)*U1.dx(i)*dxL = v*U0*dx + v*f*dx50
DOLFIN User ManualHoffman, Jansson, Logg, Wellswhich generates a file Heat.h when compiled with FFC. To initializationsthe corresponding forms we write:real k;Vector x0;Function U0(x0, mesh);// time step// vector containing dofs for u0// solution at previous time stepHeat::BilinearForm a(k);Heat::LinearForm L(U0, f, k);51
- Page 1 and 2: DOLFIN User ManualFebruary 24, 2006
- Page 3 and 4: ContentsAbout this manual 91 Introd
- Page 5 and 6: DOLFIN User ManualHoffman, Jansson,
- Page 7: DOLFIN User ManualHoffman, Jansson,
- Page 12 and 13: DOLFIN User ManualHoffman, Jansson,
- Page 14 and 15: DOLFIN User ManualHoffman, Jansson,
- Page 16 and 17: DOLFIN User ManualHoffman, Jansson,
- Page 18 and 19: DOLFIN User ManualHoffman, Jansson,
- Page 20 and 21: DOLFIN User ManualHoffman, Jansson,
- Page 22 and 23: DOLFIN User ManualHoffman, Jansson,
- Page 25 and 26: Chapter 3Linear algebra◮ Develope
- Page 27 and 28: DOLFIN User ManualHoffman, Jansson,
- Page 29 and 30: Chapter 4The mesh◮ Developer’s
- Page 31 and 32: DOLFIN User ManualHoffman, Jansson,
- Page 33 and 34: Chapter 5Functions◮ Developer’s
- Page 35 and 36: DOLFIN User ManualHoffman, Jansson,
- Page 37 and 38: DOLFIN User ManualHoffman, Jansson,
- Page 39 and 40: DOLFIN User ManualHoffman, Jansson,
- Page 41 and 42: DOLFIN User ManualHoffman, Jansson,
- Page 43: Chapter 6Ordinary differential equa
- Page 46 and 47: DOLFIN User ManualHoffman, Jansson,
- Page 48 and 49: DOLFIN User ManualHoffman, Jansson,
- Page 53 and 54: Chapter 8Nonlinear solver◮ Develo
- Page 55: DOLFIN User ManualHoffman, Jansson,
- Page 58 and 59: DOLFIN User ManualHoffman, Jansson,
- Page 60 and 61: DOLFIN User ManualHoffman, Jansson,
- Page 62 and 63: DOLFIN User ManualHoffman, Jansson,
- Page 65 and 66: Chapter 10The log systemDOLFIN prov
- Page 67 and 68: DOLFIN User ManualHoffman, Jansson,
- Page 69 and 70: DOLFIN User ManualHoffman, Jansson,
- Page 71: DOLFIN User ManualHoffman, Jansson,
- Page 74 and 75: DOLFIN User ManualHoffman, Jansson,
- Page 76 and 77: DOLFIN User ManualHoffman, Jansson,
- Page 78 and 79: DOLFIN User ManualHoffman, Jansson,
- Page 80 and 81: DOLFIN User ManualHoffman, Jansson,
- Page 82 and 83: DOLFIN User ManualHoffman, Jansson,
- Page 85: Bibliography[1] Cygwin, 2005. http:
- Page 88 and 89: v 2 v 0 = (0, 0)DOLFIN User ManualH
- Page 90 and 91: DOLFIN User ManualHoffman, Jansson,
- Page 92 and 93: DOLFIN User ManualHoffman, Jansson,
- Page 94 and 95: DOLFIN User ManualHoffman, Jansson,
- Page 96 and 97: DOLFIN User ManualHoffman, Jansson,
- Page 98 and 99: DOLFIN User ManualHoffman, Jansson,
<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, WellsThe right-hand side f of (7.1) is similarly specified by defining a new subclassof Function, which we here will name MyFunction, and overloading theevaluation operator:class MyFunction : public Function{real operator() (const Point& p) const{return p.x*p.z*sin(p.y);}};with the source f(x, y, z) = xz sin(y).7.8 Initial value problemsA time dependent problem has to be discretized in time manually, and theresulting variational form is then discretized in space using FFC similarly toa stationary problem, with the solution at previous time steps provided asdata to the form file.For example, the form file Heat.form for the heat equation discretized intime with the implicit Euler method, takes the form:v = BasisFunction(scalar) # test functionU1 = BasisFunction(scalar) # value at next time stepU0 = Function(scalar) # value at previous time stepf = Function(scalar) # source termk = Constant() # time stepa = v*U1*dx + k*v.dx(i)*U1.dx(i)*dxL = v*U0*dx + v*f*dx50