Skip to content

[MPM] Output process for tracking material point element/condition#14226

Open
ncrescenzio wants to merge 39 commits into
masterfrom
mpm/track-material-point-output-process
Open

[MPM] Output process for tracking material point element/condition#14226
ncrescenzio wants to merge 39 commits into
masterfrom
mpm/track-material-point-output-process

Conversation

@ncrescenzio
Copy link
Copy Markdown
Contributor

@ncrescenzio ncrescenzio commented Feb 20, 2026

📝 Description

This PR introduces two new output processes (MPMPointOuputProcess and MPMMultiplePointsOutputProcess)) which enable writing data stored in material point (element/condition) variables to file. This feature thus allows users to monitor the evolution of specific material points during the simulation.

The user provides:

  • The coordinates of one or multiple target points
  • A search tolerance
  • The desired output time interval
  • The material point variables to be printed

For each specified point, the process:

  • Uses the new C++ utility BruteForceMaterialPointLocator to search for the material point closest to the given coordinates.
  • Ensures the located material point lies within the user-defined tolerance.
  • Writes the selected material point variable values to file at the requested time intervals.

🆕 Changelog

  • New c++ utility BruteForceMaterialPointLocator for finding the material point element/condition closest to a given point by a specified tolerance value.
    • c++ unit test for the new utilitty in test_material_point_locator.cpp
    • python unit test for the new utility in test_material_point_locator.py
    • benchmark (based on google benchmarks) added in Kratos/applications/MPMApplication/benchmarks/brute_force_material_point_locator_benchmark.cpp
  • Python output processes:
    • MPMPointOuputProcess: output process for writing data from a material point to a file.
    • MPMMultiplePointsOutputProcess: output process for writing data from several material points to different files.
    • python test in test_mpm_point_output_process.py
  • Documentation for the python processes added in Kratos/docs/pages/Applications/MPM_Application/Output_Processes

…process' into mpm/track-material-point-output-process
@ncrescenzio ncrescenzio marked this pull request as ready for review February 23, 2026 08:53
@ncrescenzio ncrescenzio requested a review from a team as a code owner February 23, 2026 08:53
Copy link
Copy Markdown
Collaborator

@andimkatili andimkatili left a comment

Choose a reason for hiding this comment

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

Thanks for your work Nicolo!

I just have two minor comments (I think..)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi Nicolo. As always, thanks for your work!

I tried to use it and have one comment on the behavior. Currently, if an MP that is under the search tolerance is not found, it will print a warning and continue the simulation as normal. Personally, I would rather to have the process throw an error and stop the simulation, with the same reason why we decide to stop the simulation when the user provided unsuitable number of MP for the generation.

Running an entire simulation and realizing that the MP output is not printed wouldn't be a nice surprise after waiting for it to complete.

I'm not so knowledgeable about the parallelization (especially the MPMMinDistanceReduction), so I can't comment anything about it

Other than that, it looks good!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment thread applications/MPMApplication/custom_python/add_custom_utilities_to_python.cpp Outdated
…_to_python.cpp


apply andi's suggestion

Co-authored-by: Andi Makarim Katili <68382448+andimkatili@users.noreply.github.com>
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.

2 participants