C API Reference
This section provides detailed documentation for the C components of NSphere, generated from source code comments using Doxygen and Breathe.
Contents:
- NSphere Core (nsphere.c)
CLEAN_EXITCLEAN_LOCAL_EXITcubeCUTOFF_FACTOR_CORED_DEFAULTCUTOFF_FACTOR_NFW_DEFAULTDEBUG_MAX_STEPSDEBUG_PARTICLE_IDFALLOFF_FACTOR_NFW_DEFAULTG_CONSTHALO_MASSHALO_MASS_NFWHIST_NBINSIF_ALL_PARTIF_DEBUGIF_DYNPSIIF_DYNRANKiminkmsec_to_kpcmyrMYBINIO_HNUM_MINI_SUBSTEPS_BOOTSTRAPPIRADIX_BITSRADIX_MASKRADIX_SIZERCRC_NFW_DEFAULTsqrVEL_CONV_SQdrhodr_func_tdrhodr_nfw_func_tpotential_function_tadd_snapshot_to_double_buffer()adjust_ntimesteps()allocate_double_precision_buffers()allocate_trajectory_buffers()append_all_particle_data_chunk_to_file()append_all_particle_ids_to_file()append_all_particle_phi_data_chunk_to_file()append_all_particle_scatter_counts_to_file()calculate_system_energies()check_and_warn_negative_fQ()check_strict_monotonicity()cleanup_all_particle_data()cleanup_trajectory_buffers()cmp_LAI()compare_pair_by_first_element()compare_partdata_by_rad()compare_particles()cored_potential_wrapper()correct_negative_fE_and_rebuild_IE()create_backup_file()crossproduct()density_derivative_om_cored()density_derivative_om_nfw()density_hernquist()df_hernquist_aniso()direct_gaussian_convolution()doAdaptiveFullLeap()doAdaptiveFullLeviCivita()doLeviCivitaLeapfrog()doMicroLeapfrog()doMicroLeviCivita()doSingleTauStepAdaptiveLeviCivita()dotproduct()double_cmp()drhodr()drhodr_hernquist()drhodr_om_hernquist()drhodr_profile_nfwcutoff()dRhoDtaufun()effective_angular_force()effective_angular_force_rho_v()errorAndExit()evaluatespline()evaluatespline_with_boundary()fEintegrand()fEintegrand_hernquist()fEintegrand_nfw()fft_gaussian_convolution()finalize_debug_energy_output()finalize_energy_diagnostics()find_last_common_complete_snapshot()find_last_processed_snapshot()find_minimum_useful_radius()flush_double_buffer_to_disk()flush_trajectory_buffers()forceLCfun()format_file_size()fprintf_bin()fprintf_bin_dbl()fscanf_bin()fscanf_bin_dbl()gaussian_convolution()generate_ics_hernquist_anisotropic()get_available_disk_space()get_deterministic_rand()get_sort_description()get_suffixed_filename()gravitational_force()gravitational_force_rho_v()handle_sidm_step()hernquist_potential_wrapper()hyperg_2F1_safe()insertion_parallel_sort()insertion_sort()insertion_sort_sub()isFloat()isInteger()load_chosen_particles()load_existing_energy_diagnostics()load_from_double_buffer()load_particles_from_restart()log_message()make_threevector()mass_integrand_hernquist()massintegrand()massintegrand_hernquist()massintegrand_profile_nfwcutoff()mix64()nfw_potential_wrapper()om_mu_integrand()parallel_radix_sort()parse_nsphere_filename()parseSaveArgs()perform_scatter_update()perform_sidm_scattering_parallel_graphcolor()perform_sidm_scattering_serial()potential_hernquist()printUsage()prompt_yes_no()Psiintegrand()quadsort_parallel_sort()quadsort_wrapper()read_initial_conditions()reassign_orig_ids_with_rank()retrieve_all_particle_phi_snapshot()retrieve_all_particle_snapshot()save_chosen_particles()sigmatotal()sort_by_rad()sort_particles()sort_particles_with_alg()sort_rr_psi_arrays()stdlib_qsort_wrapper()store_debug_approxE()store_debug_dynE_components()truncate_files_to_snapshot()verify_sort_results()write_initial_conditions()chosendbg_approxEdbg_countdbg_dynEdbg_kinEdbg_potEdbg_radiusdbg_timedebug_direct_convolutiondoReadInitdoWriteInitg_active_halo_massg_anisotropy_betag_anisotropy_beta_providedg_attempt_load_seedsg_benchmark_countg_cored_profile_halo_massg_cored_profile_rcg_cored_profile_rmax_factorg_current_best_sortg_current_timestep_scatter_countsg_cutoff_factor_paramg_cutoff_factor_param_providedg_dbl_buf_countg_dbl_buf_current_slotg_dbl_buf_Lg_dbl_buf_nptsg_dbl_buf_phig_dbl_buf_Rg_dbl_buf_Rankg_dbl_buf_Vradg_default_max_threadsg_defaultSortAlgg_density_derivative_funcg_density_derivative_nfw_funcg_doAllParticleDatag_doDebugg_doDynPsig_doDynRankg_doRestartg_doRestartForceg_doSimExtendg_doSimRestartg_doSimRestartCheckOnlyg_E_bufg_E_init_valsg_enable_loggingg_enable_sidm_scatteringg_energy_fileg_energy_snapshots_loadedg_extend_file_sourceg_falloff_factor_paramg_falloff_factor_param_providedg_file_suffixg_halo_mass_paramg_halo_mass_param_providedg_hybrid_p_coresg_initial_cond_seedg_initial_cond_seed_filename_baseg_initial_cond_seed_providedg_insertion_winsg_L_bufg_L_init_valsg_l_target_valueg_lowestL_E_bufg_lowestL_fileg_lowestL_L_bufg_lowestL_r_bufg_master_seedg_master_seed_providedg_mu_bufg_nfw_profile_falloff_factorg_nfw_profile_halo_massg_nfw_profile_rcg_nfw_profile_rmax_norm_factorg_om_aniso_factor_providedg_om_anisotropy_radiusg_om_ra_scale_factorg_particle_scatter_stateg_precalc_force_constg_profile_type_strg_profile_type_str_providedg_quadsort_winsg_radix_winsg_restart_file_overrideg_restart_initial_timestepg_restart_mode_activeg_restart_snapshots_is_countg_rngg_scale_radius_paramg_scale_radius_param_providedg_sidm_execution_modeg_sidm_kappag_sidm_kappa_providedg_sidm_max_interaction_rangeg_sidm_seedg_sidm_seed_filename_baseg_sidm_seed_providedg_single_traj_fileg_sort_call_countg_sort_columns_bufferg_sort_columns_buffer_nptsg_time_bufg_time_snapshotsg_total_Eg_total_insertion_timeg_total_KEg_total_PEg_total_quadsort_timeg_total_radix_timeg_total_sidm_scattersg_traj_fileg_trajectories_bufg_trajectory_buffer_indexg_trajectory_buffer_sizeg_use_graph_coloring_sidmg_use_hernquist_aniso_profileg_use_hernquist_numericalg_use_nfw_profileg_use_numerical_isotropicg_use_om_profileg_velocities_bufID_blockL_blockLcomparenlowestnormalizationnum_traj_particlesPARALLEL_SORT_DEFAULT_SECTIONSPARALLEL_SORT_MIN_CHUNK_SIZE_THRESHOLDPARALLEL_SORT_MIN_CORRECTNESS_OVERLAPPARALLEL_SORT_OVERLAP_DIVISORPARALLEL_SORT_SECTIONS_PER_THREADphi_blockR_blockRank_blockreadInitFilenamescatter_count_blockskip_file_writesuse_closest_to_Lcompareuse_identity_gravityVrad_blockwriteInitFilenamecored_potential_paramsfE_integrand_params_hernquist_tfE_integrand_params_NFW_tfEintegrand_paramshernquist_paramshernquist_potential_paramsLAndIndexnfw_potential_paramsom_mu_integral_paramsPartDataPsiintegrand_paramsRrPsiPairthreevector
- NSphere Sort (nsphere_sort.h)
- QuadSort (quadsort.c / quadsort.h)