from hysop.methods_keys import Scales, TimeIntegrator, Interpolation,\
    Remesh, Support, Splitting, dtCrit, SpaceDiscretisation, GhostUpdate
from hysop.numerics.integrators.runge_kutta2 import RK2 as RK2
from hysop.numerics.integrators.runge_kutta3 import RK3 as RK3
from hysop.numerics.integrators.runge_kutta4 import RK4 as RK4
from hysop.numerics.finite_differences import FD_C_4, FD_C_2
from hysop.numerics.interpolation import Linear
from hysop.f2hysop import fftw2py
from hysop.numerics.remeshing import L4_2 as rmsh

# problem dimension
dim = 3
# resolution
nb = 33
# number of ghosts in usual cartesian topo
NBGHOSTS = 2
# Adaptative timestep method
TIMESTEP_METHOD = {TimeIntegrator: RK3, SpaceDiscretisation: FD_C_4, 
                   dtCrit: 'deform'}
# Lagrangian CFL for adaptative timestep
LCFL = 0.125
# CFL (if CFL is None, no CFL condition is taken into account 
# in the computation of adaptative timesteps)
CFL = 0.5
# Advection method
ADVECTION_METHOD = {Scales: 'p_M4', Splitting: 'classic'}
#ADVECTION_METHOD = {TimeIntegrator: RK2,
#                    Interpolation: Linear,
#                    Remesh: rmsh,
#                    Support: '',
#                    Splitting: 'o1'}
# Baroclinic Term method
BAROCLINIC_METHOD = {SpaceDiscretisation: FD_C_4, GhostUpdate: True}
# Curl method
#CURL_METHOD = {SpaceDiscretisation: FD_C_4, GhostUpdate: True}
CURL_METHOD = {SpaceDiscretisation: fftw2py, GhostUpdate: False}
# Flow
VISCOSITY = 0.001
RHO_BOTT = 1.0 #2.28 
RHO_TOP = 3.0 #12.04
# reprojection criterion
REPROJ_CST = 0.04
# Vorticity projection (list of 3 elements): 
# - the 1st element determines if the reprojection is needed
# - the 2nd element gives the reprojection frequency (nber of iterations) 
# if the 1st element is True 
# - the 3rd element indicates if the reprojection frequency given before 
# can be reduced to satisfy the reprojection criterion 
# (governed by the reprojection constant given above)
# ex1 : PROJ = [True, 10, False] means that the reprojection 
# of vorticty is strictly be applied every 10 iterations, 
# regardless of reprojection criterion
# ex2 : PROJ = [True, 25, True] means that the reprojection 
# of vorticty is be applied by default every 25 iterations 
# AND also when the reprojection criterion is not satisfied
PROJ = [True, 1, False]

# reprojection method
REPROJ_METHOD = {SpaceDiscretisation: FD_C_4}