VMTK, the Vascular Modeling Toolkit, can now export meshes directly to DOLFIN XML format, which shortens the step from medical imaging data to simulation considerably.
For more about VMTK, visit the VMTK web page: http://villacamozzi.marionegri.it/~luca/vmtk/ Thanks to Luca Antiga (author of VMTK) and Kent for implementing the new file format in VMTK! Since a few days, it is possible to attach "arbitrary" user-defined data to meshes, handled by the class MeshData. This in combination with a new optional <data> section in the mesh XML format enables VMTK to communicate boundary indicators to DOLFIN. (The possibility of dynamically attaching data to meshes may simplify the implementation of other things, like for example storing data for parallel communication without needing to modify the mesh class.) Segments of the boundary are labeled 0, 1, 2 etc so defining a boundary condition u = g on segment i is just a matter of writing bc = DirichletBC(g, mesh, i) No need to handle separate MeshFunctions. Here's the Python code for the newly added demo for illustration: # Create mesh and finite element mesh = Mesh("../../../../data/meshes/aneurysm.xml.gz") element = FiniteElement("Lagrange", "tetrahedron", 1) # Define variational problem v = TestFunction(element) u = TrialFunction(element) f = Function(element, mesh, 0.0) a = dot(grad(v), grad(u))*dx L = v*f*dx # Define boundary condition values u0 = Function(mesh, 0.0) u1 = Function(mesh, 1.0) u2 = Function(mesh, 2.0) u3 = Function(mesh, 3.0) # Define boundary conditions bc0 = DirichletBC(u0, mesh, 0) bc1 = DirichletBC(u1, mesh, 1) bc2 = DirichletBC(u2, mesh, 2) bc3 = DirichletBC(u3, mesh, 3) # Solve PDE and plot solution pde = LinearPDE(a, L, mesh, [bc0, bc1, bc2, bc3]) u = pde.solve() plot(u, interactive=True) -- Anders _______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
