DOLFIN User Manual - FEniCS Project
DOLFIN User Manual - FEniCS Project DOLFIN User Manual - FEniCS Project
DOLFIN User ManualHoffman, Jansson, Logg, WellsIn general however, a discrete Function must be initialized from a givenVector, a Mesh and a FiniteElement:Vector x;Mesh mesh;FiniteElement element;Function f(x, mesh, element);5.2.2 Accessing discrete function dataIt is possible to access the data of a discrete Function, including the associatedVector, Mesh and FiniteElement:Vector& x= u.vector();Mesh& mesh= u.mesh();FiniteElement& element = u.element();5.2.3 Attaching discrete function dataAfter a discrete Function has been initialized, it is possible to associate orreassociate data with the Function:Vector x;Mesh mesh;FiniteElement element;Function f(x);f.attach(mesh);f.attach(element);38
DOLFIN User ManualHoffman, Jansson, Logg, WellsUsually, the FiniteElement is given by the BilinearForm defining the problem.Considering the Poisson example in Chapter 2, a Function u representingthe solution can be initialized as follows:Vector x;Mesh mesh;Function f(x, mesh);Poisson::BilinearForm a;FiniteElement& element = a.trial();f.attach(element);In this example, the Function f represents a function in the trial space forthe BilinearForm a.5.3 User-defined functionsIn the simplest case, a user-defined Function is just an expression in termsof the coordinates and is typically used for defining source terms and initialconditions. For example, a source term could be given byf = f(x, y, z) = xy sin(z/π). (5.2)There are two ways to create a user-defined Function; either by creatinga sub class of Function or by creating a Function from a given functionpointer.5.3.1 Creating a sub classA user-defined Function may be defined by creating a sub class of Functionand overloading the eval() function. The following example illustrates howto create a Function representing the function in (5.2):39
- 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: 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, WellsIn general however, a discrete Function must be initialized from a givenVector, a Mesh and a FiniteElement:Vector x;Mesh mesh;FiniteElement element;Function f(x, mesh, element);5.2.2 Accessing discrete function dataIt is possible to access the data of a discrete Function, including the associatedVector, Mesh and FiniteElement:Vector& x= u.vector();Mesh& mesh= u.mesh();FiniteElement& element = u.element();5.2.3 Attaching discrete function dataAfter a discrete Function has been initialized, it is possible to associate orreassociate data with the Function:Vector x;Mesh mesh;FiniteElement element;Function f(x);f.attach(mesh);f.attach(element);38