DOLFIN User Manual - FEniCS Project
DOLFIN User Manual - FEniCS Project DOLFIN User Manual - FEniCS Project
DOLFIN User ManualHoffman, Jansson, Logg, Wellsof a Stokes or Navier-Stokes system (with U the vector-valued velocity andP the scalar pressure), the following example illustrates how to pick subfunctions and components of w:Function w; // mixed Function (U, P)U = w[0]; // first sub function (velocity)P = w[1]; // second sub function (pressure)U0 = U[0]; // first component of the velocityU1 = U[1]; // second component of the velocityU2 = U[2]; // third component of the velocityNote that picking a component or sub function creates a new Function thatshares data with the original Function.5.1.5 OutputA Function can be written to a file in various file formats. To write aFunction u to file in VTK format, suitable for viewing in ParaView orMayaVi, create a file with extension .pvd:File file(‘‘solution.pvd’’);file
DOLFIN User ManualHoffman, Jansson, Logg, Wellslinear combinations of basis functions:v =N∑v i φ i , (5.1)i=1where {φ i } N i=1 is the global basis of the finite element space defined by theMesh and the FiniteElement, and the nodal values {v i } N i=1 are given by thevalues of a Vector.Note that a discrete Function may not be evaluated at arbitrary points (onlyat each Vertex of a Mesh).5.2.1 Creating a discrete functionA discrete Function can be initialized in several ways. In the simplest case,only a Vector x of nodal values needs to be specified:Vector x;Function f(x);If possible, DOLFIN will then automatically try to determine the Mesh andthe FiniteElement.In some cases, it is necessary to also supply a Mesh when initializing a discreteFunction:Vector x;Mesh mesh;Function f(x, mesh);If possible, DOLFIN will then automatically try to determine the FiniteElement.37
- 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: 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,
- 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:
<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, Wellsof a Stokes or Navier-Stokes system (with U the vector-valued velocity andP the scalar pressure), the following example illustrates how to pick subfunctions and components of w:Function w; // mixed Function (U, P)U = w[0]; // first sub function (velocity)P = w[1]; // second sub function (pressure)U0 = U[0]; // first component of the velocityU1 = U[1]; // second component of the velocityU2 = U[2]; // third component of the velocityNote that picking a component or sub function creates a new Function thatshares data with the original Function.5.1.5 OutputA Function can be written to a file in various file formats. To write aFunction u to file in VTK format, suitable for viewing in ParaView orMayaVi, create a file with extension .pvd:File file(‘‘solution.pvd’’);file