Finite element meshes are specified in the (node,elem) structure due to Long Chen. For the standard elements used in this package, we describe a geometric figure by a triangulation. The nodes are the vertices of the triangle and the elements are the triangles themselves. These are encoded as follows:
Row $i$ of node is an $(x,y)$ (or $(x,y,z)$) pair which specifies the coordinates of the $i$th node.
Row $j$ of elem are the indices of the nodes which make the triangle. Thus in 2D each row has three numbers.
For example, to know the $(x,y)$ locations of the vertices of triangle $j$, we would see that
node[elem[j,i],:] are the $(x,y)$ locations of the $i$th vertex for $i=1,2,3$.
For more information, please see Programming of Finite Element Methods by Long Chen.
Mesh Generation Functions
Finds elements which are on the boundary of the domain. If bdflag is given, then those indices are added as nodes for a dirichlet boundary condition (useful for creating cracks and other cutouts of domains).
bdnode = Vector of indices for bdnode. Using node[:,bdnode] returns boundary nodes.
bdedge = Vector of indices for boundary edges.
is_bdnode = Vector of booleans size N which donotes which are on the boundary
is_bdelem = Vector of booleans size NT which denotes which are on the boundary
Takes in the fem_mesh and creates an array bdflag which denotes the boundary types. 1 stands for dirichlet, 2 for neumann, 3 for robin.
Returns the grid in the iFEM form of the two arrays (node,elem)
Computes the (node,elem) square mesh for the square with the chosen
dx and boundary settings.
square=[0 1 0 1] #Unit Square dx=.25 notime_squaremesh(square,dx,"dirichlet")
(node,elem) x [0,T] parabolic square mesh for the square with the chosen
dx and boundary settings and with the constant time intervals
square=[0 1 0 1] #Unit Square dx=.25; dt=.25;T=2 parabolic_squaremesh(square,dx,dt,T,:dirichlet)
meshExample_bunny() : Returns a 3D SimpleMesh.
meshExample_flowpastcylindermesh() : Returns a 2D SimpleMesh.
meshExample_lakemesh() : Returns a 2D SimpleMesh.
meshExample_Lshapemesh() : Returns a 2D SimpleMesh.
meshExample_Lshapeunstructure() : Returns a 2D SimpleMesh.
meshExample_oilpump() : Returns a 3D SimpleMesh.
meshExample_wavymesh() : Returns a 2D SimpleMesh.
meshExample_wavyperturbmesh() : Returns a 3D SimpleMesh.
The plot functionality is provided by a Plots.jl recipe. What is plotted is a "trisurf" of the mesh. To plot a mesh, simply use:
All of the functionality (keyword arguments) provided by Plots.jl are able to be used in this command. Please see the Plots.jl documentation for more information.