#PBS -S /bin/bash
#PBS -N rotor_in_hover_curv_connectivity
#PBS -l select=1:ncpus=40:mpiprocs=2:model=sky_ele
#PBS -l walltime=02:00:00
#PBS -j oe
#PBS -W group_list=<enter_group_id>
#PBS -q normal

cd $PBS_O_WORKDIR

# Unset INTEL endian-ness
export F_UFMTENDIAN

# Load required modules
module purge
module use /swbuild/LAVA/LAVA_modules
module load LAVA

# Export number of threads (ncpus)
export OMP_NUM_THREADS=40

# Create connectivity directory
mkdir -p connectivity
cd $PBS_O_WORKDIR/connectivity

# Symbolically link required files
ln -sf ../meshes/grid.x
ln -sf ../meshes/grid.bc
ln -sf ../meshes/grid.b2b
ln -sf ../input/connectivity.yaml

# Run connectivity (serial for deterministic results)
mbind.x -t 40 lavacurv.3D.NS1.AVX2 connectivity.yaml | tee connectivity.out
