poisson2d
Implementation of Tensor-Based Loss Calculation for 2D Poisson Equation.
This module implements an efficient tensor-based approach for calculating variational residuals in 2D Poisson problems. The implementation leverages TensorFlow's tensor operations for fast computation of weak form terms.
Key functions
- pde_loss_poisson: 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_poisson(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)
Calculates residual for 2D Poisson equation.
Implements the FastVPINNs methodology for computing variational residuals in 2D Poisson equation (-∇·(ε∇u) = f) using 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
|
Dictionary containing: eps: Diffusion coefficient |
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Ω The implementation uses efficient tensor operations for computing the variational residual.