void MainWindow::import_dbdump() { extern int read_dump(const char *, db_base **, char *, int); char buf[50]; db_base *dbl[] = { keys, reqs, certs, temps, crls }; if (!keys) return; QString pass; QString file = QFileDialog::getOpenFileName(this, tr(XCA_TITLE), homedir, tr("Database dump ( *.dump );;All files ( * )")); if (file.isEmpty()) return; pass_info p(tr("Import password"), tr("Please enter the password of the old database"), this); if (passRead(buf, 50, 0, &p) <0) return; pass = buf; try { read_dump(CCHAR(file), dbl, buf, 50); if (pki_evp::md5passwd(CCHAR(pass)) != buf) { int ret = QMessageBox::warning(this, tr(XCA_TITLE), tr("Password verification error. Ignore keys ?"), tr("Import anyway"), tr("Cancel")); if (ret) return; } pki_evp::setOldPasswd(CCHAR(pass)); read_dump(CCHAR(file), dbl, NULL, 0); pki_evp::eraseOldPasswd(); } catch (errorEx &err) { Error(err); } }
// Reads the data from LAMMPS. LAMMPS_Data::LAMMPS_Data(string datapath, string dumppath) { if (datapath.size()) read_data(datapath); if (dumppath.size()) read_dump(dumppath); type_counts(); }
/** Init the flow arrays... */ void init_flow(struct Field fldi) { int i,n; int j,k; double dummy_var; DEBUG_START_FUNC; // Initialise vectors to 0 for( n = 0 ; n < fldi.nfield ; n++) { for( i = 0 ; i < NTOTAL_COMPLEX ; i++) { fldi.farray[n][i] = 0.0; } } #ifdef COMPRESSIBLE // Initialise the density to 1... if(rank==0) { fldi.d[0] = (double) NTOTAL; } #endif if(param.init_large_scale_noise) init_LargeScaleNoise(fldi); if(param.init_large_scale_2D_noise) init_LargeScale2DNoise(fldi); if(param.init_vortex) init_KidaVortex(fldi); if(param.init_spatial_structure) init_SpatialStructure(fldi); if(param.init_white_noise) init_WhiteNoise(fldi); if(param.init_bench) init_Bench(fldi); if(param.init_mean_field) init_MeanField(fldi); if(param.init_dump) { read_dump(fldi, &dummy_var,"init.dmp"); MPI_Printf("Initial conditions read successfully from the restart dump\n"); } #ifdef BOUNDARY_C boundary_c(fldi); #endif projector(fldi.vx,fldi.vy,fldi.vz); #ifdef MHD projector(fldi.bx,fldi.by,fldi.bz); #endif #ifdef WITH_PARTICLES #ifdef WITH_ROTATION if(rank==0) { kappa_tau2 = 2.0*param.omega*(2.0*param.omega-param.shear) * param.particles_stime * param.particles_stime + (param.particles_dg_ratio + 1.0) * (param.particles_dg_ratio + 1.0); // This is a non trivial equilibrium for the particles+gas system fldi.vx[0] = param.particles_epsilon*param.particles_stime*param.particles_dg_ratio / kappa_tau2 * ( (double) NTOTAL); fldi.vy[0] = param.particles_epsilon*param.particles_dg_ratio*(1.0+param.particles_dg_ratio)/(2.0*param.omega*kappa_tau2) * ( (double) NTOTAL); } #endif #endif #ifdef DEBUG MPI_Printf("Initflow:\n"); D_show_all(fldi); MPI_Printf("**************************************************************************************\n"); #endif DEBUG_END_FUNC; return; }