sys.exit(1) # copy executable and parameter file to a temporary directory tmp_dir = tempfile.mkdtemp() args.exe = copy2temporary(tmp_dir, args.exe) args.prm = copy2temporary(tmp_dir, args.prm) args.procs = 1 # this generates 3 meshes Ngeo = ['1', '2'] nNgeo = len(Ngeo) Level1 = ['01', '02', '04', '08'] Level2 = ['02', '04', '08', '16'] nLevel = len(Level1) projectname = read_prm(args.prm, 'ProjectName') # loop over meshes for j in range(0, nNgeo): for i in range(0, nLevel): projectnameX = projectname + '_Ngeo_' + Ngeo[j] + '_Level_' + Level1[i] modify_prm(args.prm, {'ProjectName': projectnameX}) print(" ") print("%03.0i === > ProjectName: %s" % (i, projectnameX)) print(" ") # modify parameters by replacing string # args.prm = [w.replace('NEX',nElemsX[i] ) for w in args.prm] modify_prm(args.prm, {'DEFVAR=(INT):n_1': Level1[i]}) modify_prm(args.prm, {'DEFVAR=(INT):n_2': Level2[i]}) bo = str(int(Ngeo[j]) + 1)
err.extend([ "caseID=%6d ,project= %s <== no builddir" % (case, project) ]) return False #RUN TEST print(" ") print("===> run test %s/%s ..." % (run_test[0], run_test[1])) #change to test directory os.chdir(run_test[0]) if (not os.path.isfile('./' + run_test[1])): print("!!!!!!!! PARAMTERFILE %s/%s does not exist!" % (run_test[0], run_test[1])) os.chdir(cwd) return False projectname = read_prm(run_test[1], 'ProjectName') projectnamex = ("%s_%d_%s" % (projectname, case, project)) success = False try: [L2,Linf,PID] = execute(cwd+"/"+builddir+"/bin/fluxo", run_test[1], projectnamex,\ [get_last_L2_error, get_last_Linf_error, get_cpu_per_dof],\ log = True, ntail = ntail ,\ mpi_procs = mpi_procs ) if (Linf): print(" ... check Linf %s < %s ?" % (Linf[0], run_test[2])) if (float(Linf[0]) < float(run_test[2])): success = True except: success = False if (not success):