void write_tasks(transport::repository<>& repo, transport::step_mpi<>* model) { const double M_P = 1.0; const double m = 1E-5 * M_P; const double c = 0.0018; const double d = 0.022 * M_P; const double phi0 = 14.84 * M_P; const double phi_init = 16.5 * M_P; const double N_init = 0.0; const double N_pre = 6.0; const double N_max = 50.1; transport::parameters<> params(M_P, { m, c, d, phi0 }, model); transport::initial_conditions<> ics("step", params, { phi_init }, N_init, N_pre); transport::basic_range<> times(N_init, N_max, 100, transport::spacing::linear); transport::basic_range<> ks(exp(7.0), exp(11.5), 1000, transport::spacing::log_bottom); transport::basic_range<> alphas(0.0, 0.0, 0, transport::spacing::linear); transport::basic_range<> betas(1.0/3.0, 1.0/3.0, 0, transport::spacing::linear); // construct a threepf task transport::threepf_alphabeta_task<> tk3("step.threepf", ics, times, ks, alphas, betas); tk3.set_collect_initial_conditions(true).set_adaptive_ics_efolds(5.0); transport::zeta_threepf_task<> ztk3("step.threepf-zeta", tk3); repo.commit(ztk3); }
void write_tasks(transport::repository<>& repo, transport::dquad_mpi<>* model) { const double Mp = 1.0; const double Mphi = 9E-5 * Mp; const double Mchi = 1E-5 * Mp; transport::parameters<> params(Mp, {Mphi, Mchi}, model); const double phi_init = 10.0 * Mp; const double chi_init = 12.9 * Mp; const double N_init = 0.0; const double N_pre = 12.0; const double N_end = 60.0; transport::initial_conditions<> ics("dquad", params, {phi_init, chi_init}, N_init, N_pre); transport::basic_range<> ts(N_init, N_end, 300, transport::spacing::linear); const double kt_lo = std::exp(3.0); const double kt_hi = std::exp(8.0); transport::basic_range<> ks(kt_lo, kt_hi, 50, transport::spacing::log_bottom); transport::twopf_task<> tk2("dquad.twopf", ics, ts, ks); tk2.set_adaptive_ics_efolds(5.0); tk2.set_description("Compute time history of the 2-point function from k ~ e^3 to k ~ e^9"); transport::threepf_cubic_task<> tk3("dquad.threepf", ics, ts, ks); tk3.set_adaptive_ics_efolds(5.0); tk3.set_description("Compute time history of the 3-point function on a cubic lattice from k ~ e^3 to k ~ e^9"); repo.commit(tk2); repo.commit(tk3); }
bool PositionParser::FindSeparator(const wxString & src) { // Used when format is similar to "12 34.56 N 12 34.56 E" wxString posPartOfSeparator = _T(""); // First the XML case: // Generalized XML tag format, accepts anything like <XXX yyy="<lat>" zzz="<lon>" > // GPX format <wpt lat="<lat>" lon="<lon>" /> tag among others. wxRegEx regex; int re_compile_flags = wxRE_ICASE; #ifdef wxHAS_REGEX_ADVANCED re_compile_flags |= wxRE_ADVANCED; #endif regex.Compile( _T( "<[a-z,A-Z]*\\s*[a-z,A-Z]*=\"([0-9,.]*)\"\\s*[a-z,A-Z]*=\"([-,0-9,.]*)\"\\s*/*>" ), re_compile_flags ); if( regex.IsValid() ) { if( regex.Matches( src ) ) { int n = regex.GetMatchCount(); latitudeString = regex.GetMatch( src, 1 ); longitudeString = regex.GetMatch( src, 2 ); latitudeString.Trim( true ); latitudeString.Trim( false ); longitudeString.Trim( true ); longitudeString.Trim( false ); return true; } } // Now try various separators. separator = _T(", "); wxStringTokenizer tk1(src, separator); if (tk1.CountTokens() == 2) { latitudeString = tk1.GetNextToken(); latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk1.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T(","); wxStringTokenizer tk2 (src, separator); if (tk2.CountTokens() == 2) { latitudeString = tk2.GetNextToken(); latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk2.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T(" "); wxStringTokenizer tk3(src, separator); if (tk3.CountTokens() == 2) { latitudeString = tk3.GetNextToken(); latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk3.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T("\t"); wxStringTokenizer tk4(src, separator); if (tk4.CountTokens() == 2) { latitudeString = tk4.GetNextToken(); latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk4.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T("\n"); wxStringTokenizer tk5(src, separator); if (tk5.CountTokens() == 2) { latitudeString = tk5.GetNextToken(); latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk5.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T("N"); posPartOfSeparator = _T("N"); wxStringTokenizer tk6(src, separator); if (tk6.CountTokens() == 2) { latitudeString = tk6.GetNextToken() << posPartOfSeparator; latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk6.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } separator = _T("S"); posPartOfSeparator = _T("S"); wxStringTokenizer tk7(src, separator); if (tk7.CountTokens() == 2) { latitudeString = tk7.GetNextToken() << posPartOfSeparator; latitudeString.Trim(true); latitudeString.Trim(false); longitudeString = tk7.GetNextToken(); longitudeString.Trim(true); longitudeString.Trim(false); return true; } // Give up. return false; }