next up previous contents
Next: Boundary condition selection Up: The generic boundary interface Previous: The generic boundary interface   Contents


Boundary condition registration

To register a routine to provide some physical boundary condition, use

Boundary_RegisterPhysicalBC(CCTK_POINTER cctkGH, 
                            phys_bc_fn_ptr function_pointer, 
                            CCTK_STRING bc_name)
where

cctkGH 		 pointer to the grid hierarchy

function_pointer pointer to the function providing theboundary condition
bc_name name of boundary condition
The function pointer takes arguments
(CCTK_POINTER cctkGH, CCTK_INT num_vars, CCTK_INT *var_indices, 
 CCTK_INT *faces, CCTK_INT *widths, CCTK_INT *table_handles)
(this defines the type phys_bc_fn_ptr, above) where

cctkGH 		 pointer to the grid hierarchy

num_vars number of entries passed in the following three arrays
var_indices array of num_vars variable indices selected for this boundary condition
faces array of num_vars faces specifications(see section A1.3.4)
widths array of num_vars boundary widths (see below)
table_handles array of num_vars table handles
The table handles hold extra arguments for each application of the boundary condition. The four arrays are sorted first on table handle, and then on variable index. This way variables which have precisely the same boundary condition are grouped together, and within this grouping variables are sorted by index, so that variable groups are stored together. In many cases this sorting will allow a more efficient implementation of the boundary condition. (At the moment it is not clear how face information should be considered in the sorting, so it is not.) A null pointer can be passed for function_pointer, in which case no routine is executed when Boundary_ApplyPhysicalBCs is called (see section A1.3.3).


next up previous contents
Next: Boundary condition selection Up: The generic boundary interface Previous: The generic boundary interface   Contents