Skip to content

[SIApp] Addting Tolerance to the sensor measurements - #14634

Open
Igarizza wants to merge 3 commits into
masterfrom
siapp/sensor_tolerance_in_damage_response
Open

[SIApp] Addting Tolerance to the sensor measurements#14634
Igarizza wants to merge 3 commits into
masterfrom
siapp/sensor_tolerance_in_damage_response

Conversation

@Igarizza

@Igarizza Igarizza commented Aug 3, 2026

Copy link
Copy Markdown
Member

name: ✨ Feature
about:


📝 Description

This pull request introduces enhancements to both the Optimization and System Identification Applications, focusing on improved sensor handling, error thresholding, and model part manipulation. The main changes include support for node coordinate offsets during model part import, configurable error thresholds for sensors, and improved Python bindings for sensor classes.

@Igarizza Igarizza self-assigned this Aug 3, 2026
These parameters were unused and added unnecessary complexity to model part import.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds configurable per-sensor absolute error tolerance (“error_threshold”) so small measurement residuals are treated as zero, with updated C++/Python sensor APIs and tests ensuring thresholding behavior.

Changes:

  • Add error_threshold to Sensor (C++ + pybind) and propagate it through DisplacementSensor/StrainSensor creation + default parameters.
  • Apply thresholding in MeasurementResidualResponseFunction::CalculateValue when writing SENSOR_ERROR.
  • Add Python unit tests covering below/above/between threshold scenarios for sensor errors.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
applications/SystemIdentificationApplication/tests/responses/test_damage_response.py Adds regression tests validating sensor-error thresholding behavior in response value and stored SENSOR_ERROR.
applications/SystemIdentificationApplication/python_scripts/sensor_io/sensor_model_part_controller.py Adds VTU output generation during model-part import (currently unconditional).
applications/SystemIdentificationApplication/custom_sensors/sensor.h Extends base Sensor API to include ErrorThreshold and exposes getter + member.
applications/SystemIdentificationApplication/custom_sensors/sensor.cpp Persists error_threshold in sensor parameters serialization + PrintData.
applications/SystemIdentificationApplication/custom_sensors/displacement_sensor.h/.cpp Propagates error_threshold through constructor/create/default parameters.
applications/SystemIdentificationApplication/custom_sensors/strain_sensor.h/.cpp Propagates error_threshold through constructor/create/default parameters.
applications/SystemIdentificationApplication/custom_responses/measurement_residual_response_function.cpp Thresholds raw sensor errors before storing/using SENSOR_ERROR.
applications/SystemIdentificationApplication/custom_python/add_custom_sensors_to_python.cpp Exposes GetErrorThreshold and adds optional ctor arg in bindings.
Suppressed comments (1)

applications/SystemIdentificationApplication/custom_sensors/displacement_sensor.cpp:1

  • This directly reads SensorParameters[\"error_threshold\"], which will throw if older input files omit the new key (backward compatibility). To make the new parameter truly optional, validate/assign defaults before accessing it (e.g., validate against GetDefaultParameters() inside Create, or defensively fall back when the key is missing). The same issue applies to StrainSensor::Create.
//    |  /           |

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread applications/SystemIdentificationApplication/custom_sensors/sensor.h Outdated
Centralize the error_threshold default as Sensor::DefaultErrorThreshold
instead of duplicating 1e-16 across constructors, sensor Create()
defaults, and the pybind11 binding. Gate the debug VTU dump in
SensorModelPartController.ImportModelPart() behind an explicit
"debug_output" parameter so imports stay side-effect free by default.
Add a test covering sensor creation with error_threshold omitted from
parameters, verifying the default is applied.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants