Sundance solves PDEs on geometric domains that have been discretized to meshes. With a few simple exceptions,
Sundance does not create meshes itself; usually, one will mesh a domain using an external meshing program such as
Cubit or
Triangle and then read the results into
Sundance.
A mesh is represented in Sundance as a Mesh object. A Mesh is injected into a Sundance simulation by means of an object called a MeshSource. MeshSource is an abstract, extensible interface for mesh readers and mesh generators; several subtypes (listed below) have been implemented. Once created, an existing mesh can be transformed into another by means of a MeshTransformation object.
In the following example, we use a MeshSource to read an Exodus file and produce a Mesh
MeshSource reader = new ExodusNetCDFMeshReader("wing.ncdf");
Mesh mesh = reader.getMesh();
Currently, the following MeshReader subtypes exist
-
ExodusNetCDFMeshReader reads Exodus files rendered into NetCDF format. Note: not all Exodus features are supported. Currently, we support simplicial meshes only and node and side set definitions.
-
TriangleMeshReader reads meshes in Shewchuk's Triangle format, with extensions for distributed meshes.
The internal mesh generation capability of
Sundance is used primarily for generating test problems and is limited to lines and rectangles.
-
PartitionedLineMesher meshes lines in 1D problems.
-
PartitionedRectangleMesher meshes rectangular domains in 2D.
Both of these MeshSource subtypes produce structured, uniform meshes with a number of elements controlled by constructor arguments. Both can produce distributed meshes when
Sundance is run in parallel.
Simple 3D regions can be generated from these by extrusion.
-
ExtrusionMeshTransformation extrudes a 2D mesh into 3D
Sundance is a fully parallel code. To do a parallel run, however, one must have a distributed mesh. A distributed mesh can be created in one of two ways: by building it distributed from the start, or by partitioning an existing mesh.
As noted above, Sundance's mesh generation capability is limited to lines in 1D and rectangular domains in 2D; however, both the PartitionedLineMesher and PartitionedRectangleMesher are able to produce distributed meshes.
Sundance has no built-in capability for mesh partitioning. As a convenience, we supply several Python scripts for partitioning Triangle and Exodus files, and writing the results to a partitioned set of Triangle files. A distributed mesh created in this way can then be read in with a TriangleMeshReader.