diff --git a/lennard.f90 b/lennard.f90 index ae8a90a..50e77f6 100644 --- a/lennard.f90 +++ b/lennard.f90 @@ -5451,6 +5451,8 @@ program main if (wall(1:2) == 'pp' .or. wall(3:4) == 'pp') then allocate(mic(N,2),mic_trf(2*N)) mic = 0 + else + allocate(mic(1,2),mic_trf(2*1)) end if ! allocate(nxv(N*5),nxv_send(N*5)) diff --git a/settings.ini b/settings.ini index c3ea274..282b9de 100755 --- a/settings.ini +++ b/settings.ini @@ -4,14 +4,14 @@ # Argonio: epsilon/kb = 120K, sigma = 0.341nm [global] nimpre = 200 # quntidade de saidas - N = 8 # número de partículas + N = 1009 # número de partículas Ntype = 2 # número de tipos de partícula - t_fim = 100 # tempo de execução + t_fim = 50 # tempo de execução nimpre_init = 0 # começa a simular a partir no tempo referente ao snapshot (nimpre). - dt = 0.0001 # passo de tempo - dimX = 600 # Dimensões da região de cálculo - dimY = 600 # - mesh = 1 1 # 300 60 # malha(elementos) + dt = 0.00005 # passo de tempo + dimX = 100 # Dimensões da região de cálculo + dimY = 100 # + mesh = 10 10 # 300 60 # malha(elementos) rcut = 3 # *sigma wall = 'eeee' # condição Elastica ou Periodica nas paredes norte, sul, leste, oeste termostato_nose_hoover = .false. #liga termostato Nose Hoover. Este funciona durante toda execução. @@ -24,7 +24,7 @@ Td_hot = 2 # temperatura nas cold cells constante. Td_hot = -1 desliga termostato Td_cold = 0.8 # v = sqrt(2*T) temperatura nas hot cells constante. Td_cold = -1 desliga termostato force_lingradT = -1 # (NUMERO MULTIPLO DE 4 RECOMENDADO!) se > 0 irá dividir região no numero de subregiões entradas na direação X e será forçado um gradiente de temperatura linear. A região dos banhos será ignorada. A temperatura será controlado por um termostato velocity scaling - vd = 0 0 # velocidade distribuida com Maxwell Boltzmann = sqrt(Td') + vd = 2 2 # velocidade distribuida com Maxwell Boltzmann = sqrt(Td') NMPT = 1000 # Número máximo de partículas que poderá mudar de process. Se não souber estimar, usar -1 ou o valor de N. GField = 0 0 # Campo de força gravitacional que afeta todas as partículas MField = 0 0 0 0 0 # Campo magnético vezes momento dipolo da particula magnética Hm. O primeiro numero número é a intensidade de m*H. O segundo e terceiro numeros são a direção do campo.. Os últimos dois números são a e b na função seno e heaviside de controlam o campo no tempo. Hm = H*m*sin(b*t)*heaviside(x-a) @@ -36,33 +36,33 @@ # pr = constantes [A, B, alpha, beta] do lennard jones rugoso que simulará um cristal de atomos. Se o valor for dado, a particula poderá girar. # o grupo com pr deve ser o último e deverá haver apenas um. Ver em rot_par.py como será o potencial [par_0] - x = 'mole.csv' - v = 5 0 # velocidade global + x = 'molp.csv' + v = 0 0 # velocidade global v_file = '%%v_file_0.csv' # velocidade de cada partícula m = 1 nome = 'g1' sigma = 1 # Lennard Jones epsilon = 1 # Lennard Jones - quantidade = 7 + quantidade = 1000 x_lockdelay = 0 # só vai poder mudar de posição a partir de t = x_lockdelay rs = 0 # raio sólido. Posição de partículas na superfície de um sólido de raio rs fric_term = 0 # fricção artifical não funciona quando o termostato nose hoover está ligado ismolecule = .true. [par_1] - x = 'parti.csv' + x = 'parp.csv' v = 0 0 # velocidade global v_file = '%%v_file_1.csv' # velocidade de cada partícula m = 10 nome = 'g2' - sigma = 0.94 # Lennard Jones - epsilon = 0.428 # Lennard Jones - quantidade = 1 + sigma = 1 # Lennard Jones + epsilon = 1 # Lennard Jones + quantidade = 9 x_lockdelay = 0 # só vai poder mudar de posição a partir de t = x_lockdelay rs = 5 # raio sólido. Posição de partículas na superfície de um sólido de raio rs fric_term = 0 # fricção artifical ismolecule = .false. - pr = 0.1 0.1 20 20 0.071847 # constantes [A, B, alpha, beta, ph] do lennard jones rugoso que simulará um cristal de atomos 43.72584 43.72584 - + pr = 0 0.001 20 20 0.071847 # constantes [A, B, alpha, beta, ph] do lennard jones rugoso que simulará um cristal de atomos 43.72584 43.72584 +# #[par_2] # x = 'p_g.csv' # v = 0 0 diff --git a/verify_settings.py b/verify_settings.py index 2627558..cc475b3 100644 --- a/verify_settings.py +++ b/verify_settings.py @@ -65,8 +65,8 @@ def file_len(fname): x_file = x_file.replace("'","") x_file = x_file.replace('"','') if os.path.isfile(x_file): - q = config['par_'+str(i)]['quantidade'].split()[0] - if file_len('x_file') < q: + q = int(config['par_'+str(i)]['quantidade'].split()[0]) + if file_len(x_file) < q: print('Number of particles in file smaller then expected.') os.system('xdg-open settings.ini') break @@ -82,20 +82,22 @@ def file_len(fname): v_file = config['par_'+str(i)]['v_file'].split()[0] v_file = v_file.replace("'","") v_file = v_file.replace('"','') - if v_file[0] == '%' or os.path.isfile(x_file): - q = config['par_'+str(i)]['quantidade'].split()[0] - if file_len('v_file') < q: - print('Number of particles in file smaller then expected.') + + if v_file[0] != '%': + if os.path.isfile(v_file): + q = config['par_'+str(i)]['quantidade'].split()[0] + if file_len(v_file) < int(q): + print('Number of particles in file smaller then expected.') + os.system('xdg-open settings.ini') + break + else: + aux = False + else: + print("Velocity file {} not found.".format(v_file)) os.system('xdg-open settings.ini') + input("Fix the config file, then enter to continue...") + config.read('settings.ini') break - else: - aux = False - else: - print("Velocity file {} not found.".format(v_file)) - os.system('xdg-open settings.ini') - input("Fix the config file, then enter to continue...") - config.read('settings.ini') - break if sum(quant) != N: