Skip to content

[Initial condition] Add functions to initialize velocity and accelerations#105

Draft
bodhinandach wants to merge 2 commits intomasterfrom
initial-vel-condition
Draft

[Initial condition] Add functions to initialize velocity and accelerations#105
bodhinandach wants to merge 2 commits intomasterfrom
initial-vel-condition

Conversation

@bodhinandach
Copy link
Member

@bodhinandach bodhinandach commented Jun 17, 2025

Describe the PR
This PR introduces a way to initialize the velocity and acceleration fields. To specify the inputs correctly, users need to specify the following in the .json file:

    "particles_velocities": {
      "type": "file",
      "location": "particle_velocities.txt"
    }

or

    "particles_accelerations": {
      "type": "file",
      "location": "particles_accelerations.txt"
    }

The .txt files should be located in the same working folder with input formats as follows for 3D:

0	0.000192735535593574	0.000192735535593574	0.000192735535593574
1	0.000191385852799918	0.000201731034032346	0.000201731034032346
2	0.000188889069065023	0.000210476391243882	0.000210476391243882
...
id      vx or ax                vy or ay                vz or az

For 2D, only three columns are necessary: id, vx/ax, vy/ay

Related Issues/PRs
N/A

Additional context
N/A

@bodhinandach bodhinandach self-assigned this Jun 17, 2025
@bodhinandach bodhinandach added the enhancement New feature or request label Jun 17, 2025
@bodhinandach bodhinandach requested a review from LDTalbot June 17, 2025 19:26
@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 18.39080% with 71 lines in your changes missing coverage. Please review.

Project coverage is 95.60%. Comparing base (d93ef19) to head (397cc8d).

Files with missing lines Patch % Lines
include/mesh/mesh.tcc 0.00% 26 Missing ⚠️
include/io/io_mesh_ascii.tcc 0.00% 23 Missing ⚠️
include/solvers/mpm_base.tcc 42.11% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
- Coverage   95.73%   95.60%   -0.13%     
==========================================
  Files         244      244              
  Lines       51323    51410      +87     
==========================================
+ Hits        49130    49146      +16     
- Misses       2193     2264      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LDTalbot
Copy link
Collaborator

LDTalbot commented Jun 18, 2025

We should discuss input format for MP properties:

Some of our MP input files have ID while others do not (see recently-added wiki page).

  • w/ ID: volumes, particles-cells
  • w/o ID: particles (positions), stresses
  • side note: mesh.txt also, of course, does not include node IDs in the first section with node positions.

Similarly input consistency notes:

  • Particle count headers (e.g. stresses has this, while cells & volumes do not)
  • JSON file input style (e.g. stresses is multiline, while cells & volumes are single)

The current PR has elements from different types (ID and no header like volumes and cells, but multiline input in JSON like stresses).

Copy link
Collaborator

@LDTalbot LDTalbot left a comment

Choose a reason for hiding this comment

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

#TODO

  • Tests
  • Particle sets option (if we keep 2-line JSON input format)

NOTES:

  • We can alter volumes to use "read_particles_scalar_properties" in this PR (removing "read_particles_volumes")
  • Should make separate PR for other proposed breaking changes re: particle input format consistency

@bodhinandach bodhinandach marked this pull request as draft June 23, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants