Function 3D
Module: basis_function_3d.py
This module provides the abstract base class for all 3D finite element basis functions. It defines the interface for computing basis functions and their derivatives in three-dimensional reference coordinates.
Classes:
Name | Description |
---|---|
BasisFunction3D |
Abstract base class for 3D finite element basis functions |
Dependencies
- abc: For abstract base class functionality
Key Features
- Abstract interface for 3D basis function evaluation
- Support for first and second order derivatives
- Reference coordinate system (xi, eta, zeta) implementation
- Unified interface for different polynomial bases
- Systematic derivative computation in three dimensions
Version Info
27/Dec/2024: Initial version: Thivin Anandh D
References
None
BasisFunction3D
An abstract base class defining the interface for three-dimensional finite element basis functions.
This class serves as a template for implementing various types of 3D basis functions used in finite element computations. It defines the required methods for function evaluation and derivatives in three dimensions.
Attributes:
Name | Type | Description |
---|---|---|
num_shape_functions |
int
|
The number of shape functions in the 3D element. Must be specified during initialization. |
Methods:
Name | Description |
---|---|
value |
Evaluates the basis function at given coordinates Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Value of basis function at (xi, eta, zeta) |
gradx |
Computes derivative w.r.t. xi Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Partial derivative w.r.t. xi |
grady |
Computes derivative w.r.t. eta Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Partial derivative w.r.t. eta |
gradxx |
Computes second derivative w.r.t. xi Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Second partial derivative w.r.t. xi |
gradxy |
Computes mixed derivative w.r.t. xi and eta Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Mixed partial derivative w.r.t. xi and eta |
gradyy |
Computes second derivative w.r.t. eta Args: xi (np.ndarray): First reference coordinate eta (np.ndarray): Second reference coordinate zeta (np.ndarray): Third reference coordinate Returns: float: Second partial derivative w.r.t. eta |
Notes
- All coordinate inputs (xi, eta, zeta) should be in the reference element range
- All methods are abstract and must be implemented by derived classes
- Implementation should ensure proper handling of 3D tensor-product bases
Source code in scirex/core/sciml/fe/basis_function_3d.py
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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
gradx(xi, eta, zeta)
abstractmethod
Computes the partial derivative of the basis function with respect to xi.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The partial derivative of the basis function with respect to xi. |
Source code in scirex/core/sciml/fe/basis_function_3d.py
gradxx(xi, eta, zeta)
abstractmethod
Computes the second partial derivative of the basis function with respect to xi.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The second partial derivative of the basis function with respect to xi. |
Source code in scirex/core/sciml/fe/basis_function_3d.py
gradxy(xi, eta, zeta)
abstractmethod
Computes the mixed partial derivative of the basis function with respect to xi and eta.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The mixed partial derivative of the basis function with respect to xi and eta. |
Source code in scirex/core/sciml/fe/basis_function_3d.py
grady(xi, eta, zeta)
abstractmethod
Computes the partial derivative of the basis function with respect to eta.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The partial derivative of the basis function with respect to eta. |
Source code in scirex/core/sciml/fe/basis_function_3d.py
gradyy(xi, eta, zeta)
abstractmethod
Computes the second partial derivative of the basis function with respect to eta.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The second partial derivative of the basis function with respect to eta. |
Source code in scirex/core/sciml/fe/basis_function_3d.py
value(xi, eta, zeta)
abstractmethod
Evaluates the basis function at the given xi and eta coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xi
|
ndarray
|
The xi coordinate. |
required |
eta
|
ndarray
|
The eta coordinate. |
required |
zeta
|
ndarray
|
The zeta coordinate. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: The value of the basis function at (xi, eta, zeta). |