Skip to content

Implement the elastoplastic snow constitutive model - #171

Merged
utilForever merged 15 commits into
mainfrom
snow-constitutive-model
Aug 3, 2026
Merged

Implement the elastoplastic snow constitutive model#171
utilForever merged 15 commits into
mainfrom
snow-constitutive-model

Conversation

@utilForever

@utilForever utilForever commented Aug 3, 2026

Copy link
Copy Markdown
Owner

This revision includes:

Summary by CodeRabbit

  • New Features

    • Added snow material simulation for 2D and 3D scenarios.
    • Supports elastic and plastic deformation, including hardening, softening, and stress calculation.
    • Handles compression, stretching, rotation, and multi-axis deformation.
    • Validates material settings and deformation states to prevent invalid results.
  • Tests

    • Added comprehensive coverage for deformation behavior, stress responses, material changes, rotations, and invalid inputs.

@utilForever utilForever self-assigned this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

The pull request adds a 2-D and 3-D elastoplastic snow constitutive model. It tracks elastic and plastic deformation, projects singular values, computes hardened Kirchhoff stress, validates inputs, and adds unit tests.

Snow constitutive model

Layer / File(s) Summary
Model state and public API
Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp
Defines deformation state, material parameters, update and stress APIs, validation helpers, and 2-D/3-D aliases.
Constitutive update and stress computation
Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
Validates parameters and deformation gradients, clamps elastic singular values, derives plastic deformation, and computes hardened Kirchhoff stress.
Constitutive behavior validation
Tests/UnitTests/SnowConstitutiveModelTests.cpp
Tests elastic, plastic, rotational, hardening, softening, multi-axis, dimensional, and invalid-state behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SnowConstitutiveModel
  participant SVDUtilities
  participant SnowDeformationState
  SnowConstitutiveModel->>SnowDeformationState: Read elastic and plastic deformation
  SnowConstitutiveModel->>SVDUtilities: Decompose trial elastic deformation
  SVDUtilities-->>SnowConstitutiveModel: Return singular values and rotation
  SnowConstitutiveModel->>SnowDeformationState: Store projected elastic and plastic deformation
  SnowConstitutiveModel->>SVDUtilities: Decompose elastic deformation for stress
  SVDUtilities-->>SnowConstitutiveModel: Return elastic rotation
  SnowConstitutiveModel-->>SnowDeformationState: Return Kirchhoff stress
Loading

Possibly related issues

  • Issue 14: The change implements the snow-specific elastoplastic constitutive model required for Frozen-style MPM snow simulation.

Poem

A rabbit checks each snowy fold,
Singular values bend, not break.
Elastic leaves, plastic holds,
Stress grows firm with every quake.
Two dimensions, three in flight—
Tests keep every state just right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: implementing the elastoplastic snow constitutive model.
Linked Issues check ✅ Passed The implementation and tests address issue #161, including deformation tracking, projection, hardening, validation, and 2-D/3-D coverage.
Out of Scope Changes check ✅ Passed The changes remain within issue #161 and do not introduce unrelated functionality or a generic material-model hierarchy.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch snow-constitutive-model

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Aug 3, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 43 complexity · 0 duplication

Metric Results
Complexity 43
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (5)
Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp (2)

35-45: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Drop the redundant finiteness term.

Line 39 already rejects a non-finite criticalStretch. Therefore 1.0 + criticalStretch is always finite when line 40 runs. The term never changes the result.

♻️ Proposed cleanup
         !std::isfinite(criticalStretch) || criticalStretch < 0.0 ||
-        !std::isfinite(1.0 + criticalStretch) ||
         !std::isfinite(hardeningCoefficient) || hardeningCoefficient < 0.0 ||
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp` around lines 35 -
45, Remove the redundant std::isfinite(1.0 + criticalStretch) condition from the
parameter validation in the Snow constitutive model, keeping the existing
std::isfinite(criticalStretch) check and all other validation rules unchanged.

28-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Note the ordering of the Lamé computation and the parameter check.

The member initializer list divides by (1.0 - 2.0 * poissonRatio) before the body validates poissonRatio. For poissonRatio == 0.5 the division produces infinity, and the body then throws because !std::isfinite(m_lambda0). The behavior is correct under IEEE-754. The division still raises FE_DIVBYZERO and depends on non-finite arithmetic being preserved, so it breaks under -ffast-math.

If you prefer an explicit order, validate the raw parameters in a static helper and call it from the initializer list before the Lamé terms.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp` around lines 28 -
33, Validate the raw poissonRatio and other constructor parameters before
computing Lamé terms by introducing a static validation helper and invoking it
from the initializer list before m_mu0 and m_lambda0. Ensure invalid values such
as poissonRatio == 0.5 are rejected without performing the division, while
preserving the existing validation behavior for valid inputs.
Tests/UnitTests/SnowConstitutiveModelTests.cpp (2)

