morphogen.micromorphic.space

The mixed finite elements of micromorphic media and their Newton solver.

The displacement u is interpolated on the ten nodes of quadratic tetrahedra and the n_g generalized degrees of freedom (the components of the microdeformation, a scalar micromorphic variable…) on their four corners: one order lower, so that the relative deformation ∇u - χ can vanish (a penalty on it with equal orders locks). The degrees of freedom are numbered node by node (three components of u, then n_g on a corner); the sparse pattern of the matrix follows from the node graph of the mesh, and the element matrices, computed by chunks of elements in parallel, are added into it in place (one pass, no list of triplets: an element of the full micromorphic medium has 66 degrees of freedom, 4356 entries).

Elements are integrated at the four points of the degree-two rule of the tetrahedron (exact for the products of the gradients of quadratic functions and of linear functions), where the behaviours keep their internal variables.

The solver (MixedProblem.run()) grows prescribed degrees of freedom with a load factor; Newton’s method with a line search, the steps divided when it fails.

morphogen.micromorphic.space.POINTS = array([[0.5854102, 0.1381966, 0.1381966, 0.1381966],        [0.1381966, 0.5854102, 0.1381966, 0.1381966],        [0.1381966, 0.1381966, 0.5854102, 0.1381966],        [0.1381966, 0.1381966, 0.1381966, 0.5854102]])

Gauss points (barycentric coordinates) and weights of the elements

morphogen.micromorphic.space.WEIGHTS = array([0.25, 0.25, 0.25, 0.25])

Gauss points (barycentric coordinates) and weights of the elements

morphogen.micromorphic.space.CHUNK = 2048

8 x 66² bytes each)

Type:

Elements whose matrices are computed together (memory

class morphogen.micromorphic.space.MixedSpace(mesh: TetMesh, n_g: int)[source]

Bases: object

The degrees of freedom of a mesh (made quadratic if it is linear, with straight edges): three displacements per node, n_g generalized ones per corner node (see the module).

property n_local: int
dofs(nodes, components) → ndarray[source]

The degrees of freedom (nodes x components) of components (0-2: u, 3…: the generalized ones, on corner nodes only) of nodes.

new_matrix_data() → ndarray[source]
matrix(data) → csr_matrix[source]
add(first, ke, fe, data, rhs) → None[source]

Add the matrices ke and vectors fe of the elements first....

displacement(values) → ndarray[source]

The displacement (nodes x 3) of a vector of degrees of freedom.

generalized(values) → ndarray[source]

The generalized degrees of freedom at every node (nodes x n_g): those of the corners, interpolated linearly at the mid-edge nodes.

class morphogen.micromorphic.space.PathResult(loads: ndarray, reactions: list, iterations: ndarray, values: ndarray, state: ndarray, fields: list = <factory>, states: list = <factory>, time_s: float = 0.0)[source]

Bases: object

The steps of a problem: load factors, reactions (steps x prescribed sets x components of each set, summed over its nodes), Newton iterations, the final degrees of freedom and internal variables and, with fields, the degrees of freedom and the internal variables of the steps.

class morphogen.micromorphic.space.MixedProblem[source]

Bases: object

A boundary value problem on a MixedSpace; subclasses give _assemble(values, state, tangent) -> (residual, matrix data or None, new state) (the residual: the internal forces, no external ones) and _initial_state().

run(prescribed, load: float = 1.0, *, steps: int = 10, tol: float = 1e-06, max_newton: int = 25, max_cuts: int = 12, fields: bool = False, refactor: float = 0.0, ordering: str = 'COLAMD', duration: float = 1.0, predictor: bool = False) → PathResult[source]

Grow the prescribed degrees of freedom to load times their values in steps steps (divided when Newton’s method fails): entries (nodes, components, value), components 0-2 for the displacement and 3… for the generalized ones (corner nodes only), the value a number or an array of the nodes x components (0: held). The factors of the tangent (SuperLU, column ordering) are kept from an iteration to the next while each divides the residual by more than 1 / refactor (a modified Newton method for large problems, whose cost the factorization dominates; by default 0, Newton’s method: stale tangents may miss the bifurcation of a softening body). duration: the time of the whole load, for viscous behaviours (a step lasts its fraction of it: the attribute _dt of the problem during its iterations). predictor: the iterations of a step start from the free degrees of freedom that the last converged tangent predicts for the prescribed increment (K_ff Δu_f = -K_fd Δu_d), instead of the converged ones, which strain the elements along the loaded boundary alone: there they may yield, and the iterations of a plastic body stall on that first guess; when they fail, the same step from the converged ones (near a bifurcation, the tangent may predict another branch).