Create vtk file of ParaView from Mathematica [FEM post-processing]

I'm doing FEM in Mathematica and want to visualize the results in Paraview (e.g., create a video of the displacement field). Now I have the element mesh, the displacement and stress fields. How can I convert the data into VTK format as readable by Paraview?

The minimum code is as follows.

ClearAll["Global*"]

Needs["NDSolveFEM"]

op = {Inactive[
Div][({{0, (Y ν)/((1 - 2 ν) (1 + ν))}, {Y/(
2 (1 + ν)), 0}}.Inactive[Grad][v[x, y], {x, y}]), {x,
y}] + Inactive[
Div][({{(Y (1 - ν))/((1 - 2 ν) (1 + ν)), 0}, {0,
Y/(2 (1 + ν))}}.Inactive[Grad][u[x, y], {x, y}]), {x,
y}], Inactive[
Div][({{0, Y/(2 (1 + ν))}, {(
Y ν)/((1 - 2 ν) (1 + ν)), 0}}.Inactive[Grad][
u[x, y], {x, y}]), {x, y}] +
Inactive[
Div][({{Y/(2 (1 + ν)), 0}, {0, (
Y (1 - ν))/((1 - 2 ν) (1 + ν))}}.Inactive[Grad][
v[x, y], {x, y}]), {x, y}]} /. {Y -> 2.5, ν -> 1/4};

Subscript[Γ,
D] = {DirichletCondition[{u[x, y] == 0.}, x == 0],
DirichletCondition[{v[x, y] == 0.}, y == 0]};

b2 = 1;
(*b2=Piecewise[{{1.5x y,y<1},{1.5,y≥1}}];*)

{ufun, vfun} =
NDSolveValue[{op == {0, b2}, Subscript[Γ, D]}, {u,
v}, {x, 0, 1}, {y, 0, 2}];
(*∇·σ+Overscript[b, ⇀]=0, given \
Overscript[b, ⇀]={0,-1}, compare the result with that of \
"LE_Example_Single_Step.nb"*)

mesh = ufun["ElementMesh"];
deformedMesh = ElementMeshDeformation[mesh, {ufun, vfun}];
Show[{mesh["Wireframe"],
deformedMesh[
"Wireframe"[
"ElementMeshDirective" ->
Directive[EdgeForm[{Thin, Red}], FaceForm[]]]]}]

ContourPlot[ufun[x, y], {x, y} ∈ mesh,
AspectRatio -> Automatic, PlotRange -> All,
ColorFunction -> ColorData["LightTemperatureMap"], Contours -> 50,
ContourLines -> False, ImageSize -> 200, PlotLegends -> Automatic]
ContourPlot[vfun[x, y], {x, y} ∈ mesh,
AspectRatio -> Automatic, PlotRange -> All,
ColorFunction -> ColorData["LightTemperatureMap"], Contours -> 50,
ContourLines -> False, ImageSize -> 200, PlotLegends -> Automatic]

• What's the reason you do not want to use Mathematica for the visualization? It might be easier than to write an export for ElementMesh` and interpolating functions - though not undoable. Nov 14, 2017 at 1:10
• Did you manage to export the data to paraview? I would like to do the same. Dec 17, 2018 at 12:56
• @user21 does MMA 13 now support .vtk file of ParaView in FEM post-processing? Jan 4, 2022 at 0:34
• @ABCDEMMM, no there is no export of interpolating functions to vtk; however, in version 13 VectorDisplacementPlot was added. Also check out the Solid Mechanics tutorial that has many visualizations ideas. Jan 4, 2022 at 7:36
• @user21 thanks a lot for your support! is it also the case/option that we can (quickly) develop plasticity material models in MMA 13? Jan 4, 2022 at 21:29