Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc error in mesh.create_mesh for coordinate layout. #2540

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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