COSMOS
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Fmv0 Class Reference

Base class for Finite Mesh Variables version 0. More...

#include <cosmos_d.h>

Inheritance diagram for Fmv0:
Inheritance graph
Collaboration diagram for Fmv0:
Collaboration graph

Public Member Functions

 Fmv0 (int tabs, int jupper, int jlower, int kupper, int klower, int lupper, int llower, double xupper, double xlower, double yupper, double ylower, double zupper, double zlower, double cfl_in, double etaa_in, double etab_in, double etabb_in, double KOep_in, int exg_in, double Hb_in, double fluidw_in, double kap_MUSCL_in, double b_minmod_in, double amp_in)
 Constructor for the Fmv0 class.
 
virtual ~Fmv0 ()
 Destructor for the Fmv0 class. Frees allocated memory.
 
virtual void rhs (double dt, double t)
 Calculates the right-hand sides (RHS) of the BSSN evolution equations.
 
void KOdiss (double ***q, double ***f)
 Applies Kreiss-Oliger numerical dissipation to evolved variables.
 
double funcf (double x)
 Coordinate mapping function from logical coordinate (e.g., j*dx) to physical coordinate.
 
double df (double x)
 First derivative of the coordinate mapping function funcf.
 
double ddf (double x)
 Second derivative of the coordinate mapping function funcf.
 
double dddf (double x)
 Third derivative of the coordinate mapping function funcf.
 
int get_tab () const
 Get the number of buffer zones.
 
double get_cfl () const
 Get the CFL factor.
 
bool get_fluidevo () const
 Check if fluid evolution is enabled (based on fluidw perhaps).
 
int & set_bflag (int l, int k, int j)
 Set the boundary flag at a specific grid point. Returns a reference.
 
int get_bflag (int l, int k, int j) const
 Get the boundary flag at a specific grid point.
 
