![]() |
PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
Functions | |
rotate (p, theta, axis) | |
get_ref_rect_points (center, Lx, Ly, add_center=False) | |
get_ref_triangle_points (center, radius, add_center=False) | |
get_ref_hex_points (center, radius, add_center=False) | |
get_ref_drum_points (center, radius, width, add_center=False) | |
does_intersect (p, particles, padding) | |
does_intersect_rect (p, particles, padding, rect, is_3d=False) | |
get_gmsh_entities () | |
gmsh_transform (m, offset_entity, offset_node, offset_element, tx, ty, tz) | |
gmsh_transform_general (m, offset_entity, offset_node, offset_element, angle, axis=[0, 0, 1]) | |
gmsh_translate (xc) | |
geom_util.does_intersect | ( | p, | |
particles, | |||
padding | |||
) |
Returns true if particle p intersects or is near enough to existing particles Parameters ---------- p : list Coordinates of center and radius of particle [x,y,z,r] particles : list List of center + radius of multiple particles. E.g. particles[0] is a list containing coordinates of center and radius. padding: float Minimum distance between circle boundaries such that if two circles Returns ------- bool True if particle intersects or is near enough to one of the particle in the list
Definition at line 225 of file geom_util.py.
geom_util.does_intersect_rect | ( | p, | |
particles, | |||
padding, | |||
rect, | |||
is_3d = False |
|||
) |
Returns true if particle p is sufficiently close or outside the rectangle (in 2d) or cuboid (in 3d) Parameters ---------- p : list Coordinates of center and radius of particle [x,y,z,r] particles : list List of center + radius of multiple particles. E.g. particles[0] is a list containing coordinates of center and radius. padding: float Minimum distance between circle boundaries such that if two circles rect: list Coordinates of left-bottom and right-top corner points of rectangle (2d) or cuboid (3d). E.g. [x1 y1, z1, x2, y2, z2] is_3d: bool True if we are dealing with cuboid Returns ------- bool True if particle intersects or is near enough to the rectangle
Definition at line 254 of file geom_util.py.
geom_util.get_gmsh_entities | ( | ) |
Definition at line 295 of file geom_util.py.
Referenced by gmsh_particles.annulus_circle_mesh_symmetric(), gmsh_particles.annulus_rectangle_mesh(), gmsh_particles.circle_mesh_symmetric(), gmsh_particles.cuboid_mesh_symmetric(), gmsh_particles.cylinder_mesh_symmetric(), gmsh_particles.drum2d_mesh_symmetric(), gmsh_particles.ellipse_mesh_symmetric(), gmsh_particles.ellipsoid_mesh_symmetric(), gmsh_particles.hexagon_mesh_symmetric(), gmsh_particles.open_rectangle_mesh(), gmsh_particles.polygon_mesh_symmetric(), gmsh_particles.rectangle_mesh_symmetric(), gmsh_particles.sphere_mesh_symmetric(), and gmsh_particles.triangle_mesh_symmetric().
geom_util.get_ref_drum_points | ( | center, | |
radius, | |||
width, | |||
add_center = False |
|||
) |
Returns size points on reference concave polygon (we refer to it as drum) Reference concave polygon: v3 v2 + -------------------------------- + \ / \ / + o + /v4 x v1 \ / \ + -------------------------------- + v5 v6 Radius: x-v2 Width: v1-v4 Axis vector: x-v1 Rotation axis: [0, 0, 1] Parameters ---------- center: list Coordinates of center of polygon radius : float Radius of polygon (distance between center x and vertex v2) width : float Width of neck, i.e. distance between vertex v2 and v4 add_center : bool True if we include the center to the returned list (first point in the returned list will be the center if the flag is true) Returns ------- list Coordinates of points
Definition at line 161 of file geom_util.py.
References rotate().
Referenced by gmsh_particles.drum2d_mesh_symmetric().
geom_util.get_ref_hex_points | ( | center, | |
radius, | |||
add_center = False |
|||
) |
Returns size points on reference hexagon Reference hexagon: v3 v2 + + + o + v4 x v1 + + v5 v6 Radius: x-v1 Axis vector: x-v1 Rotation axis: [0, 0, 1] Parameters ---------- center: list Coordinates of center of hexagon radius : float Radius of hexagon add_center : bool True if we include the center to the returned list (first point in the returned list will be the center if the flag is true) Returns ------- list Coordinates of points
Definition at line 115 of file geom_util.py.
References rotate().
geom_util.get_ref_rect_points | ( | center, | |
Lx, | |||
Ly, | |||
add_center = False |
|||
) |
Returns size points on reference rectangle Reference rectangle: +-------------------+ | | | | | | +-------------------+ Parameters ---------- center: list Coordinates of center of rectangle Lx : float Length of rectangle in x-direction Ly : float Length of rectangle in y-direction add_center : bool True if we include the center to the returned list (first point in the returned list will be the center if the flag is true) Returns ------- list Coordinates of points
Definition at line 32 of file geom_util.py.
geom_util.get_ref_triangle_points | ( | center, | |
radius, | |||
add_center = False |
|||
) |
Returns size points on reference triangle Reference triangle: + v2 | \ | \ | \ | o + v1 | / | / | / + v3 Radius: o-v1 Axis vector: o-v1 Rotation axis: [0, 0, 1] Parameters ---------- center: list Coordinates of center of triangle radius : float Radius of triangle add_center : bool True if we include the center to the returned list (first point in the returned list will be the center if the flag is true) Returns ------- list Coordinates of points
Definition at line 68 of file geom_util.py.
References rotate().
Referenced by gmsh_particles.triangle_mesh_symmetric().
geom_util.gmsh_transform | ( | m, | |
offset_entity, | |||
offset_node, | |||
offset_element, | |||
tx, | |||
ty, | |||
tz | |||
) |
Definition at line 307 of file geom_util.py.
Referenced by gmsh_particles.annulus_circle_mesh_symmetric(), gmsh_particles.annulus_rectangle_mesh(), gmsh_particles.circle_mesh_symmetric(), gmsh_particles.cuboid_mesh_symmetric(), gmsh_particles.cylinder_mesh_symmetric(), gmsh_particles.drum2d_mesh_symmetric(), gmsh_particles.ellipse_mesh_symmetric(), gmsh_particles.ellipsoid_mesh_symmetric(), gmsh_particles.open_rectangle_mesh(), gmsh_particles.rectangle_mesh_symmetric(), and gmsh_particles.sphere_mesh_symmetric().
geom_util.gmsh_transform_general | ( | m, | |
offset_entity, | |||
offset_node, | |||
offset_element, | |||
angle, | |||
axis = [0, 0, 1] |
|||
) |
Rotate mesh by angle (in radians) around specified axis Parameters: m - mesh data dictionary offset_entity - offset for entity numbers offset_node - offset for node numbers offset_element - offset for element numbers angle - rotation angle in radians axis - rotation axis vector (default is z-axis [0,0,1])
Definition at line 328 of file geom_util.py.
References rotate().
Referenced by gmsh_particles.hexagon_mesh_symmetric(), gmsh_particles.polygon_mesh_symmetric(), and gmsh_particles.triangle_mesh_symmetric().
geom_util.gmsh_translate | ( | xc | ) |
Translate mesh by vector xc Parameters: xc - translation vector [x, y, z]
Definition at line 361 of file geom_util.py.
Referenced by gmsh_particles.annulus_circle_mesh_symmetric(), gmsh_particles.annulus_rectangle_mesh(), gmsh_particles.circle_mesh_symmetric(), gmsh_particles.cuboid_mesh_symmetric(), gmsh_particles.cylinder_mesh_symmetric(), gmsh_particles.drum2d_mesh_symmetric(), gmsh_particles.ellipse_mesh_symmetric(), gmsh_particles.ellipsoid_mesh_symmetric(), gmsh_particles.hexagon_mesh_symmetric(), gmsh_particles.open_rectangle_mesh(), gmsh_particles.polygon_mesh_symmetric(), gmsh_particles.rectangle_mesh_symmetric(), gmsh_particles.sphere_mesh_symmetric(), and gmsh_particles.triangle_mesh_symmetric().
geom_util.rotate | ( | p, | |
theta, | |||
axis | |||
) |
Returns rotation of vector about specified axis by specified angle Parameters ---------- p: list Coordinates of vector theta : float Angle of rotation axis : list Axis of rotation Returns ------- list Coordinates of rotated vector
Definition at line 7 of file geom_util.py.
Referenced by get_ref_drum_points(), get_ref_hex_points(), get_ref_triangle_points(), and gmsh_transform_general().