280-290: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add the 3-D counterpart for parameter validation.

Every other test in this file runs for both dimensions. This test exercises SnowConstitutiveModel2 only. The constructor validation lives in the class template, so a 3-D instantiation is a separate specialization that no test currently covers. Add the matching SnowConstitutiveModel3 assertions.

💚 Proposed addition
     EXPECT_THROW((SnowConstitutiveModel2{ 1.0, 0.2, 0.1, 0.1, -1.0 }),
                  std::invalid_argument);
+
+    EXPECT_THROW(SnowConstitutiveModel3{ 0.0 }, std::invalid_argument);
+    EXPECT_THROW((SnowConstitutiveModel3{ 1.0, 0.5 }), std::invalid_argument);
+    EXPECT_THROW((SnowConstitutiveModel3{ 1.0, 0.2, 1.0 }),
+                 std::invalid_argument);
+    EXPECT_THROW((SnowConstitutiveModel3{ 1.0, 0.2, 0.1, -0.1 }),
+                 std::invalid_argument);
+    EXPECT_THROW((SnowConstitutiveModel3{ 1.0, 0.2, 0.1, 0.1, -1.0 }),
+                 std::invalid_argument);
 }

As per coding guidelines: "Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/SnowConstitutiveModelTests.cpp` around lines 280 - 290,
Extend the InvalidParameters test to cover SnowConstitutiveModel3 with the same
invalid constructor argument cases currently asserted for
SnowConstitutiveModel2. Keep the existing 2-D assertions unchanged and ensure
both template specializations validate identical parameter constraints.

Source: Coding guidelines


205-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Guard the macro body and identify the failing dimension.

Two issues exist in this macro.

First, the body is two statements without a do { } while (0) wrapper. At the current call sites the macro is a standalone statement, so it compiles. If a later caller writes if (cond) EXPECT_FOR_2D_AND_3D(f);, only the 2-D call stays inside the branch.

Second, each scenario helper runs for both dimensions inside one TEST. When an EXPECT_* fails, the output does not state whether <2> or <3> failed. Add SCOPED_TRACE to report the dimension.

The name also starts with EXPECT_ but the macro asserts nothing by itself. Consider RUN_FOR_2D_AND_3D.

♻️ Proposed refactor
-#define EXPECT_FOR_2D_AND_3D(function) \
-    function<2>();                     \
-    function<3>()
+#define RUN_FOR_2D_AND_3D(function)   \
+    do                                \
+    {                                 \
+        {                             \
+            SCOPED_TRACE("N = 2");    \
+            function<2>();            \
+        }                             \
+        {                             \
+            SCOPED_TRACE("N = 3");    \
+            function<3>();            \
+        }                             \
+    } while (0)

Update each call site to use RUN_FOR_2D_AND_3D.

As per path instructions: "Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/SnowConstitutiveModelTests.cpp` around lines 205 - 207,
Rename EXPECT_FOR_2D_AND_3D to RUN_FOR_2D_AND_3D and update every call site;
wrap its two invocations in do-while(0) so it behaves as one statement, and add
dimension-specific SCOPED_TRACE messages before running the 2-D and 3-D helpers.

Source: Path instructions

Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp (1)

82-91: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Close the Doxygen block.

Every other documentation block in this file ends with a //! line. This block does not. Add the closing line for consistency.

📝 Proposed fix
     //! \return Fixed-corotated Kirchhoff stress.
+    //!
     [[nodiscard]] MatrixType ComputeKirchhoffStress(const State& state) const;

