HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions | Variables
tetrad.c File Reference

Tetrad related calculations. More...

#include "decs.h"
Include dependency graph for tetrad.c:

Go to the source code of this file.

Macros

#define DEBUGLAPACK   1
 GODMARK: only applies for metric as input whether to debug lapack by comparing with simpler Mathematica version that doesn't work in all generality but seems to be correct GODMARK: for now, always in debug mode because use bootstrap technique to figure out how to reorder lapack result 0 : don't use yet since raw lapack isn't ordered correctly 1 : fake debug, bootstrap method 2 : true debug method. More...
 

Functions

static int compute_tetrcon_frommetric_mathematica (FTYPE(*generalmatrix)[NDIM], FTYPE(*tetrcon)[NDIM], FTYPE eigenvalues[])
 compute orthonormal tetrad [ortho]^[lab] for converting u_[lab] or u^[ortho] Notes: For full rotating BH with g_{r}=0 (i.e. More...
 
static int compute_tetrcon_frommetric (FTYPE(*generalmatrix)[NDIM], FTYPE(*tetrcon)[NDIM], FTYPE eigenvalues[])
 
static int tetlapack_func_prec (FTYPE(*metr)[NDIM], FTYPE(*tetr)[NDIM], FTYPE eigenvalues[])
 pre-setup tetrad use of lapack function More...
 
int tetr_func_frommetric (int primcoord, FTYPE(*dxdxp)[NDIM], FTYPE *gcov, FTYPE(*tetrcov)[NDIM], FTYPE(*tetrcon)[NDIM], FTYPE eigenvalues[])
 find suitable orthonormal tetrad wrapper for tetr_func(). More...
 
int tetr_func (int inputtype, FTYPE *gcov, FTYPE(*tetr_cov)[NDIM], FTYPE(*tetr_con)[NDIM], FTYPE eigenvalues[])
 input gcov and get out orthonormal tetrad in covariant and contravariant forms if metrictype, assume gcov is inputted as simplest as user could (e.g. More...
 
int calc_ORTHOes (int primcoord, struct of_geom *ptrgeom, FTYPE tmuup[][NDIM], FTYPE tmudn[][NDIM])
 Notes: More...
 
int get_tetrcovcon (int primcoord, struct of_geom *ptrgeom, FTYPE(**tetrcov)[NDIM], FTYPE(**tetrcon)[NDIM])
 get stored or compute tetrcov and tetrcon primcoord: whether PRIMCOORDS type, so will use dxdxp to simplify matching to get tetrad More...
 
int calc_generalized_boost_uu (struct of_geom *ptrgeom, FTYPE *wcon, FTYPE *ucon, FTYPE(*lambda)[NDIM])
 Compute general Lorentz boost for an arbitrary metric and arbitrary 4-velocities see docs/lorentz.ps.gz by Avery Broderick Lambda^[w]_[u] u^ = w^ [Corresponding to boost into fluid frame] Lambda^[w]_[u] w_ = u_ [Corresponding to boost from fluid frame] (iLambda)^[u]_[w] u_ = w_ [Corresponding to boost into fluid frame] (iLambda)^[u]_[w] w^ = u^ [Corresponding to boost from fluid frame] So if going from w->u (i.e. More...
 
int calc_ortho_boost_uu (FTYPE *wcon, FTYPE *ucon, FTYPE(*lambda)[NDIM])
 calculate boost assuming in orthonormal basis where g_{}={} = diag(-1,0,0,0) NOTEMARK: Orthonormal does not mean in Cartesian coordinates! If metric was originally in SPC Mink or SPC KS, then final metric is diag(-1,0,0,0) but is still SPC. More...
 
int transboost_lab2fluid (int lab2orthofluid, int primcoord, struct of_geom *ptrgeom, FTYPE *uconlab, FTYPE(*transboostup)[NDIM], FTYPE(*transboostlo)[NDIM])
 use lab frame contravariant 4-velocity (uconlab) and get transformation matrix for going to orthonormal basis (same base coordinate system: e.g. More...
 
int vector_harm2orthofluidorback (int whichvector, int harm2orthofluid, struct of_geom *ptrgeom, int uconcovtype, FTYPE *uconcov, FTYPE v4concovtype, FTYPE *vector4in, FTYPE *vector4out)
 Wrapper for vector_lab2orthofluidorback() More...
 
int vector_lab2orthofluidorback (int primcoord, int lab2orthofluid, struct of_geom *ptrgeom, int uconcovtype, FTYPE *uconcov, FTYPE v4concovtype, FTYPE *vector4in, FTYPE *vector4out)
 convert 4-vector to/from lab-frame coordinate basis to fluid frame orthonormal basis More...
 
int tensor_lab2orthofluidorback (int primcoord, int lab2orthofluid, struct of_geom *ptrgeom, int uconcovtype, FTYPE *uconcov, int tconcovtypeA, int tconcovtypeB, FTYPE(*tensor4in)[NDIM], FTYPE(*tensor4out)[NDIM])
 convert lab frame 4-tensor to fluid frame orthonormal 4-tensor More...
 
void vecX2vecVortho (int concovtype, struct of_geom *ptrgeom, FTYPE *veclab, FTYPE *vecortho)
 Use as, e.g. More...
 
FTYPE Root (FTYPE a, FTYPE b, FTYPE c, FTYPE d, FTYPE *roots, int *numroots)
 http://stackoverflow.com/questions/12449079/roots-of-cubic-using-c-and-gsl http://en.wikipedia.org/wiki/Cubic_function (but not good if need to use all real numbers) a x^3 + b c^2 + c x + d = 0 More...
 
int cubicroots (FTYPE a, FTYPE b, FTYPE c, FTYPE d, FTYPE *roots)
 http://en.wikipedia.org/wiki/Cubic_function (but not good if need to use all real numbers) a x^3 + b c^2 + c x + d = 0 More...
 
int genes (FTYPE *gcov[4], FTYPE *evec[4], FTYPE *eval)
 compute the semi-general eigensystem for a pretty general metric. More...
 
int genortho (FTYPE *vec1, FTYPE *vec2, FTYPE *vec3, FTYPE *vec4, FTYPE *ovec1, FTYPE *ovec2, FTYPE *ovec3, FTYPE *ovec4)
 compute the general orthonormal version of 4 vectors (that should be from eigensystem) More...
 

Variables

int globalii
 
int globaljj
 
int globalkk
 

Detailed Description

Tetrad related calculations.

Definition in file tetrad.c.

Macro Definition Documentation

#define DEBUGLAPACK   1

GODMARK: only applies for metric as input whether to debug lapack by comparing with simpler Mathematica version that doesn't work in all generality but seems to be correct GODMARK: for now, always in debug mode because use bootstrap technique to figure out how to reorder lapack result 0 : don't use yet since raw lapack isn't ordered correctly 1 : fake debug, bootstrap method 2 : true debug method.

Definition at line 147 of file tetrad.c.

Function Documentation

int calc_generalized_boost_uu ( struct of_geom ptrgeom,
FTYPE wcon,
FTYPE ucon,
FTYPE(*)  lambda[NDIM] 
)

Compute general Lorentz boost for an arbitrary metric and arbitrary 4-velocities see docs/lorentz.ps.gz by Avery Broderick Lambda^[w]_[u] u^ = w^ [Corresponding to boost into fluid frame] Lambda^[w]_[u] w_ = u_ [Corresponding to boost from fluid frame] (iLambda)^[u]_[w] u_ = w_ [Corresponding to boost into fluid frame] (iLambda)^[u]_[w] w^ = u^ [Corresponding to boost from fluid frame] So if going from w->u (i.e.

FF2LAB) frame for vecff^ , then apply (iLambda)^ vecff^nu = veclab^ So if going from u->w (i.e. LAB2FF) frame for veclab^ , then apply Lambda ^ veclab^nu = vecff^ All this assumes iLambda was formed from matrix_inverse() that gives inverse transpose

Definition at line 565 of file tetrad.c.

int calc_ortho_boost_uu ( FTYPE wcon,
FTYPE ucon,
FTYPE(*)  lambda[NDIM] 
)

calculate boost assuming in orthonormal basis where g_{}={} = diag(-1,0,0,0) NOTEMARK: Orthonormal does not mean in Cartesian coordinates! If metric was originally in SPC Mink or SPC KS, then final metric is diag(-1,0,0,0) but is still SPC.

Have to do SPC->Cart conversion (see, e.g., jon_interp stuff) to get to Cartesian.

Definition at line 594 of file tetrad.c.

Here is the caller graph for this function:

int calc_ORTHOes ( int  primcoord,
struct of_geom ptrgeom,
FTYPE  tmuup[][NDIM],
FTYPE  tmudn[][NDIM] 
)

Notes:

dxdxp = dV^i/dX^k = ^i_k idxdxp = inverse and tranpose of dxdxp = dX^k/dV^i = (iLambda)^k_i Tetrcon_k^j [first index ortho, second index lab] Tetrcov^k_j [first index ortho, second index lab (i.e. not transposed!)]

calculates base vectors and 1-forms of ORTHO to transform lab <–> ORTHO primcoord: 0 = false 1 = true, then probably want to remove known dxdxp that twisted-up the coordinates tmuup : LAB2ORTHO tmudn : ORTHO2LAB

Definition at line 390 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int compute_tetrcon_frommetric ( FTYPE(*)  generalmatrix[NDIM],
FTYPE(*)  tetrcon[NDIM],
FTYPE  eigenvalues[] 
)
static

Definition at line 149 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int compute_tetrcon_frommetric_mathematica ( FTYPE(*)  generalmatrix[NDIM],
FTYPE(*)  tetrcon[NDIM],
FTYPE  eigenvalues[] 
)
static

compute orthonormal tetrad [ortho]^[lab] for converting u_[lab] or u^[ortho] Notes: For full rotating BH with g_{r}=0 (i.e.

use dxdxp first), result can be found analytically: See: simple_eigensystem_nonrotbh.nb http://en.wikipedia.org/wiki/Cubic_equation However, Orthogonalization is quite involved, so probably simpler to do full numerical solution Issue always: order of system being out-of-order compared to input order

Definition at line 315 of file tetrad.c.

Here is the caller graph for this function:

int cubicroots ( FTYPE  a,
FTYPE  b,
FTYPE  c,
FTYPE  d,
FTYPE roots 
)

http://en.wikipedia.org/wiki/Cubic_function (but not good if need to use all real numbers) a x^3 + b c^2 + c x + d = 0

Definition at line 1084 of file tetrad.c.

int genes ( FTYPE gcov[4],
FTYPE evec[4],
FTYPE eval 
)

compute the semi-general eigensystem for a pretty general metric.

Definition at line 1112 of file tetrad.c.

Here is the call graph for this function:

int genortho ( FTYPE vec1,
FTYPE vec2,
FTYPE vec3,
FTYPE vec4,
FTYPE ovec1,
FTYPE ovec2,
FTYPE ovec3,
FTYPE ovec4 
)

compute the general orthonormal version of 4 vectors (that should be from eigensystem)

Definition at line 1122 of file tetrad.c.

int get_tetrcovcon ( int  primcoord,
struct of_geom ptrgeom,
FTYPE(**)  tetrcov[NDIM],
FTYPE(**)  tetrcon[NDIM] 
)

get stored or compute tetrcov and tetrcon primcoord: whether PRIMCOORDS type, so will use dxdxp to simplify matching to get tetrad

Definition at line 462 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

FTYPE Root ( FTYPE  a,
FTYPE  b,
FTYPE  c,
FTYPE  d,
FTYPE roots,
int *  numroots 
)

http://stackoverflow.com/questions/12449079/roots-of-cubic-using-c-and-gsl http://en.wikipedia.org/wiki/Cubic_function (but not good if need to use all real numbers) a x^3 + b c^2 + c x + d = 0

Definition at line 1059 of file tetrad.c.

Here is the caller graph for this function:

int tensor_lab2orthofluidorback ( int  primcoord,
int  lab2orthofluid,
struct of_geom ptrgeom,
int  uconcovtype,
FTYPE uconcov,
int  tconcovtypeA,
int  tconcovtypeB,
FTYPE(*)  tensor4in[NDIM],
FTYPE(*)  tensor4out[NDIM] 
)

convert lab frame 4-tensor to fluid frame orthonormal 4-tensor

lab2orthofluid: LAB2FF : lab2orthofluid FF2LAB: orthofluid 2 lab uconcovtype: TYPEUCON=uconcov is ucon or TYPEUCOV=uconcov is ucov for fluid 4-velocity uconcov is in lab-frame as 4-vector of fluid tconcovtypeA: for 1st index of tensor: TYPEUCON=tconcov is con or TYPEUCOV=tconcov is cov tconcovtypeB: for 2nd index of tensor: TYPEUCON=tconcov is con or TYPEUCOV=tconcov is cov tensor4in : input lab-frame as 4-tensor tensor4out is returned orthonormal fluid frame 4-tensor (same tconcovtypeA and tconcovtypeB as tensor4in) NOTEMARK: If insert uconcov as ZAMO, then no boost, so can then use this for just lab2ortho and back

Definition at line 907 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int tetlapack_func_prec ( FTYPE(*)  metr[NDIM],
FTYPE(*)  tetr[NDIM],
FTYPE  eigenvalues[] 
)
static

pre-setup tetrad use of lapack function

Definition at line 56 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int tetr_func ( int  inputtype,
FTYPE gcov,
FTYPE(*)  tetr_cov[NDIM],
FTYPE(*)  tetr_con[NDIM],
FTYPE  eigenvalues[] 
)

input gcov and get out orthonormal tetrad in covariant and contravariant forms if metrictype, assume gcov is inputted as simplest as user could (e.g.

using dxdxp's)

Definition at line 80 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int tetr_func_frommetric ( int  primcoord,
FTYPE(*)  dxdxp[NDIM],
FTYPE gcov,
FTYPE(*)  tetrcov[NDIM],
FTYPE(*)  tetrcon[NDIM],
FTYPE  eigenvalues[] 
)

find suitable orthonormal tetrad wrapper for tetr_func().

This converts metric using dxdxp so likely simpler form easier to match mathematica version with

Definition at line 18 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int transboost_lab2fluid ( int  lab2orthofluid,
int  primcoord,
struct of_geom ptrgeom,
FTYPE uconlab,
FTYPE(*)  transboostup[NDIM],
FTYPE(*)  transboostlo[NDIM] 
)

use lab frame contravariant 4-velocity (uconlab) and get transformation matrix for going to orthonormal basis (same base coordinate system: e.g.

SPC, does not convert to Cartesian) or back NOTEMARK: If set uconlab=uconZAMO, then no boost and just does Xlab2Vortho

Definition at line 626 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int vector_harm2orthofluidorback ( int  whichvector,
int  harm2orthofluid,
struct of_geom ptrgeom,
int  uconcovtype,
FTYPE uconcov,
FTYPE  v4concovtype,
FTYPE vector4in,
FTYPE vector4out 
)

Wrapper for vector_lab2orthofluidorback()

Correct for HARM tensor quantities that have implicit component set to (e.g.) t, which makes it ambiguous what frame that was measured in.

whichvector:

TYPEUCOV : T^t_ type, so that T^t_ = -[E_]/(-) = -[- T^] /(-) . So that E_t is negative definite in Minkowski. T^{t} type, so that T^{t} = -[E^]/(-) = -[- T^{}]/(-) . So that E^t is positive definite in Minkowski.

TYPEUCON: B^i = *F^{it} type, so that B^i = *F^{it}[HARMLAB] = -[B^]/(-) = -[ *F^{}]/(-) B_i = *F_i^t type , so that B_i = *F_i^t[HARMLAB] = -[B_]/(-) = -[ *F^] /(-) primcoord=1 assumed because if "harm" then assuming PRIMCOORD coordinates that used dxdxp

Definition at line 764 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int vector_lab2orthofluidorback ( int  primcoord,
int  lab2orthofluid,
struct of_geom ptrgeom,
int  uconcovtype,
FTYPE uconcov,
FTYPE  v4concovtype,
FTYPE vector4in,
FTYPE vector4out 
)

convert 4-vector to/from lab-frame coordinate basis to fluid frame orthonormal basis

lab2orthofluid : LAB2FF = then vector4 is lab and vector4out is fluid ortho. FF2LAB = orthofluid 2 lab uconcovtype: TYPEUCON=uconcov is ucon or TYPEUCOV=uconcov is ucov for fluid 4-velocity uconcov is in lab-frame as 4-vector of fluid v4concovtype: TYPEUCON=vector4 is ucon or TYPEUCOV=vector4 is ucov for 4-vector to transform vector4in : inserted 4-vector to transform vector4out : returned orthonormal fluid frame 4-vector (returned as same concov as input vector4in) NOTEMARK: If insert uconcov as ZAMO, then no boost, so can then use this for just lab2ortho and back NOTES: 1) "Lab" corresponds to value of uconcov in = (-,0,0,0) frame. 2) "HARMLAB" corresponds to "frame" used by harm. E.g. = - u^ / E_[harm] = - T^/ [MA or EM or RAD] B^[harm] = + *F^{}/ [i.e. B^i [lab] = *F^{it} is our choice of sign for the magnetic field] [[Note these are without {-g}]]

Definition at line 840 of file tetrad.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void vecX2vecVortho ( int  concovtype,
struct of_geom ptrgeom,
FTYPE veclab,
FTYPE vecortho 
)

Use as, e.g.

: FTYPE vecvortho[NDIM]; concovtype=1; // contravariant input in vec[0-3] vecX2vecVortho(concovtype, vecv, vecvortho);

converts contravariant (concovtype=1 using tetrcov) or covariant (concovtype=2 using tetrcon) X-based vector into orthonormal V-based vector no boost here!

Definition at line 1003 of file tetrad.c.

Here is the call graph for this function:

Variable Documentation

int globalii

Definition at line 8 of file tetrad.c.

int globaljj

Definition at line 8 of file tetrad.c.

int globalkk

Definition at line 8 of file tetrad.c.