These html pages are based on the PhD thesis "Cluster-Based Parallelization of Simulations on Dynamically Adaptive Grids and Dynamic Resource Management" by Martin Schreiber.
There is also more information and a PDF version available.

2.4 Weak formulation

We restrict the support of our basis functions to the reference triangle and continue by formulating the continuity equation (1.5) in the weak form [Bra07]. Using the basis functions as a particular set of test functions, this yields

∫                    ∫                          ∫
   ˆUt(ξ,η,t)φj(ξ,η)+    ∇  ⋅F(ˆU (ξ,η,t))φj(ξ,η) =   S (Uˆ(ξ,η,t))φj(ξ,η).
 T                    T                          T
(2.7)

Applying the Gauss divergence theorem yields

  ∫
  ∫T ˆUt(ξ,η, t)φj(ξ,η)             Time derivative
- ∮T F(ˆU (ξ,η,t))⋅∇ φj(ξ,η)       Spatial derivative
+  dT F (ˆU(ξ,η,t))φj(ξ,η)⋅⃗n(ξ,η) Flux
= ∫  S(ˆU (ξ,η,t))φ (ξ,η)          Source
   T             j
(2.8)

with ⃗n(ξ,η) the normal on each edge. Expanding Û, this yields the Ritz-Galerkin formulation

  ∫  ∑  Ui(t)
  ∫T   i∑ dt φi(ξ,η)φj(ξ,η)             Time  derivative
- ∮T F (∑ iUi(t)φi(ξ,η))⋅∇ φj(ξ,η)      Spatial derivative
+ ∫dT F (∑ iUi(t)φi(ξ,η))⋅⃗n(ξ,η)φj (ξ,η)  Flux
=  T S(  iUi(t)φi(ξ,η ))φj(ξ,η)          Source.
(2.9)

The following sections continue with successive discretization of those terms, aiming at a matrix and vector representation of all terms, see [GW08].