{"id":19863529,"url":"https://github.com/sandialabs/compadre","last_synced_at":"2025-04-13T04:25:06.297Z","repository":{"id":37896970,"uuid":"165897408","full_name":"sandialabs/compadre","owner":"sandialabs","description":"Compadre (Compatible Particle Discretization and Remap)","archived":false,"fork":false,"pushed_at":"2025-03-06T04:31:33.000Z","size":30289,"stargazers_count":22,"open_issues_count":22,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T09:45:02.822Z","etag":null,"topics":["scr-2367","snl-comp-science-libs","snl-data-analysis"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandialabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-01-15T17:52:40.000Z","updated_at":"2024-12-13T18:04:43.000Z","dependencies_parsed_at":"2024-06-12T19:10:22.613Z","dependency_job_id":"2dd8659f-d876-4318-9412-ffd77252bc62","html_url":"https://github.com/sandialabs/compadre","commit_stats":{"total_commits":974,"total_committers":9,"mean_commits":"108.22222222222223","dds":"0.23613963039014374","last_synced_commit":"0e3c7025fd2bd38c75c9975d12514a0d0c78a19b"},"previous_names":["snlcomputation/compadre"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fcompadre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fcompadre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fcompadre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fcompadre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandialabs","download_url":"https://codeload.github.com/sandialabs/compadre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248662457,"owners_count":21141580,"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":["scr-2367","snl-comp-science-libs","snl-data-analysis"],"created_at":"2024-11-12T15:15:02.025Z","updated_at":"2025-04-13T04:25:06.268Z","avatar_url":"https://github.com/sandialabs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COMpatible PArticle Discretization and REmap Toolkit\n\n## About\n\nThe Compadre Toolkit provides a performance portable solution for the parallel evaluation of computationally dense kernels. The toolkit specifically targets the Generalized Moving Least Squares (GMLS) approach, which requires the inversion of small dense matrices. The result is a set of weights that provide the information needed for remap or entries that constitute the rows of some globally sparse matrix.\n\nThis toolkit focuses on the 'on-node' aspects of meshless PDE solution and remap, namely the parallel construction of small dense matrices and their inversion. What it does **not** provide is the tools for managing fields, inverting globally sparse matrices, or neighbor search that requires orchestration over many MPI processes. This toolkit is designed to be easily dropped-in to an existing MPI (or serial) based framework for PDE solution or remap, with minimal dependencies ([Kokkos](https://github.com/kokkos/kokkos) and [KokkosKernels](https://github.com/kokkos/kokkos-kernels)).\n\n### Generalized Moving Least Squares (GMLS)\n\nHere is a brief overview of the GMLS framework:\n\nConsider $\\phi$ of function class $\\mathbf{V}$ as well as a collection of samples $\\Lambda = \\\\{\\lambda_ i(\\phi)\\\\}_ {i=1}^{N}$ (Compadre::SamplingFunctional) corresponding to a quasiuniform collection of data sites $\\mathbf{X}_ h = \\\\{ \\mathbf{x}_ i \\\\} \\subset \\mathbb{R}^d$ characterized by fill distance $h$. To approximate a given linear target functional $\\tau_{\\tilde{x}}$ (Compadre::TargetOperation) associated with a target site $\\tilde{x}$, we seek a reconstruction $p \\in \\mathbf{V}_ h$, where $\\mathbf{V}_ h \\subset \\mathbf{V}$ is a finite dimensional space (Compadre::ReconstructionSpace) chosen to provide good approximation properties, with basis $\\mathbf{P} = \\\\{P\\\\}_{i=1}^{dim(V_h)}$. We perform this reconstruction in the following weighted $\\ell_2$ sense:\n\n$$p = \\underset{{q \\in \\mathbf{V}_ h}}{\\mathrm{argmin}} \\sum_{i=1}^N ( \\lambda_i(\\phi) -\\lambda_i(q) )^2 \\omega(\\lambda_i,\\tau_{\\tilde{x}}),$$\n\nwhere $\\omega$ is a locally supported positive function, $\\omega = \\Phi(|\\tilde{x}-\\mathbf{x}_i|)$ and $|\\cdot|$ denotes the Euclidean norm. $\\Phi(r,\\epsilon)$ is selected by the user, having a parameter controlling the support of $\\omega$.\n\nWith an optimal reconstruction $p$ in hand, the target functional is approximated via $\\tau_{\\tilde{x}} (\\phi) \\approx \\tau^h_{\\tilde{x}} (\\phi) := \\tau_{\\tilde{x}} (p)$.\n\nAs an unconstrained $\\ell_2$-optimization problem, this process admits the explicit form:\n\n\n$$\\tau^h_{\\tilde{x}}(\\phi) = \\tau_{\\tilde{x}}(\\mathbf{P})^\\top \\left(\\Lambda(\\mathbf{P})^\\top \\mathbf{W} \\Lambda(\\mathbf{P})\\right)^{-1} \\Lambda(\\mathbf{P})^\\top \\mathbf{W} \\Lambda(\\phi),$$\n\nwhere:\n* $\\tau_{\\tilde{x}}(\\mathbf{P}) \\in \\mathbb{R}^{dim(V_h)}$ is a vector with components consisting of the target functional applied to each basis function,\n* $\\mathbf{W} \\in \\mathbb{R}^{N \\times N}$ is a diagonal matrix with diagonal entries consisting of $\\\\{\\omega(\\lambda_i,\\tau_{\\tilde{x}})\\\\}_{i=1,...,N}$,\n* $\\Lambda(\\mathbf{P}) \\in \\mathbb{R}^{N \\times dim(V_h)}$ is a rectangular matrix whose $(i,j)$ entry corresponds to the application of the $i^{th}$ sampling functional applied to the $j^{th}$ basis function,\n* and $\\Lambda(\\phi) \\in \\mathbb{R}^N$ is a vector consisting of the $N$ samples of the function $\\phi$.\n\nCompadre forms and solves the GMLS problem for $\\\\{\\alpha_i\\\\}$ used in the approximation $\\tau^h_{\\tilde{x}}(\\phi) = \\sum_{\\mathbf{x}_i \\in B^\\epsilon(\\tilde{x})} \\alpha_i \\lambda_i(\\phi)$,\nwhere $B^\\epsilon(\\tilde{x})$ denotes the $\\epsilon$-ball neighborhood of the target site $\\tilde{x}$. \n\nAs such, GMLS admits an interpretation as an automated process for generating generalized finite difference methods on unstructured point clouds. Note that the computational cost of solving the GMLS problem amounts to inverting a small linear system which may be assembled using only information from neighbors within the support of $\\omega$, and construction of such stencils across the entire domain is embarrassingly parallel.\n\nThe Compadre Toolkit is designed to efficiently assemble, factorize, and solve large batches of GMLS problems.\n\n## Wiki Information\nDetails about building and using the Compadre toolkit can be found on the [Wiki](https://github.com/sandialabs/compadre/wiki).\n\n## Recent Changes\n[Recent Changes](https://github.com/sandialabs/compadre/wiki/Changelog)\n\n## Installation\n[Installation of Kokkos and KokkosKernels](https://github.com/sandialabs/compadre/wiki/Kokkos-and-KokkosKernels) [Either automatically configured and built, or user installation location provided]\n\n[Installation of Compadre](https://github.com/sandialabs/compadre/wiki/Building-Compadre)\n\n## Documentation and Tutorials\nThe toolkit is documented by Doxygen. \u003cb\u003e[Documentation is available online](https://sandialabs.github.io/compadre/index.html)\u003c/b\u003e or can be compiled from source.\nTo compile from source: 1.) install doxygen software on your computer, 2.) execute '\u003e\u003e make doc' after having installed the Compadre Toolkit. HTML and Latex documentation will be generated in the \u003cb\u003edoc/\u003c/b\u003e folder, in-source. \n\n## Citing the Software\n\nIf you write a paper using results obtained with the help of the Compadre Toolkit, please cite the following reference which is applicable to every version of the Compadre Toolkit:\n\n```\n@software{compadre_toolkit,\n  author       = {Paul Kuberry and\n                  Peter Bosler and\n                  Nathaniel Trask},\n  title        = {Compadre Toolkit},\n  month        = jan, \n  year         = 2019,\n  doi          = {10.11578/dc.20190411.1},\n  url          = {https://github.com/sandialabs/compadre}\n}\n```\n\nIf you are using a particular release of the Compadre Toolkit and would like to help others to reproduce your results, please cite that release specifically. A reference to the most recent release is:\n```\n@software{compadre_toolkit_v1_6_0,\n  author       = {Paul Kuberry and\n                  Peter Bosler and\n                  Nathaniel Trask},\n  title        = {Compadre Toolkit},\n  month        = dec,\n  year         = 2024,\n  publisher    = {Zenodo},\n  version      = {v1.6.0},\n  doi          = {10.5281/zenodo.14279180},\n  url          = {https://doi.org/10.5281/zenodo.14279180}\n}\n```\n\n```diff\n! DOI: 10.11578/dc.20190411.1\n```\n\n## Copyright and License\nSee compadre/COPYRIGHT, compadre/LICENSE, https://trilinos.github.io/license.html and individual file headers for additional information.\n\n\n## Questions? \nContact lead developers:\n\n* Compadre team     (GitHub handle: @trilinos/Compadre)\n* Paul Kuberry      (GitHub handle: [kuberry](https://github.com/kuberry) or pakuber@sandia.gov@sandia.gov)\n\nThe views and conclusions contained in the software and documentation are those\nof the authors and should not be interpreted as representing official policies,\neither expressed or implied, of NTESS or the U.S. Government.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fcompadre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandialabs%2Fcompadre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fcompadre/lists"}