{"id":25267558,"url":"https://github.com/kgorze/molecular-dynamics-simulator","last_synced_at":"2025-04-06T03:27:28.506Z","repository":{"id":249510325,"uuid":"774603964","full_name":"kGorze/Molecular-Dynamics-Simulator","owner":"kGorze","description":"A 2D molecular dynamics simulator that models atomic interactions using Lennard-Jones forces on a Boltzmann lattice. Currently implements an all-pairs algorithm for force calculations with visualization capabilities. This academic project aims to evolve into a 3D simulation of water and solutes.","archived":false,"fork":false,"pushed_at":"2025-01-29T20:31:58.000Z","size":167364,"stargazers_count":0,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T13:47:58.097Z","etag":null,"topics":["atom-simulation","cpp","lennard-jones","molecular-dynamics","physics-simulation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kGorze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-19T20:57:37.000Z","updated_at":"2025-01-29T20:32:02.000Z","dependencies_parsed_at":"2024-08-03T21:48:42.669Z","dependency_job_id":"05089ca0-ccee-4277-9197-3afd55da3002","html_url":"https://github.com/kGorze/Molecular-Dynamics-Simulator","commit_stats":null,"previous_names":["kgorze/mds","kgorze/molecular-dynamics-simulator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kGorze%2FMolecular-Dynamics-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kGorze%2FMolecular-Dynamics-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kGorze%2FMolecular-Dynamics-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kGorze%2FMolecular-Dynamics-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kGorze","download_url":"https://codeload.github.com/kGorze/Molecular-Dynamics-Simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430494,"owners_count":20937859,"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":["atom-simulation","cpp","lennard-jones","molecular-dynamics","physics-simulation"],"created_at":"2025-02-12T09:40:11.162Z","updated_at":"2025-04-06T03:27:28.490Z","avatar_url":"https://github.com/kGorze.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Project Name\nMolecular Dynamic Simulator - Simulates the molecular dynamics of atoms.\n\n---\n## Project Description\n**This is an academic project focused on developing a molecular dynamics simulator.** Currently, it simulates Lennard-Jones (LJ) forces using a (less efficient) all-pairs algorithm on a 2D Boltzmann lattice of atoms. Half an assignment for a project in object-oriented programming and on the other hand a hobby project related to simulations. Lab assignment for Dr. Carrascoza - Bioinformatics 2nd semester, object-oriented programming.\n\n**Am not familiar with Docker yet**,  so here's a breakdown of the \"toolchain\" dependencies needed for the project:\nThose are the files required to:\n- run the main program, this is a zip archive with **Google test framework library** and **external libraries(inih, matplotplusplus).**\nhttps://drive.google.com/file/d/1qWKXbvHN7cqKYxY8W0PSXjXOvH26tP9q/view?usp=sharing\n\n\n- visualize the atom coordinates, this is a zip with **python scripts**\nhttps://drive.google.com/file/d/1tgm48HFup8QAHkeGqLZC07GnXcTWbKDC/view?usp=sharing\n\n### Initial Conditions: \nVelocities and accelerations are **randomly assigned**, preventing the exact reproduction of simulations at present.\n\n### Data Output: \nEach iteration is saved with **coordinates**, **physical properties**, and **velocity distribution** for later analysis.\n\n### Visualization:\nA separate **Python script** utilizing Pygame generates a visual representation of the atomic plane.\n\n### Calculations:\n![Alt Text](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ3dwb250bXlhdDNtdmpjY3RjN3Y1aGJ3eGZ1cnJram84MmRmODFpOSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/A3FNYGbqptXCeYyUma/giphy.gif)\n\n### Visualization:\n**Color coded** made by python script: \n```\ndraw_atoms_velocity_sensitive.py\n```\n![Alt Text](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExaGtpeWl1MDkzb3N2MWtjY29tdmhpazM4Znd2MGJ1M3d3aGQyZDdmZyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/g6oxb5B3CX98gutee8/giphy.gif)\n\n\n**No colour coded** by python script:\n```\ndraw_atoms_no_color_coded.py\n```\n![Alt Text](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbmoyNTgwc2JxZ3Q1MnNydmltY2JtMTMxY2F6OWpreGZ5YzQ1cWhwYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/HQil6mwHKyXkgzAcp9/giphy.gif)\n\n---\n\n## Project Status\n**This project is in its initial stages.** The ultimate goal is a 3D simulation of water and solutes, but the current focus is on achieving a stable 2D simulation of atoms.\n### Stability:\nThe 2D simulation functionality is still under development.\n\n---\n## Features\n\nThe project employs a director-builder pattern to create a simulation object. The `computeForces` function calculates the forces acting on the atoms.\n\n---\n## Requirements\n### For main program\n\n#### Development Environment:\nCLion\n#### Compiler:\nLikely GCC (**as used by CLion**)\n\n### For python visualizations\npygame\n\n---\n\n\n## Installation\nThe program is not only intended for  **Windows** environment and **JetBrains CLion IDE.**\n[installation youtube instruction](https://www.youtube.com/watch?v=NE3JG-eTcnU)\n\n---\n\n## Usage Examples\nThe configuration file can be modified to obtain different simulation results.\n\n---\n## Documentation\nDoxygen documentation is not yet available.\n\n---\n## Testing\nUnit tests are still under development. The Google Test framework is being considered for implementation.\n\n---\n## Contribution and Issue Reporting\nFeel free to fork the project or report issues for collaboration. No formal oversight exists yet.\n\n---\n## License\nThe code is freely reusable. The license for the book-based portions is still under consideration.\n\n---\n## Authors and Acknowledgments\nThis project is heavily inspired by the book: [The Art of Molecular Dynamics Simulation](https://www.cambridge.org/core/books/art-of-molecular-dynamics-simulation/57D40C5ECE9B7EA17C0E77E7754F5874)\n1. Rapaport DC. _The Art of Molecular Dynamics Simulation_. 2nd ed. Cambridge University Press; 2004.\n\n\n--\n## Post-Mortem\nFirst Iteration:\nThe initial challenge arose when we needed to create 3D simulations using methods originally designed for 2D. As a quick solution, we implemented a very primitive object-oriented paradigm with a deeply hierarchical structure.\n\nSecond Iteration:\nThe structure became an issue again when we had to incorporate design patterns for the final project submission. To address this, we rewrote the program, adding design patterns like Factory and Builder.\n\nThird Iteration:\nThe third challenge was related to making the base class too generic, which hindered further development. To overcome this, we:\n\nCreated a UML diagram before coding.\nAdded design patterns to promote code reusability, modularity, and scalability.\nImplemented a CI/DI framework with Google tests.\nDivided the work into modules responsible for multithreading, inter-module communication, physics, etc.\n\nLessons Learned:\n\nEarly planning: Creating a UML diagram from the beginning can prevent architectural issues.\nDesign patterns: They are essential for maintainable and extensible code.\nTesting: A comprehensive test suite is crucial for catching regressions.\nModularization: Breaking down the system into smaller, well-defined modules improves understanding and maintainability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgorze%2Fmolecular-dynamics-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgorze%2Fmolecular-dynamics-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgorze%2Fmolecular-dynamics-simulator/lists"}