cd2d_inverse
Loss Function Implementation for Convection-Diffusion 2D Inverse Problems.
This module implements the loss function for solving inverse problems in 2D convection-diffusion equations with constant coefficients using neural networks. It focuses on computing residuals in the weak form of the PDE for parameter identification.
Key functions
- pde_loss_cd2d: Computes domain-based PDE loss for constant coefficients
Note
The implementation is based on the FastVPINNs methodology [1] for efficient computation of Variational residuals of PDEs.
References
[1] FastVPINNs: Tensor-Driven Acceleration of VPINNs for Complex Geometries DOI: https://arxiv.org/abs/2404.12063
pde_loss_cd2d(test_shape_val_mat, test_grad_x_mat, test_grad_y_mat, pred_nn, pred_grad_x_nn, pred_grad_y_nn, forcing_function, bilinear_params_dict, inverse_param_dict)
Calculates residual for convection-diffusion inverse problem with constant coefficients.
Implements the FastVPINNs methodology for computing variational residuals in 2D convection-diffusion inverse problems. Handles constant coefficient identification through efficient tensor operations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_shape_val_mat
|
Tensor
|
Test function values at quadrature points Shape: (n_elements, n_test_functions, n_quad_points) |
required |
test_grad_x_mat
|
Tensor
|
Test function x-derivatives at quadrature points Shape: (n_elements, n_test_functions, n_quad_points) |
required |
test_grad_y_mat
|
Tensor
|
Test function y-derivatives at quadrature points Shape: (n_elements, n_test_functions, n_quad_points) |
required |
pred_nn
|
Tensor
|
Neural network solution at quadrature points Shape: (n_elements, n_quad_points) |
required |
pred_grad_x_nn
|
Tensor
|
x-derivative of NN solution at quadrature points Shape: (n_elements, n_quad_points) |
required |
pred_grad_y_nn
|
Tensor
|
y-derivative of NN solution at quadrature points Shape: (n_elements, n_quad_points) |
required |
forcing_function
|
callable
|
Right-hand side forcing term |
required |
bilinear_params_dict
|
dict
|
Dictionary containing: b_x: x-direction convection coefficient b_y: y-direction convection coefficient c: reaction coefficient |
required |
inverse_param_dict
|
dict
|
Dictionary containing: eps: Diffusion coefficient to be identified |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Cell-wise residuals averaged over test functions Shape: (n_cells,) |
Note
The weak form includes: - Diffusion term: ∫ε∇u·∇v dΩ - Convection term: ∫(b·∇u)v dΩ - Reaction term: ∫cuv dΩ where ε is the constant diffusion coefficient to be identified.