def add_to_Cfunction_dict__find_timestep(rel_path_to_Cparams=os.path.join('./'), enable_mask=False, output_dt_local_h_only=False, use_unit_wavespeed=False):
    gridsuffix = ''
    desc = 'Find the CFL-constrained timestep'
    c_type = 'REAL'
    name = ('find_timestep' + gridsuffix)
    preloop = '    REAL dsmin = 1e38; // Start with a crazy high value... close to the largest number in single precision.'
    loopopts = 'InteriorPoints,Read_xxs,DisableOpenMP'
    if (gridsuffix != ''):
        loopopts += (',' + gridsuffix)
    params = 'const paramstruct *restrict params, REAL *restrict xx[3], const REAL CFL_FACTOR'
    if enable_mask:
        params += ', int8_t *restrict mask'
    if output_dt_local_h_only:
        ds_drn = ds_dirn(gri.dxx, append_gridsuffix_to_xx=True)
    else:
        ds_drn = ds_dirn(gri.dxx, append_gridsuffix_to_xx=False)
    ds_dirn_h = outputC([ds_drn[0], ds_drn[1], ds_drn[2]], ['ds_dirn0', 'ds_dirn1', 'ds_dirn2'], 'returnstring').replace('dxx0', ('dxx0' + gridsuffix)).replace('dxx1', ('dxx1' + gridsuffix)).replace('dxx2', ('dxx2' + gridsuffix))
    body = (('REAL ds_dirn0, ds_dirn1, ds_dirn2;\n' + ds_dirn_h) + '\n#ifndef MIN\n#define MIN(A, B) ( ((A) < (B)) ? (A) : (B) )\n#endif\n')
    indent = ''
    if enable_mask:
        body += (('if(mask[IDX3S' + gridsuffix) + '(i0,i1,i2)] >= 0) {\n')
        indent = '    '
    if (not output_dt_local_h_only):
        body += (indent + '// Set dsmin = MIN(dsmin, ds_dirn0, ds_dirn1, ds_dirn2):\n')
        body += (indent + 'dsmin = MIN(dsmin, MIN(ds_dirn0, MIN(ds_dirn1, ds_dirn2)));\n')
    else:
        body += (((indent + '// Set dt_local[') + gridsuffix.replace('_grid', '')) + '] = MIN(ds_dirn0, ds_dirn1, ds_dirn2) * CFL_FACTOR/wavespeed :\n')
        body += (((indent + 'dt_local[') + gridsuffix.replace('_grid', '')) + '] = MIN(ds_dirn0, MIN(ds_dirn1, ds_dirn2)) * CFL_FACTOR/wavespeed;\n')
        if use_unit_wavespeed:
            body = body.replace('wavespeed', '1.0')
    if enable_mask:
        body += '}\n'
    if output_dt_local_h_only:
        return body.replace('ds_dirn0', ('ds_dirn0' + gridsuffix)).replace('ds_dirn1', ('ds_dirn1' + gridsuffix)).replace('ds_dirn2', ('ds_dirn2' + gridsuffix))
    postloop = '    return dsmin*CFL_FACTOR/wavespeed;\n'
    if use_unit_wavespeed:
        postloop = postloop.replace('wavespeed', '1.0')
    add_to_Cfunction_dict(includes=[os.path.join(rel_path_to_Cparams, 'NRPy_basic_defines.h')], desc=desc, c_type=c_type, name=name, params=params, preloop=preloop, body=body, loopopts=loopopts, postloop=postloop, rel_path_to_Cparams=rel_path_to_Cparams)
def add_to_Cfunction_dict__find_timestep(rel_path_to_Cparams=os.path.join('./'), enable_mask=False, output_dt_local_h_only=False, use_unit_wavespeed=False):
    gridsuffix = 
    desc = 'Find the CFL-constrained timestep'
    c_type = 'REAL'
    name = ('find_timestep' + gridsuffix)
    preloop = '    REAL dsmin = 1e38; // Start with a crazy high value... close to the largest number in single precision.'
    loopopts = 'InteriorPoints,Read_xxs,DisableOpenMP'
    if (gridsuffix != ):
        loopopts += (',' + gridsuffix)
    params = 'const paramstruct *restrict params, REAL *restrict xx[3], const REAL CFL_FACTOR'
    if enable_mask:
        params += ', int8_t *restrict mask'
    if output_dt_local_h_only:
        ds_drn = ds_dirn(gri.dxx, append_gridsuffix_to_xx=True)
    else:
        ds_drn = ds_dirn(gri.dxx, append_gridsuffix_to_xx=False)
    ds_dirn_h = outputC([ds_drn[0], ds_drn[1], ds_drn[2]], ['ds_dirn0', 'ds_dirn1', 'ds_dirn2'], 'returnstring').replace('dxx0', ('dxx0' + gridsuffix)).replace('dxx1', ('dxx1' + gridsuffix)).replace('dxx2', ('dxx2' + gridsuffix))
    body = (('REAL ds_dirn0, ds_dirn1, ds_dirn2;\n' + ds_dirn_h) + '\n#ifndef MIN\n#define MIN(A, B) ( ((A) < (B)) ? (A) : (B) )\n#endif\n')
    indent = 
    if enable_mask:
        body += (('if(mask[IDX3S' + gridsuffix) + '(i0,i1,i2)] >= 0) {\n')
        indent = '    '
    if (not output_dt_local_h_only):
        body += (indent + '// Set dsmin = MIN(dsmin, ds_dirn0, ds_dirn1, ds_dirn2):\n')
        body += (indent + 'dsmin = MIN(dsmin, MIN(ds_dirn0, MIN(ds_dirn1, ds_dirn2)));\n')
    else:
        body += (((indent + '// Set dt_local[') + gridsuffix.replace('_grid', )) + '] = MIN(ds_dirn0, ds_dirn1, ds_dirn2) * CFL_FACTOR/wavespeed :\n')
        body += (((indent + 'dt_local[') + gridsuffix.replace('_grid', )) + '] = MIN(ds_dirn0, MIN(ds_dirn1, ds_dirn2)) * CFL_FACTOR/wavespeed;\n')
        if use_unit_wavespeed:
            body = body.replace('wavespeed', '1.0')
    if enable_mask:
        body += '}\n'
    if output_dt_local_h_only:
        return body.replace('ds_dirn0', ('ds_dirn0' + gridsuffix)).replace('ds_dirn1', ('ds_dirn1' + gridsuffix)).replace('ds_dirn2', ('ds_dirn2' + gridsuffix))
    postloop = '    return dsmin*CFL_FACTOR/wavespeed;\n'
    if use_unit_wavespeed:
        postloop = postloop.replace('wavespeed', '1.0')
    add_to_Cfunction_dict(includes=[os.path.join(rel_path_to_Cparams, 'NRPy_basic_defines.h')], desc=desc, c_type=c_type, name=name, params=params, preloop=preloop, body=body, loopopts=loopopts, postloop=postloop, rel_path_to_Cparams=rel_path_to_Cparams)