FENICS Examples
    
    
    
      
        - 
          
          annulus_flow,
          a FENICS script which
          simulates flow in an annulus, goverened by the time-dependent
          Navier Stokes equations.
        
- 
          
          burgers_steady_viscous,
          a FENICS script which
          solves the steady viscous Burgers equation in 1D.
        
- 
          
          burgers_time_viscous,
          a FENICS script which
          solves the time-dependent viscous Burgers equation in 1D.
        
- 
          
          bvp,
          FENICS scripts which
          solve two-point boundary value problems (BVP) in 1D.
        
- 
          
          convection_diffusion,
          a FENICS script which
          simulates a 1D convection diffusion problem.
        
- 
          
          convection_diffusion_stabilized,
          a FENICS script which
          simulates a 1D convection diffusion problem, using a stabilization scheme.
        
- 
          
          dg_advection_diffusion, 
          a FENICS script which
          uses the Discontinuous Galerking (DG) method to set up and solve
          an advection diffusion problem.
        
- 
          
          domain, 
          a FENICS script which
          creates a region starting with a circle,
          and then "subtracting" a rectangle and smaller circle.
        
- 
          
          dpg_bvp,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a boundary value problem over an interval,
          by Jay Gopalakrishnan.
        
- 
          
          dpg_laplace,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a Poisson problem over the unit square,
          by Jay Gopalakrishnan.
        
- 
          
          dpg_laplace_adapt,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a Poisson problem over the unit square, with adaptivity,
          by Jay Gopalakrishnan.
        
- 
          
          ell,
          a FENICS script which
          solves the Poisson equation on the L-shaped region.
        
- 
          
          expression_test,
          a FENICS script which
          demonstrates some properties of the objects created by the
          FEniCS Expression() function.
        
- 
          
          fenics_to_fem, 
          a FENICS script which
          illustrate how a mesh or scalar function computed by a FENICS program
          can be written to FEM files, which can then be used to create
          images, or as input to meshing programs or other analysis tools.
        
- 
          
          fenics_to_txyv, 
          a FENICS script which
          illustrates how a mesh or scalar function computed by a FENICS program
          can be written to a triangulation file ("t.txt"), a coordinate
          file ("xy.txt", and a value file ("v.txt").
        
- 
          
          fenics_to_txyz, 
          a FENICS script which
          illustrates how a mesh or scalar function computed by a FENICS program
          can be written to a triangulation file ("t.txt") and a coordinate
          and value file ("xyz.txt").
        
- 
          
          glacier, 
          a FENICS script which
          sets up the 2D steady Stokes equations
          to model the movement of a glacier, by William Mitchell.
          Sadly, this USED to work with a previous version of FENICS...
        
- 
          
          heat_explicit,
          a FENICS script which
          uses the finite element method to solve a version of the time dependent
          heat equation over a rectangular region with a circular hole.
          Time steps are handled using an explicit method.
        
- 
          
          heat_implicit,
          a FENICS script which
          uses the finite element method to solve a version of the time dependent
          heat equation over a rectangular region with a circular hole.
          Time steps are handled using an implicit solver.
        
- 
          
          heat_steady, 
          FENICS scripts which
          set up the 2D steady heat equation in a rectangle.
        
- 
          
          interpolant,
          a FENICS script which
          shows how to define a function in FENICS by supplying a mesh and
          the function values at the nodes of that mesh, so that FENICS
          works with the finite element interpolant of that data.
        
- 
          
          membrane, 
          a FENICS script which
          models the deflection of a circular elastic 
          membrane subject to a perpendicular pressure modeled as a Gaussian 
          function.
        
- 
          
          mesh_test,
          a FENICS script which
          demonstrates some properties of the objects created
          by the various FEniCS meshing functions.
        
- 
          
          meshes, 
          a FENICS script which
          generates and plots the simple built-in mesh
          types that FENICS provides.
        
- 
          
          mitchell, 
          FENICS scripts which
          illustrate the implementation of the Mitchell elliptic test problems
          using FENICS.  I only managed to complete a few of these.
        
- 
          
          neumann,
          a FENICS script which
          solves a boundary value problem in the unit square,
          for which homogeneous Neumann conditions are imposed,
          adapted from a program by Doug Arnold.
        
- 
          
          p_laplacian,
          a FENICS script which
          sets up and solves the nonlinear p-Laplacian PDE in the unit square.
        
- 
          
          poisson,
          a FENICS script which
          solves the Poisson equation on the unit square,
          adapted from the FENICS tutorial by Langtangen and Logg.
        
- 
          
          poisson_mixed,
          a FENICS script which
          solves the Poisson equation using a mixed formulation.
        
- 
          
          poisson_nonlinear,
          a FENICS script which
          uses the finite element method to solve a version of the nonlinear
          Poisson equation over the unit square.
        
- 
          
          poisson_source_symbolic,
          a FENICS script which
          shows how the symbolic package can be used to determine the 
          right hand side f(x,y) of a Poisson equation, given the desired exact
          solution u(x,y).
        
- 
          
          quadrilateral,
          a FENICS script which
          solves the Poisson equation on the unit square,
          using a quadrilateral mesh.
        
- 
          
          step1,
          a FENICS script which
          solves a Poisson equation with constant diffusivity kappa(x,y).
        
- 
          
          step2,
          a FENICS script which
          solves a Poisson equation with piecewise constant diffusivity kappa(x,y).
        
- 
          
          step3,
          a FENICS script which
          solves a Poisson equation with piecewise constant diffusivity kappa(x,y),
          and computes and plots |grad(u)|.
        
- 
          
          step4,
          a FENICS script which
          shows how to generate the right hand side of a Poisson problem,
          using the symbolic mathematics package and an exact solution formula.
        
- 
          
          step5,
          a FENICS script which
          solves a Poisson equation whose diffusivity kappa(x,y) is defined 
          as |grad(w)| for a given scalar field w(x,y).
        
- 
          
          step6,
          a FENICS script which
          solves the nonlinear p-Laplacian problem directly.
        
- 
          
          step7,
          a FENICS script which
          compares error norm and DPG error indicators for a Poisson problem.
        
- 
          
          step8,
          a FENICS script which
          uses DPG error indicators for adaptive mesh refinement.
        
- 
          
          step9,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a Poisson problem, and repeatedly refines the mesh, guided by
          DPG error indicators.  On each refinement step, the top fifty percent 
          of the cells are refined, as ordered by size of local error estimates.
          It then plots the decay of the estimated error as a function of the 
          number of mesh elements.
        
- 
          
          step10,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a Poisson problem, and repeatedly refines the mesh, guided by
          DPG error indicators.  On each refinement step, cells are ordered by 
          size of the local error estimates, and then enough "top" cells are 
          refined to represent the proportion THETA of the total error estimate.
          It then plots the decay of the estimated error as a function of the 
          number of mesh elements.
        
- 
          
          step11,
          a FENICS script which
          uses the Discontinuous Petrov Galerkin (DPG) method to solve
          a Poisson problem, and repeatedly refines the mesh, guided by
          DPG error indicators.  Two methods of adaptive refinement are 
          compared, one of which refines cells which represent a fixed percentage
          of the error (case 0), and one of which refines a fixed percentage 
          of the cells (case1).  The problem uses a discontinuous diffusivity 
          function kappa(x,y).
        
      You can go up one level to
      the main web page.
    
    
    
      Last revised on 24 January 2019.