Skip to content

Commit

Permalink
Mesh/element
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKryslUCSD committed Nov 18, 2017
1 parent 3ebe499 commit 1837184
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
31 changes: 30 additions & 1 deletion docs/element.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Finite element

The finite element is the basic entity in FinEtools.
The finite element set is one of the basic entities in FinEtools.

The finite element set is a collection of finite elements defined by the connectivity (array of node numbers, listing the nodes connected by the element in a specific order). The finite element set provides specialized methods to compute values of basis functions and the values of the gradients of the basis functions with respect to the parametric coordinates.

The finite element sets are instances of concrete types. Each particular shape and order of element has its own type. There are types for linear and quadratic quadrilaterals, for instance, `FESetQ4` and `FESetQ8`. Each element set provides access to the number of nodes connected by the element (`nodesperelem`), the connectivity as the two dimensional array `conn`, and the integer label vector `label`.

The concrete finite element set types are subtypes of the abstract type for elements of different manifold dimension (3, 2, 1, and 0), for instance for the quadrilaterals that would be `FESet2Manifold`. These types are in turn subtypes of the abstract finite element set type `FESet`.

The concrete finite element set type provides specialized methods to compute the values of the basis functions, `bfun`, and methods to compute the gradients of the basis functions with respect to the parametric coordinates, `bfundpar`.

## Finite element set functions

- `manifdim`: Return the manifold dimension..
- `nodesperelem`: Get the number of nodes connected by the finite element.
- `count`: Get the number of individual connectivities in the FE set.
- `getconn!`: Get the connectivity of the jth element in the set.
- `boundaryconn`: Get boundary connectivity.
- `boundaryfe`: Return the constructor of the type of the boundary finite element.
- `setlabel!`: Set the label of the entire finite elements set.
- `subset`: Extract a subset of the finite elements from the given finite element set.
- `cat`: Concatenate the connectivities of two FE sets.
- `updateconn!`: Update the connectivity after the IDs of nodes changed.
- `bfun`: Compute the values of the basis functions at a given parametric coordinate.
- `bfundpar`: Compute the values of the basis function gradients at a given parametric coordinate.
- `Jacobian`: Evaluate the Jacobian.
- `gradN!`: Compute the gradient of the basis functions with the respect to the "reduced" spatial coordinates.
- `inparametric`: Are given parametric coordinates inside the element parametric domain?
- `map2parametric`: Map a spatial location to parametric coordinates.
- `centroidparametric`: Return the parametric coordinates of the centroid of the element.



4 changes: 2 additions & 2 deletions docs/mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As an example, the following code generates a hexahedral mesh of simple rectang
fens, fes = H8block(h, l, 2.0 * pi, nh, nl, nc)
```

The finite element node set and the finite element set are returned. This is typical: a mesh generation function would return these data structures. More complicated meshes can be constructed from such mesh parts. There are functions for merging nodes and even multiple meshes together.
The finite element node set and the finite element set are returned. More complicated meshes can be constructed from such mesh parts. There are functions for merging nodes and even multiple meshes together.

The code snippet below constructs the mesh of an L-shaped domain from the meshes of three rectangles.
```julia
Expand Down Expand Up @@ -49,8 +49,8 @@ candidates = selectnode(fens, box = boundingbox([Rmed - h -Inf 0.0; Rmed + h +In
fens, fes = mergenodes(fens, fes, tolerance, candidates);
```


The final mesh used for a simulation consists of a single node set and one or more finite element sets.
The finite elements may be divided into separate sets to accommodate different material properties, different orientations of the material coordinate systems, or different formulations of the discrete model. The aassignment of the finite elements to sets may be based on geometrical proximity, topological connections, or some other characteristic. See the "mesh selection" module for details.



10 changes: 5 additions & 5 deletions examples/meshing/L_shaped_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Meshing an L-shaped membrane: merging multiple meshes.

t0 = time()

W = 100. # strip width
L = 200. # length of the strip
nL = 15
nW = 10
tolerance = W / nW / 1.0e5
W = 100. # width of the leg
L = 200. # length of the leg
nL = 15 # number of elements along the length of the leg
nW = 10 # number of elements along the width
tolerance = W / nW / 1.0e5 # tolerance for merging nodes
Meshes = Array{Tuple{FENodeSet,FESet},1}()
push!(Meshes, Q4quadrilateral([0.0 0.0; W W], nW, nW))
push!(Meshes, Q4quadrilateral([-L 0.0; 0.0 W], nL, nW))
Expand Down

0 comments on commit 1837184

Please sign in to comment.