create.mesh.3D: Create a 'mesh.3D' object from the connectivity matrix and...

View source: R/mesh.R

create.mesh.3DR Documentation

Create a mesh.3D object from the connectivity matrix and nodes locations

Description

Create a mesh.3D object from the connectivity matrix and nodes locations

Usage

create.mesh.3D(
  nodes,
  tetrahedrons,
  order = 1,
  nodesattributes = NULL,
  segments = NULL,
  holes = NULL
)

Arguments

nodes

A #nodes-by-3 matrix containing the x, y, z coordinates of the mesh nodes.

tetrahedrons

A #tetrahedrons-by-4 (when order = 1) or #tetrahedrons-by-10 (when order = 2) matrix. It specifies the tetrahedrons giving the row's indices in nodes of the tetrahedrons' vertices and (when nodes = 2) also if the tetrahedrons' edges midpoints. The tetrahedrons' vertices and midpoints are ordered as described in "The Finite Element Method its Basis and Fundamentals" by O. C. Zienkiewicz, R. L. Taylor and J.Z. Zhu

order

Either '1' or '2'. It specifies wether each mesh tetrahedron should be represented by 4 nodes (the tetrahedron's vertices) or by 10 nodes (the tetrahedron's vertices and edge midpoints). These are respectively used for linear (order = 1) and quadratic (order = 2) Finite Elements. Default is order = 1.

nodesattributes

A matrix with #nodes rows containing nodes' attributes. These are passed unchanged to the output. This has been added for consistency with the function create.mesh.2D.

segments

A #segments-by-2 matrix. Each row contains the row's indices in nodes of the vertices where the segment starts from and ends to. Segments are edges that are not splitted during the triangulation process. These are for instance used to define the boundaries of the domain. This has been added for consistency with the function create.mesh.2D.

holes

A #holes-by-3 matrix containing the x, y, z coordinates of a point internal to each hole of the mesh. These points are used to carve holes in the triangulation, when the domain has holes. This has been added for consistency with the function create.mesh.2D.

Value

An object of the class mesh.3D with the following output:

  • nodesA #nodes-by-3 matrix containing the x, y, z coordinates of the mesh nodes.

  • nodesmarkersA vector of length #nodes, with entries either '1' or '0'. An entry '1' indicates that the corresponding node is a boundary node; an entry '0' indicates that the corresponding node is not a boundary node.

  • nodesattributesA matrix with #nodes rows containing nodes' attributes. These are passed unchanged from the input.

  • tetrahedronsA #tetrahedrons-by-4 (when order = 1) or #tetrahedrons-by-10 (when order = 2) matrix. It specifies the tetrahedrons giving the indices in nodes of the tetrahedrons' vertices and (when nodes = 2) also if the tetrahedrons' edges midpoints.

  • segmentsmarkerA vector of length #segments with entries either '1' or '0'. An entry '1' indicates that the corresponding element in segments is a boundary segment; an entry '0' indicates that the corresponding segment is not a boundary segment.

  • facesA #faces-by-3 matrix containing all the faces of the tetrahedrons in the output triangulation. Each row contains the row's indices in nodes, indicating the nodes where the face starts from and ends to.

  • facesmarkersA vector of lenght #faces with entries either '1' or '0'. An entry '1' indicates that the corresponding element in faces is a boundary face; an entry '0' indicates that the corresponding edge is not a boundary face.

  • neighborsA #triangles-by-4 matrix. Each row contains the indices of the four neighbouring tetrahedrons An entry '-1' indicates that one face of the tetrahedrons is a boundary face.

  • holesA #holes-by-3 matrix containing the x, y, z coordinates of a point internal to each hole of the mesh. These points are used to carve holes in the triangulation, when the domain has holes. These are passed unchanged from the input.

  • orderEither '1' or '2'. It specifies wether each mesh tetrahedron should be represented by 3 nodes (the tetrahedron's vertices) or by 6 nodes (the tetrahedron's vertices and midpoints). These are respectively used for linear (order = 1) and quadratic (order = 2) Finite Elements.

Examples

library(fdaPDE)

##Load the matrix nodes and tetrahedrons
data(sphere3Ddata)

nodes=sphere3Ddata$nodes
tetrahedrons=sphere3Ddata$tetrahedrons

##Create the triangulated mesh from the connectivity matrix and nodes locations
mesh=create.mesh.3D(nodes,tetrahedrons)

fdaPDE documentation built on March 7, 2023, 5:28 p.m.