forked from atchekho/harmpi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathu2p_defs.h
127 lines (90 loc) · 3.94 KB
/
u2p_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/***********************************************************************************
Copyright 2006 Charles F. Gammie, Jonathan C. McKinney, Scott C. Noble,
Gabor Toth, and Luca Del Zanna
HARM version 1.0 (released May 1, 2006)
This file is part of HARM. HARM is a program that solves hyperbolic
partial differential equations in conservative form using high-resolution
shock-capturing techniques. This version of HARM has been configured to
solve the relativistic magnetohydrodynamic equations of motion on a
stationary black hole spacetime in Kerr-Schild coordinates to evolve
an accretion disk model.
You are morally obligated to cite the following two papers in his/her
scientific literature that results from use of any part of HARM:
[1] Gammie, C. F., McKinney, J. C., \& Toth, G.\ 2003,
Astrophysical Journal, 589, 444.
[2] Noble, S. C., Gammie, C. F., McKinney, J. C., \& Del Zanna, L. \ 2006,
Astrophysical Journal, 641, 626.
Further, we strongly encourage you to obtain the latest version of
HARM directly from our distribution website:
http://rainman.astro.uiuc.edu/codelib/
HARM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
HARM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with HARM; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <complex.h>
#include "decs.h"
/* your choice of floating-point data type */
#define FTYPE double
/* Adiabatic index used for the state equation */
#define GAMMA (gam)
#define G_ISOTHERMAL (1.)
/* use K(s)=K(r)=const. (G_ATM = GAMMA) of time or T = T(r) = const. of time (G_ATM = 1.) */
#define USE_ISENTROPIC 1
#if( USE_ISENTROPIC )
#define G_ATM GAMMA
#else
#define G_ATM G_ISOTHERMAL
#endif
#define MAX_NEWT_ITER 30 /* Max. # of Newton-Raphson iterations for find_root_2D(); */
#define NEWT_TOL 1.0e-10 /* Min. of tolerance allowed for Newton-Raphson iterations */
#define MIN_NEWT_TOL 1.0e-10 /* Max. of tolerance allowed for Newton-Raphson iterations */
#define EXTRA_NEWT_ITER 2
#define NEWT_TOL2 1.0e-15 /* TOL of new 1D^*_{v^2} gnr2 method */
#define MIN_NEWT_TOL2 1.0e-10 /* TOL of new 1D^*_{v^2} gnr2 method */
#define W_TOO_BIG 1.e20 /* \gamma^2 (\rho_0 + u + p) is assumed
to always be smaller than this. This
is used to detect solver failures */
#define UTSQ_TOO_BIG 1.e20 /* \tilde{u}^2 is assumed to be smaller
than this. Used to detect solver
failures */
#define FAIL_VAL 1.e30 /* Generic value to which we set variables when a problem arises */
#define NUMEPSILON (2.2204460492503131e-16)
/* some mnemonics */
/* for primitive variables */
#ifndef RHO
#define RHO 0
#endif
#ifndef UU
#define UU 1
#endif
#define UTCON1 2
#define UTCON2 3
#define UTCON3 4
#define BCON1 5
#define BCON2 6
#define BCON3 7
/* for conserved variables */
#define QCOV0 1
#define QCOV1 2
#define QCOV2 3
#define QCOV3 4
#define MYMAX(a,b) ( ((a) > (b)) ? (a) : (b) )
//#define dot(a,b) (a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3])
//#define delta(i,j) (((i) == (j)) ? 1. : 0.)
#define finite(x) isfinite(x)
extern double gam;
extern double mrat;