Skip to content

Add pre-crack and per-particle Dirichlet for BB-PD#1881

Open
alhermann wants to merge 2 commits into4C-multiphysics:mainfrom
alhermann:feature/pd-precracks-fixedflag
Open

Add pre-crack and per-particle Dirichlet for BB-PD#1881
alhermann wants to merge 2 commits into4C-multiphysics:mainfrom
alhermann:feature/pd-precracks-fixedflag

Conversation

@alhermann
Copy link
Copy Markdown

@alhermann alhermann commented Mar 20, 2026

Description and Context

This PR adds two features to the bond-based peridynamics (BB-PD) module and
includes a minor bugfix in VTK restart path handling.

1. Pre-crack support (PRE_CRACKS)

  • New input parameter in PARTICLE DYNAMIC/PD section
  • Format: semicolon-separated 2D line segments "x1 y1 x2 y2 ; x3 y3 x4 y4"
  • At initialization, bonds whose connecting line crosses any pre-crack segment are excluded from the bond list
  • These bonds still count toward InitialConnectedBonds, so particles near pre-cracks have non-zero initial damage (pd_damage_phi > 0)
  • Enables modeling of pre-notched specimens (e.g., Kalthoff-Winkler experiment)

2. Per-particle fixed flag (PDFixedFlag / PDFIXED)

  • New optional keyword PDFIXED in particle definitions (e.g., "TYPE pdphase POS ... PDFIXED 1")
  • Particles with PDFIXED 1 are reset to their reference position with zero velocity/acceleration at every Velocity-Verlet sub-step
  • Enables zero-displacement Dirichlet conditions on individual PD particles without needing boundary phase particles

Updated (more general) version:

  • New optional keyword DIRICHLET_FUNCT in particle definitions (e.g., "TYPE pdphase POS ... DIRICHLET_FUNCT 1")
  • Particles with DIRICHLET_FUNCT 1 are subject to a Dirichlet boundary condition prescribed by FUNCT1
  • Enables to apply Dirichlet boundary conditions on subsets of particle phases (works for any particle phase)
  • Activated via this new "flagged" condition
PARTICLE DYNAMIC/INITIAL AND BOUNDARY CONDITIONS:
  DIRICHLET_BOUNDARY_CONDITION_FLAGGED: "pdphase"

3. VTK restart path fix (unrelated to PD, included for convenience)

  • 4C_io_vtk_writer_base.cpp: guards against empty paths in create_restarted_initial_collection_file_mid_section() — the original code passes p_restart.parent_path() and path_existing_working_directory_ directly to std::filesystem::absolute(), which throws when either is empty (e.g., restart file has no directory component). The fix substitutes "." as fallback.

Verification

  • New input-file test particle_sph_2d_pdbody_precrack_fixedflag.4C.yaml:
    • 100 particles, 2D, NP=2, runs in <1s
    • 14 result checks covering:
      • Fixed particle (PDFIXED 1): position unchanged, velocity zero (x and y)
      • Crack-adjacent particle: non-zero pd_damage_phi from pre-crack
      • Free particle: moved by gravity, zero damage

Related Issues and Pull Requests

None.


// pre-crack line segments: bonds crossing these lines are broken at init
// format: "x1 y1 x2 y2 ; x3 y3 x4 y4 ; ..." (semicolon-separated segments)
parameter<std::string>("PRE_CRACKS",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-cracks are defined for 2D problems in this version. I wonder if there is an alternative via some plane description to directly account for 3D problems which incorporate the 2D variant automatically?!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought here, if there is a general way ... probably one could define a plane similar than with the open boundaries?

alhermann and others added 2 commits March 26, 2026 14:24
…ynamics

Add two new features to the BB-PD module:

1. PRE_CRACKS input parameter (PARTICLE DYNAMIC/PD section):
   Semicolon-separated 2D line segments ("x1 y1 x2 y2 ; ...").
   Bonds crossing any segment are broken at initialization,
   producing non-zero initial damage near the crack.

2. PDFixedFlag (PDFIXED keyword in PARTICLES section):
   Per-particle zero-displacement Dirichlet condition.
   Particles with PDFIXED 1 are reset to their reference
   position with zero velocity at every time step.

Also fix a crash in VTK restart path resolution when
parent_path() or working directory is empty by guarding
with "." fallback before calling std::filesystem::absolute().

Tested with a minimal 2D input-file test
(particle_sph_2d_pdbody_precrack_fixedflag.4C.yaml, 14 checks).
@georghammerl georghammerl force-pushed the feature/pd-precracks-fixedflag branch from e999507 to 481de37 Compare March 26, 2026 13:29
@georghammerl georghammerl requested a review from ppraegla March 26, 2026 14:25
Copy link
Copy Markdown
Member

@ppraegla ppraegla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The per particle dirichlet conditions are nice 👍

Please open a separate PR for the changes to the restart.

Also I would have split the pre-cracking and introduction of the new dirichlet condition in separate PRs. But I'm fine with one PR as both address the particle code.

@georghammerl
Copy link
Copy Markdown
Member

The per particle dirichlet conditions are nice 👍

Please open a separate PR for the changes to the restart.

Also I would have split the pre-cracking and introduction of the new dirichlet condition in separate PRs. But I'm fine with one PR as both address the particle code.

Extracted the per particle dbs into #1895 for better reviewability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants