from snek5000 import ensure_env, get_snek_resource
from snek5000_tgv import short_name, Output


configfile: "config_simul.yml"


ensure_env()

# Necessary to pass configuration to other Snakemake modules
Output.update_snakemake_config(config, short_name)


# default rule
rule all:
    input:
        "nek5000",


# shorthand for mesh
rule mesh:
    input:
        f"{short_name}.re2",
        f"{short_name}.ma2",


# compiler and run rules
# ======================
module compiler:
    snakefile:
        get_snek_resource("compiler.smk")
    config:
        config


use rule * from compiler


# I/O rules
# =========
module io:
    snakefile:
        get_snek_resource("io.smk")
    config:
        config


use rule * from io


# internal rules
# ==============
module internal:
    snakefile:
        get_snek_resource("internal.smk")
    config:
        config


use rule * from internal as internal_*
