I wanted to ask a question about post-processing: After I am solving my problem in a very fine mesh, I plot the deformation of the meshes over the body (to do so, I am using Paraview and Warp by vector filter).
However, since my meshes are very fine and the deformation of their edges is not viewable on every part of the domain, I am thinking of creating a secondary coarse mesh. Then, I want to plot the results of the fine mesh on the domain, and, plot the secondary mesh edges and their deformation on the same domain.
I wanted to know if there is any way to do this (i.e, creating a secondary mesh, and plotting their edge over the main results)? Whether using Fenics or Paraview filters would solve my problem.
I have attached the Poisson equation demo as a minimal code.
Thanks in advance for all the help!
from dolfin import * mesh = UnitSquareMesh(32, 32) V = FunctionSpace(mesh, "Lagrange", 1) def boundary(x): return x < DOLFIN_EPS or x > 1.0 - DOLFIN_EPS u0 = Constant(0.0) bc = DirichletBC(V, u0, boundary) # Define variational problem u = TrialFunction(V) v = TestFunction(V) f = Expression("10*exp(-(pow(x - 0.5, 2) + pow(x - 0.5, 2)) / 0.02)", degree=2) g = Expression("sin(5*x)", degree=2) a = inner(grad(u), grad(v))*dx L = f*v*dx + g*v*ds # Compute solution u = Function(V) solve(a == L, u, bc) file = File("poisson.pvd") file << u