cd2d_inverse_domain
Loss Function Implementation for Convection-Diffusion 2D Inverse Problems.
This module implements the loss function for solving inverse problems in 2D convection-diffusion equations using neural networks. It focuses on computing residuals in the weak form of the PDE for parameter identification.
Key functions
- pde_loss_cd2d_inverse_domain: Computes domain-based PDE loss
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_inverse_domain(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, inverse_params_list)
Computes domain-based loss for 2D convection-diffusion inverse problem.
Implements the weak form residual calculation for parameter identification in 2D convection-diffusion equations. The loss includes diffusion, convection, and reaction terms.
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
|
Dictionary containing: - b_x: x-direction convection coefficient - b_y: y-direction convection coefficient - c: reaction coefficient |
required |
inverse_params_list
|
list
|
List containing: - diffusion coefficient neural network |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Cell-wise residuals averaged over test functions Shape: (n_cells,) |
Notes
The weak form includes: - Diffusion term: ∫ε∇u·∇v dΩ - Convection term: ∫(b·∇u)v dΩ - Reaction term: ∫cuv dΩ where ε is the diffusion coefficient to be identified.
Source code in scirex/core/sciml/fastvpinns/physics/cd2d_inverse_domain.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|