pihnn.graphics.plot_sol#
- pihnn.graphics.plot_sol(triangulation, model, model_true=None, format='png', dir='results/', figsize=None, split=False, **kwargs)#
Plot of the solution from the training of the network. This can be graphically compared with a reference solution (either numerical or analytical). The function behaves differently for each problem:
For the Laplace and biharmonic problems, it shows the PDE solutions.
For linear elasticity, it plots the stresses.
- Parameters:
triangulation (
matplotlib.tri.Triangulation
) – 2D mesh used for the contour plot.model (
pihnn.nn.PIHNN
/pihnn.nn.DD_PIHNN
) – Neural network model.model_true (callable / None) – Reference solution. It must be a scalar function for Laplace and biharmonic problems whereas it must return the 3 components of the stress tensor when solving the linear elasticity problem. Instead, leave it to None if no comparison is desired.
format (str) – Format of the save figure.
dir (str) – Directory where to save the figure.
figsize (tuple of float) – Size of the
matplotlib.pyplot.figure
. If None, no figure is created.split (bool) – Whether to split the solutions into multiple files or a single picture.