hippylib/hippylibx

Improve paraview output in examples

Closed this issue · 1 comments

Each example should save one and only one XDMFFile containing the following fields:

  • mtrue: The true parameter
  • utrue: The state evaluated by solveFwd at the true parameter
  • d: The noisy data
  • m: The estimated parameter (as stored in x[PARAMETER] after solving the inverse problem)
  • u: The estimated state (as stored in x[PARAMETER] after solving the inverse problem).

When using vector2Function to transform a dlx.la.Vector into a dlx.fem.Function use the keyword argument name= to specify the name of the function.

For example:

m_estimated_fun = hpx.vector2Function(x[hpx.PARAMETER], Vh[hpx.PARAMETER], name = "Estimated m")

When this variable is then saved in XDMFFile and you open it in Paraview, you will see "Estimated m" as the name of that function.

NOTE: Saving everything in the same XDMFFile is very useful if one for example wants to use Paraview to visualize the difference between mtrue and m

This has been done using VTXWriter.