Improve paraview output in examples
Closed this issue · 1 comments
uvilla commented
Each example should save one and only one XDMFFile
containing the following fields:
mtrue
: The true parameterutrue
: The state evaluated by solveFwd at the true parameterd
: The noisy datam
: 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
V-Rang commented
This has been done using VTXWriter.