74 Ahf2d(
int ntheta_in,
int nphi_in,
double hini_in,
double var_in,
double fac_in,
75 double err_p_in,
double err_e_in,
int ahloop_in,
Fmv0 *fm_in);
92 int find_ah(
double *ah_mass =
nullptr,
double *ah_spin =
nullptr);
144 double**
matrix2d(
long nrl,
long nrh,
long ncl,
long nch);
151 double D1th(
double **f,
int i,
int j);
153 double D1ph(
double **f,
int i,
int j);
Implements a 2D Apparent Horizon Finder.
Definition ahf2d_d.h:27
double fac
Mixing factor for updating horizon radius guess during iteration.
Definition ahf2d_d.h:43
double D1ph(double **f, int i, int j)
Calculates the phi derivative of a 2D AHF grid function.
~Ahf2d()
Destructor for the Ahf2d class. Frees allocated memory.
Ahf2d(int ntheta_in, int nphi_in, double hini_in, double var_in, double fac_in, double err_p_in, double err_e_in, int ahloop_in, Fmv0 *fm_in)
Constructor for the Ahf2d class.
int find_ah(double *ah_mass=nullptr, double *ah_spin=nullptr)
Main function to find the apparent horizon.
int solve_elliptic(double **source, double **solution)
Solves the elliptic (Poisson-like) equation arising in the iteration.
double ** ths
Expansion Theta(theta, phi).
Definition ahf2d_d.h:55
double hini
Initial guess for the horizon radius (coordinate radius).
Definition ahf2d_d.h:39
double err_p
Tolerance for the Poisson solver part.
Definition ahf2d_d.h:45
double ** matrix2d(long nrl, long nrh, long ncl, long nch)
Allocates memory for a 2D AHF grid array.
Fmv0 * fm
Pointer to the Fmv0/Fmv object containing the spacetime grid data.
Definition ahf2d_d.h:59
double err_e
Tolerance for the main AH equation solver part.
Definition ahf2d_d.h:47
double interpolate_to_ah(double ***f, double r, double th, double ph)
Interpolates a spacetime grid function from the Cartesian grid to a point on the AH surface.
int ntheta
Number of grid points in theta direction (excluding buffers).
Definition ahf2d_d.h:31
double var
Acceleration parameter eta for the elliptic solver. Also distinguishes AH/CH.
Definition ahf2d_d.h:41
void free_matrix2d(double **m, long nrl, long nrh, long ncl, long nch)
Frees memory allocated by matrix2d().
int ahloop
Maximum number of iterations allowed for the solver.
Definition ahf2d_d.h:49
double dth
Grid spacing in theta.
Definition ahf2d_d.h:35
double calculate_ah_mass()
Calculates the irreducible mass of the found horizon.
void calc_expansion()
Calculates the expansion Theta at all points on the AHF grid.
void print_horizon_shape(const char *filename, double t)
Prints the current horizon shape h(theta, phi) to a file.
double ** h
Horizon shape function h(theta, phi).
Definition ahf2d_d.h:53
double calculate_ah_spin()
Calculates the dimensionless spin of the found horizon.
double D1th(double **f, int i, int j)
Calculates the theta derivative of a 2D AHF grid function.
int nphi
Number of grid points in phi direction (excluding buffers).
Definition ahf2d_d.h:33
double dphi
Grid spacing in phi.
Definition ahf2d_d.h:37
Base class for Finite Mesh Variables version 0.
Definition cosmos_d.h:47