Skip to content

.397395619494580:eb91f111a0a5c785d9d2026cd67e3333_69e6210c180bcf8a442e5ffe.69e623c7180bcf8a442e6003.69e623c6966af563bdeec98d:Trae CN.T(2026/4/20 21:01:59)#113

Open
yangou-hash wants to merge 1 commit intotaichi-dev:masterfrom
yangou-hash:ouyu_trae
Open

.397395619494580:eb91f111a0a5c785d9d2026cd67e3333_69e6210c180bcf8a442e5ffe.69e623c7180bcf8a442e6003.69e623c6966af563bdeec98d:Trae CN.T(2026/4/20 21:01:59)#113
yangou-hash wants to merge 1 commit intotaichi-dev:masterfrom
yangou-hash:ouyu_trae

Conversation

@yangou-hash
Copy link
Copy Markdown

@yangou-hash yangou-hash commented Apr 20, 2026

实现风场效果功能,允许在特定区域内施加风力。新增add_wind_field方法,通过指定区域边界和风力向量来创建风场效果,并在网格后处理阶段应用风力影响。


Note

Medium Risk
Adds a new grid postprocess kernel that modifies grid velocities inside a user-defined region, which can change simulation behavior and performance if bounds/forces are misconfigured.

Overview
Adds support for a region-bounded wind field in MPMSolver via add_wind_field(lower_bound, upper_bound, force), implemented as a Taichi kernel appended to grid_postprocess to apply an acceleration to grid_v within the specified bounds.

Updates the demo_3d.py example to enable the new wind field so reviewers can see the effect in a 3D scene.

Reviewed by Cursor Bugbot for commit e333388. Bugbot is set up for automated code reviews on this repo. Configure here.

实现风场效果功能,允许在特定区域内施加风力。新增add_wind_field方法,通过指定区域边界和风力向量来创建风场效果,并在网格后处理阶段应用风力影响。
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit e333388. Configure here.

Comment thread engine/mpm_solver.py
if inside:
grid_v[I] += dt * ti.Vector(force)

self.grid_postprocess.append(apply_wind)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wind postprocessor overrides bounding box boundary conditions

Medium Severity

The wind postprocessor is appended to grid_postprocess after the bounding box (which is always the first element, added in __init__). During each substep, the bounding box runs first and zeroes out boundary-violating velocities, but then apply_wind adds velocity back, potentially in the outward direction. Unlike existing colliders which only reduce or project velocity, wind adds velocity, so it can override the bounding box constraint and allow particles to escape the simulation domain.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e333388. Configure here.

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.

1 participant