{"id":17908378,"url":"https://github.com/pseudotensor/pvs_grmhd2","last_synced_at":"2025-04-03T06:26:12.669Z","repository":{"id":148324233,"uuid":"59169508","full_name":"pseudotensor/pvs_grmhd2","owner":"pseudotensor","description":"Conservative GRMHD Primitive Variable Solvers (from Noble et al. 2006)","archived":false,"fork":false,"pushed_at":"2016-05-19T03:06:20.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T20:18:02.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pseudotensor.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2016-05-19T03:05:49.000Z","updated_at":"2016-05-19T03:06:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"9841f066-a657-40c0-91cb-72eb420cc843","html_url":"https://github.com/pseudotensor/pvs_grmhd2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudotensor%2Fpvs_grmhd2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudotensor%2Fpvs_grmhd2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudotensor%2Fpvs_grmhd2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pseudotensor%2Fpvs_grmhd2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pseudotensor","download_url":"https://codeload.github.com/pseudotensor/pvs_grmhd2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246946138,"owners_count":20859095,"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-10-28T19:15:42.305Z","updated_at":"2025-04-03T06:26:12.648Z","avatar_url":"https://github.com/pseudotensor.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n###############################################################\n\n  \"Primitive Variable Solvers for Conservative \n  \n   General Relativistic Magnetohydrodynamics\"\n\n\n    Copyright 2005 Scott C. Noble, Charles F. Gammie, \n                   Jonathan C. McKinney, and Luca Del Zanna\n\n\n    This file is part of PVS-GRMHD.\n\n    PVS-GRMHD is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    PVS-GRMHD is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with PVS-GRMHD; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n\n\nHistory:\n\n  -- released to the public June 8, 2005\n\n###############################################################\n\n\nThis code consists of the following files:\n\nREADME             : this file\nCOPYING            : GNU Public License (GPL)\nlic.txt            : text file of copyright information\nMakefile           : used to compile main.c \nmain.c             : demonstration program \nutoprim_1d.c\t   : contains those routines for the 1D_W       method\nutoprim_1dvsq1.c   : contains those routines for the 1D_{v^2}   method\nutoprim_1dvsq2.c   : contains those routines for the 1D^*_{v^2} method\nutoprim_2d.c\t   : contains those routines for the 2D         method\nutoprim_5d.c\t   : contains those routines for the 5D         method\nutoprim_poly.c     : contains those routines for the Polynomial method\nu2p_defs.h         : header file containing compile time options/flags\nu2p_util.c\t   : utility routines used by the inversion methods\nu2p_util.h\t   : header for u2p_util.h\n\n\n\nIn order to use a particular method, you will need to only include the \nfollowing files in your compilation:\n\n      utoprim_$NAME.c, u2p_util.c, u2p_util.h, u2p_defs.h \n\nwhere $NAME is the name of the file pertaining to the method you wish to use. \nThe inversion routine that you will call within your code has the definition:\n\n   int Utoprim_$NAME(FTYPE U[NPR], FTYPE gcov[NDIM][NDIM], FTYPE gcon[NDIM][NDIM], \n               FTYPE gdet, FTYPE prim[NPR])\n\n\nwhere $NAME is the same as before (1d, 2d, 5d, 1dvsq2, etc.).  \nFTYPE, NDIM, NPR are all defined in u2p_defs.h  and are the desired floating-point\ntype (float, double, long double, etc.), number of spacetime dimensions (default 4), \nand the number of primitive and conserved variables (default 8 and we\nassume there is an equal number of primitive and conserved variables).  U[NPR] is \nthe array of conserved variables, prim[NPR] is the array of primitive variables, \ngcov[NDIM][NDIM] is the covariant (\"down-down\", g_{\\mu \\nu}) form of the metric, \ngcon[NDIM][NDIM] is the contravariant (\"up-up\", g^{\\mu \\nu}) form of the metric, \ngdet is sqrt(-det(g_{\\mu \\nu})  where det(g_{\\mu \\nu} is the determinant of\nthe metric. U[] and prim[] on input and output are defined as the following:\n\n              /  \\rho u^t          \\\n         U =  |  T^t_\\mu + rho u^t |  sqrt(-det(g_{\\mu\\nu}))\n              \\   B^i              /\n\n             /    \\rho       \\\n         P = |    uu         |\n             | \\tilde{u}^i   |\n             \\   B^i         /\n\n\nwhere T_{\\mu \\nu} is the stress-energy tensor, u^\\mu is the 4-velocity, \n\\rho  is the rest-mass density, uu is the internal energy density, \nB^i = *F^{i t},  *F^{\\mu \\nu} is the dual of the electromagnetic field tensor,\nand  \\tilde{u}^i  is the spatial projection of the 4-velocity (see paper\nfor further details).  \n\nU[], gcov[][], gcon[][], and gdet must all be set to their correct \nvalues at input, and a \"reasonable\" guess for the primitive variables \nmust be saved in prim[] at input.   At output, all are the same except \nprim[] = P(U[])  now, unless the method encountered an error and/or \ndid not converge to a solution.  In this case, prim[] at output\nequals what it was at input.  Also, Utoprim_$NAME() will return a non-zero\ninteger if it encountered such a problem.  \n\n\nCurrently, only a \\Gamma-law equation of state (EOS) is used.  The following \nroutines can easily be changed to use a different EOS:  \n\tUtoprim_1d(), Utoprim_2d(), Utoprim_1dvsq2()  \nTo change the EOS with these methods, only the routines at the bottom \nof their associated source files need be changed.  The routines \ncan be identified by the comment above them that states that they\ndefine the EOS. \n\nUtoprim_5d() can, in principle, be used with a general EOS, but we have \nnot written it with EOS-portability in mind.  In order to make Utoprim_5d() \ncompatible with a different EOS, the user will have to write a new dudp_calc_g() \nthat calculates the Jacobian dU_i/dP_k  correctly for that EOS.  \n\nCompile-time parameters in u2p_defs.h that you may wish to change \nare the following:\n\nGAMMA           :  adiabatic index of the \\Gamma-law equation of state\nNPR             :  number of conserved and primitive variables (assumed to be the same)\nNDIM            :  number of spacetime dimensions (assumed to be the same)\nFTYPE           :  type used for floating-point arithmetic (default double)\nNEWT_TOL        :  \"TOL\" of the paper\nMAX_NEWT_ITER   :  \"N_{NR}\" of the paper\nEXTRA_NEWT_ITER :  \"N_{extra}\" of the paper \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudotensor%2Fpvs_grmhd2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpseudotensor%2Fpvs_grmhd2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudotensor%2Fpvs_grmhd2/lists"}