Modules
DeformationGradient
¶
A class representing deformation gradient operations.
Source code in hyper_surrogate/deformation_gradient.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 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 |
|
biaxial(stretch1, stretch2)
staticmethod
¶
Calculate the deformation gradient tensor for biaxial deformation. latex equation:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stretch1 |
ndarray
|
A 1D array representing the first stretch factor. |
required |
stretch2 |
ndarray
|
A 1D array representing the second stretch factor. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The deformation gradient tensor as a 3D array. |
Source code in hyper_surrogate/deformation_gradient.py
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 |
|
rescale(F)
¶
Rescale the deformation gradient tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
ndarray
|
The deformation gradient tensor as a 3D array. |
required |
Returns:
Type | Description |
---|---|
Any
|
The rescaled deformation gradient tensor. |
Source code in hyper_surrogate/deformation_gradient.py
133 134 135 136 137 138 139 140 141 142 143 |
|
rotate(F, R)
staticmethod
¶
Rotate the deformation gradient tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
ndarray
|
The deformation gradient tensor as a 3D array. |
required |
R |
ndarray
|
The rotation matrix as a 3D array. |
required |
Returns:
Type | Description |
---|---|
Any
|
The rotated deformation gradient tensor. |
Source code in hyper_surrogate/deformation_gradient.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
rotation(axis, angle)
¶
Calculate the rotation matrix for multiple axes and angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
axis |
ndarray
|
A 1D array representing the axes of rotation (0 for x-axis, 1 for y-axis, 2 for z-axis). |
required |
angle |
ndarray
|
A 1D array representing the angles of rotation in radians. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The rotation matrix as a 3D array. |
Source code in hyper_surrogate/deformation_gradient.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
shear(shear)
staticmethod
¶
Calculate the deformation gradient tensor for shear deformation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shear |
ndarray
|
A 1D array representing the shear factor. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The deformation gradient tensor as a 3D array. |
Source code in hyper_surrogate/deformation_gradient.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
to_radians(degree)
staticmethod
¶
Convert degrees to radians.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree |
float
|
The angle in degrees. |
required |
Returns:
Type | Description |
---|---|
float
|
The angle in radians. |
Source code in hyper_surrogate/deformation_gradient.py
145 146 147 148 149 150 151 152 153 154 155 156 |
|
uniaxial(stretch)
staticmethod
¶
Calculate the deformation gradient tensor for uniaxial deformation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stretch |
ndarray
|
A 1D array representing the stretch factor. |
required |
Returns: The deformation gradient tensor as a 3D array.
Source code in hyper_surrogate/deformation_gradient.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
DeformationGradientGenerator
¶
Bases: DeformationGradient
Generates deformation gradients for hyper-surrogate modeling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seed |
int | None
|
Seed value for the random number generator. Default is None. |
None
|
size |
int | None
|
Size of the generator. Default is None. |
None
|
generator |
Generator | None
|
Random number generator. Default is None. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
seed |
int | None
|
Seed value for the random number generator. |
size |
int | None
|
Size of the generator. |
generator |
Generator
|
Random number generator. |
Methods:
Name | Description |
---|---|
axis |
int = 3) -> Any: Generates a random axis. |
angle |
float = 5) -> Any: Generates a random angle. |
generate_rotation |
int = 3, min_interval: float = 5) -> np.ndarray: Generates a random rotation matrix. |
generate |
float = 0.4, stretch_max: float = 3.0, shear_min: float = -1, shear_max: float = 1) -> Any: Generates a deformation gradient. |
Source code in hyper_surrogate/deformation_gradient.py
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 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
angle(min_interval=5)
¶
Generates a random angle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_interval |
float
|
Minimum interval for the angle. Default is 5. |
5
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
Randomly generated angle. |
Source code in hyper_surrogate/deformation_gradient.py
227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
axis(n_axis=3)
¶
Generates a random axis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_axis |
int
|
Number of axes to choose from. Default is 3. |
3
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
Randomly generated axis. |
Source code in hyper_surrogate/deformation_gradient.py
214 215 216 217 218 219 220 221 222 223 224 225 |
|
generate(stretch_min=0.4, stretch_max=3.0, shear_min=-1, shear_max=1)
¶
Generates a random deformation gradient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stretch_min |
float
|
Minimum value for stretch. Default is 0.4. |
0.4
|
stretch_max |
float
|
Maximum value for stretch. Default is 3.0. |
3.0
|
shear_min |
float
|
Minimum value for shear. Default is -1. |
-1
|
shear_max |
float
|
Maximum value for shear. Default is 1. |
1
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
Generated random deformation gradient. |
Source code in hyper_surrogate/deformation_gradient.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
generate_rotation(n_axis=3, min_interval=5)
¶
Generates a random rotation matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_axis |
int
|
Number of axes to choose from. Default is 3. |
3
|
min_interval |
float
|
Minimum interval for the angle. Default is 5. |
5
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Randomly generated rotation matrix. |
Source code in hyper_surrogate/deformation_gradient.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
Generator
¶
A class that provides various random number generation methods.
Source code in hyper_surrogate/generator.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 |
|
__init__(seed=None, size=None)
¶
Initialize the Generator object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seed |
int | None
|
The seed value for random number generation. If None, a random seed will be used. |
None
|
size |
int | None
|
The size of the generated random numbers. If None, a single random number will be generated. |
None
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in hyper_surrogate/generator.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
beta(a, b)
¶
Generate random numbers from a beta distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a |
float
|
The shape parameter (alpha) of the distribution. |
required |
b |
float
|
The shape parameter (beta) of the distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the beta distribution. |
Source code in hyper_surrogate/generator.py
92 93 94 95 96 97 98 99 100 101 102 103 |
|
float_in_interval(a=0, b=180, interval=5)
¶
Generate random numbers in the specified interval with a given interval.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a |
float
|
The lower bound of the interval. |
0
|
b |
float
|
The upper bound of the interval. |
180
|
interval |
float
|
The interval between the generated numbers. |
5
|
Returns:
Type | Description |
---|---|
ndarray[Any, Any]
|
np.ndarray: An array of random numbers in the specified interval. |
Source code in hyper_surrogate/generator.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
gamma(shape, scale)
¶
Generate random numbers from a gamma distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape |
float
|
The shape parameter (k) of the distribution. |
required |
scale |
float
|
The scale parameter (theta) of the distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the gamma distribution. |
Source code in hyper_surrogate/generator.py
105 106 107 108 109 110 111 112 113 114 115 116 |
|
integer_in_interval(low=0, high=3)
¶
Generate random integers in the specified interval.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
low |
int
|
The lower bound of the interval (inclusive). |
0
|
high |
int
|
The upper bound of the interval (exclusive). |
3
|
Returns:
Type | Description |
---|---|
ndarray[Any, Any]
|
np.ndarray: An array of random integers in the specified interval. |
Source code in hyper_surrogate/generator.py
37 38 39 40 41 42 43 44 45 46 47 48 |
|
lognormal(mean, sigma)
¶
Generate random numbers from a log-normal distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mean |
float
|
The mean of the underlying normal distribution. |
required |
sigma |
float
|
The standard deviation of the underlying normal distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the log-normal distribution. |
Source code in hyper_surrogate/generator.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|
normal(loc, scale)
¶
Generate random numbers from a normal distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loc |
float
|
The mean of the distribution. |
required |
scale |
float
|
The standard deviation of the distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the normal distribution. |
Source code in hyper_surrogate/generator.py
66 67 68 69 70 71 72 73 74 75 76 77 |
|
uniform(low, high)
¶
Generate random numbers from a uniform distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
low |
float
|
The lower bound of the distribution. |
required |
high |
float
|
The upper bound of the distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the uniform distribution. |
Source code in hyper_surrogate/generator.py
24 25 26 27 28 29 30 31 32 33 34 35 |
|
weibull(a)
¶
Generate random numbers from a Weibull distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a |
float
|
The shape parameter (k) of the distribution. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array of random numbers from the Weibull distribution. |
Source code in hyper_surrogate/generator.py
118 119 120 121 122 123 124 125 126 127 128 |
|
Kinematics
¶
A class that provides various kinematic methods.
Source code in hyper_surrogate/kinematics.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 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 |
|
__init__()
¶
Initialize the Kinematics object.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in hyper_surrogate/kinematics.py
9 10 11 12 13 14 15 16 |
|
invariant1(F)
staticmethod
¶
Calculate the first invariant of each tensor in the batch.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
ndarray
|
4D tensor of shape (N, 3, 3, 3). |
required |
Returns:
Type | Description |
---|---|
Any
|
The first invariant of each tensor in the batch. |
Source code in hyper_surrogate/kinematics.py
30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
invariant2(F)
staticmethod
¶
Calculate the second invariant of the deformation gradient tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
ndarray
|
4D tensor of shape (N, 3, 3, 3). |
required |
Returns:
Type | Description |
---|---|
Any
|
The second invariant. |
Source code in hyper_surrogate/kinematics.py
44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
invariant3(F)
staticmethod
¶
Calculate the third invariant of the deformation gradient tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
ndarray
|
The deformation gradient tensor as a 3D array. |
required |
Returns:
Type | Description |
---|---|
Any
|
The third invariant. |
Source code in hyper_surrogate/kinematics.py
58 59 60 61 62 63 64 65 66 67 68 69 |
|
jacobian(f)
¶
Compute the Jacobian of the deformation gradient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
4D tensor of shape (N, 3, 3, 3). |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The Jacobian of the deformation gradient. |
Source code in hyper_surrogate/kinematics.py
18 19 20 21 22 23 24 25 26 27 28 |
|
left_cauchy_green(f)
staticmethod
¶
Compute the left Cauchy-Green deformation tensor for a batch of deformation gradients using a more efficient vectorized approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
The deformation gradient tensor with shape (N, 3, 3), where N is the number of deformation gradients. |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The batch of left Cauchy-Green deformation tensors, shape (N, 3, 3). |
Source code in hyper_surrogate/kinematics.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
principal_directions(f)
¶
Compute the principal directions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
The deformation gradient. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The principal directions. |
Source code in hyper_surrogate/kinematics.py
153 154 155 156 157 158 159 160 161 162 163 |
|
principal_stretches(f)
¶
Compute the principal stretches.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
The deformation gradient. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The principal stretches. |
Source code in hyper_surrogate/kinematics.py
141 142 143 144 145 146 147 148 149 150 151 |
|
pushforward(f, tensor2D)
staticmethod
¶
Forward tensor configuration. Ftensor2DF^T. This is the forward transformation of a 2D tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
deformation gradient # (N, 3, 3) |
required |
tensor2D |
ndarray
|
The 2D tensor to be mapped # (N, 3, 3) |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The transformed tensor. |
Source code in hyper_surrogate/kinematics.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
right_cauchy_green(f)
staticmethod
¶
Compute the right Cauchy-Green deformation tensor for a batch of deformation gradients using a more efficient vectorized approach. \(\(C = F^T F\)\)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
The deformation gradient tensor with shape (N, 3, 3), where N is the number of deformation gradients. |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The batch of right Cauchy-Green deformation tensors, shape (N, 3, 3). |
Source code in hyper_surrogate/kinematics.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
rotation_tensor(f)
staticmethod
¶
Compute the rotation tensors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
ndarray
|
The deformation gradients. batched with shape (N, 3, 3). |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The rotation tensors. batched with shape (N, 3, 3). |
Source code in hyper_surrogate/kinematics.py
113 114 115 116 117 118 119 120 121 122 123 124 |
|
Material
¶
Bases: SymbolicHandler
Material class for defining the constitutive model of the material. The class is inherited from the SymbolicHandler class and provides the necessary methods to define the constitutive model in symbolic form.
args: parameters: Iterable[Any] - The material parameters as a list of strings
properties: sef: The strain energy function in symbolic form
methods: pk2() -> Any: Returns the second Piola-Kirchhoff stress tensor cmat() -> Any: Returns the material stiffness tensor
Source code in hyper_surrogate/materials.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
cmat_symb: Any
property
¶
Material stiffness tensor in symbolic form.
pk2_symb: Any
property
¶
Second Piola-Kirchhoff stress tensor in symbolic form.
sef: Any
property
¶
Strain energy function in symbolic form.
cmat()
¶
Material stiffness tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
64 65 66 |
|
pk2()
¶
Second Piola-Kirchhoff stress tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
60 61 62 |
|
sigma(f)
¶
Cauchy stress tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
68 69 70 |
|
sigma_symb(f)
¶
Cauchy stress tensor in symbolic form.
Source code in hyper_surrogate/materials.py
45 46 47 |
|
smat(f)
¶
Material stiffness tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
72 73 74 |
|
smat_symb(f)
¶
Material stiffness tensor in spatial form.
Source code in hyper_surrogate/materials.py
49 50 51 |
|
MooneyRivlin
¶
Bases: Material
Mooney-Rivlin material model for hyperelastic materials. The class inherits from the Material class and provides the necessary methods to define the Mooney-Rivlin model in symbolic form.
properties: sef: The strain energy function in symbolic form
Source code in hyper_surrogate/materials.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
NeoHooke
¶
Bases: Material
Neo-Hookean material model for hyperelastic materials. The class inherits from the Material class and provides the necessary methods to define the Neo-Hookean model in symbolic form.
properties: sef: The strain energy function in symbolic form
Source code in hyper_surrogate/materials.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
SymbolicHandler
¶
A class that handles symbolic computations using SymPy.
Attributes:
Name | Type | Description |
---|---|---|
c_tensor |
Matrix
|
A 3x3 matrix of symbols. |
Source code in hyper_surrogate/symbolic.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 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 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
invariant1: Any
property
¶
Compute the first invariant of the c_tensor.
Returns:
Type | Description |
---|---|
Any
|
sym.Expr: The first invariant of the c_tensor. |
invariant2: Any
property
¶
Compute the second invariant of the c_tensor.
Returns:
Type | Description |
---|---|
Any
|
sym.Expr: The second invariant of the c_tensor. |
invariant3: Any
property
¶
Compute the third invariant of the c_tensor.
Returns:
Type | Description |
---|---|
Any
|
sym.Expr: The third invariant of the c_tensor. |
c_symbols()
¶
Return the c_tensor flattened symbols.
Returns:
Name | Type | Description |
---|---|---|
list |
Any
|
A list of c_tensor symbols. |
Source code in hyper_surrogate/symbolic.py
18 19 20 21 22 23 24 25 |
|
cmat_tensor(pk2)
¶
Compute the cmat tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pk2 |
Matrix
|
The pk2 tensor. |
required |
Returns:
Type | Description |
---|---|
ImmutableDenseNDimArray
|
sym.MutableDenseNDimArray: The cmat tensor. |
Source code in hyper_surrogate/symbolic.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
evaluate_iterator(lambdified_tensor, numerical_c_tensors, *args)
¶
Evaluate a lambdified tensor with specific values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lambdified_tensor |
function
|
A lambdified tensor function. |
required |
args |
dict
|
Additional substitution lists of symbols. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The evaluated tensor. |
Source code in hyper_surrogate/symbolic.py
185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
jaumann_rate_mat(sigma)
staticmethod
¶
Compute the Jaumann rate contribution for the spatial elasticity tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sigma |
Matrix
|
The Cauchy stress tensor (2nd order tensor). |
required |
Returns:
Type | Description |
---|---|
MutableDenseNDimArray
|
sym.MutableDenseNDimArray: The Jaumann rate contribution (4th order tensor). |
Source code in hyper_surrogate/symbolic.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
lambdify(symbolic_tensor, *args)
¶
Create a lambdified function from a symbolic tensor that can be used for numerical evaluation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbolic_tensor |
Expr or Matrix
|
The symbolic tensor to be lambdified. |
required |
args |
dict
|
Additional substitution lists of symbols. |
()
|
Returns: function: A function that can be used to numerically evaluate the tensor with specific values.
Source code in hyper_surrogate/symbolic.py
159 160 161 162 163 164 165 166 167 168 169 170 |
|
pk2_tensor(sef)
¶
Compute the pk2 tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sef |
Expr
|
The strain energy function. |
required |
Returns:
Type | Description |
---|---|
Matrix
|
sym.Matrix: The pk2 tensor. |
Source code in hyper_surrogate/symbolic.py
80 81 82 83 84 85 86 87 88 89 90 |
|
pushforward_2nd_order(tensor2, f)
staticmethod
¶
Push forward a 2nd order tensor in material configuration.
args: tensor2: Any - The 2nd order tensor f: Any - The deformation gradient tensor
returns: Any - The pushforwarded 2nd order tensor
Source code in hyper_surrogate/symbolic.py
255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
pushforward_4th_order(tensor4, f)
staticmethod
¶
Push forward a 4th order tensor in material configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor4 |
MutableDenseNDimArray
|
The 4th order tensor. |
required |
f |
Matrix
|
The deformation gradient tensor (2nd order tensor). |
required |
Returns:
Type | Description |
---|---|
MutableDenseNDimArray
|
sym.MutableDenseNDimArray: The pushforwarded 4th order tensor. |
Source code in hyper_surrogate/symbolic.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
reduce_2nd_order(tensor)
staticmethod
¶
Convert a 3x3 matrix to 6x1 matrix using Voigt notation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
Matrix
|
A 3x3 symmetric matrix. |
required |
Returns:
Type | Description |
---|---|
Any
|
sp.Matrix: A 6x1 matrix. |
Source code in hyper_surrogate/symbolic.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
reduce_4th_order(tensor)
staticmethod
¶
Convert a 3x3x3x3 matrix to 6x6 matrix using Voigt notation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
MutableDenseNDimArray
|
A 3x3x3x3 matrix. |
required |
Returns:
Type | Description |
---|---|
Any
|
sym.Matrix: A 6x6 matrix. |
Source code in hyper_surrogate/symbolic.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
substitute(symbolic_tensor, numerical_c_tensor, *args)
¶
Automatically substitute numerical values from a given 3x3 numerical matrix into c_tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbolic_tensor |
Matrix
|
A symbolic tensor to substitute numerical values into. |
required |
numerical_c_tensor |
ndarray
|
A 3x3 numerical matrix to substitute into c_tensor. |
required |
args |
dict
|
Additional substitution dictionaries. |
()
|
Returns:
Type | Description |
---|---|
Any
|
sym.Matrix: The symbolic_tensor with numerical values substituted. |
Raises:
Type | Description |
---|---|
ValueError
|
If numerical_tensor is not a 3x3 matrix. |
Source code in hyper_surrogate/symbolic.py
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 |
|
substitute_iterator(symbolic_tensor, numerical_c_tensors, *args)
¶
Automatically substitute numerical values from a given 3x3 numerical matrix into c_tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbolic_tensor |
Matrix
|
A symbolic tensor to substitute numerical values into. |
required |
numerical_c_tensors |
ndarray
|
N 3x3 numerical matrices to substitute into c_tensor. |
required |
args |
dict
|
Additional substitution dictionaries. |
()
|
Returns:
Type | Description |
---|---|
Any
|
sym.Matrix: The symbolic_tensor with numerical values substituted. |
Raises:
Type | Description |
---|---|
ValueError
|
If numerical_tensor is not a 3x3 matrix. |
Source code in hyper_surrogate/symbolic.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|