#!/usr/bin/env python2 from math import * import sys import re from string import Template from subprocess import call import os ########################### # Outer boundary outer_boundary = 5120. ########################### # Resolution # The resolutions increase in steps of 1.25, a constant factor, # which should make it easy to perform a convergence study. # The resolution is set by setting directly dx on the coarsest level. # The values [12.8, 10.24, 8.192] result in resolutions of # [0.2, 0.16, 0.128] on level 6 try: resolution = str("@RESOLUTION@") except: resolution = "mid" if resolution == "@"+"RESOLUTION"+"@": resolution = "mid" if resolution=="mid": dx = 12.8 elif resolution=="high": dx = 10.24 elif resolution=="fine": dx = 8.192 else: print("Unknown RESOLUTION keyword") sys.exit() ########################### # CIDRFILE try : cidr_file = str("@CIDRF@") except : cidr_file = "nosuchthing" if cidr_file == "@"+"CIDRF"+"@": cidr_file = "nosuchthing" ########################### # EVOLVE try : evolve = str("@EVOLVE@") except : evolve = "no" if evolve == "@"+"EVOLVE"+"@": evolve = "no" if evolve == "no": end = "iteration" elif evolve == "yes": end = "never" ########################### # betaDriver try: betaDriver = float(str("@BDRIVER@")) except: betaDriver = 1.0 if betaDriver == "@"+"BDRIVER"+"@": betaDriver = 1.0 lines = """ ActiveThorns = " ADMBase ADMCoupling ADMMacros AEILocalInterp Boundary Carpet CarpetIOASCII CarpetIOBasic CarpetIOHDF5 CarpetIOScalar CarpetInterp CarpetLib CarpetReduce CarpetRegrid2 CarpetSlab CartGrid3D Cartoon2D Constants CoordBase CoordGauge Fortran GenericFD IOUtil InitBase LoopControl ML_CCZ4 ML_CCZ4_Helper MoL NaNChecker NewRad Nice ReflectionSymmetry Slab SpaceMask SphericalSurface StaticConformal SymBase SystemStatistics SystemTopology TerminationTrigger Time TimerReport TmunuBase TwoPunctures WatchDog hwloc " # ============================================================================= # General # ============================================================================= Cactus::cctk_run_title = "Cartoon BH McLachlan" Cactus::cctk_show_banners = "no" Cactus::recovery_mode = "strict" Cactus::schedule_sort_mode = "ascending" Cactus::terminate = "$end" Cactus::cctk_itlast = 0 TerminationTrigger::max_walltime = @WALLTIME_HOURS@ TerminationTrigger::on_remaining_walltime = 10 TerminationTrigger::create_termination_file = "yes" TerminationTrigger::termination_from_file = "yes" TerminationTrigger::termination_file = "../TERMINATE" TerminationTrigger::output_remtime_every_minutes = 120 TimerReport::out_every = 0 TimerReport::output_all_timers_readable = "yes" Nice::Nice_nice = 0 # ============================================================================= # Grid # ============================================================================= Grid::avoid_origin = "no" Grid::domain = "full" Grid::type = "coordbase" ReflectionSymmetry::reflection_x = "no" ReflectionSymmetry::reflection_y = "no" ReflectionSymmetry::reflection_z = "yes" ReflectionSymmetry::avoid_origin_x = "no" ReflectionSymmetry::avoid_origin_y = "no" ReflectionSymmetry::avoid_origin_z = "no" CoordBase::xmin = 0. CoordBase::xmax = +$outer_boundary CoordBase::ymin = 0. CoordBase::ymax = 0. CoordBase::zmin = 0. CoordBase::zmax = +$outer_boundary CoordBase::spacing = "gridspacing" CoordBase::dx = $dx CoordBase::dy = $dx CoordBase::dz = $dx CoordBase::boundary_size_x_lower = 3 CoordBase::boundary_size_x_upper = 3 CoordBase::boundary_shiftout_x_lower = 1 CoordBase::boundary_shiftout_x_upper = 1 CoordBase::boundary_staggered_x_lower = "no" CoordBase::boundary_staggered_x_upper = "no" CoordBase::boundary_size_y_lower = 3 CoordBase::boundary_size_y_upper = 3 CoordBase::boundary_shiftout_y_lower = 1 CoordBase::boundary_shiftout_y_upper = 1 CoordBase::boundary_staggered_y_lower = "no" CoordBase::boundary_staggered_y_upper = "no" CoordBase::boundary_size_z_lower = 3 CoordBase::boundary_size_z_upper = 3 CoordBase::boundary_shiftout_z_lower = 1 CoordBase::boundary_shiftout_z_upper = 1 CoordBase::boundary_staggered_z_lower = "no" CoordBase::boundary_staggered_z_upper = "no" Driver::ghost_size = 3 Driver::ghost_size_x = 3 Driver::ghost_size_y = 3 Driver::ghost_size_z = 3 Cartoon2D::cartoon_active = "yes" Cartoon2D::order = 3 Cartoon2D::eno_order = 3 Carpet::processor_topology = "automatic" Carpet::no_split_direction = 1 Carpet::domain_from_coordbase = "yes" InitBase::initial_data_setup_method = "init_some_levels" LoopControl::settle_after_iteration = 0 Carpet::max_refinement_levels = 7 Carpet::prolongation_order_space = 3 Carpet::prolongation_order_time = 2 CarpetLib::use_higher_order_restriction = "no" Carpet::use_buffer_zones = "no" Carpet::enable_all_storage = "no" Carpet::init_fill_timelevels = "yes" Carpet::time_refinement_factors = "[1,1,2,4,8,16,32,64,128,256,512]" Carpet::grid_coordinates_filename = "grid.carpet" CarpetLib::poison_new_memory = "yes" CarpetRegrid2::num_centres = 1 CarpetRegrid2::regrid_every = -1 CarpetRegrid2::ensure_proper_nesting = "yes" CarpetRegrid2::snap_to_coarse = "yes" CarpetRegrid2::freeze_unaligned_levels = "yes" CarpetRegrid2::freeze_unaligned_parent_levels = "yes" CarpetRegrid2::active_1 = "yes" CarpetRegrid2::num_levels_1 = 7 CarpetRegrid2::position_x_1 = 0.0 CarpetRegrid2::radius_1[1] = 512.0 CarpetRegrid2::radius_1[2] = 256.0 CarpetRegrid2::radius_1[3] = 128.0 CarpetRegrid2::radius_1[4] = 64.0 CarpetRegrid2::radius_1[5] = 32.0 CarpetRegrid2::radius_1[6] = 16.0 CarpetRegrid2::symmetry_rotating180 = "no" CarpetRegrid2::verbose = "no" Carpet::print_grid_info = "no" NaNChecker::check_every = 4096 NaNChecker::check_vars = " ADMBase::alp " NaNChecker::action_if_found = "abort" # ============================================================================= # Time integration # ============================================================================= Carpet::num_integrator_substeps = 4 MoL::ode_method = "RK4" MoL::MoL_Intermediate_Steps = 4 MoL::MoL_Num_Scratch_Levels = 1 MoL::verbose = "register" MoL::disable_prolongation = "no" Time::timestep_method = "courant_static" Time::dtfac = 0.15 # ============================================================================= # Initial data # ============================================================================= ADMBase::initial_data = "twopunctures" ADMBase::initial_lapse = "twopunctures-averaged" ADMBase::initial_shift = "zero" ADMBase::initial_dtlapse = "zero" ADMBase::initial_dtshift = "zero" TmunuBase::prolongation_type = "none" TmunuBase::stress_energy_storage = "no" TmunuBase::stress_energy_at_RHS = "no" TmunuBase::support_old_CalcTmunu_mechanism = "no" # These will give you a BH of mass 1 at the center of the domain, # not boosteed. TwoPunctures::target_M_plus = 1.0 TwoPunctures::target_M_minus = 0.0 TwoPunctures::par_b = 1 TwoPunctures::center_offset[0] = -1 TwoPunctures::par_P_plus[0] = 0 TwoPunctures::par_P_plus[1] = 0 TwoPunctures::par_P_plus[2] = 0 TwoPunctures::par_P_minus[0] = 0 TwoPunctures::par_P_minus[1] = 0 TwoPunctures::par_P_minus[2] = 0 TwoPunctures::par_S_plus[0] = 0 TwoPunctures::par_S_plus[1] = 0 TwoPunctures::par_S_plus[2] = 0 TwoPunctures::par_S_minus[0] = 0 TwoPunctures::par_S_minus[1] = 0 TwoPunctures::par_S_minus[2] = 0 TwoPunctures::npoints_A = 30 TwoPunctures::npoints_B = 30 TwoPunctures::npoints_phi = 16 TwoPunctures::grid_setup_method = "evaluation" TwoPunctures::give_bare_mass = "no" TwoPunctures::TP_epsilon = 1e-6 # ============================================================================= # Spacetime evolution # ============================================================================= ADMBase::evolution_method = "ML_CCZ4" ADMBase::lapse_evolution_method = "ML_CCZ4" ADMBase::shift_evolution_method = "ML_CCZ4" ADMBase::dtlapse_evolution_method = "ML_CCZ4" ADMBase::dtshift_evolution_method = "ML_CCZ4" ML_CCZ4::timelevels = 3 ML_CCZ4::harmonicN = 1.0 # 1+log ML_CCZ4::harmonicF = 2.0 # 1+log ML_CCZ4::alphaDriver = 0.0 # not more than 0.5 ML_CCZ4::betaDriver = $betaDriver # ~1/M (eta) ML_CCZ4::advectLapse = 1 ML_CCZ4::advectShift = 1 ML_CCZ4::evolveA = 0 ML_CCZ4::evolveB = 1 ML_CCZ4::shiftGammaCoeff = 0.75 ML_CCZ4::shiftFormulation = 0 # Gamma driver ML_CCZ4::fixAdvectionTerms = 0 ML_CCZ4::dampk1 = 0.02 ML_CCZ4::dampk2 = 0.0 ML_CCZ4::GammaShift = 0.5 ML_CCZ4::MinimumLapse = 1.0e-8 ML_CCZ4::conformalMethod = 1 # 1 for W ML_CCZ4::dt_lapse_shift_method = "noLapseShiftAdvection" ML_CCZ4::initial_boundary_condition = "extrapolate-gammas" ML_CCZ4::rhs_boundary_condition = "scalar" Boundary::radpower = 2 ML_CCZ4::fdOrder = 4 ML_CCZ4::epsDiss = 0.2 ML_CCZ4::ML_CCZ4_EvolutionAnalysisInit_calc_every = 1 ML_CCZ4::ML_CCZ4_EvolutionAnalysisInit_calc_offset = 2 ML_CCZ4::ML_CCZ4_EvolutionAnalysisInterior_calc_every = 1 ML_CCZ4::ML_CCZ4_EvolutionAnalysisInterior_calc_offset = 2 ML_CCZ4::ML_CCZ4_ConstraintsEverywhere_calc_every = 1 ML_CCZ4::ML_CCZ4_ConstraintsEverywhere_calc_offset = 2 ML_CCZ4::ML_CCZ4_ConstraintsInterior_calc_every = 1 ML_CCZ4::ML_CCZ4_ConstraintsInterior_calc_offset = 0 ML_CCZ4::ML_log_confac_bound = "none" ML_CCZ4::ML_log_confac_bound_speed = 1.0 ML_CCZ4::ML_log_confac_bound_limit = 0.0 ML_CCZ4::ML_log_confac_bound_scalar = 0.0 ML_CCZ4::ML_metric_bound = "none" ML_CCZ4::ML_metric_bound_speed = 1.0 ML_CCZ4::ML_metric_bound_limit = 0.0 ML_CCZ4::ML_metric_bound_scalar = 0.0 ML_CCZ4::ML_Gamma_bound = "none" ML_CCZ4::ML_Gamma_bound_speed = 1.0 ML_CCZ4::ML_Gamma_bound_limit = 0.0 ML_CCZ4::ML_Gamma_bound_scalar = 0.0 ML_CCZ4::ML_trace_curv_bound = "none" ML_CCZ4::ML_trace_curv_bound_speed = 1.0 ML_CCZ4::ML_trace_curv_bound_limit = 0.0 ML_CCZ4::ML_trace_curv_bound_scalar = 0.0 ML_CCZ4::ML_curv_bound = "none" ML_CCZ4::ML_curv_bound_speed = 1.0 ML_CCZ4::ML_curv_bound_limit = 0.0 ML_CCZ4::ML_curv_bound_scalar = 0.0 ML_CCZ4::ML_Theta_bound = "none" ML_CCZ4::ML_Theta_bound_speed = 1.0 ML_CCZ4::ML_Theta_bound_limit = 0.0 ML_CCZ4::ML_Theta_bound_scalar = 0.0 ML_CCZ4::ML_lapse_bound = "none" ML_CCZ4::ML_lapse_bound_speed = 1.0 ML_CCZ4::ML_lapse_bound_limit = 0.0 ML_CCZ4::ML_lapse_bound_scalar = 0.0 ML_CCZ4::ML_dtlapse_bound = "none" ML_CCZ4::ML_dtlapse_bound_speed = 1.0 ML_CCZ4::ML_dtlapse_bound_limit = 0.0 ML_CCZ4::ML_dtlapse_bound_scalar = 0.0 ML_CCZ4::ML_shift_bound = "none" ML_CCZ4::ML_shift_bound_speed = 1.0 ML_CCZ4::ML_shift_bound_limit = 0.0 ML_CCZ4::ML_shift_bound_scalar = 0.0 ML_CCZ4::ML_dtshift_bound = "none" ML_CCZ4::ML_dtshift_bound_speed = 1.0 ML_CCZ4::ML_dtshift_bound_limit = 0.0 ML_CCZ4::ML_dtshift_bound_scalar = 0.0 ML_CCZ4::phi_bound = "skip" ML_CCZ4::phi_bound_speed = 1.0 ML_CCZ4::phi_bound_limit = 0.0 ML_CCZ4::phi_bound_scalar = 0.0 ML_CCZ4::gt11_bound = "skip" ML_CCZ4::gt11_bound_speed = 1.0 ML_CCZ4::gt11_bound_limit = 0.0 ML_CCZ4::gt11_bound_scalar = 0.0 ML_CCZ4::gt12_bound = "skip" ML_CCZ4::gt12_bound_speed = 1.0 ML_CCZ4::gt12_bound_limit = 0.0 ML_CCZ4::gt12_bound_scalar = 0.0 ML_CCZ4::gt13_bound = "skip" ML_CCZ4::gt13_bound_speed = 1.0 ML_CCZ4::gt13_bound_limit = 0.0 ML_CCZ4::gt13_bound_scalar = 0.0 ML_CCZ4::gt22_bound = "skip" ML_CCZ4::gt22_bound_speed = 1.0 ML_CCZ4::gt22_bound_limit = 0.0 ML_CCZ4::gt22_bound_scalar = 0.0 ML_CCZ4::gt23_bound = "skip" ML_CCZ4::gt23_bound_speed = 1.0 ML_CCZ4::gt23_bound_limit = 0.0 ML_CCZ4::gt23_bound_scalar = 0.0 ML_CCZ4::gt33_bound = "skip" ML_CCZ4::gt33_bound_speed = 1.0 ML_CCZ4::gt33_bound_limit = 0.0 ML_CCZ4::gt33_bound_scalar = 0.0 ML_CCZ4::Xt1_bound = "skip" ML_CCZ4::Xt1_bound_speed = 1.0 ML_CCZ4::Xt1_bound_limit = 0.0 ML_CCZ4::Xt1_bound_scalar = 0.0 ML_CCZ4::Xt2_bound = "skip" ML_CCZ4::Xt2_bound_speed = 1.0 ML_CCZ4::Xt2_bound_limit = 0.0 ML_CCZ4::Xt2_bound_scalar = 0.0 ML_CCZ4::Xt3_bound = "skip" ML_CCZ4::Xt3_bound_speed = 1.0 ML_CCZ4::Xt3_bound_limit = 0.0 ML_CCZ4::Xt3_bound_scalar = 0.0 ML_CCZ4::trK_bound = "skip" ML_CCZ4::trK_bound_speed = 1.0 ML_CCZ4::trK_bound_limit = 0.0 ML_CCZ4::trK_bound_scalar = 0.0 ML_CCZ4::At11_bound = "skip" ML_CCZ4::At11_bound_speed = 1.0 ML_CCZ4::At11_bound_limit = 0.0 ML_CCZ4::At11_bound_scalar = 0.0 ML_CCZ4::At12_bound = "skip" ML_CCZ4::At12_bound_speed = 1.0 ML_CCZ4::At12_bound_limit = 0.0 ML_CCZ4::At12_bound_scalar = 0.0 ML_CCZ4::At13_bound = "skip" ML_CCZ4::At13_bound_speed = 1.0 ML_CCZ4::At13_bound_limit = 0.0 ML_CCZ4::At13_bound_scalar = 0.0 ML_CCZ4::At22_bound = "skip" ML_CCZ4::At22_bound_speed = 1.0 ML_CCZ4::At22_bound_limit = 0.0 ML_CCZ4::At22_bound_scalar = 0.0 ML_CCZ4::At23_bound = "skip" ML_CCZ4::At23_bound_speed = 1.0 ML_CCZ4::At23_bound_limit = 0.0 ML_CCZ4::At23_bound_scalar = 0.0 ML_CCZ4::At33_bound = "skip" ML_CCZ4::At33_bound_speed = 1.0 ML_CCZ4::At33_bound_limit = 0.0 ML_CCZ4::At33_bound_scalar = 0.0 ML_CCZ4::Theta_bound = "skip" ML_CCZ4::Theta_bound_speed = 1.0 ML_CCZ4::Theta_bound_limit = 0.0 ML_CCZ4::Theta_bound_scalar = 0.0 ML_CCZ4::alpha_bound = "skip" ML_CCZ4::alpha_bound_speed = 1.0 ML_CCZ4::alpha_bound_limit = 0.0 ML_CCZ4::alpha_bound_scalar = 0.0 ML_CCZ4::A_bound = "skip" ML_CCZ4::A_bound_speed = 1.0 ML_CCZ4::A_bound_limit = 0.0 ML_CCZ4::A_bound_scalar = 0.0 ML_CCZ4::beta1_bound = "skip" ML_CCZ4::beta1_bound_speed = 1.0 ML_CCZ4::beta1_bound_limit = 0.0 ML_CCZ4::beta1_bound_scalar = 0.0 ML_CCZ4::beta2_bound = "skip" ML_CCZ4::beta2_bound_speed = 1.0 ML_CCZ4::beta2_bound_limit = 0.0 ML_CCZ4::beta2_bound_scalar = 0.0 ML_CCZ4::beta3_bound = "skip" ML_CCZ4::beta3_bound_speed = 1.0 ML_CCZ4::beta3_bound_limit = 0.0 ML_CCZ4::beta3_bound_scalar = 0.0 ML_CCZ4::B1_bound = "skip" ML_CCZ4::B1_bound_speed = 1.0 ML_CCZ4::B1_bound_limit = 0.0 ML_CCZ4::B1_bound_scalar = 0.0 ML_CCZ4::B2_bound = "skip" ML_CCZ4::B2_bound_speed = 1.0 ML_CCZ4::B2_bound_limit = 0.0 ML_CCZ4::B2_bound_scalar = 0.0 ML_CCZ4::B3_bound = "skip" ML_CCZ4::B3_bound_speed = 1.0 ML_CCZ4::B3_bound_limit = 0.0 ML_CCZ4::B3_bound_scalar = 0.0 # ============================================================================= # Checkpoint # ============================================================================= CarpetIOHDF5::checkpoint = "yes" CarpetIOHDF5::use_reflevels_from_checkpoint = "yes" IOUtil::abort_on_io_errors = "yes" IOUtil::checkpoint_on_terminate = "yes" IOUtil::checkpoint_every_walltime_hours = 6. IOUtil::checkpoint_keep = 1 IOUtil::recover = "autoprobe" IOUtil::checkpoint_dir = "../checkpoints" IOUtil::recover_dir = "../checkpoints" # ============================================================================= # Output # ============================================================================= IOUtil::out_dir = "data" CarpetIOHDF5::out1D_dir = "data/out_1D" CarpetIOHDF5::out2D_dir = "data/out_2D" CarpetIOHDF5::out3D_dir = "data/out_3D" IOUtil::strict_io_parameter_check = "yes" IOUtil::parfile_write = "copy" CarpetIOScalar::one_file_per_group = "yes" CarpetIOScalar::all_reductions_in_one_file = "yes" CarpetIOASCII::one_file_per_group = "yes" CarpetIOHDF5::one_file_per_group = "yes" IO::out_single_precision = "yes" CarpetIOHDF5::output_symmetry_points = "yes" CarpetIOHDF5::output_ghost_points = "yes" CarpetIOHDF5::output_boundary_points = "yes" CarpetIOHDF5::output_buffer_points = "no" CarpetIOHDF5::compression_level = 0 CarpetIOHDF5::minimum_size_for_compression = 1000000 CarpetIOBasic::outinfo_vars = " Carpet::physical_time_per_hour ADMBase::lapse ML_CCZ4::ML_Ham " CarpetIOScalar::outscalar_reductions = " minimum maximum norm_inf norm1 norm2 " CarpetIOScalar::outscalar_vars = " ADMBase::lapse{ reductions = 'minimum' } ADMBase::shift{ reductions = 'norm_inf' } ML_CCZ4::ML_Ham{ reductions = 'norm_inf' } ML_CCZ4::ML_Mom{ reductions = 'norm_inf' } ML_CCZ4::ML_log_confac{ reductions = 'maximum minimum' } " CarpetIOASCII::out0D_vars = " Carpet::timing " CarpetIOHDF5::out1d_d = "no" CarpetIOHDF5::out1d_x = "yes" CarpetIOHDF5::out1d_y = "yes" CarpetIOHDF5::out1d_z = "yes" CarpetIOHDF5::out1d_vars = " ADMBase::lapse ADMBase::shift ADMBase::metric ADMBase::curv ML_CCZ4::ML_Ham ML_CCZ4::ML_Mom ML_CCZ4::ML_log_confac CarpetReduce::weight " CarpetIOHDF5::out2d_xy = "no" CarpetIOHDF5::out2d_xz = "yes" CarpetIOHDF5::out2d_yz = "no" CarpetIOHDF5::out2d_vars = " ADMBase::lapse ADMBase::shift ADMBase::metric ADMBase::curv ML_CCZ4::ML_Ham ML_CCZ4::ML_Mom ML_CCZ4::ML_log_confac CarpetReduce::weight " CarpetIOBasic::outinfo_every = 1024 CarpetIOScalar::outscalar_every = 256 CarpetIOASCII::out0d_every = 256 CarpetIOHDF5::out1d_every = 2048 CarpetIOHDF5::out2d_every = 1024 CarpetIOHDF5::out_every = -1 """ open(re.sub(r'(.*)\.rpar$', r'\1.par', sys.argv[0]), 'w').write(re.sub(r'\n *',r'\n',Template(Template(lines).substitute(locals())).substitute(locals())))