{"id":23158766,"url":"https://github.com/gpavanb1/splitnewtonpp","last_synced_at":"2025-04-04T18:41:02.297Z","repository":{"id":265892663,"uuid":"892996649","full_name":"gpavanb1/SplitNewtonpp","owner":"gpavanb1","description":"FAST, Bounded, SPLIT Newton solver with pseudo-transient continuation and backtracking.","archived":false,"fork":false,"pushed_at":"2025-03-25T17:27:12.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T18:33:26.904Z","etag":null,"topics":["backtracking","continuation","cpp","newton","nonlinear","optimization","pseudotransient"],"latest_commit_sha":null,"homepage":"","language":"C++","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/gpavanb1.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-11-23T08:57:21.000Z","updated_at":"2025-03-24T16:18:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d0d9f4e-cea9-492b-b205-815795ba9720","html_url":"https://github.com/gpavanb1/SplitNewtonpp","commit_stats":null,"previous_names":["gpavanb1/splitnewtonpp"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FSplitNewtonpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FSplitNewtonpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FSplitNewtonpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FSplitNewtonpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpavanb1","download_url":"https://codeload.github.com/gpavanb1/SplitNewtonpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234841,"owners_count":20905852,"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":["backtracking","continuation","cpp","newton","nonlinear","optimization","pseudotransient"],"created_at":"2024-12-17T22:27:29.660Z","updated_at":"2025-04-04T18:41:02.288Z","avatar_url":"https://github.com/gpavanb1.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SplitNewton++\n\n![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen.svg)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14783839.svg)](https://doi.org/10.5281/zenodo.14783839)\n\nFast, Bounded, Split [Newton](https://en.wikipedia.org/wiki/Newton%27s_method) with [pseudo-transient continuation\n](https://ctk.math.ncsu.edu/TALKS/Purdue.pdf) and [backtracking](https://en.wikipedia.org/wiki/Backtracking_line_search)\n\nCheck out its Python cousin - [SplitNewton](https://github.com/gpavanb1/SplitNewton)\n\n## Where is this used?\n\nGood for ill-conditioned problems where there are two different sets of systems\n\nParticular applications include\n* [Fast-Slow Reaction-Diffusion systems](https://en.wikipedia.org/wiki/Reaction%E2%80%93diffusion_system)\n* [CFD](https://en.wikipedia.org/wiki/Computational_fluid_dynamics) - Pressure-Velocity coupling\n\n## What does 'split' mean?\n\nThe system is divided into multiple segments, and for ease of communication, let’s refer to the first segment of variables as \"outer\" and the remaining as \"inner\".\n\n* Holding the outer variables fixed, Newton iteration is performed recursively for the inner variables, using the sub-Jacobian associated with them, until convergence is reached.\n\n* One Newton step is then performed for the outer variables, while the inner variables are kept fixed, using the sub-Jacobian for the outer subsystem.\n\n* This process is repeated, alternating between solving the inner and outer subsystems, until the convergence criterion for the entire system (similar to standard Newton) is met.\n\n### Example:\n\nConsider a system of 5 variables, with the split locations at indices [1, 4]. This results in the following segments:\n\n  * `a1` (variables from 0 to 1)\n  * `a2 a3 a4` (variables from 1 to 4)\n  * `a5` (variable at index 4)\n\n1. First, the innermost segment `a5` is solved recursively using Newton's method while holding the variables `a1` and `a2 a3 a4`) fixed. This step is repeated until the convergence criterion for `a5` is met.\n\n2. Next, one Newton step is taken for the segment `a2 a3 a4`, with `a5` held fixed. This step is followed by solving `a5` again till convergence.\n\n3. This alternating process repeats: solving for `a5` until convergence, then one step for `a2 a3 a4`, and so on, until all subsystems converge.\n\nFinally, one Newton step is performed for `a1`, with the other segments fixed. This completes one cycle of the split Newton process.\n\n## How to install and execute?\n\nThis is a header-only library and can be most easily used with VSCode. The `tasks.json` contains the build and run commands that can be invoked directly from the IDE.\n\nThere is an example in `main.cpp` which can be compiled and executed\n\n## How much faster is this?\n\nFor the bounded test problem with N=5000 and two split locations (at 1/3rd and 2/3rd), the C++ version is faster (even though the sparse linear solver is in C for the Python version). The comparison is as follows\n\n| Method    | Time       | Iterations    | Time/Iteration |\n|-----------|------------|---------------| -------------- |\nC++ |  ~36 seconds  | 44  | \u003c0.8 seconds |\nPython | ~37 seconds | 33  | ~1.2 seconds |\n\n## How to test?\nYou can run tests with the `gtest` framework. There is a `Bazel: Test` task in `.vscode/tasks.json` which can be used to run the tests.\n\nThe coverage reports can be generated with `llvm-cov` or `gcov` depending on the OS being used\n\n## Whom to contact?\n\nPlease direct your queries to [gpavanb1](http://github.com/gpavanb1)\nfor any questions.\n\n## Citing\n\nIf you are using SplitNewton++ in any scientific work, please make sure to cite as follows\n```\n@software{pavan_b_govindaraju_2025_14783839,\n  author       = {Pavan B Govindaraju},\n  title        = {gpavanb1/SplitNewtonpp: v0.2.0},\n  month        = feb,\n  year         = 2025,\n  publisher    = {Zenodo},\n  version      = {0.2.0},\n  doi          = {10.5281/zenodo.14783839},\n  url          = {https://doi.org/10.5281/zenodo.14783839}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpavanb1%2Fsplitnewtonpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpavanb1%2Fsplitnewtonpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpavanb1%2Fsplitnewtonpp/lists"}