pyLattice packages
pyLattice package
pyLattice.beam module
pyLattice.cell module
pyLattice.lattice module
pyLattice.plotting_lattice module
pyLattice.materials module
- class pyLattice.materials.MatProperties(name_material)[source]
Bases:
object
A class to represent the properties of a material loaded from a file.
- MATERIALS_DIR = PosixPath('/home/runner/work/pyLattice/pyLattice/src/pyLattice/materials')
- load_material()[source]
Loads material properties from a JSON file.
- Returns:
Material name_lattice, density, elastic properties, and plastic properties
- project_root = PosixPath('/home/runner/work/pyLattice/pyLattice')
pyLattice.point module
point.py
- class pyLattice.point.Point(x, y, z, cell_belongings, node_uncertainty_SD=0.0)[source]
Bases:
object
Represents a point in 3D space with additional attributes for simulation.
- add_cell_belonging(cell)[source]
Adding a cell to the list of cells this point belongs to.
- Return type:
None
- calculate_point_energy()[source]
Calculate the internal energy of the point.
- Returns:
Internal energy based on displacement and reaction forces.
- Return type:
float
- property coordinates: Tuple[float, float, float]
Retrieve the current position of the point.
- Returns:
(x, y, z) coordinates of the point.
- Return type:
Tuple[float, float, float]
- property data: List[float]
Retrieve point data for exporting.
- Returns:
[index, x, y, z] of the point.
- Return type:
List[float]
- property deformed_coordinates: Tuple[float, float, float]
Retrieve the deformed position of the point.
- Returns:
(x, y, z) coordinates including displacements.
- Return type:
Tuple[float, float, float]
- distance_to(other)[source]
Calculate the distance to another point.
- Parameters:
other (Point) – The other point.
- Returns:
The Euclidean distance to the other point.
- Return type:
float
- fix_DOF(DOF)[source]
Fix specific degrees of freedom for the point.
- Parameters:
DOF (List[int]) – List of DOF to fix (0: x, 1: y, 2: z, 3: Rx, 4: Ry, 5: Rz).
- Return type:
None
- is_identical_to(other, cell_size)[source]
Check if this point is identical to another point, modulo the cell size (periodicity).
- Parameters:
other (Point) – The other point to compare with.
cell_size (list[float]) – Size of the unit cell in x, y, z directions.
- Returns:
True if the points are identical modulo the cell size, False otherwise.
- Return type:
bool
- is_on_boundary(boundary_box_lattice)[source]
Get boolean that give information of boundary node
- Return type:
bool
Parameters:
- boundary_box_lattice: list[float]
Boundary box of the lattice containing [x_min, x_max, y_min, y_max, z_min, z_max].
Returns:
: boolean: (True if node on boundary)
- move_to(xNew, yNew, zNew)[source]
Move the point to new coordinates.
- Parameters:
xNew (float) – New X-coordinate.
yNew (float) – New Y-coordinate.
zNew (float) – New Z-coordinate.
- Return type:
None
- set_applied_force(appliedForce, DOF)[source]
Assign applied force to the point.
- Parameters:
appliedForce (List[float]) – Applied force values for each DOF.
DOF (list[int]) – List of DOF to assign (0: x, 1: y, 2: z, 3: Rx, 4: Ry, 5: Rz).
- Return type:
None
- set_local_tag(cell_index, local_tag)[source]
Set the local tag for a specific cell containing the point.
- Return type:
None
Parameters:
- cell_indexint
Index of the cell.
- local_tagint
Local tag to assign to the point for the specified cell.
- set_reaction_force(reactionForce)[source]
Assign reaction force to the point.
- Parameters:
reactionForce (List[float]) – Reaction force values for each DOF.
- Return type:
None
- tag_point(boundary_box_domain)[source]
Generate standardized tags for the point based on its position. Check : https://docs.fenicsproject.org/basix/v0.2.0/index.html for more informations
- Parameters:
boundary_box_domain (List[float]) – Boundary box domain containing [x_min, x_max, y_min, y_max, z_min, z_max].
- Returns:
tag of the point
- Return type:
int