As per coding guidelines: "Keep public C++ declarations, Doxygen comments, and public contracts under Includes/Core/".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp` around lines 82 - 91,
Complete the Doxygen block immediately preceding ComputeKirchhoffStress by
adding the standard closing //! line, matching the documentation style used
throughout the file.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp`:
- Around line 35-45: Remove the redundant std::isfinite(1.0 + criticalStretch)
condition from the parameter validation in the Snow constitutive model, keeping
the existing std::isfinite(criticalStretch) check and all other validation rules
unchanged.
- Around line 28-33: Validate the raw poissonRatio and other constructor
parameters before computing Lamé terms by introducing a static validation helper
and invoking it from the initializer list before m_mu0 and m_lambda0. Ensure
invalid values such as poissonRatio == 0.5 are rejected without performing the
division, while preserving the existing validation behavior for valid inputs.

In `@Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp`:
- Around line 82-91: Complete the Doxygen block immediately preceding
ComputeKirchhoffStress by adding the standard closing //! line, matching the
documentation style used throughout the file.

In `@Tests/UnitTests/SnowConstitutiveModelTests.cpp`:
- Around line 280-290: Extend the InvalidParameters test to cover
SnowConstitutiveModel3 with the same invalid constructor argument cases
currently asserted for SnowConstitutiveModel2. Keep the existing 2-D assertions
unchanged and ensure both template specializations validate identical parameter
constraints.
- Around line 205-207: Rename EXPECT_FOR_2D_AND_3D to RUN_FOR_2D_AND_3D and
update every call site; wrap its two invocations in do-while(0) so it behaves as
one statement, and add dimension-specific SCOPED_TRACE messages before running
the 2-D and 3-D helpers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06542a49-3f64-4355-935c-7d5cbd43e10e

📥 Commits

Reviewing files that changed from the base of the PR and between 9845df6 and 7fc3ac5.

