   # Listing of documented examples

Source code for these examples can be found in Sundance/examples. The doxygen pages linked here will show a short description of the main() function. To see a source browser page, follow the link "Go to the source code for this file."

#### Laplace's equation

This example shows many of the core features of Sundance in the context of a simple linear PDE: getting a Mesh, defining geometry regions via CellFilter objects, setting up a weak form and boundary conditions using Expr objects, forming a LinearProblem, getting the solution back as a DiscreteFunction (a subtype of Expr), and then postprocessing and output. This example is explained in detail in the document GettingStarted.pdf.

#### Infrastructure

These examples show the skeleton of "boilerplate" code that appears in most simulations you'll develop, as well as utilities for user input via command-line options and parameter lists. These examples are explained in detail in the document GettingStarted.pdf.

#### Nonlinear PDE

These examples solve Bratu's equation using several different methods. These examples are explained in detail in the document NonlinearExamples.pdf.

• Fixed-point iteration: FixedPointBratu1D.cpp
• Newton's method with linearization done by hand and a simple user-level Newton loop: HandLinearizedNewtonBratu1D.cpp
• Newton's method with the linearization automated, but the Newton loop still done at the user level: AutoLinearizedNewtonBratu1D.cpp
• Newton's method with the linearization automated and the solve done by a packaged Newton-Armijo algorithm (Playa or NOX): FullyAutomatedNewtonBratu1D.cpp. In most cases this is the most efficient and robust way to program a nonlinear PDE.
• An outer loop with continuation on the parameter : ContinuationBratu1D.cpp. A single nonlinear problem object is reused for every continuation step, similar to how a single linear problem was used through the sweep in ParameterSweep.cpp.