Module 1 - Mesh

module1_mesh_cont.MyMesh(r, n, n_vertex)

Function that generate the mesh based in number of vertex in boundary. It is extremely important that forward mesh and inverse mesh have vertex in commum, so this routine generate both, mesh_direct is a refiniment from mesh_inverse.

Parameters
  • r (float.) – Circle Radius

  • n (int.) – Refinament parameter

  • n_vertex (int) – Vertices number in boundary

Returns

dolfin.cpp.mesh.Mesh

Example
>>> mesh_inverse, mesh_forward=MyMesh(r=1, n=8, n_vertex=100)
../_images/mesh6.png
module1_mesh_cont.getBoundaryVertex(mesh, u)

Functions that calculate the values of a function on boundary and return a array with that.

Parameters
  • mesh (dolfin.cpp.mesh.Mesh) – Mesh where u is defined.

  • u (dolfin.cpp.mesh.Function) – Function that you want compute vertex values on the boundary.

Returns

array

Example

>>> u_boundary=getBoundaryVertex(mesh,u)
module1_mesh_cont.getBoundaryVertexTwoMesh(mesh_inverse, mesh_forward, u, u0)

Functions that calculate the values of two function on the boundary and select the vertex in commum, then return an array with it.

Parameters
  • mesh_inverse (dolfin.cpp.mesh.Mesh) – Coarsed mesh where Function u is defined.

  • mesh_forward (dolfin.cpp.mesh.Mesh) – Refined mesh where Function u0 is defined.

  • u (dolfin.cpp.mesh.Function) – Function that you want compute vertex values on the boundary.`

  • u0 (dolfin.cpp.mesh.Function) – Function that you want compute vertex values on the boundary.`

Returns

(array) u_boundary, u0_boundary, vertex_index.

Example
>>> u_boundary, u0_boundary, vertex_index=getBoundaryVertexTwoMesh(mesh_inverse, mesh_direct, u, u0)