pyxfem.core.dynamic_solver module

Explicit and implicit time integration schemes for dynamics.

This module provides second-order ordinary differential equation (ODE) time integrators suited for dynamic finite element systems: - Velocity-Verlet (Störmer-Verlet) explicit integration. - Newmark-beta family of integrators using Richardson fixed-point

or Newton-Raphson nonlinear solvers.

class pyxfem.core.dynamic_solver.Newmark(getF, getM, getK, linsolve, gamma=0.5, beta=0.25, solver='richardson', verbose=False)[source]

Bases: object

Newmark-beta family of implicit and explicit time integration schemes.

Solves second-order dynamic equilibrium systems:

M(u) * a = F(u)

Constructeur : :param getF: Function returning the force vector F(u) for displacement u. :type getF: callable :param getM: Function returning the mass matrix M(u) for displacement u. :type getM: callable :param getK: Function returning the tangent stiffness matrix K(u) for displacement u.

Required when solver=’newton’.

Parameters:
  • linsolve (callable or None) – Linear solver function (A, b) -> x. Required when solver=’newton’.

  • gamma (float, optional) – Newmark parameter governing numerical damping (default is 0.5, ensuring second-order accuracy without numerical dissipation).

  • beta (float, optional) – Newmark parameter governing acceleration interpolation (default is 0.25, corresponding to average acceleration / unconditional stability). If beta=0.0 and gamma=0.5, the scheme simplifies to explicit Verlet.

  • solver ({'richardson', 'newton'}, optional) – Nonlinear iteration strategy used for implicit steps (default is ‘richardson’).

  • verbose (bool, optional) – If True, prints iteration residuals during time stepping (default is False).

Raises:

ValueError – If solver=’newton’ and either getK or linsolve is None.

step_newton(t, u0, v0, a0, dt)[source]

Advance the solution by a single step using Newton-Raphson iterations.

Solves the nonlinear dynamic equilibrium equation for displacement u at time t + dt using the effective dynamic tangent matrix:

K_eff = M / (beta * dt^2) + K

Once converged, velocity and acceleration are updated via Newmark formulae.

Parameters:
  • t (float) – Current simulation time.

  • u0 (NDArray) – Current displacement vector at time t.

  • v0 (NDArray) – Current velocity vector at time t.

  • a0 (NDArray) – Current acceleration vector at time t.

  • dt (float) – Time step increment.

Returns:

  • t_next (float) – Updated simulation time (t + dt).

  • u (NDArray) – Displacement vector at time t + dt.

  • v (NDArray) – Velocity vector at time t + dt.

  • a (NDArray) – Acceleration vector at time t + dt.

step_richardson(t, u0, v0, a0, dt)[source]

Advance the solution by a single step using Richardson fixed-point iterations.

Solves the implicit Newmark-beta equations by iteratively updating acceleration, displacement, and velocity until successive acceleration increments satisfy convergence tolerances or itmax is reached.

Parameters:
  • t (float) – Current simulation time.

  • u0 (NDArray) – Current displacement vector at time t.

  • v0 (NDArray) – Current velocity vector at time t.

  • a0 (NDArray) – Current acceleration vector at time t.

  • dt (float) – Time step increment.

Returns:

  • t_next (float) – Updated simulation time (t + dt).

  • u (NDArray) – Displacement vector at time t + dt.

  • v (NDArray) – Velocity vector at time t + dt.

  • a (NDArray) – Acceleration vector at time t + dt.

class pyxfem.core.dynamic_solver.Verlet(acc, verbose=False)[source]

Bases: object

Velocity-Verlet (Störmer-Verlet) explicit time integration scheme.

Integrates equations of motion of the form:

a = acc(u, v)

Parameters:
  • acc (callable) – Function evaluating the acceleration vector a = acc(u, v) given displacement u and velocity v.

  • verbose (bool, optional) – If True, prints diagnostic information (default is False).

step(t, u, v, a, dt)[source]

Advance the solution by a single Velocity-Verlet time step.

Parameters:
  • t (float) – Current simulation time.

  • u (NDArray) – Current displacement vector at time t.

  • v (NDArray) – Current velocity vector at time t.

  • a (NDArray) – Current acceleration vector at time t.

  • dt (float) – Time step increment.

Returns:

  • t_next (float) – Updated time (t + dt).

  • u_next (NDArray) – Displacement vector at time t + dt.

  • v_next (NDArray) – Velocity vector at time t + dt.

  • a_next (NDArray) – Acceleration vector at time t + dt.