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 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 |
|
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, mode=None)
¶
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
|
mode
|
str
|
Mode for deformation gradient generation. Options are 'uniaxial', 'shear', 'biaxial', or None. Default is None. |
None
|
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 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 |
|
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.
Attributes:
Name | Type | Description |
---|---|---|
None |
This class does not have any attributes. |
Methods:
Name | Description |
---|---|
jacobian |
Compute the Jacobian of the deformation gradient. |
invariant1 |
Calculate the first invariant of each tensor in the batch. |
invariant2 |
Calculate the second invariant of the deformation gradient tensor. |
invariant3 |
Calculate the third invariant of the deformation gradient tensor. |
right_cauchy_green |
Compute the right Cauchy-Green deformation tensor for a batch of deformation gradients. |
left_cauchy_green |
Compute the left Cauchy-Green deformation tensor for a batch of deformation gradients. |
rotation_tensor |
Compute the rotation tensors. |
pushforward |
Forward tensor configuration. |
principal_stretches |
Compute the principal stretches. |
principal_directions |
Compute the principal directions. |
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 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 |
|
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
40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
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
54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
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
68 69 70 71 72 73 74 75 76 77 78 79 |
|
jacobian(f)
staticmethod
¶
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
27 28 29 30 31 32 33 34 35 36 37 38 |
|
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
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
left_stretch_tensor(f)
¶
Compute the left stretch tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f
|
ndarray
|
The deformation gradient. |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The left stretch tensor. |
Source code in hyper_surrogate/kinematics.py
175 176 177 178 179 180 181 182 183 184 185 186 |
|
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
150 151 152 153 154 155 156 157 158 159 160 |
|
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
138 139 140 141 142 143 144 145 146 147 148 |
|
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
123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
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
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
right_stretch_tensor(f)
¶
Compute the right stretch tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f
|
ndarray
|
The deformation gradient. |
required |
Returns:
Type | Description |
---|---|
Any
|
np.ndarray: The right stretch tensor. |
Source code in hyper_surrogate/kinematics.py
162 163 164 165 166 167 168 169 170 171 172 173 |
|
rotation_tensor(f)
¶
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
188 189 190 191 192 193 194 195 196 197 198 |
|
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
Iterable[str]
|
Iterable[Any] - The material parameters as a list of strings |
required |
Properties
sef: The strain energy function in symbolic form
Methods:
Name | Description |
---|---|
pk2 |
Returns the second Piola-Kirchhoff stress tensor |
cmat |
Returns the material stiffness tensor |
Source code in hyper_surrogate/materials.py
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 |
|
cmat_symb
property
¶
Material stiffness tensor in symbolic form.
pk2_symb
property
¶
Second Piola-Kirchhoff stress tensor in symbolic form.
sef
property
¶
Strain energy function in symbolic form.
cauchy(f)
¶
Reduce Cauchy stress tensor to 6x1 matrix using Voigt notation.
Source code in hyper_surrogate/materials.py
80 81 82 |
|
cmat()
¶
Material stiffness tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
67 68 69 |
|
jr_symb(f)
¶
Jaumann rate contribution to the tangent tensor in symbolic form.
Source code in hyper_surrogate/materials.py
59 60 61 |
|
pk2()
¶
Second Piola-Kirchhoff stress tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
63 64 65 |
|
sigma(f)
¶
Cauchy stress tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
71 72 73 |
|
sigma_symb(f)
¶
Cauchy stress tensor in symbolic form.
Source code in hyper_surrogate/materials.py
51 52 53 |
|
smat(f)
¶
Material stiffness tensor generator of numerical form.
Source code in hyper_surrogate/materials.py
75 76 77 |
|
smat_symb(f)
¶
Material stiffness tensor in spatial form.
Source code in hyper_surrogate/materials.py
55 56 57 |
|
tangent(f, use_jaumann_rate=False)
¶
Reduce tangent tensor to 6x6 matrix using Voigt notation.
Source code in hyper_surrogate/materials.py
84 85 86 87 88 89 |
|
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
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
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
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
SymbolicHandler
¶
A class that handles symbolic computations for Continuum Mechanics Hyperelastic Frameworks using SymPy.
Attributes:
Name | Type | Description |
---|---|---|
c_tensor |
Matrix
|
A 3x3 matrix of symbols. |
Source code in hyper_surrogate/symbolic.py
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 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|
invariant1
property
¶
Compute the first invariant of the c_tensor.
Returns:
Name | Type | Description |
---|---|---|
Expr |
Expr
|
The first invariant of the c_tensor. |
invariant2
property
¶
Compute the second invariant of the c_tensor.
Returns:
Name | Type | Description |
---|---|---|
Expr |
Expr
|
The second invariant of the c_tensor. |
invariant3
property
¶
Compute the third invariant of the c_tensor.
Returns:
Name | Type | Description |
---|---|---|
Expr |
Expr
|
The third invariant of the c_tensor. |
c_symbols()
¶
Return the c_tensor flattened symbols.
Returns:
Name | Type | Description |
---|---|---|
list |
List[Symbol]
|
A list of c_tensor symbols. |
Source code in hyper_surrogate/symbolic.py
48 49 50 51 52 53 54 55 |
|
cmat_tensor(pk2)
¶
Compute the cmat tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pk2
|
Matrix
|
The pk2 tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
ImmutableDenseNDimArray |
ImmutableDenseNDimArray
|
The stiffness tensor (3x3x3x3) with minor symmetry. |
Source code in hyper_surrogate/symbolic.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
evaluate_iterator(lambdified_tensor, numerical_c_tensors, *args, **kwargs)
¶
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. |
()
|
kwargs
|
dict
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
None
|
Generator[Any, None, None]: The evaluated tensor. |
Source code in hyper_surrogate/symbolic.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
f_symbols()
¶
Return the f_tensor flattened symbols.
Returns:
Name | Type | Description |
---|---|---|
list |
List[Symbol]
|
A list of f_tensor symbols. |
Source code in hyper_surrogate/symbolic.py
30 31 32 33 34 35 36 37 |
|
jr(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:
Name | Type | Description |
---|---|---|
ImmutableDenseNDimArray |
ImmutableDenseNDimArray
|
The Jaumann rate contribution (4th order tensor). |
Source code in hyper_surrogate/symbolic.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|
lambda_tensor(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
223 224 225 226 227 228 229 230 231 232 233 234 |
|
pk2_tensor(sef)
¶
Compute the pk2 tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sef
|
Expr
|
The strain energy function. |
required |
Returns:
Name | Type | Description |
---|---|---|
Matrix |
Matrix
|
The pk2 tensor. |
Source code in hyper_surrogate/symbolic.py
110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
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
323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
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:
Name | Type | Description |
---|---|---|
ImmutableDenseNDimArray |
ImmutableDenseNDimArray
|
The pushforwarded 4th order tensor. |
Source code in hyper_surrogate/symbolic.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
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 |
---|---|
Matrix
|
sp.Matrix: A 6x1 matrix. |
Source code in hyper_surrogate/symbolic.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
reduce_4th_order(tensor)
staticmethod
¶
Convert a 3x3x3x3 matrix to 6x6 matrix using Voigt notation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor
|
ImmutableDenseNDimArray
|
A 3x3x3x3 matrix. |
required |
Returns:
Name | Type | Description |
---|---|---|
Matrix |
Matrix
|
A 6x6 matrix. |
Source code in hyper_surrogate/symbolic.py
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 |
|
sigma_tensor(sef, f)
¶
Compute the sigma tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sef
|
Expr
|
The strain energy function. |
required |
f
|
Matrix
|
The deformation gradient tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
Matrix |
Matrix
|
The Cauchy stress tensor. |
Source code in hyper_surrogate/symbolic.py
145 146 147 148 149 150 151 152 153 154 155 156 |
|
smat_tensor(pk2, f)
¶
Compute the material stiffness tensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pk2
|
Matrix
|
The pk2 tensor. |
required |
f
|
Matrix
|
The deformation gradient tensor. |
required |
Returns:
Name | Type | Description |
---|---|---|
ImmutableDenseNDimArray |
ImmutableDenseNDimArray
|
The material stiffness tensor. |
Source code in hyper_surrogate/symbolic.py
158 159 160 161 162 163 164 165 166 167 168 169 |
|
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:
Name | Type | Description |
---|---|---|
Matrix |
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
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 |
|
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 |
---|---|
None
|
Generator[Matrix, None, None]: 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
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|