Skip to content

Physical Simulation

Nick Sharp edited this page Nov 14, 2017 · 7 revisions

The next task is to implement an integrator for the (undamped) wave equation across a mesh:

We've discussed in class how to calculate the Discrete Laplacian operator, via the cotan-formula:

![Laplacian On a Triangle Mesh](http://15462.courses.cs.cmu.edu/fall2016content/article_images/26_.jpg)

For this task, you should update Vertex::Laplacian in halfedgeMesh.cpp and Mesh::forwardEuler and Mesh::symplecticEuler in dynamic_scene/mesh.cpp, storing your calculated u value in Vertex::offset and the calculated u' value in Vertex::velocity. Be careful about when you update these quantities. Note that since forward Euler is defined to solve a single, first-order differential equation, solving a second-order one will require you to break it up into 2 first order equations and solve each of them with forward Euler.

The next task is to change your intergrators to solve the damped wave equation across a mesh: Where we call the damping factor, which can take on any value between 0 and 1. You'll notice here that a damping factor of 0 is identical to the undamped case.

Once you've implemented these integrators, you can switch between them with F and S, change the timestep with - and =, and the damping factor with SHIFT/- and SHIFT/=. Be aware that Forward Euler is not numerically stable, so if your solutions blow up then it's the expected behavior.

Clone this wiki locally