Hughes2d documentation
Hughes2d is a Python library for approximating the solutions of a macroscopic pedestrian flow model named the Hughes’ model. The package combines a finite volume scheme for the scalar conservation law and a fast marching algorithm for the Eikonal equation.
Check out the Mathematics section for a quick introduction to macroscopic pedestrian models and a short bibliography on the subject. Check out the Usage section for further information, including how to Installation the project. Check out the examples (https://github.com/TheoRGirard/hughes2d/tree/main/examples) on the repository for short demonstrations of what this package can achieve. Check out the Geometry reference for a complete reference of the classes and methods of the package.
Note
This project is under active development.
Citation
You can cite the Hughes2d package using:
@software{hughes2d,
author = {Théo Girard},
title = {Hughes2d: approximating solutions of Hughes' model},
journal = {(submitted)},
year = {2025},
}
which produces the output:
T. Girard, Hughes2d: approximating solutions of Hughes’ model, submitted (2025).
Contents
- Usage
- Mathematics
- Geometry reference
NonConvexDomainNonConvexDomain.outer_verticesNonConvexDomain.wall_verticesNonConvexDomain.outer_boundaryNonConvexDomain.wall_edgesNonConvexDomain.wall_holes_pointNonConvexDomain.exit_listNonConvexDomain.zonesNonConvexDomain.__contains__()NonConvexDomain.add_boundary_point()NonConvexDomain.add_exit()NonConvexDomain.add_exits()NonConvexDomain.add_plot()NonConvexDomain.add_wall()NonConvexDomain.add_wall_point()NonConvexDomain.add_zone()NonConvexDomain.belong_segment()NonConvexDomain.find_boundary_point()NonConvexDomain.find_exit_point()NonConvexDomain.find_wall_point()NonConvexDomain.get_limits()NonConvexDomain.has_boundary_point()NonConvexDomain.has_exit_edge()NonConvexDomain.has_exit_point()NonConvexDomain.has_outer_edge()NonConvexDomain.has_wall_edge()NonConvexDomain.has_wall_point()NonConvexDomain.import_from_dxf()NonConvexDomain.shortest_path_bfs()NonConvexDomain.show()
MeshMesh.min_cell_areaMesh.max_edge_lengthMesh.verticesMesh.edgesMesh.trianglesMesh.exit_verticesMesh.exit_edgesMesh.wall_edgesMesh.boundary_pointsMesh.boundary_edges_indexMesh.triangles_with_edgesMesh.pairs_of_trianglesMesh.triangles_per_vertexMesh.outer_normal_vect_by_trianglesMesh.cell_areasMesh.edge_lengthMesh.zonesMesh.add_convex_zone()Mesh.add_plot()Mesh.computations()Mesh.compute_cell_areas()Mesh.compute_edge_length()Mesh.compute_edge_list()Mesh.compute_outer_normals()Mesh.compute_pair_of_triangles_list()Mesh.compute_triangles_per_vertex()Mesh.compute_vertex_flags()Mesh.compute_zones_triangles()Mesh.export_mesh_msh()Mesh.export_mesh_msh_free_fem()Mesh.generate_mesh_from_domain()Mesh.get_limits()Mesh.import_from_lists()Mesh.import_mesh_from_msh()Mesh.import_mesh_from_msh_free_fem()Mesh.in_zone()Mesh.load_from_json()Mesh.save_to_json()Mesh.set_exits_from_domain()Mesh.show()
CellValueMapVertexValueMapVertexValueMap.MeshVertexValueMap.valuesVertexValueMap.add_3d_plot()VertexValueMap.compute_gradient_flow()VertexValueMap.compute_vertex_gradient_flow()VertexValueMap.generate_random()VertexValueMap.set_infinity()VertexValueMap.show()VertexValueMap.show_3d()VertexValueMap.show_vector_field()
- Equation solvers reference
EikoSolverEikoSolver.meshEikoSolver.densityEikoSolver.fieldValuesEikoSolver.costEikoSolver.optEikoSolver.add_in_order_by_field_value()EikoSolver.compute_field()EikoSolver.compute_field_by_edges()EikoSolver.compute_field_constrained_dep_1()EikoSolver.compute_field_constrained_dep_2()EikoSolver.compute_field_unconstrained_dep_1()EikoSolver.compute_field_unconstrained_dep_2()EikoSolver.compute_height_from_grad_constrained()EikoSolver.compute_height_from_grad_unconstrained()EikoSolver.compute_height_length()EikoSolver.dist()EikoSolver.show_narrow_band_after_step()EikoSolver.update_density()
LWRSolverLWRSolver.meshLWRSolver.densityt0LWRSolver.densityt1LWRSolver.directionsLWRSolver.fluxFunctionLWRSolver.dtLWRSolver.optLWRSolver.appro_zero_dichotomy()LWRSolver.approxi_max()LWRSolver.approxi_min()LWRSolver.arg_max()LWRSolver.check_cfl()LWRSolver.compute_next_step()LWRSolver.compute_step_mid_vector()LWRSolver.compute_step_tmap()LWRSolver.god()LWRSolver.show_density()LWRSolver.update()
PedestrianSolverPedestrianSolver.meshPedestrianSolver.time_stepPedestrianSolver.optionsPedestrianSolver.dtPedestrianSolver.speed_functionPedestrianSolver.cost_functionPedestrianSolver.directionsPedestrianSolver.numForgottenStepsPedestrianSolver.compute_step()PedestrianSolver.compute_steps()PedestrianSolver.compute_steps_and_show()PedestrianSolver.compute_until_empty()PedestrianSolver.save_additionnal_computations()PedestrianSolver.save_to_json()
- Plot utilities