Commit be8790e
feat(constraint): Improve SurfacePressureConstraint logic and fix bug (#340)
* improve SurfacePressureConstraint logic and fix bug
This commit addresses a bug in the `SurfacePressureConstraintResolution` where the force was incorrectly calculated due to a flawed `if/if/else` control flow. The logic has been corrected to a proper `if/else if/else` structure.
Additionally, the clamping logic in `VolumeGrowthConstraintResolution` has been refactored to use `std::min` and `std::max`, improving code clarity and conciseness.
* refactoring of volume computation
* Apply suggestions from code review (renaming)
---------
Co-authored-by: EulalieCoevoet <eulalie.coevoet@gmail.com>1 parent 1961779 commit be8790e
3 files changed
Lines changed: 17 additions & 30 deletions
File tree
- src/SoftRobots/component/constraint
- model
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
69 | 68 | | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | | - | |
73 | | - | |
| 71 | + | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
77 | | - | |
78 | | - | |
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
| |||
106 | 102 | | |
107 | 103 | | |
108 | 104 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 105 | + | |
| 106 | + | |
113 | 107 | | |
114 | 108 | | |
115 | 109 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
Lines changed: 9 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
| |||
272 | 278 | | |
273 | 279 | | |
274 | 280 | | |
275 | | - | |
276 | 281 | | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 290 | + | |
| 291 | + | |
300 | 292 | | |
301 | 293 | | |
302 | 294 | | |
| |||
0 commit comments