pihnn.utils#

Utilities for building and training PIHNNs.

Functions#

ordinal_number(n)

Accessory function to get the ordinal number as a string from an int.

get_complex_input(input_value)

get_complex_function(func)

MSE(value[, true_value])

Mean squared error (MSE). Equivalent to torch.nn.MSELoss() except it takes into account empty inputs.

PIHNNloss(boundary, model, t)

Evaluation of the loss function as Mean squared error (MSE).

scalar_loss(boundary, model, t)

Called by pihnn.utils.PIHNNloss() if one aims to solve the Laplace or biharmonic problem.

km_loss(boundary, model, t)

Called by pihnn.utils.PIHNNloss() if one aims to solve the linear elasticity problem

rotate_stresses(vars, angle)

Stresses and displacements transformation for rotated systems of coordinates.

compute_J_integral(model, tip[, radius, ...])

Compute the J-integral.

yau_wang_method(model, tip[, radius, ...])

Implementation of the method from Yau et al. [1980] to evaluate the

train(boundary, model, n_epochs[, learn_rate, ...])

Performs the training of the neural network.

RAD_sampling(boundary, model[, fine_grid])

Employ the RAD adaptive sampling from Wu et al. [2023].

compute_Lp_error(triangulation, model, model_true[, p])

Compute and print to screen the approximated relative \(L^p\) error between a model and a reference solution. I.e.,