DOLFIN
DOLFIN C++ interface
Public Member Functions | Static Public Member Functions | List of all members
dolfin::BoxMesh Class Reference

#include <BoxMesh.h>

Inheritance diagram for dolfin::BoxMesh:
Inheritance graph
[legend]
Collaboration diagram for dolfin::BoxMesh:
Collaboration graph
[legend]

Public Member Functions

 BoxMesh (const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::size_t nz)
 
 BoxMesh (MPI_Comm comm, const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::size_t nz)
 
- Public Member Functions inherited from dolfin::Mesh
 Mesh ()
 Create empty mesh.
 
 Mesh (MPI_Comm comm)
 Create empty mesh.
 
 Mesh (const Mesh &mesh)
 
 Mesh (std::string filename)
 
 Mesh (MPI_Comm comm, std::string filename)
 
 Mesh (MPI_Comm comm, LocalMeshData &local_mesh_data)
 
 ~Mesh ()
 Destructor.
 
const Meshoperator= (const Mesh &mesh)
 
std::size_t num_vertices () const
 
std::size_t num_edges () const
 
std::size_t num_faces () const
 
std::size_t num_facets () const
 
std::size_t num_cells () const
 
std::size_t num_entities (std::size_t d) const
 
std::vector< double > & coordinates ()
 
const std::vector< double > & coordinates () const
 
const std::vector< unsigned int > & cells () const
 
std::size_t num_entities_global (std::size_t dim) const
 
MeshTopologytopology ()
 
const MeshTopologytopology () const
 
MeshGeometrygeometry ()
 
const MeshGeometrygeometry () const
 
MeshDomainsdomains ()
 
const MeshDomainsdomains () const
 
std::shared_ptr< BoundingBoxTreebounding_box_tree () const
 
MeshDatadata ()
 
const MeshDatadata () const
 
CellTypetype ()
 
const CellTypetype () const
 Get mesh cell type (const version).
 
std::size_t init (std::size_t dim) const
 
void init (std::size_t d0, std::size_t d1) const
 
void init () const
 Compute all entities and connectivity.
 
void init_global (std::size_t dim) const
 Compute global indices for entity dimension dim.
 
void clean ()
 
void order ()
 
bool ordered () const
 
Mesh renumber_by_color () const
 
void scale (double factor)
 
void translate (const Point &point)
 
void rotate (double angle, std::size_t axis=2)
 
void rotate (double angle, std::size_t axis, const Point &point)
 
void smooth (std::size_t num_iterations=1)
 
void smooth_boundary (std::size_t num_iterations=1, bool harmonic_smoothing=true)
 
void snap_boundary (const SubDomain &sub_domain, bool harmonic_smoothing=true)
 
const std::vector< std::size_t > & color (std::string coloring_type) const
 
const std::vector< std::size_t > & color (std::vector< std::size_t > coloring_type) const
 
double hmin () const
 
double hmax () const
 
double rmin () const
 
double rmax () const
 
std::size_t hash () const
 
std::string str (bool verbose) const
 
const std::vector< int > & cell_orientations () const
 
void init_cell_orientations (const Expression &global_normal)
 
MPI_Comm mpi_comm () const
 
std::string ghost_mode () const
 
- Public Member Functions inherited from dolfin::Variable
 Variable ()
 Create unnamed variable.
 
 Variable (const std::string name, const std::string label)
 Create variable with given name and label.
 
 Variable (const Variable &variable)
 Copy constructor.
 
virtual ~Variable ()
 Destructor.
 
const Variableoperator= (const Variable &variable)
 Assignment operator.
 
void rename (const std::string name, const std::string label)
 Rename variable.
 
std::string name () const
 Return name.
 
std::string label () const
 Return label (description)
 
std::size_t id () const
 
- Public Member Functions inherited from dolfin::Hierarchical< Mesh >
 Hierarchical (Mesh &self)
 Constructor.
 
virtual ~Hierarchical ()
 Destructor.
 
std::size_t depth () const
 
bool has_parent () const
 
bool has_child () const
 
Meshparent ()
 
const Meshparent () const
 Return parent in hierarchy (const version).
 
std::shared_ptr< Meshparent_shared_ptr ()
 
std::shared_ptr< const Meshparent_shared_ptr () const
 Return shared pointer to parent (const version).
 
Meshchild ()
 
const Meshchild () const
 Return child in hierarchy (const version).
 
std::shared_ptr< Meshchild_shared_ptr ()
 
std::shared_ptr< const Meshchild_shared_ptr () const
 Return shared pointer to child (const version).
 
Meshroot_node ()
 
const Meshroot_node () const
 Return root node object in hierarchy (const version).
 
std::shared_ptr< Meshroot_node_shared_ptr ()
 
std::shared_ptr< const Meshroot_node_shared_ptr () const
 Return shared pointer to root node object in hierarchy (const version).
 
Meshleaf_node ()
 
const Meshleaf_node () const
 Return leaf node object in hierarchy (const version).
 
std::shared_ptr< Meshleaf_node_shared_ptr ()
 
std::shared_ptr< const Meshleaf_node_shared_ptr () const
 Return shared pointer to leaf node object in hierarchy (const version).
 
void set_parent (std::shared_ptr< Mesh > parent)
 Set parent.
 
void clear_child ()
 Clear child.
 
void set_child (std::shared_ptr< Mesh > child)
 Set child.
 
const Hierarchicaloperator= (const Hierarchical &hierarchical)
 Assignment operator.
 
void _debug () const
 Function useful for debugging the hierarchy.
 

Static Public Member Functions

static Mesh create (const std::array< Point, 2 > &p, std::array< std::size_t, 3 > n, CellType::Type cell_type)
 
static Mesh create (MPI_Comm comm, const std::array< Point, 2 > &p, std::array< std::size_t, 3 > n, CellType::Type cell_type)
 

Additional Inherited Members

- Public Attributes inherited from dolfin::Variable
Parameters parameters
 Parameters.
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ BoxMesh() [1/2]

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.

Parameters
p0(Point) First point.
p1(Point) Second point.
nx(double) Number of cells in x-direction.
ny(double) Number of cells in y-direction.
nz(double) Number of cells in z-direction.
// 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);

◆ BoxMesh() [2/2]

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.

Parameters
comm(MPI_Comm) MPI communicator
p0(Point) First point.
p1(Point) Second point.
nx(double) Number of cells in x-direction.
ny(double) Number of cells in y-direction.
nz(double) Number of cells in z-direction.
// 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);

Member Function Documentation

◆ create() [1/2]

static Mesh dolfin::BoxMesh::create ( const std::array< Point, 2 > &  p,
std::array< std::size_t, 3 >  n,
CellType::Type  cell_type 
)
inlinestatic

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.

Parameters
p(std::array<Point, 2>) Points of box.
n(std::array<double, 3> ) Number of cells in each direction.
cell_typeTetrahedron or Hexahedron
// 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});

◆ create() [2/2]

static Mesh dolfin::BoxMesh::create ( MPI_Comm  comm,
const std::array< Point, 2 > &  p,
std::array< std::size_t, 3 >  n,
CellType::Type  cell_type 
)
inlinestatic

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.

Parameters
comm(MPI_Comm) MPI communicator
p(std::array<Point, 2>) Points of box.
n(std::array<double, 3> ) Number of cells in each direction.
cell_typeTetrahedron or hexahedron
// 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});

The documentation for this class was generated from the following files: