Models
Boundary
fiber_matrix.models.boundary
BoundaryNode
Node info for the boundary of fibers or the rve.
Source code in fiber_matrix/models/boundary.py
243 244 245 246 247 248 249 250 251 252 253 254 255 | |
BoundaryType
Bases: Enum
Enumeration class for denoting a type of boundary.
Attributes:
| Name | Type | Description |
|---|---|---|
PERIODIC |
int
|
Fibers can exist across boundary pair to be periodic. |
FINITE |
int
|
Fibers cannot cross the boundary. |
SYMMETRIC |
int
|
Fibers are only allowed to lie exactly half way or not at all. |
Source code in fiber_matrix/models/boundary.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 | |
get_color()
Returns the color associated with the boundary type.
Returns:
| Type | Description |
|---|---|
Tuple[float, float, float, float]
|
RGBA color tuple. |
Source code in fiber_matrix/models/boundary.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
LinearBoundary
A boundary of the RVE that is defined by a line segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
List[ndarray]
|
List of 2 points defining the start and end of the boundary segment. |
required |
point_indices
|
List[int]
|
Indices of the points in the global boundary point list. |
required |
btype
|
BoundaryType
|
The type of the boundary (PERIODIC, FINITE, SYMMETRIC). |
required |
Source code in fiber_matrix/models/boundary.py
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 | |
check_collision(fiber_center, fiber_radius, eps=0.0)
Checks if a fiber collides with the boundary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fiber_center
|
ndarray
|
The center of the fiber. |
required |
fiber_radius
|
float
|
The radius of the fiber. |
required |
eps
|
float
|
A small epsilon buffer ratio. Default is 0.0. |
0.0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the distance from the fiber center to the boundary is less than the buffered radius. |
Source code in fiber_matrix/models/boundary.py
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 | |
get_distance_to_fiber(fiber_center)
Calculates the Euclidean distance from the fiber center to the boundary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fiber_center
|
ndarray
|
The center of the fiber. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Distance to the boundary. |
Source code in fiber_matrix/models/boundary.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
get_length()
Calculates the length of the boundary segment.
Returns:
| Type | Description |
|---|---|
float
|
The length of the boundary. |
Source code in fiber_matrix/models/boundary.py
62 63 64 65 66 67 68 69 70 | |
get_move_vector()
Get the vector that should be used to move a fiber if it intersects this boundary.
Returns:
| Type | Description |
|---|---|
ndarray
|
A normalized 2D vector pointing strictly inward from the boundary. |
Source code in fiber_matrix/models/boundary.py
105 106 107 108 109 110 111 112 113 114 115 116 117 | |
get_periodic_vector()
Gets the translation vector to the paired boundary.
Returns:
| Type | Description |
|---|---|
Optional[ndarray]
|
The translation vector if a pair exists, None otherwise. |
Source code in fiber_matrix/models/boundary.py
93 94 95 96 97 98 99 100 101 102 103 | |
get_point_relative_position(point)
Determines the position of a point relative to the boundary line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
ndarray
|
The 2D point to check. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Positive value if the point lies inside (to the left of the boundary vector), negative if outside. |
Source code in fiber_matrix/models/boundary.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
is_pair(other_boundary)
Checks if this boundary forms a periodic pair with another boundary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other_boundary
|
LinearBoundary
|
The other boundary to check against. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the boundaries are geometric pairs (same length, parallel, opposite direction), False otherwise. |
Source code in fiber_matrix/models/boundary.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
Fiber
fiber_matrix.models.fiber
Fiber
The basic fiber class representing a circular inclusion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center
|
ndarray
|
The coordinates of the fiber center. |
required |
radius
|
float
|
The radius of the fiber. |
required |
Source code in fiber_matrix/models/fiber.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 | |
adjust_for_bounds(boundaries, eps=0.05)
Checks to make sure this fiber does not violate any specified boundaries and will move it if necessary.
Source code in fiber_matrix/models/fiber.py
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 | |
fix_overlap_with_neighbors(boundaries, min_space_between_fibers)
Iteratively resolves overlaps with neighboring fibers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boundaries
|
List[LinearBoundary]
|
List of RVE boundaries for constraint checking. |
required |
min_space_between_fibers
|
float
|
Minimum allowed distance between fiber surfaces. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if any overlap was found and corrected, False otherwise. |
Source code in fiber_matrix/models/fiber.py
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 | |
get_vector_to_other(other_fiber)
Calculates the vector pointing from this fiber to another fiber.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other_fiber
|
Fiber
|
The target fiber. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Vector from self to other. |
Source code in fiber_matrix/models/fiber.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
move(move_vec)
Translates the fiber by the given vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
move_vec
|
ndarray
|
Translation vector. |
required |
Source code in fiber_matrix/models/fiber.py
45 46 47 48 49 50 51 52 53 | |
PeriodicPrimaryFiber
Bases: Fiber
A class for storing a fiber that is in the RVE domain.
Source code in fiber_matrix/models/fiber.py
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 | |