Physical Simulation - cmu462/Scotty3D GitHub Wiki

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

For this part of the assignment, you may assume that the mesh is always a triangle mesh.

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

media/discrete_laplacian.jpg

There is an additional note for evaluating this cotangent here: Evaluating cotan

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: ![height=14px](https://raw.githubusercontent.com/wiki/cmu462/Scotty3Dmedia/task4_dev_eq_images/0090.png|height=16px]] Where we call [[media/task4_dev_eq_images/0091.png) 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.


You may find it easier to initially test this behavior on one of the simpler meshes from media/meshedit. The images below show a sample output on bean.dae at the 10th and 100th frame of animation, note that the damping factor of 0.01 causes the waves to dissipate.

media/wave_example_01.png media/simulation.gif