double *** matrix (long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
 Allocates memory for a 3D grid function array.
 
void free_matrix (double ***m, long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
 Frees memory allocated by matrix().
 

Public Attributes

int tab
 Number of buffer/ghost zones.
 
int jmin
 Minimum physical grid index in x.
 
int jmax
 Maximum physical grid index in x.
 
double xmin
 Minimum coordinate value in x.
 
double xmax
 Maximum coordinate value in x.
 
double dx
 Grid spacing in x (uniform logical grid).
 
double cfl
 CFL factor for time step calculation.
 
double etaa
 Gauge parameter eta for 1+log lapse.
 
double etab
 Gauge parameter eta for Gamma-driver shift.
 
double etabb
 Gauge parameter eta_b (or similar) for Gamma-driver shift.
 
double KOep
 Kreiss-Oliger dissipation coefficient epsilon.
 
double Hb
 Initial Hubble parameter.
 
double fluidw
 Fluid equation of state parameter w (if fluid enabled).
 
double kap_MUSCL
 MUSCL reconstruction parameter kappa (if fluid enabled).
 
double b_minmod
 Minmod limiter parameter b (if fluid enabled).
 
int exg
 Grid size for excision region (if enabled).
 
double tmax
 Maximum simulation time.
 
double amp
 Grid stretching parameter for coordinate mapping.
 
double *** alp
 Pointer to the lapse function grid data.
 
double *** betax
 Pointer to the shift vector component beta^x grid data.
 

Protected Member Functions

double D1x (double ***f, int l, int k, int j)
 Calculates spatial derivatives (e.g., first derivative in x).
 
void calculate_christoffel (int l, int k, int j)
 Calculates Christoffel symbols or connection functions.
 
void calculate_ricci (int l, int k, int j)
 Calculates Ricci tensor components.
 
void calculate_matter_sources (int l, int k, int j)
 Calculates matter source terms (Stress-Energy Tensor T_munu).
 

Detailed Description

Base class for Finite Mesh Variables version 0.

Handles the fundamental grid structure, memory allocation, coordinate mapping, basic BSSN evolution steps (RHS calculation), and Kreiss-Oliger dissipation. Does not implement specific boundary conditions or mesh refinement.

Constructor & Destructor Documentation

◆ Fmv0()

Fmv0::Fmv0 ( int tabs,
int jupper,
int jlower,
int kupper,
int klower,
int lupper,
int llower,
double xupper,
double xlower,
double yupper,
double ylower,
double zupper,
double zlower,
double cfl_in,
double etaa_in,
double etab_in,
double etabb_in,
double KOep_in,
int exg_in,
double Hb_in,
double fluidw_in,
double kap_MUSCL_in,
double b_minmod_in,
double amp_in )

Constructor for the Fmv0 class.

Parameters
tabsNumber of buffer zones (ghost zones).
jupperUpper index boundary in x for the physical domain.
jlowerLower index boundary in x for the physical domain.
kupperUpper index boundary in y.
klowerLower index boundary in y.
lupperUpper index boundary in z.
llowerLower index boundary in z.
xupperUpper coordinate boundary in x.
xlowerLower coordinate boundary in x.
yupperUpper coordinate boundary in y.
ylowerLower coordinate boundary in y.
zupperUpper coordinate boundary in z.
zlowerLower coordinate boundary in z.
cfl_inCFL factor.
etaa_inGauge parameter eta for lapse.
etab_inGauge parameter eta for shift damping (B^i).
etabb_inGauge parameter eta_b for shift evolution.
KOep_inKreiss-Oliger dissipation coefficient.
exg_inExcision region grid size.
Hb_inInitial Hubble parameter.
fluidw_inFluid equation of state parameter w.
kap_MUSCL_inMUSCL kappa parameter.
b_minmod_inMinmod b parameter.
amp_inGrid stretching parameter.

◆ ~Fmv0()

virtual Fmv0::~Fmv0 ( )
virtual

Destructor for the Fmv0 class. Frees allocated memory.

Member Function Documentation

◆ calculate_christoffel()

void Fmv0::calculate_christoffel ( int l,
int k,
int j )
protected

Calculates Christoffel symbols or connection functions.

◆ calculate_matter_sources()

void Fmv0::calculate_matter_sources ( int l,
int k,
int j )
protected

Calculates matter source terms (Stress-Energy Tensor T_munu).

◆ calculate_ricci()

void Fmv0::calculate_ricci ( int l,
int k,
int j )
protected

Calculates Ricci tensor components.

◆ D1x()

double Fmv0::D1x ( double *** f,
int l,
int k,
int j )
protected

Calculates spatial derivatives (e.g., first derivative in x).

◆ dddf()

double Fmv0::dddf ( double x)

Third derivative of the coordinate mapping function funcf.

◆ ddf()

double Fmv0::ddf ( double x)

Second derivative of the coordinate mapping function funcf.

◆ df()

double Fmv0::df ( double x)

First derivative of the coordinate mapping function funcf.

◆ free_matrix()

void Fmv0::free_matrix ( double *** m,
long nrl,
long nrh,
long ncl,
long nch,
long ndl,
long ndh )

Frees memory allocated by matrix().

◆ funcf()

double Fmv0::funcf ( double x)

Coordinate mapping function from logical coordinate (e.g., j*dx) to physical coordinate.

Parameters
xLogical coordinate.
Returns
Physical coordinate.

◆ get_bflag()

int Fmv0::get_bflag ( int l,
int k,
int j ) const

Get the boundary flag at a specific grid point.

Parameters
lz-index.
ky-index.
jx-index.
Returns
Value of bflag[l-lmin][k-kmin][j-jmin].

◆ get_cfl()

double Fmv0::get_cfl ( ) const

Get the CFL factor.

◆ get_fluidevo()

bool Fmv0::get_fluidevo ( ) const

Check if fluid evolution is enabled (based on fluidw perhaps).

◆ get_tab()

int Fmv0::get_tab ( ) const

Get the number of buffer zones.

◆ KOdiss()

void Fmv0::KOdiss ( double *** q,
double *** f )

Applies Kreiss-Oliger numerical dissipation to evolved variables.

Parameters
qPointer to the grid function data array to apply dissipation to.
fPointer to the RHS array corresponding to q (dissipation added here).

◆ matrix()

double *** Fmv0::matrix ( long nrl,
long nrh,
long ncl,
long nch,
long ndl,
long ndh )

Allocates memory for a 3D grid function array.

◆ rhs()

virtual void Fmv0::rhs ( double dt,
double t )
virtual

Calculates the right-hand sides (RHS) of the BSSN evolution equations.

Parameters
dtCurrent time step size (may be needed for some terms).
tCurrent simulation time.
Note
This is typically the most complex function, calculating spatial derivatives and combining terms for each evolved variable.
Warning
Ensure boundary conditions are applied before calling this for points needing boundary data.

◆ set_bflag()

int & Fmv0::set_bflag ( int l,
int k,
int j )

Set the boundary flag at a specific grid point. Returns a reference.

Parameters
lz-index.
ky-index.
jx-index.
Returns
Reference to bflag[l-lmin][k-kmin][j-jmin].

Member Data Documentation

◆ alp

double*** Fmv0::alp

Pointer to the lapse function grid data.

◆ amp

double Fmv0::amp

Grid stretching parameter for coordinate mapping.

◆ b_minmod

double Fmv0::b_minmod

Minmod limiter parameter b (if fluid enabled).

◆ betax

double*** Fmv0::betax

Pointer to the shift vector component beta^x grid data.

◆ cfl

double Fmv0::cfl

CFL factor for time step calculation.

◆ dx

double Fmv0::dx

Grid spacing in x (uniform logical grid).

◆ etaa

double Fmv0::etaa

Gauge parameter eta for 1+log lapse.

◆ etab

double Fmv0::etab

Gauge parameter eta for Gamma-driver shift.

◆ etabb

double Fmv0::etabb

Gauge parameter eta_b (or similar) for Gamma-driver shift.

◆ exg

int Fmv0::exg

Grid size for excision region (if enabled).

◆ fluidw

double Fmv0::fluidw

Fluid equation of state parameter w (if fluid enabled).

◆ Hb

double Fmv0::Hb

Initial Hubble parameter.

◆ jmax

int Fmv0::jmax

Maximum physical grid index in x.

◆ jmin

int Fmv0::jmin

Minimum physical grid index in x.

◆ kap_MUSCL

double Fmv0::kap_MUSCL

MUSCL reconstruction parameter kappa (if fluid enabled).

◆ KOep

double Fmv0::KOep

Kreiss-Oliger dissipation coefficient epsilon.

◆ tab

int Fmv0::tab

Number of buffer/ghost zones.

◆ tmax

double Fmv0::tmax

Maximum simulation time.

◆ xmax

double Fmv0::xmax

Maximum coordinate value in x.

◆ xmin

double Fmv0::xmin

Minimum coordinate value in x.


The documentation for this class was generated from the following file: