Skip to content

Issue on page /chapter3/subdomains.html #64

Closed
@jomoulin

Description

@jomoulin

Hello,

Just a nit: in the create_mesh() helper (taken from https://jorgensd.github.io/dolfinx-tutorial/chapter3/subdomains.html#convert-msh-files-to-xdmf-using-meshio), I believe points should be passed to the meshio.Mesh() constructor if one wants prune_z to work

import meshio
def create_mesh(mesh, cell_type, prune_z=False):
    cells = mesh.get_cells_type(cell_type)
    cell_data = mesh.get_cell_data("gmsh:physical", cell_type)
    points = mesh.points[:,:2] if prune_z else mesh.points
    out_mesh = meshio.Mesh(points=mesh.points, cells={cell_type: cells}, cell_data={"name_to_read":[cell_data]}) # <-- here, should be points=points
    return out_mesh

Thanks for these great tutorials !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions