fedoo.constraint.IPCSelfContact

class IPCSelfContact(mesh, dhat=0.001, dhat_is_relative=True, barrier_stiffness=None, friction_coefficient=0.0, eps_v=0.001, broad_phase='hash_grid', adaptive_barrier_stiffness=True, use_ccd=None, line_search_energy=None, use_ogc=False, space=None, name='IPC Self Contact')

Self-contact Assembly using the IPC method.

Convenience wrapper around IPCContact that automatically extracts the surface mesh from the volumetric mesh. Useful for problems where a single body may come into contact with itself (e.g. buckling, folding, compression of porous structures).

All barrier stiffness tuning is automatic (see IPCContact for details).

Parameters:
  • mesh (fedoo.Mesh) – Full volumetric mesh.

  • dhat (float, default=1e-3) – Barrier activation distance (relative to bounding box diagonal by default, see dhat_is_relative).

  • dhat_is_relative (bool, default=True) – If True, dhat is a fraction of the bounding box diagonal.

  • barrier_stiffness (float, optional) – Barrier stiffness \(\kappa\). None (default) for automatic computation and adaptive update — recommended.

  • friction_coefficient (float, default=0.0) – Coulomb friction coefficient \(\mu\).

  • eps_v (float, default=1e-3) – Friction smoothing velocity.

  • broad_phase (str, default="hash_grid") – Broad-phase collision detection method.

  • adaptive_barrier_stiffness (bool, default=True) – Adaptively update \(\kappa\) at each converged time increment.

  • use_ccd (bool, default=False) – Enable CCD line search for robustness. Mutually exclusive with use_ogc.

  • line_search_energy (bool or None, default=None) – Energy-based backtracking after CCD. None auto-enables when use_ccd=True (see IPCContact).

  • use_ogc (bool, default=False) – Enable OGC trust-region step filtering. Mutually exclusive with use_ccd. Only supported for shell / surface meshes; raises ValueError for solid meshes.

  • space (ModelingSpace, optional) – Modeling space.

  • name (str, default="IPC Self Contact") – Name of the contact assembly.

Examples

import fedoo as fd

fd.ModelingSpace("3D")
mesh = fd.Mesh.read("gyroid.vtk")
material = fd.constitutivelaw.ElasticIsotrop(1e5, 0.3)

contact = fd.constraint.IPCSelfContact(mesh, use_ccd=True)

wf = fd.weakform.StressEquilibrium(material, nlgeom="UL")
solid = fd.Assembly.create(wf, mesh)
assembly = fd.Assembly.sum(solid, contact)

pb = fd.problem.NonLinear(assembly)
res = pb.add_output("results", solid, ["Disp", "Stress"])
# ... add BCs and solve ...

See also

IPCContact

Base class with full parameter documentation.

__init__(mesh, dhat=0.001, dhat_is_relative=True, barrier_stiffness=None, friction_coefficient=0.0, eps_v=0.001, broad_phase='hash_grid', adaptive_barrier_stiffness=True, use_ccd=None, line_search_energy=None, use_ogc=False, space=None, name='IPC Self Contact')

Methods

IPCSelfContact.assemble_global_mat([compute])

Recompute barrier contributions from cached vertex positions.

IPCSelfContact.delete_global_mat()

Delete Global Matrix and Global Vector related to the assembly.

IPCSelfContact.get_all()

Return a dict with all the known Assembly (with a name).

IPCSelfContact.get_global_matrix()

Get the last computed global matrix.

IPCSelfContact.get_global_vector()

Get the last computed global vector.

IPCSelfContact.initialize(pb)

Initialize the IPC contact assembly.

IPCSelfContact.reset()

Reset the assembly.

IPCSelfContact.set_start(pb)

Begin a new time increment.

IPCSelfContact.to_start(pb)

Restart the current time increment after NR failure.

IPCSelfContact.update(pb[, compute])

Update the IPC assembly for the current Newton–Raphson iteration.

IPCSelfContact.name

Name of the assembly if defined.

IPCSelfContact.space

Modeling space associated to the assembly.

IPCSelfContact.current

Assembly associated to the mesh of the deformed geometry.

IPCSelfContact.associated_assembly_sum

AssemblySum object that contains the assembly.