📒 Files selected for processing (3)
  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp
  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🌞 Static Analysis - SonarCloud (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{cpp,cu,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{cpp,cu,hpp,h}: Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions.
Put dimension-independent logic in shared templates and preserve Foo2/Foo3 and pointer aliases exposed by public types.
Add explicit template instantiations for both supported dimensions when extending a dimensional template.
Preserve C++17 portability across GCC, Clang, and MSVC on Linux, macOS, and Windows; avoid compiler extensions unless isolated behind existing CMake checks.
Treat warnings as errors and fix project warnings instead of globally suppressing them.
Use project includes, keep code in the CubbyFlow namespace, follow existing -Impl.hpp conventions for visible template definitions, and reuse nearby ownership aliases and builder APIs.
Use existing repository patterns and abstractions before adding new code, abstractions, or dependencies.
Use the existing parallel helpers and keep behavior correct across TBB, OpenMP, HPX, CPP11Thread, and Serial backends.
Format touched C++ and CUDA files with .clang-format; follow four-space indentation, an 80-column limit, sorted includes, and project brace style.

Files:

  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
Tests/UnitTests/**/*.{cpp,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures or new test frameworks.

Files:

  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not commit build output, test logs, caches, IDE state, or unrelated local changes.
Keep each commit focused on one logical change and use the conventional prefixes feat:, fix:, refactor:, test:, docs:, build:, ci:, or chore:.

Files:

  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
Includes/Core/**/*.{hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Keep public C++ declarations, Doxygen comments, and public contracts under Includes/Core/; place non-inline implementations in the matching Sources/Core/ domain.

Files:

  • Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp
  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
🔇 Additional comments (10)
Includes/Core/Particle/MPM/SnowConstitutiveModel.hpp (2)

1-90: LGTM!


92-113: LGTM!

Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp (4)

46-62: LGTM!


86-123: LGTM!


124-144: LGTM!


63-85: 🗄️ Data Integrity & Integration

No API issue found. The fixed-size SVD overload exists and normalizes negative singular values. MakeScaleMatrix, Transposed(), and Inverse() support the fixed-size matrix types.

			> Likely an incorrect or invalid review comment.
Tests/UnitTests/SnowConstitutiveModelTests.cpp (4)

1-105: LGTM!


106-203: LGTM!


209-278: LGTM!


1-8: 📐 Maintainability & Code Quality

The Tests/UnitTests/CMakeLists.txt glob includes all .cpp files in Tests/UnitTests, including SnowConstitutiveModelTests.cpp. No build-manifest change is required.

			> Likely an incorrect or invalid review comment.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.46%. Comparing base (9845df6) to head (459903e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   82.39%   82.46%   +0.06%     
==========================================
  Files         413      414       +1     
  Lines       23488    23570      +82     
==========================================
+ Hits        19354    19436      +82     
  Misses       4134     4134              
🚀 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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
Tests/UnitTests/SnowConstitutiveModelTests.cpp (1)

209-216: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add non-finite material-parameter cases.

This helper only tests finite boundary failures. It does not execute the constructor std::isfinite checks for any material parameter. Add NaN and infinity inputs so both dimensions verify the finite-parameter contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/SnowConstitutiveModelTests.cpp` around lines 209 - 216, Add
NaN and positive/negative infinity material-parameter cases to the existing
SnowConstitutiveModel<N> invalid-argument test helper, covering each constructor
parameter dimension and ensuring the constructor’s std::isfinite validation is
exercised while preserving the current finite boundary-failure cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Tests/UnitTests/SnowConstitutiveModelTests.cpp`:
- Around line 209-216: Add NaN and positive/negative infinity material-parameter
cases to the existing SnowConstitutiveModel<N> invalid-argument test helper,
covering each constructor parameter dimension and ensuring the constructor’s
std::isfinite validation is exercised while preserving the current finite
boundary-failure cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7216775-2563-4b5e-b864-f486e4bf4e4b

📥 Commits

Reviewing files that changed from the base of the PR and between 7fc3ac5 and 34d2379.

📒 Files selected for processing (2)
  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🌞 Static Analysis - SonarCloud (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
🧰 Additional context used
📓 Path-based instructions (4)
Includes/Core/**/*.{hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Keep public C++ declarations, Doxygen comments, and public contracts under Includes/Core/; place non-inline implementations in the matching Sources/Core/ domain.

Files:

  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
**/*.{cpp,cu,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{cpp,cu,hpp,h}: Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions.
Put dimension-independent logic in shared templates and preserve Foo2/Foo3 and pointer aliases exposed by public types.
Add explicit template instantiations for both supported dimensions when extending a dimensional template.
Preserve C++17 portability across GCC, Clang, and MSVC on Linux, macOS, and Windows; avoid compiler extensions unless isolated behind existing CMake checks.
Treat warnings as errors and fix project warnings instead of globally suppressing them.
Use project includes, keep code in the CubbyFlow namespace, follow existing -Impl.hpp conventions for visible template definitions, and reuse nearby ownership aliases and builder APIs.
Use existing repository patterns and abstractions before adding new code, abstractions, or dependencies.
Use the existing parallel helpers and keep behavior correct across TBB, OpenMP, HPX, CPP11Thread, and Serial backends.
Format touched C++ and CUDA files with .clang-format; follow four-space indentation, an 80-column limit, sorted includes, and project brace style.

Files:

  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not commit build output, test logs, caches, IDE state, or unrelated local changes.
Keep each commit focused on one logical change and use the conventional prefixes feat:, fix:, refactor:, test:, docs:, build:, ci:, or chore:.

Files:

  • Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp
  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
Tests/UnitTests/**/*.{cpp,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures or new test frameworks.

Files:

  • Tests/UnitTests/SnowConstitutiveModelTests.cpp
🔇 Additional comments (3)
Includes/Core/Particle/MPM/SnowConstitutiveModel-Impl.hpp (2)

17-17: LGTM!

Also applies to: 29-46


48-49: 🎯 Functional Correctness

Retain the C++20 ranges algorithms.

The project configures CXX_STANDARD 23, so std::ranges::all_of does not prevent the configured build from compiling.

			> Likely an incorrect or invalid review comment.
Tests/UnitTests/SnowConstitutiveModelTests.cpp (1)

29-30: LGTM!

Also applies to: 72-73, 219-245, 248-298, 319-339

@utilForever
utilForever force-pushed the snow-constitutive-model branch from f98991d to 459903e Compare August 3, 2026 12:24
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@utilForever
utilForever merged commit 6c4c101 into main Aug 3, 2026
21 checks passed
@utilForever
utilForever deleted the snow-constitutive-model branch August 3, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the elastoplastic snow constitutive model

1 participant