Developer Tutorials

Session 0: C++ Essentials

Slides

Exercise solution

Errata:

  • Slide 8: “macro” should be “directive.” A directive is the command; a macro is a definition (e.g., a variable) stored by the preprocessor.

Session 1: Advanced C++

Slides

Exercise solution

Session 2: Kokkos

Slides

Exercise solution

Session 3: MPI

Slides

Exercise solution

Session 4: Hands-On PIC Exercise

You must be logged in to UIUC MediaSpace and a member of the LCPP channel to view this video.

Session 5: hPIC2 Class Hierarchy

You must be logged in to UIUC MediaSpace and a member of the LCPP channel to view this video. The session slides are an attachment to the video on MediaSpace.

Session 6: hPIC2 Code Example Walkthrough Pt. 1

You must be logged in to UIUC MediaSpace and a member of the LCPP channel to view this video.

Session 7: hPIC2 Code Example Walkthrough Pt. 2

You must be logged in to UIUC MediaSpace and a member of the LCPP channel to view this video.

Session 8: Finite Element Methods

You must be logged in to UIUC MediaSpace and a member of the LCPP channel to view this video. The session slides are an attachment to the video on MediaSpace.

Exercise solutions
  1. Given a test function \(\psi\), the weak form is

    \[- \int_\Omega \sigma \nabla u \cdot \nabla \psi \, \mathrm{d} \mathbf{x} + \int_{\partial \Omega} \psi \sigma \nabla u \cdot \hat{\mathbf{n}} \, \mathrm{d} S + k^2 \int_\Omega u \psi \, \mathrm{d} \mathbf{x} = \int_\Omega f \psi \, \mathrm{d} \mathbf{x}.\]
  2. From the weak form, it can be seen that natural boundary conditions have the form

    \[\sigma \nabla u \cdot \hat{\mathbf{n}} = g,\]

    for some known function \(g\). This differs from the isotropic Poisson’s equation in that we have an extra factor of \(\sigma\) in the boundary condition; i.e., the natural boundary conditions are not purely Neumann.

  3. With a bilinear form of

    \[a(u, v) = -\int_\Omega \sigma \nabla u \cdot \nabla v \, \mathrm{d} \mathbf{x} + k^2 \int_\Omega u v \, \mathrm{d} \mathbf{x},\]

    and a linear form of

    \[\langle l, u \rangle = \int_\Omega f u \, \mathrm{d} \mathbf{x} - \int_{\partial \Omega} g u \, \mathrm{d} S,\]

    where \(g\) corresponds to a natural boundary condition, the weak form can be written as

    \[a(u, \psi) = \langle l, \psi \rangle.\]

    Note that this bilinear form is actually only truly bilinear if \(\sigma\) is a constant matrix. Otherwise, it is called a nonlinear form.