Example 10
This code solves a system corresponding to a discretization of the Laplace equation with zero boundary conditions on the unit square. The domain is split into a n x n grid of quadrilateral elements and each processors owns a horizontal strip of size m x n, where m = n/nprocs. We use bilinear finite element discretization, so there are nodes (vertices) that are shared between neighboring processors. The Finite Element Interface is used to assemble the matrix and solve the problem. Nine different solvers are available.
Example 13
This code solves the 2D Laplace equation using bilinear finite element discretization on a mesh with an "enhanced connectivity" point. Specifically, we solve -Delta u = 1 with zero boundary conditions on a star-shaped domain consisting of identical rhombic parts each meshed with a uniform n x n grid. Every part is assigned to a different processor and all parts meet at the origin, equally subdividing the 2*pi angle there. The case of six processors (parts) looks as follows:
+ / \ / \ / \ +--------+ 1 +---------+ \ \ / / \ 2 \ / 0 / \ \ / / +--------+---------+ / / \ \ / 3 / \ 5 \ / / \ \ +--------+ 4 +---------+ \ / \ / \ / +Note that in this problem we use nodal variables, which will be shared between the different parts, so the node at the origin, for example, will belong to all parts.
We recommend viewing the Struct examples before viewing this and the other SStruct examples. The primary role of this particular SStruct example is to demonstrate how to set up non-cell-centered problems, and specifically problems with an "enhanced connectivity" point.
Example 14
This is a version of Example 13, which uses the SStruct FEM input functions instead of stencils to describe a problem on a mesh with an "enhanced connectivity" point. This is the recommended way to set up a finite element problem in the SStruct interface.
Example 15
This code solves a 3D electromagnetic diffusion (definite curl-curl) problem using the lowest order Nedelec, or "edge" finite element discretization on a uniform hexahedral meshing of the unit cube. The right-side corresponds to a unit force and we use uniform zero Dirichlet boundary conditions. The overall problem reads: curl alpha curl E + beta E = 1, with E x n = 0 on the boundary, where alpha and beta are piecewise-constant material coefficients.
The linear system is split in parallel using the SStruct interface with a n x n x n grid on each processors. Note that, the number of processors should therefore be a perfect cube!
This code is mainly meant as an illustration of using the Auxiliary-space Maxwell Solver (AMS) through the SStruct interface. It uses two grids -- one for the nodal and one for the edge variables, and we show how to constructs the rectangular "discrete gradient" matrix that connects them. Finally, this is also an example of setting up a finite element discretization in the SStruct interface, and we recommend viewing Example 13 and Example 14 before viewing this example.
Example 16
This code solves the 2D Laplace equation using a high order Q3 finite element discretization. Specifically, we solve -Delta u = 1 with zero boundary conditions on a unit square domain meshed with a uniform grid. The mesh is distributed across an N x N process grid, with each processor containing an n x n sub-mesh of data, so the global mesh is nN x nN.