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

Derived class from Fmv0, implementing Fixed Mesh Refinement (FMR). More...

#include <cosmos_d.h>

Inheritance diagram for Fmv1:
Inheritance graph
Collaboration diagram for Fmv1:
Collaboration graph

Public Member Functions

 Fmv1 (int laymax_in, int *jbs_in, int *kbs_in, int *lbs_in, double *alp_fmr_in)
 Constructor for the Fmv1 class (FMR manager).
 
virtual ~Fmv1 ()
 Destructor for the Fmv1 class. Deallocates levels.
 
void evolution (double dt, double t)
 Performs one full evolution step across all refinement levels.
 
void check_refinement_trigger (double t)
 Checks if new refinement levels need to be created based on triggers.
 
void create_refinement_level (int level)
 Creates a new refinement level.
 
void prolongate (int coarse_level, int fine_level)
 Interpolates data from a coarser level to a finer level (Prolongation).
 
void restrict (int fine_level, int coarse_level)
 Averages data from a finer level to a coarser level (Restriction).
 
- Public Member Functions inherited from 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.
 
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 laymax
 Maximum number of refinement levels.
 
Fmv0 ** fmv
 Array of pointers to Fmv0/Fmv objects representing each refinement level.
 
int * jbs
 Array storing x-boundary indices for refinement regions on coarser levels.
 
int * kbs
 Array storing y-boundary indices for refinement regions on coarser levels.
 
int * lbs
 Array storing z-boundary indices for refinement regions on coarser levels.
 
double * alp_fmr
 Array storing lapse threshold values for triggering refinement.
 
- Public Attributes inherited from Fmv0
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.
 

Additional Inherited Members

- Protected Member Functions inherited from Fmv0
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

Derived class from Fmv0, implementing Fixed Mesh Refinement (FMR).

Manages multiple refinement levels, interpolation between levels, and potentially modified evolution steps considering refinement boundaries.

Note
This class structure might be significantly more complex depending on the FMR implementation details (e.g., using pointers to Fmv0/Fmv objects for each level). The documentation below is a basic placeholder.

Constructor & Destructor Documentation

◆ Fmv1()

Fmv1::Fmv1 ( int laymax_in,
int * jbs_in,
int * kbs_in,
int * lbs_in,
double * alp_fmr_in )

Constructor for the Fmv1 class (FMR manager).

Parameters
laymax_inMaximum number of refinement levels.
jbs_inArray of x-boundary indices.
kbs_inArray of y-boundary indices.
lbs_inArray of z-boundary indices.
alp_fmr_inArray of lapse trigger thresholds.
[in]base_paramsParameters needed to construct the base level (level 0), likely similar to Fmv0/Fmv constructor.

◆ ~Fmv1()

virtual Fmv1::~Fmv1 ( )
virtual

Destructor for the Fmv1 class. Deallocates levels.

Member Function Documentation

◆ check_refinement_trigger()

void Fmv1::check_refinement_trigger ( double t)

Checks if new refinement levels need to be created based on triggers.

Parameters
tCurrent simulation time.

◆ create_refinement_level()

void Fmv1::create_refinement_level ( int level)

Creates a new refinement level.

Parameters
levelIndex of the new level to create.

◆ evolution()

void Fmv1::evolution ( double dt,
double t )

Performs one full evolution step across all refinement levels.

Handles Runge-Kutta steps, boundary conditions, inter-level interpolation (prolongation/restriction), and potentially checks for creating new refinement levels.

Parameters
dtCurrent time step size for the finest level.
tCurrent simulation time.

◆ prolongate()

void Fmv1::prolongate ( int coarse_level,
int fine_level )

Interpolates data from a coarser level to a finer level (Prolongation).

Parameters
coarse_levelIndex of the coarser level.
fine_levelIndex of the finer level.

◆ restrict()

void Fmv1::restrict ( int fine_level,
int coarse_level )

Averages data from a finer level to a coarser level (Restriction).

Parameters
fine_levelIndex of the finer level.
coarse_levelIndex of the coarser level.

Member Data Documentation

◆ alp_fmr

double* Fmv1::alp_fmr

Array storing lapse threshold values for triggering refinement.

◆ fmv

Fmv0** Fmv1::fmv

Array of pointers to Fmv0/Fmv objects representing each refinement level.

◆ jbs

int* Fmv1::jbs

Array storing x-boundary indices for refinement regions on coarser levels.

◆ kbs

int* Fmv1::kbs

Array storing y-boundary indices for refinement regions on coarser levels.

◆ laymax

int Fmv1::laymax

Maximum number of refinement levels.

◆ lbs

int* Fmv1::lbs

Array storing z-boundary indices for refinement regions on coarser levels.


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