Loading...
Searching...
No Matches
dolfin::RectangleMesh Class Reference

`#include <RectangleMesh.h>`

Inheritance diagram for dolfin::RectangleMesh:
[legend]
Collaboration diagram for dolfin::RectangleMesh:
[legend]

## Public Member Functions

| RectangleMesh (const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::string diagonal="right")
| RectangleMesh (MPI_Comm comm, const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::string diagonal="right")
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 Mesh & | operator= (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
MeshTopology & | topology ()
const MeshTopology & | topology () const
MeshGeometry & | geometry ()
const MeshGeometry & | geometry () const
MeshDomains & | domains ()
const MeshDomains & | domains () const
std::shared_ptr< BoundingBoxTree > | bounding_box_tree () const
MeshData & | data ()
const MeshData & | data () const
CellType & | type ()
const CellType & | type () 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
void | build_mapping (std::shared_ptr< const Mesh > other) 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 Variable & | operator= (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
Mesh & | parent ()
std::shared_ptr< Mesh > | parent_shared_ptr ()
Mesh & | child ()
std::shared_ptr< Mesh > | child_shared_ptr ()
Mesh & | root_node ()
std::shared_ptr< Mesh > | root_node_shared_ptr ()
Mesh & | leaf_node ()
std::shared_ptr< Mesh > | leaf_node_shared_ptr ()
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 Hierarchical & | operator= (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, 2 > n, CellType::Type cell_type, std::string diagonal="right")
static Mesh | 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")

## Additional Inherited Members

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

## Detailed Description

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

## Constructor & Destructor Documentation

## RectangleMesh() [1/2]

RectangleMesh::RectangleMesh | ( | const Point & | p0,
|  | const Point & | p1,
|  | std::size_t | nx,
|  | std::size_t | ny,
|  | std::string | diagonal = "right" )

Parameters

  p0 | (Point) First point.
  p1 | (Point) Second point.
  nx | (double) Number of cells in :math:x-direction.
  ny | (double) Number of cells in :math:y-direction.
  diagonal | (string) Direction of diagonals: "left", "right", "left/right", "crossed"

// 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);
dolfin::Point
Definition Point.h:41
dolfin::RectangleMesh::RectangleMesh
RectangleMesh(const Point &p0, const Point &p1, std::size_t nx, std::size_t ny, std::string diagonal="right")
Definition RectangleMesh.cpp:30

## RectangleMesh() [2/2]

RectangleMesh::RectangleMesh | ( | MPI_Comm | comm,
|  | const Point & | p0,
|  | const Point & | p1,
|  | std::size_t | nx,
|  | std::size_t | ny,
|  | std::string | diagonal = "right" )

Parameters

  comm | (MPI_Comm) MPI communicator
  p0 | (Point) First point.
  p1 | (Point) Second point.
  nx | (double) Number of cells in :math:x-direction.
  ny | (double) Number of cells in :math:y-direction.
  diagonal | (string) Direction of diagonals: "left", "right", "left/right", "crossed"

// 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);

## Member Function Documentation

## create() [1/2]

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

inline static

Parameters

  p | (std::array<Point, 2>) Vertex points.
  n | (std::array<std::size_t, 2>) Number of cells in each direction
  cell_type | (dolfin::CellType::Type) Cell type
  diagonal | (string) Direction of diagonals: "left", "right", "left/right", "crossed"

// 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});
dolfin::Mesh::Mesh
Mesh()
Create empty mesh.
Definition Mesh.cpp:59
dolfin::RectangleMesh::create
static Mesh create(const std::array< Point, 2 > &p, std::array< std::size_t, 2 > n, CellType::Type cell_type, std::string diagonal="right")
Definition RectangleMesh.h:57

## create() [2/2]

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

inline static

Parameters

  comm | (MPI_Comm) MPI communicator
  p | (std::array<Point, 2>) Vertex points.
  n | (std::array<std::size_t, 2>) Number of cells in each direction
  cell_type | (dolfin::CellType::Type) Cell type
  diagonal | (string) Direction of diagonals: "left", "right", "left/right", "crossed"

// 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});

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

- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/generation/RectangleMesh.h
- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/generation/RectangleMesh.cpp