dolfin/generation¶
Documentation for C++ code found in dolfin/generation/*.h
Contents
Classes¶
BoxMesh¶
C++ documentation for BoxMesh
from dolfin/generation/BoxMesh.h
:
-
class
dolfin::
BoxMesh
: public dolfin::Mesh¶ Tetrahedral mesh of the 3D rectangular prism spanned by two points p0 and p1. Given the number of cells (nx, ny, nz) in each direction, the total number of tetrahedra will be 6*nx*ny*nz and the total number of vertices will be (nx + 1)*(ny + 1)*(nz + 1).
-
dolfin::BoxMesh::
BoxMesh
(MPI_Comm comm, const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::size_t nz)¶ Deprecated Create a uniform finite element
Mesh
over the rectangular prism spanned by the two _Point_s p0 and p1. The order of the two points is not important in terms of minimum and maximum coordinates.// Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] x [-1,2]. Point p0(-1, -1, -1); Point p1(2, 2, 2); BoxMesh mesh(MPI_COMM_WORLD, p0, p1, 8, 8, 8);
Parameters:
-
dolfin::BoxMesh::
BoxMesh
(const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::size_t nz)¶ Deprecated Create a uniform finite element
Mesh
over the rectangular prism spanned by the two _Point_s p0 and p1. The order of the two points is not important in terms of minimum and maximum coordinates.// Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] x [-1,2]. Point p0(-1, -1, -1); Point p1(2, 2, 2); BoxMesh mesh(p0, p1, 8, 8, 8);
Parameters:
-
void
dolfin::BoxMesh::
build_tet
(Mesh &mesh, const std::array<Point, 2> &p, std::array<std::size_t, 3> n)¶ Parameters: - mesh –
- p –
- n –
-
Mesh
dolfin::BoxMesh::
create
(MPI_Comm comm, const std::array<Point, 2> &p, std::array<std::size_t, 3> n, CellType::Type cell_type)¶ Create a uniform finite element
Mesh
over the rectangular prism spanned by the two _Point_s p0 and p1. The order of the two points is not important in terms of minimum and maximum coordinates.// Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] x [-1,2]. Point p0(-1, -1, -1); Point p1(2, 2, 2); auto mesh = BoxMesh::create({p0, p1}, {8, 8, 8});
Parameters:
-
Mesh
dolfin::BoxMesh::
create
(const std::array<Point, 2> &p, std::array<std::size_t, 3> n, CellType::Type cell_type)¶ Create a uniform finite element
Mesh
over the rectangular prism spanned by the two _Point_s p0 and p1. The order of the two points is not important in terms of minimum and maximum coordinates.// Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] x [-1,2]. Point p0(-1, -1, -1); Point p1(2, 2, 2); auto mesh = BoxMesh::create({p0, p1}, {8, 8, 8});
Parameters: - p – (std::array<
Point
, 2>) Points of box. - n – (std::array<double, 3> ) Number of cells in each direction.
- cell_type – Tetrahedron or Hexahedron
- p – (std::array<
-
IntervalMesh¶
C++ documentation for IntervalMesh
from dolfin/generation/IntervalMesh.h
:
-
class
dolfin::
IntervalMesh
: public dolfin::Mesh¶ Interval mesh of the 1D line [a,b]. Given the number of cells (n) in the axial direction, the total number of intervals will be n and the total number of vertices will be (n + 1).
-
dolfin::IntervalMesh::
IntervalMesh
(MPI_Comm comm, std::size_t n, double a, double b)¶ Constructor
// Create a mesh of 25 cells in the interval [-1,1] IntervalMesh mesh(MPI_COMM_WORLD, 25, -1.0, 1.0);
Parameters: - comm – (MPI_Comm)
MPI
communicator - n – (std::size_t) The number of cells.
- a – (double) The minimum point (inclusive).
- b – (double) The maximum point (inclusive).
- comm – (MPI_Comm)
-
dolfin::IntervalMesh::
IntervalMesh
(std::size_t n, double a, double b)¶ Constructor
// Create a mesh of 25 cells in the interval [-1,1] IntervalMesh mesh(25, -1.0, 1.0);
Parameters: - n – (std::size_t) The number of cells.
- a – (double) The minimum point (inclusive).
- b – (double) The maximum point (inclusive).
-
void
dolfin::IntervalMesh::
build
(Mesh &mesh, std::size_t n, std::array<double, 2> x)¶ Parameters: - mesh –
- n –
- x –
-
Mesh
dolfin::IntervalMesh::
create
(MPI_Comm comm, std::size_t n, std::array<double, 2> x)¶ Factory
// Create a mesh of 25 cells in the interval [-1,1] IntervalMesh mesh(MPI_COMM_WORLD, 25, -1.0, 1.0);
Parameters: - comm – (MPI_Comm)
MPI
communicator - n – (std::size_t) The number of cells.
- x – (std::array<double, 2>) The end points
- comm – (MPI_Comm)
-
RectangleMesh¶
C++ documentation for RectangleMesh
from dolfin/generation/RectangleMesh.h
:
-
class
dolfin::
RectangleMesh
: public dolfin::Mesh¶ Triangular mesh of the 2D rectangle spanned by two points p0 and p1. Given the number of cells (nx, ny) in each direction, the total number of triangles will be 2*nx*ny and the total number of vertices will be (nx + 1)*(ny + 1).
-
dolfin::RectangleMesh::
RectangleMesh
(MPI_Comm comm, const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::string diagonal = "right")¶ // Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); RectangleMesh mesh(MPI_COMM_WORLD, p0, p1, 8, 8);
Parameters:
-
dolfin::RectangleMesh::
RectangleMesh
(const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::string diagonal = "right")¶ // Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); RectangleMesh mesh(p0, p1, 8, 8);
Parameters:
-
void
dolfin::RectangleMesh::
build_quad
(Mesh &mesh, const std::array<Point, 2> &p, std::array<std::size_t, 2> n)¶ Parameters: - mesh –
- p –
- n –
-
void
dolfin::RectangleMesh::
build_tri
(Mesh &mesh, const std::array<Point, 2> &p, std::array<std::size_t, 2> n, std::string diagonal = "right")¶ Parameters: - mesh –
- p –
- n –
- diagonal –
-
Mesh
dolfin::RectangleMesh::
create
(MPI_Comm comm, const std::array<Point, 2> &p, std::array<std::size_t, 2> n, CellType::Type cell_type, std::string diagonal = "right")¶ // Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); auto mesh = RectangleMesh::create(MPI_COMM_WORLD, {p0, p1}, {8, 8});
Parameters:
-
Mesh
dolfin::RectangleMesh::
create
(const std::array<Point, 2> &p, std::array<std::size_t, 2> n, CellType::Type cell_type, std::string diagonal = "right")¶ // Mesh with 8 cell edges in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); auto Mesh = RectangleMesh::create({p0, p1}, {8, 8});
Parameters:
-
SphericalShellMesh¶
C++ documentation for SphericalShellMesh
from dolfin/generation/SphericalShellMesh.h
:
-
class
dolfin::
SphericalShellMesh
¶ Spherical shell approximation, icosahedral mesh, with degree=1 or degree=2
UnitCubeMesh¶
C++ documentation for UnitCubeMesh
from dolfin/generation/UnitCubeMesh.h
:
-
class
dolfin::
UnitCubeMesh
: public dolfin::BoxMesh¶ Tetrahedral/hexahedral mesh of the 3D unit cube [0,1] x [0,1] x [0,1]. Given the number of cells (nx, ny, nz) in each direction, the total number of tetrahedra will be 6*nx*ny*nz and the total number of vertices will be (nx + 1)*(ny + 1)*(nz + 1).
-
dolfin::UnitCubeMesh::
UnitCubeMesh
(MPI_Comm comm, std::size_t nx, std::size_t ny, std::size_t nz)¶ Create a uniform finite element
Mesh
over the unit cube [0,1] x [0,1] x [0,1].UnitCubeMesh mesh(MPI_COMM_WORLD, 32, 32, 32);
Parameters: - comm – (MPI_Comm)
MPI
communicator - nx – (std::size_t) Number of cells in \(x\) direction.
- ny – (std::size_t) Number of cells in \(y\) direction.
- nz – (std::size_t) Number of cells in \(z\) direction.
- comm – (MPI_Comm)
-
dolfin::UnitCubeMesh::
UnitCubeMesh
(std::size_t nx, std::size_t ny, std::size_t nz)¶ Create a uniform finite element
Mesh
over the unit cube [0,1] x [0,1] x [0,1].UnitCubeMesh mesh(32, 32, 32);
Parameters: - nx – (std::size_t) Number of cells in \(x\) direction.
- ny – (std::size_t) Number of cells in \(y\) direction.
- nz – (std::size_t) Number of cells in \(z\) direction.
-
Mesh
dolfin::UnitCubeMesh::
create
(MPI_Comm comm, std::array<std::size_t, 3> n, CellType::Type cell_type)¶ Create a uniform finite element
Mesh
over the unit cube [0,1] x [0,1] x [0,1].auto mesh = UnitCubeMesh::create(MPI_COMM_WORLD, {32, 32, 32}, CellType::Type::hexahedron);
Parameters: - comm – (MPI_Comm)
MPI
communicator - n – (std::aray<std::size_t, 3>) Number of cells in each direction.
- cell_type – Tetrahedron or hexahedron
- comm – (MPI_Comm)
-
Mesh
dolfin::UnitCubeMesh::
create
(MPI_Comm comm, std::size_t nx, std::size_t ny, std::size_t nz, CellType::Type cell_type)¶ Parameters: - comm –
- nx –
- ny –
- nz –
- cell_type –
-
Mesh
dolfin::UnitCubeMesh::
create
(std::array<std::size_t, 3> n, CellType::Type cell_type)¶ Create a uniform finite element
Mesh
over the unit cube [0,1] x [0,1] x [0,1].Parameters: - n – (std::array<std::size_t, 3>) Number of cells in each direction.
- cell_type – Tetrahedron or hexahedron :: auto mesh = UnitCubeMesh::create(32, 32, 32, CellType::Type::tetrahedron);
-
UnitDiscMesh¶
C++ documentation for UnitDiscMesh
from dolfin/generation/UnitDiscMesh.h
:
UnitIntervalMesh¶
C++ documentation for UnitIntervalMesh
from dolfin/generation/UnitIntervalMesh.h
:
-
class
dolfin::
UnitIntervalMesh
: public dolfin::IntervalMesh¶ A mesh of the unit interval (0, 1) with a given number of cells (nx) in the axial direction. The total number of intervals will be nx and the total number of vertices will be (nx + 1).
-
dolfin::UnitIntervalMesh::
UnitIntervalMesh
(MPI_Comm comm, std::size_t nx)¶ Constructor
// Create a mesh of 25 cells in the interval [0,1] UnitIntervalMesh mesh(MPI_COMM_WORLD, 25);
Parameters: - comm – (MPI_Comm)
MPI
communicator - nx – (std::size_t) The number of cells.
- comm – (MPI_Comm)
-
dolfin::UnitIntervalMesh::
UnitIntervalMesh
(std::size_t nx)¶ Constructor
// Create a mesh of 25 cells in the interval [0,1] UnitIntervalMesh mesh(25);
Parameters: nx – (std::size_t) The number of cells.
-
UnitSquareMesh¶
C++ documentation for UnitSquareMesh
from dolfin/generation/UnitSquareMesh.h
:
-
class
dolfin::
UnitSquareMesh
: public dolfin::RectangleMesh¶ Triangular/quadrilateral mesh of the 2D unit square [0,1] x [0,1]. Given the number of cells (nx, ny) in each direction, the total number of triangles will be 2*nx*ny and the total number of vertices will be (nx + 1)*(ny + 1). std::string diagonal (“left”, “right”, “right/left”, “left/right”, or “crossed”) indicates the direction of the diagonals.
-
dolfin::UnitSquareMesh::
UnitSquareMesh
(MPI_Comm comm, std::size_t nx, std::size_t ny, std::string diagonal = "right")¶ Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].UnitSquareMesh mesh1(MPI_COMM_WORLD, 32, 32); UnitSquareMesh mesh2(MPI_COMM_WORLD, 32, 32, "crossed");
Parameters: - comm – (MPI_Comm)
MPI
communicator - nx – (std::size_t) Number of cells in horizontal direction.
- ny – (std::size_t) Number of cells in vertical direction.
- diagonal – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
- comm – (MPI_Comm)
-
dolfin::UnitSquareMesh::
UnitSquareMesh
(std::size_t nx, std::size_t ny, std::string diagonal = "right")¶ Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].UnitSquareMesh mesh1(32, 32); UnitSquareMesh mesh2(32, 32, "crossed");
Parameters: - nx – (std::size_t) Number of cells in horizontal direction.
- ny – (std::size_t) Number of cells in vertical direction.
- diagonal – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
-
Mesh
dolfin::UnitSquareMesh::
create
(MPI_Comm comm, std::array<std::size_t, 2> n, CellType::Type cell_type, std::string diagonal = "right")¶ Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].auto mesh1 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32); auto mesh2 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32, "crossed");
Parameters: - comm – (MPI_Comm)
MPI
communicator - n – (std:::array<std::size_t, 2>) Number of cells in each direction.
- cell_type – Triangle or quadrilateral.
- diagonal – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
- comm – (MPI_Comm)
-
Mesh
dolfin::UnitSquareMesh::
create
(MPI_Comm comm, std::size_t nx, std::size_t ny, CellType::Type cell_type, std::string diagonal = "right")¶ Parameters: - comm –
- nx –
- ny –
- cell_type –
- diagonal –
-
Mesh
dolfin::UnitSquareMesh::
create
(std::array<std::size_t, 2> n, CellType::Type cell_type, std::string diagonal = "right")¶ Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].auto mesh1 = UnitSquareMesh::create(32, 32); auto mesh2 = UnitSquareMesh::create(32, 32, "crossed");
Parameters: - n – (std:::array<std::size_t, 2>) Number of cells in each direction.
- cell_type – Triangle or quadrilateral
- diagonal – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
-
UnitTetrahedronMesh¶
C++ documentation for UnitTetrahedronMesh
from dolfin/generation/UnitTetrahedronMesh.h
:
UnitTriangleMesh¶
C++ documentation for UnitTriangleMesh
from dolfin/generation/UnitTriangleMesh.h
: