DOLFIN User Manual - FEniCS Project
DOLFIN User Manual - FEniCS Project DOLFIN User Manual - FEniCS Project
DOLFIN User ManualHoffman, Jansson, Logg, WellsNext, we initialize the pair of bilinear and linear forms that we have previouslycompiled with FFC:Poisson::BilinearForm a;Poisson::LinearForm L(f);We may now define a PDE from the pair of forms, the mesh and the boundaryconditions:PDE pde(a, L, mesh, bc);To solve the PDE, we now just need to call the solve function as follows:Function U = pde.solve();Finally, we export the solution u to a file for visualization. Here, we chooseto save the solution in VTK format for visualization in ParaView or MayaVi,which we do by specifying a file name with extension .pvd:File file(‘‘poisson.pvd’’);file
DOLFIN User ManualHoffman, Jansson, Logg, Wellsclass : public Function{real eval(const Point& p, unsigned int i){return p.x*sin(p.y);}} f;// Boundary conditionclass : public BoundaryCondition{void eval(BoundaryValue& value, const Point& p, unsigned int i){if ( std::abs(p.x - 1.0) < DOLFIN_EPS )value = 0.0;}} bc;// Set up problemUnitSquare mesh(16, 16);Poisson::BilinearForm a;Poisson::LinearForm L(f);PDE pde(a, L, mesh, bc);// Compute solutionFunction U = pde.solve();// Save solution to fileFile file("poisson.pvd");file
- 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 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 50 and 51: 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,
<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, WellsNext, we initialize the pair of bilinear and linear forms that we have previouslycompiled with FFC:Poisson::BilinearForm a;Poisson::LinearForm L(f);We may now define a PDE from the pair of forms, the mesh and the boundaryconditions:PDE pde(a, L, mesh, bc);To solve the PDE, we now just need to call the solve function as follows:Function U = pde.solve();Finally, we export the solution u to a file for visualization. Here, we chooseto save the solution in VTK format for visualization in ParaView or MayaVi,which we do by specifying a file name with extension .pvd:File file(‘‘poisson.pvd’’);file