{"id":18695937,"url":"https://github.com/gridap/unstructuredgrids.jl","last_synced_at":"2025-11-08T14:30:30.013Z","repository":{"id":61799955,"uuid":"181285345","full_name":"gridap/UnstructuredGrids.jl","owner":"gridap","description":"++REPO NOT MAINTAINED++ Helper routines for topological operations on unstructured grids in julia","archived":false,"fork":false,"pushed_at":"2023-08-09T15:39:57.000Z","size":120,"stargazers_count":3,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T22:58:29.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gridap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-14T09:18:11.000Z","updated_at":"2020-10-13T08:15:01.000Z","dependencies_parsed_at":"2024-12-28T03:36:32.327Z","dependency_job_id":null,"html_url":"https://github.com/gridap/UnstructuredGrids.jl","commit_stats":{"total_commits":94,"total_committers":1,"mean_commits":94.0,"dds":0.0,"last_synced_commit":"24ae552b3e772286eea084209f3d6de33b995b1b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridap%2FUnstructuredGrids.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridap%2FUnstructuredGrids.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridap%2FUnstructuredGrids.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridap%2FUnstructuredGrids.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridap","download_url":"https://codeload.github.com/gridap/UnstructuredGrids.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239558910,"owners_count":19658927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T11:16:40.168Z","updated_at":"2025-11-08T14:30:28.658Z","avatar_url":"https://github.com/gridap.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnstructuredGrids\n\n*Helper routines for topological operations on unstructured grids in julia*\n\n[![Build Status](https://travis-ci.com/gridap/UnstructuredGrids.jl.svg?branch=master)](https://travis-ci.com/gridap/UnstructuredGrids.jl)\n[![Codecov](https://codecov.io/gh/gridap/UnstructuredGrids.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/gridap/UnstructuredGrids.jl)\n\nIf you ❤️ this project, give us a ⭐️!\n\n**UnstructuredGrids** provides a set of functions providing common topological operations associated with unstructured meshes/grids such as:\n\n- Find the lower dimensial objects (e.g., edges and faces) on the boundary of each cell in the grid\n- Find the vertices on low dimensional objects of the grid (e.g., the vertices on each face, the vertices on each edge)\n- Find dual connections (e.g., cells arround a face, cells around a vertex, faces around an edge, etc.)\n- Identify objects on the boundary of the grid\n- Export unstructured grids into `.vtu` files (using the `WriteVTK` package).\n\n## Installation\n\n```julia\nPkg.add(\"UnstructuredGrids\")\n```\n## Quick Start\n\n### Generate a `UGrid` object from its nodal coordinates, cell connectivities, and cell types\n\n```julia\nusing UnstructuredGrids\nusing UnstructuredGrids.RefCellGallery: SQUARE, TRIANGLE\n\n# Define coordinates\ncoords = zeros(2,9)\ncoords[:,1] = [1,1]\ncoords[:,2] = [3,1]\ncoords[:,3] = [4,1]\ncoords[:,4] = [1,2]\ncoords[:,5] = [2,2]\ncoords[:,6] = [1,3]\ncoords[:,7] = [2,3]\ncoords[:,8] = [3,3]\ncoords[:,9] = [4,3]\n\n# Define connectivity\nconnect = [1,2,5,4,2,3,9,4,5,7,6,5,8,7,5,2,8,2,9,8]\noffsets = [1,      5,    8,      12,   15,   18,   21]\n\n# Define cell types\nrefcells = [SQUARE, TRIANGLE]\ntypes = [1,2,1,2,2,2]\n\n# Generate the UGrid object\ngrid = UGrid(connect,offsets,types,refcells,coords)\n\n```\n\n### Export the `UGrid` object into vtk format\n\n```julia\nwritevtk(grid,\"foo\") # -\u003e generates file \"foo.vtu\" \n```\n\n![](assets/grid.png)\n\n### Generate a numbering for the edges (1d-faces) of the grid\n\n```julia\nn=1\ncell_to_edges = generate_cell_to_faces(n,grid)\n@show cell_to_edges.list\n@show cell_to_edges.ptrs\n# cell_to_edges.list = [1, 2, 3, 4, 5, 6, 7, 3, 8, 9, 10, 11, 12, 8, 2, 13, 11, 7, 14, 13]\n# cell_to_edges.ptrs = [1, 5, 8, 12, 15, 18, 21]\n```\nThe vector `cell_to_edges.list` contains the ids of the edges for each cell. The vector `cell_to_edges.ptrs` determines which range of the previous vector correspond to a given cell. E.g., the edge ids on cell number 3 are recovered as follows:\n```julia\ncell = 3\na = cell_to_edges.ptrs[cell]\nb = cell_to_edges.ptrs[cell+1]-1\nedges = cell_to_edges.list[a:b]\n@show edges\n# edges = [3, 8, 9, 10]\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridap%2Funstructuredgrids.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridap%2Funstructuredgrids.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridap%2Funstructuredgrids.jl/lists"}