Skip to content

Lifter¤

tatva.lifter.Lifter ¤

Lifter(size: int, /, *constraints: Constraint, **kwargs)

Create a lifter that maps between reduced and full vectors.

Parameters:

  • size ¤

    (int) –

    Total number of dofs in the full vector.

  • *constraints ¤

    (Constraint) –

    Extra constraints (e.g., periodic maps).

  • **kwargs ¤

    Ignored; kept for compatibility with equinox.Module init.

Examples::

lifter = Lifter(
    6,
    DirichletBC(jnp.array([0, 5])),
    PeriodicMap(dofs=jnp.array([2]), master_dofs=jnp.array([1])),
)
u_reduced = jnp.array([10.0, 20.0, 30.0])
u_full = lifter.lift_from_null(u_reduced)
# u_full -> [0., 10., 10., 20., 30., 0.]
u_reduced_back = lifter.reduce(u_full)

Methods:

  • add

    Return a new lifter with condition appended to constraints.

  • lift

    Lift reduced displacement vector to full size.

  • lift_from_zeros

    Lift reduced vector to a full vector starting from zeros.

  • reduce

    Extract the reduced vector by selecting free dofs from u_full.

Attributes:

constraints class-attribute ¤

constraints = ()

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

add ¤

add(condition: Constraint) -> Self

Return a new lifter with condition appended to constraints.

lift ¤

lift(u_reduced: Array, u_full: Array) -> Array

Lift reduced displacement vector to full size.

Parameters:

  • u_reduced ¤
    (Array) –

    Vector on free dofs (length size_reduced).

  • u_full ¤
    (Array) –

    Base full vector to modify; typically previous solution.

Returns:

  • Array

    Full vector with free dofs set to u_reduced and constraints

  • Array

    applied (Dirichlet, periodic, etc.).

lift_from_zeros ¤

lift_from_zeros(u_reduced: Array) -> Array

Lift reduced vector to a full vector starting from zeros.

reduce ¤

reduce(u_full: Array) -> Array

Extract the reduced vector by selecting free dofs from u_full.