morphogen.contact.surfaces

The surfaces that touch: faces of a tetrahedral mesh, pairs of them, rigid obstacles, and bodies meshed apart brought into one mesh.

class morphogen.contact.surfaces.Surface(faces: ndarray)[source]

Bases: object

Faces of a tetrahedral mesh that may touch others: rows of three nodes (4-node tetrahedra) or of six (10-node ones: the corners, then the middles of the edges 0-1, 1-2 and 2-0), their normals out of the body.

classmethod of(mesh: TetMesh, where=None, phases=None) → Surface[source]

The free faces of a mesh (those of one element only: its outside, the walls of its pores, the lips of its cracks): all of them, those of the elements of the phases given, those whose centroids (rows) where keeps.

property n_faces: int
property order: int

1 for faces of three nodes, 2 for faces of six.

subset(keep) → Surface[source]

The faces keep (mask or indices).

centroids(nodes: ndarray) → ndarray[source]

The centroids of the corners of the faces.

normals(nodes: ndarray) → ndarray[source]

The outward unit normals of the triangles of the corners.

points(nodes: ndarray, rule: str = 'gauss')[source]

The integration points of the faces: their faces, coordinates (ξ, η) and weights (their shares of the areas of the faces in the positions nodes: the area element of each on a curved face of six nodes), three per face of three nodes, six per face of six. rule: "gauss", points inside the faces, or "nodes": the vertices of the faces of three nodes; the vertices, the middles of the edges and the centroids of those of six (a corner or an edge of a body is then a contact point).

positions(nodes: ndarray, face, xi, eta) → ndarray[source]

The positions of points of the faces (rows) in the positions nodes.

areas(nodes: ndarray) → ndarray[source]

The areas of the faces in the positions nodes.

rims() → ndarray[source]

Which of the edges of each face (0-1, 1-2 and 2-0 of its corners; faces x 3) no other face of the surface shares: the rim of the surface, none on the closed surface of a body.

size(nodes: ndarray) → float[source]

The mean length of the edges of the triangles of the corners.

class morphogen.contact.surfaces.Pair(slave: Surface, master: Surface | None = None, friction: float = 0.0, stiffness: float | None = None, tangential: float | None = None, depth: float | None = None, symmetric: bool = False, points: str = 'gauss')[source]

Bases: object

Two surfaces that may touch: the integration points of the faces of slave are kept out of master (and those of master out of slave too with symmetric: two passes, for bodies of like stiffness and meshes). slave alone (master None): a surface that may touch itself, the walls of pores or the struts of a lattice (every face against the others, those that share a node with it left out).

friction: Coulomb’s coefficient. stiffness: the penalty, a pressure per unit of penetration (by default ten times the stiffest Young’s modulus over the size of the faces; the two passes of a symmetric pair, or the two sides of a surface that touches itself, share it); tangential: that of the stick (by default the penalty). depth: the deepest penetration looked for (by default half the size of the faces): a point deeper behind a face is taken to be across a wall, not through it. points: the slave points, "gauss" (inside the faces) or "nodes" (at their nodes: for a surface whose corners or edges meet the master first, which points inside its faces would let through; the weight of a point is then the share of its face that the master sees, the cosine of the angle of their normals, and a point of the rim of the slave still faces the master a twentieth of a face beyond its rim).

property own: bool

Whether the surface touches itself.

class morphogen.contact.surfaces.Obstacle(kind: int, surface: Surface, point: tuple, axis: tuple = (0.0, 0.0, 1.0), size: float = 0.0, inside: bool = False, friction: float = 0.0, stiffness: float | None = None, tangential: float | None = None, motion: object = None, name: str = '', points: str = 'gauss')[source]

Bases: object

A rigid obstacle that the integration points of the faces of surface stay out of, with Coulomb’s friction on it; stiffness and tangential: as for a Pair. motion: its translation, a vector grown with the load factor (load factor x motion) or a function of the load factor returning one; the force that the body exerts on it is a result of each step.

The kinds (plane(), sphere(), cylinder(), cone()): a plane (a point and its normal, out of the obstacle: a platen), a sphere (its centre and radius), a cylinder without ends (a point of its axis, its axis and radius), a cone (its apex, its axis from the apex into the cone and its half-angle, in degrees: an indenter). inside: the body is held within the sphere or the cylinder (a die). points: the points of the surface kept out of it, "gauss" or "nodes" (as for a Pair: a body that meets a platen by a corner or an edge).

translation(t: float) → ndarray[source]

The translation of the obstacle at the load factor t.

geometry(t: float = 0.0) → ndarray[source]

The array of the kernels: the point moved to the load factor t, the axis, the size and the sign of the side.

distance(points: ndarray, t: float = 0.0) → ndarray[source]

The signed distances of points (rows) to the obstacle at the load factor t (positive outside it).

morphogen.contact.surfaces.assemble(meshes, phases=None) → TetMesh[source]

Bodies meshed apart as one mesh, for their contact: the nodes and elements of the meshes one after the other (nothing is merged: nodes at the same place stay apart), in the box of them all; phases: a phase per mesh in place of their own (by default each mesh keeps its phases).