fastvpinns.FE.FE2D_Cell module

This module FE2D_Cell.py will be used to setup the FE2D and quadrature rule for a given cell based on the given mesh and the degree of the basis functions

Author: Thivin Anandh D

Date: 30/Aug/2023

Implementation History : The grad_x_orig and grad_y_orig will actually store the magnitute with which we need to multiply this grad_x_ref and grad_y_ref to obtain the actual values of the gradient in the original cell this is done to improve efficiency

class fastvpinns.FE.FE2D_Cell.FE2D_Cell(cell_coordinates: ndarray, cell_type: str, fe_order: int, fe_type: str, quad_order: int, quad_type: str, fe_transformation_type: str, forcing_function)[source]

Bases: object

This class is used to Store the FE Values, such as Coordinates, Basis Functions, Quadrature Rules, etc. for a given cell.

assign_basis_function() BasisFunction2D[source]

Assigns the basis function class based on the cell type and the FE order.

Returns:

An instance of the BasisFunction2D class.

assign_basis_values_at_quadrature_points() None[source]

Assigns the basis function values at the quadrature points.

This method calculates the values of the basis functions and their gradients at the quadrature points. The basis function values are stored in self.basis_at_quad, while the gradients are stored in self.basis_gradx_at_quad, self.basis_grady_at_quad, self.basis_gradxy_at_quad, self.basis_gradxx_at_quad, and self.basis_gradyy_at_quad.

The basis function values are of size N_basis_functions x N_quad_points.

Returns:

None

assign_fe_transformation() None[source]

Assigns the FE Transformation class based on the cell type and the FE order.

This method assigns the appropriate FE Transformation class based on the cell type and the FE order. It sets the cell coordinates for the FE Transformation and obtains the Jacobian of the transformation.

Returns:

None

assign_forcing_term(forcing_function) None[source]

Assigns the forcing function values at the quadrature points.

This function computes the values of the forcing function at the quadrature points and assigns them to the forcing_at_quad attribute of the FE2D_Cell object.

Parameters:

forcing_function (callable) – The forcing function that takes the coordinates (x, y) as input and returns the value of the forcing function at those coordinates.

Returns:

None

Notes

  • The final shape of forcing_at_quad will be N_shape_functions x 1.

  • This function is for backward compatibility with old code and currently assigns the values as zeros. The actual calculation is performed in the fespace class.

assign_quad_weights_and_jacobian() None[source]

Assigns the quadrature weights and the Jacobian of the transformation.

This method calculates and assigns the quadrature weights and the Jacobian of the transformation for the current cell. The quadrature weights are multiplied by the flattened Jacobian array and stored in the mult attribute of the class.

Returns:

None

assign_quadrature() None[source]

Assigns the quadrature points and weights based on the cell type and the quadrature order.

Returns:

None

assign_quadrature_coordinates() None[source]

Assigns the actual coordinates of the quadrature points.

This method calculates the actual coordinates of the quadrature points based on the given Xi and Eta values. The Xi and Eta values are obtained from the quad_xi and quad_eta attributes of the class. The calculated coordinates are stored in the quad_actual_coordinates attribute as a NumPy array.

Returns:

None