Skip to content

Commit

Permalink
Fix doc error in mesh.create_mesh for coordinate layout. (#2540)
Browse files Browse the repository at this point in the history
Fixes #2535.
  • Loading branch information
garth-wells committed Feb 20, 2023
1 parent 78b295a commit a428407
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cpp/dolfinx/mesh/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class Geometry
/// @param[in] dofmap The geometry (point) dofmap. For a cell, it
/// gives the position in the point array of each local geometry node
/// @param[in] element The element that describes the cell geometry map
/// @param[in] x The point coordinates. It is a `std::vector<double>`
/// and uses row-major storage. The shape is `(num_points, 3)`.
/// @param[in] x The point coordinates. The shape is `(num_points, 3)`
/// and the storage is row-major.
/// @param[in] dim The geometric dimension (`0 < dim <= 3`)
/// @param[in] input_global_indices The 'global' input index of each
/// point, commonly from a mesh input file. The type is
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/mesh/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Mesh
/// @param[in] element The coordinate element that describes the
/// geometric mapping for cells
/// @param[in] x The coordinates of mesh nodes
/// @param[in] xshape The shape of `x`
/// @param[in] xshape The shape of `x`. It should be `(num_points, gdim)`.
/// @param[in] ghost_mode The requested type of cell ghosting/overlap
/// @return A distributed Mesh.
Mesh create_mesh(MPI_Comm comm, const graph::AdjacencyList<std::int64_t>& cells,
Expand Down
34 changes: 18 additions & 16 deletions python/dolfinx/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ def locate_entities(mesh: Mesh, dim: int, marker: typing.Callable) -> np.ndarray
Args:
mesh: Mesh to locate entities on
dim: Topological dimension of the mesh entities to consider
marker: A function that takes an array of points `x` with shape ``(gdim,
num_points)`` and returns an array of booleans of length
``num_points``, evaluating to `True` for entities to be located.
marker: A function that takes an array of points `x` with shape
`(gdim, num_points)` and returns an array of booleans of
length `num_points`, evaluating to `True` for entities to be
located.
Returns:
Indices (local to the process) of marked mesh entities.
Expand All @@ -121,9 +122,10 @@ def locate_entities_boundary(mesh: Mesh, dim: int, marker: typing.Callable) -> n
Args:
mesh: Mesh to locate boundary entities on
dim: Topological dimension of the mesh entities to consider
marker: Function that takes an array of points `x` with shape ``(gdim,
num_points)`` and returns an array of booleans of length
``num_points``, evaluating to `True` for entities to be located.
marker: Function that takes an array of points `x` with shape
`(gdim, num_points)` and returns an array of booleans of
length `num_points`, evaluating to `True` for entities to be
located.
Returns:
Indices (local to the process) of marked mesh entities.
Expand Down Expand Up @@ -225,19 +227,19 @@ def refine_plaza(mesh: Mesh, edges: typing.Optional[np.ndarray] = None, redistri
def create_mesh(comm: _MPI.Comm, cells: typing.Union[np.ndarray, _cpp.graph.AdjacencyList_int64],
x: np.ndarray, domain: ufl.Mesh,
partitioner=_cpp.mesh.create_cell_partitioner(GhostMode.none)) -> Mesh:
"""
Create a mesh from topology and geometry arrays
"""Create a mesh from topology and geometry arrays.
Args:
comm: MPI communicator to define the mesh on
cells: Cells of the mesh
x: Mesh geometry ('node' coordinates), with shape ``(gdim, num_nodes)``
domain: UFL mesh
ghost_mode: The ghost mode used in the mesh partitioning
partitioner: Function that computes the parallel distribution of cells across MPI ranks
comm: MPI communicator to define the mesh on.
cells: Cells of the mesh. `cells[i]` is the 'nodes' of cell `i`.
x: Mesh geometry ('node' coordinates), with shape ``(num_nodes, gdim)``
domain: UFL mesh.
ghost_mode: The ghost mode used in the mesh partitioning.
partitioner: Function that computes the parallel distribution of
cells across MPI ranks.
Returns:
A new mesh
A mesh.
"""
ufl_element = domain.ufl_coordinate_element()
Expand Down Expand Up @@ -270,7 +272,7 @@ def __init__(self, meshtags, mesh: Mesh):
"""Mesh tags associate data (markers) with a subset of mesh entities of a given dimension.
Args:
meshtags: C++ mesh tags object
meshtags: C++ mesh tags object.
mesh: Python mesh that tags are defined on.
Note:
Expand Down

0 comments on commit a428407

Please sign in to comment.