ex_eos_had_skyrme.cpp
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2020, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 /** \file ex_eos_had_skyrme.cpp
24  \brief File defining \ref ex_eos_had_skyrme class
25 */
26 /* Example: ex_eos_had_skyrme.cpp
27  -------------------------------------------------------------------
28 */
29 #include <o2scl/test_mgr.h>
30 #include <o2scl/eos_had_skyrme.h>
31 #include <o2scl/fermion_nonrel.h>
32 #include <o2scl/nstar_cold.h>
33 #include <o2scl/format_float.h>
34 #include <o2scl/hdf_file.h>
35 #include <o2scl/hdf_io.h>
36 #include <o2scl/hdf_eos_io.h>
37 #include <o2scl/cli.h>
38 #include <o2scl/lib_settings.h>
39 
40 using namespace std;
41 using namespace o2scl;
42 using namespace o2scl_const;
43 using namespace o2scl_hdf;
44 
45 /** \brief Output data for a Skyrme EOS [Example class]
46  */
48 
49 public:
50 
51  /// Name of model
52  string name;
53  /// Saturation density
54  double n0;
55  /// Binding energy
56  double B;
57  /// Compressibility
58  double K;
59  /// Symmetry energy
60  double S;
61  /// Symmetry energy slope parameter
62  double L;
63  /// Maximum mass
64  double m_max;
65  /// Radius of maximum mass star
66  double r_max;
67  /// Central baryon density of maximum mass star
68  double nb_max;
69  /// Radius of a 1.4 solar mass star
70  double r_14;
71  /// Central baryon density of a 1.4 solar mass neutron star
72  double nb_14;
73  /// True if the EOS is acausal
74  double acausal;
75  /// True if the pressure is flat
76  double pressure_dec;
77  /// Quality of neutron matter
78  double neut_qual;
79  /// True if the maximum mass is large enough
81  /// True if the pressure is nondecreasing
83  /// True if neutron matter is always positive
84  bool pos_neut;
85  /// True if saturation is good
86  bool good_sat;
87  /// Desc
88  double pure_neut;
89  /// Desc
90  int other;
91  /// Desc
92  bool success;
93  /// Alternate description of symmetry energy
94  double alt_S;
95  /// Energy of neutron matter at saturation
96  double E_neut_n0;
97  /// Pressure of neutron matter at saturation
98  double P_neut_n0;
99 };
100 
101 /** \brief Class to analyze Skyrme EOSs and output the results
102  [Example class]
103  */
105 
106 protected:
107 
108  /// To compute neutron stars
110 
111  /// Neutron
112  fermion n;
113 
114  /// Proton
115  fermion p;
116 
117  /// Thermodynamics
119 
120  /// File for I/O
122 
123  /// Results
125 
126  /// Formatting output
128 
129  /// Neutron matter
131 
132  /// Neutron matter
134 
135 public:
136 
137  /// Base EOS model
139 
140  /// Model name
141  string name;
142 
143  /// Parameter t0 in MeV
144  double t0hc;
145 
146  /// Parameter t1 in MeV
147  double t1hc;
148 
149  /// Parameter t2 in MeV
150  double t2hc;
151 
152  /// Parameter t3 in MeV
153  double t3hc;
154 
155  /// Parameter W0 in MeV
156  double W0hc;
157 
158  /// Parameter b4
159  double b4hc;
160 
161  /// Parameter b4p
162  double b4phc;
163 
164  /// Verbose parameter
165  int verbose;
166 
167  /// If true, create output files for individual EOSs
169 
170  /// Prefix for output files
171  string file_prefix;
172 
173  /// If true, output JSON
174  bool json_mode;
175 
177 
178  // Ensure that this works without GNU units
180 
182  ("kg","1/fm",o2scl_mks::mass_neutron),2.0);
184  ("kg","1/fm",o2scl_mks::mass_proton),2.0);
185  n.non_interacting=false;
186  p.non_interacting=false;
187 
188  nst.set_eos(sk);
189  nst.def_eos_tov.verbose=0;
190  nst.def_tov.verbose=0;
191  nst.include_muons=true;
192  verbose=1;
193 
194  fd.html_mode();
195 
196  output_files=false;
197  file_prefix="skyrme_";
198 
199  json_mode=false;
200  }
201 
202  /** \brief Generate a table comparing neutron matter and neutron
203  star matter
204  */
206 
207  tneut.clear_table();
208  tneut2.clear_table();
209 
210  tneut.new_column("nb");
211  tneut.new_column("pr_neut");
212  tneut.new_column("pr_nstar");
213 
214  tneut2.new_column("ed");
215  tneut2.new_column("pr_neut");
216  tneut2.new_column("pr_nstar");
217 
218  tneut.set_unit("nb","fm^-3");
219  tneut.set_unit("pr_neut","fm^-4");
220  tneut.set_unit("pr_nstar","fm^-4");
221 
222  tneut2.set_unit("ed","fm^-4");
223  tneut2.set_unit("pr_neut","fm^-4");
224  tneut2.set_unit("pr_nstar","fm^-4");
225 
226  for(double nbt=0.06;nbt<0.9001;nbt+=0.02) {
227  n.n=nbt;
228  p.n=0;
229  int ret=sk.calc_e(n,p,th);
230  double line[3]={nbt,th.pr,0.0};
231  tneut.line_of_data(3,line);
232  double line2[3]={th.ed,th.pr,0.0};
233  tneut2.line_of_data(3,line2);
234  }
235 
236  return;
237  }
238 
239  /// Check if the pressure of neutron matter is positive
241  bool failed_once=false;
242 
243  res.pos_neut=true;
244  res.inc_pressure=true;
245 
246  double prlast=0.0;
247  for(double nbt=0.005;nbt<0.1601 && failed_once==false;nbt+=0.01) {
248  n.n=nbt;
249  p.n=0;
250  int ret=sk.calc_e(n,p,th);
251 
252  if (th.pr<prlast) {
253  res.inc_pressure=false;
254  res.success=false;
255  prlast=th.pr;
256  }
257  if (th.ed-n.n*n.m<0.0) {
258  res.pos_neut=false;
259  res.success=false;
260  }
261  }
262  if (verbose>0) {
263  if (failed_once==false) {
264  cout << "Pressure increases and energy of neutrons is positive.\n"
265  << endl;
266  } else {
267  cout << "Pressure decreased or energy of neutrons is negative.\n"
268  << endl;
269  }
270  }
271  return 0;
272  }
273 
274  /// Check low-density neutron matter
276 
277  double g_kf[4]={0.06,0.14,0.26,0.54};
278  double g_rat[4]={0.80,0.67,0.57,0.52};
279 
280  table_units<> ln;
281  ln.line_of_names("nb epb kf fermi rat");
282  if (verbose>0) cout << "Low density neutron matter: " << endl;
283  for(double nbt=0.000003;nbt<0.0051;nbt*=1.2) {
284  n.n=nbt;
285  p.n=0;
286  int ret=sk.calc_e(n,p,th);
287 
288  // The APR energy per baryon
289  double epb=(th.ed-n.n*n.m)/nbt*hc_mev_fm;
290 
291  // The Fermi gas energy per baryon
292  double fermi=pow(n.kf,5.0)/10.0/o2scl_const::pi2/n.ms/nbt*hc_mev_fm;
293 
294  if (verbose>1) {
295  cout << nbt << " " << epb << " "
296  << n.kf << " " << fermi << " " << epb/fermi << endl;
297  }
298  double line[5]={nbt,epb,n.kf,fermi,epb/fermi};
299  ln.line_of_data(5,line);
300  }
301  if (verbose>1) cout << endl;
302 
303  // At the saturation density, evaluate the properties of
304  // neutron matter
305  n.n=sk.n0;
306  p.n=0.0;
307  sk.calc_e(n,p,th);
308  res.E_neut_n0=(th.ed/sk.n0-n.m)*hc_mev_fm;
309  res.P_neut_n0=th.pr*hc_mev_fm;
310 
311  res.neut_qual=0.0;
312  for(size_t i=0;i<4;i++) {
313  if (verbose>0) {
314  cout << g_kf[i] << " " << g_rat[i] << " "
315  << ln.interp("kf",g_kf[i],"rat") << " "
316  << ln.interp("kf",g_kf[i],"epb") << endl;
317  }
318  res.neut_qual+=g_kf[i]*fabs(g_rat[i]-ln.interp("kf",g_kf[i],"rat"));
319  }
320  ln.add_constant("neut_qual",res.neut_qual);
321  if (verbose>0) {
322  cout << "Quality: " << res.neut_qual << endl;
323  cout << endl;
324  }
325 
326  return 0;
327  }
328 
329  /// Test saturation density
331 
332  n.n=0.08;
333  p.n=0.08;
334  sk.saturation();
335 
336  // Collect saturation results
337  res.n0=sk.n0;
338  res.B=sk.eoa*hc_mev_fm;
339  res.K=sk.comp*hc_mev_fm;
340  res.S=sk.esym*hc_mev_fm;
341  res.alt_S=sk.fesym_diff(sk.n0)*hc_mev_fm;
342  res.L=sk.fesym_slope(sk.n0)*hc_mev_fm;
343 
344  if (json_mode) {
345  cout << "{\"n0\":" << sk.n0 << "," << endl;
346  cout << "\"EoA\":" << sk.eoa*hc_mev_fm << "," << endl;
347  cout << "\"K\":" << sk.comp*hc_mev_fm << "," << endl;
348  cout << "\"msom\":" << sk.msom << "," << endl;
349  cout << "\"S\":" << sk.esym*hc_mev_fm << "," << endl;
350  cout << "\"S2\":" << res.alt_S << "," << endl;
351  cout << "\"L\":" << res.L << "}" << endl;
352  } else if (verbose>0) {
353  cout << "Saturation: " << endl;
354  cout << "n_0=" << sk.n0 << " fm^-3" << endl;
355  cout << "E_B=" << sk.eoa*hc_mev_fm << " MeV" << endl;
356  cout << "K=" << sk.comp*hc_mev_fm << " MeV" << endl;
357  cout << "M^*/M=" << sk.msom << endl;
358  cout << "S=" << sk.esym*hc_mev_fm << " MeV" << endl;
359  cout << "S2=" << res.alt_S << " MeV" << endl;
360  cout << "L=" << res.L << " MeV" << endl;
361  cout << endl;
362  }
363 
364  // Check saturation properties
365 
366  res.good_sat=true;
367 
368  if (fabs(sk.n0-0.16)>0.013) {
369  res.good_sat=false;
370  }
371  if (fabs(sk.eoa*hc_mev_fm+16.0)>1.2) {
372  res.good_sat=false;
373  }
374  if (fabs(sk.comp*hc_mev_fm-220.0)>20.0) {
375  res.good_sat=false;
376  }
377  if (fabs(sk.esym*hc_mev_fm-32.0)>4.0) {
378  res.good_sat=false;
379  }
380  if (res.good_sat==false) {
381  cout << "Bad saturation." << endl;
382  res.success=false;
383  }
384 
385  return 0;
386  }
387 
388  /// Compute the M vs. R curve
389  int mvsr() {
390 
391  res.other=0;
392 
393  cout << "EOS:" << endl;
394  {
395  double nb_last=10.0;
396  for(double nb=0.16;nb<=2.0001;nb+=0.001) {
397  p.n=0.0;
398  n.n=nb-p.n;
399  sk.calc_e(n,p,th);
401  ("kg","1/fm",o2scl_mks::mass_electron);
402  if (n.mu-p.mu-me<0.0) {
403  nb_last=nb-0.001;
404  nb=2.1;
405  }
406  }
407  if (nb_last<10.0) {
408  cout << "Pure neutron matter after nb=" << nb_last << endl;
409  nst.nb_end=nb_last;
410  } else {
411  nst.nb_end=2.0;
412  }
413  }
414  nst.verbose=2;
415  nst.calc_eos();
416  cout << endl;
417 
418  cout << "Neutron stars:" << endl;
419  nst.calc_nstar();
420  std::shared_ptr<table_units<> > te=nst.get_eos_results();
421  std::shared_ptr<table_units<> > tr=nst.get_tov_results();
422 
423  if (output_files) {
424  // Output EOS and M vs. R curve to file
425  string fn=file_prefix+res.name+"_eos.o2";
426  hf.open_or_create(fn.c_str());
427  hdf_output(hf,*te,"eos");
428  hf.close();
429  fn=file_prefix+res.name+"_mvsr.o2";
430  hf.open_or_create(fn.c_str());
431  hdf_output(hf,*tr,"mvsr");
432  hf.close();
433  }
434 
435  if (verbose>0) {
436  cout << "M_{max} = " << tr->max("gm") << " R_{max} = "
437  << tr->get("r",tr->lookup("gm",tr->max("gm")))
438  << " cent. density = "
439  << tr->get("nb",tr->lookup("gm",tr->max("gm"))) << endl;
440  cout << "R_{1.4} = "
441  << tr->get("r",tr->lookup("gm",1.4)) << " cent. density = "
442  << tr->get("nb",tr->lookup("gm",1.4)) << endl;
443  }
444 
445  res.m_max=tr->max("gm");
446  res.r_max=tr->get("r",tr->lookup("gm",tr->max("gm")));
447  res.nb_max=tr->get("nb",tr->lookup("gm",tr->max("gm")));
448  res.r_14=tr->get("r",tr->lookup("gm",1.4));
449  res.nb_14=tr->get("nb",tr->lookup("gm",1.4));
450 
451  // Fix the maximum density to check if necessary
452  double nbtop=res.nb_max;
453  if (nbtop>2.0) nbtop=2.0;
454  if (nbtop<0.4) nbtop=0.7;
455 
456  // Check for pure neutron matter, now that we have the central
457  // density of the maximum mass star. If we find pure neutron
458  // matter, set the neutron star parameters to zero since they're
459  // likely invalid.
460  res.pure_neut=true;
461  for(double nb=0.1;nb<=nbtop;nb+=0.01) {
462  if (te->get("np",te->lookup("nb",nb))<1.0e-5) {
463  res.success=false;
464  res.m_max=0.0;
465  res.r_max=0.0;
466  res.nb_max=0.0;
467  res.r_14=0.0;
468  res.nb_14=0.0;
469  res.pure_neut=false;
470  }
471  }
472 
473  // Check that the maximum mass is larger than 1.6
474  res.max_mass_ok=true;
475  if (tr->max("gm")<1.6) {
476  res.max_mass_ok=false;
477  res.success=false;
478  }
479 
480  // Find where the EOS becomes acausal
481  res.acausal=nst.acausal;
482  res.pressure_dec=nst.pressure_dec;
483  if (nst.pressure_dec>0.0 &&
484  nst.pressure_dec<tr->get("nb",tr->lookup("gm",tr->max("gm")))) {
485  cout << "Pressure decreases in maximum mass star" << endl;
486  cout << "pressure_dec: " << nst.pressure_dec << endl;
487  res.success=false;
488  }
489  if (nst.acausal>0.0 &&
490  nst.acausal<tr->get("nb",tr->lookup("gm",tr->max("gm")))) {
491  cout << "Acausal before central density of maximum mass star." << endl;
492  cout << "acausal: " << nst.acausal << endl;
493  res.success=false;
494  }
495 
496  if (verbose>0) {
497  cout << endl;
498  }
499 
500  return 0;
501  }
502 
503  /// Summarize the results of one model
504  int json(vector<string> &sv, bool itive_com) {
505  if (sv.size()<1) {
506  cout << "No model to summarize." << endl;
507  return exc_einval;
508  }
509 
510  cout << "Model: " << sv[1] << endl;
511  cout << "-----------------------------------------------------"
512  << "-----------------------" << endl;
513  cout << endl;
514 
515  skyrme_load(sk,sv[1]);
516  name=sv[1];
517  res.name=sv[1];
518 
519  W0hc=sk.W0*hc_mev_fm;
520  t0hc=sk.t0*hc_mev_fm;
521  t1hc=sk.t1*hc_mev_fm;
522  t2hc=sk.t2*hc_mev_fm;
523  t3hc=sk.t3*hc_mev_fm;
524 
525  nst.verbose=0;
526  nst.nb_end=1.18;
527 
528  json_mode=true;
529  saturation_prop();
530  json_mode=false;
531 
532  return 0;
533  }
534 
535  /// Summarize the results of one model
536  int summary(vector<string> &sv, bool itive_com) {
537  if (sv.size()<1) {
538  cout << "No model to summarize." << endl;
539  return exc_einval;
540  }
541 
542  cout << "Model: " << sv[1] << endl;
543  cout << "-----------------------------------------------------"
544  << "-----------------------" << endl;
545  cout << endl;
546 
547  skyrme_load(sk,sv[1]);
548  name=sv[1];
549  res.name=sv[1];
550 
551  W0hc=sk.W0*hc_mev_fm;
552  t0hc=sk.t0*hc_mev_fm;
553  t1hc=sk.t1*hc_mev_fm;
554  t2hc=sk.t2*hc_mev_fm;
555  t3hc=sk.t3*hc_mev_fm;
556 
557  nst.verbose=0;
558  nst.nb_end=1.18;
559 
560  saturation_prop();
561  check_pressure();
562  low_neutron_mat();
563 
564  compare_neut_nstar();
565 
566  mvsr();
567 
568  cout << "-----------------------------------------------------"
569  << "-----------------------" << endl;
570 
571  return 0;
572  }
573 
574  /// Test the code
575  int test(vector<string> &sv, bool itive_com) {
576  test_mgr t;
577  t.set_output_level(1);
578 
579  bool of_old=output_files;
580  output_files=true;
581  file_prefix="ex_eos_had_skyrme_";
582 
583  // Just summarize SLy4
584  vector<string> args;
585  args.push_back("summary");
586  args.push_back("SLy4");
587  summary(args,0);
588 
589  // And compare to expected results
590  t.test_rel(res.n0,0.1595468,1.0e-5,"n0");
591  t.test_rel(res.m_max,2.050391,4.0e-4,"m_max");
592  t.test_rel(res.r_14,11.72476,4.0e-3,"R_1.4");
593 
594  t.report();
595 
596  output_files=of_old;
597 
598  return 0;
599  }
600 
601  /// Write to a file
602  int store(vector<string> &sv, bool itive_com) {
603 
604  if (sv.size()<2) {
605  cout << "No filename specified in 'store'." << endl;
606  return exc_efailed;
607  }
608 
609  hf.open_or_create(sv[1]);
610  skyrme_write(hf,sk,name);
611  hf.close();
612 
613  if (verbose>0) {
614  cout << "Wrote model '" << name << "' to file named '"
615  << sv[1] << "'." << endl;
616  }
617 
618  return 0;
619  }
620 
621  /// Create data files for the UNEDF forces
622  int unedf(vector<string> &sv, bool itive_com) {
623 
624  test_mgr t;
625  t.set_output_level(1);
626 
627  /*
628  These couplings are in the supplemental material
629  for Kortelainen et al. PRC 89 (2014)
630  */
631  double coups[13][3]={
632  {-706.382928878428856,-779.3730087208653,-650.796319465688839},
633  {240.049520427681131,287.722131583286796,291.664014339185485},
634  {868.871771539645351,891.47789044234969,768.32770588203357},
635  {-69.0518957481631617,-200.587774317884879,-283.187292227492492},
636  {-12.9172408208016112,-0.989915057807676746,9.78520558824309639},
637  {-45.1894169426759476,-33.6320970701835549,-23.3573612977035339},
638  {0.321955989588264435,0.2700180115027076,0.351455132555483607},
639  {-55.2606,-45.135131022237303,-46.8314091470605973},
640  {-55.6226,-145.382167908057,-113.163790795259004},
641  {-79.5308,-74.0263331764599,-64.3088624157838069},
642  {45.6302,-35.6582611147917,-38.6501946851355029},
643  {0.0,0.0,-54.4333635973721002},
644  {0.0,0.0,-65.9030310445938028}
645  };
646 
647  sk.def_neutron.m=hc_mev_fm/20.73553/2.0;
648  sk.def_proton.m=hc_mev_fm/20.73553/2.0;
649 
650  for(size_t i=0;i<3;i++) {
651  cout << "UNEDF" << i << ":" << endl;
652 
653  // Convert to O2scl units
654  for(size_t j=0;j<13;j++) {
655  if (j!=6) {
656  coups[j][i]/=hc_mev_fm;
657  }
658  }
659 
660  sk.alt_params_set(coups[0][i],coups[1][i],coups[2][i],coups[3][i],
661  coups[4][i],coups[5][i],coups[7][i],coups[8][i],
662  coups[9][i],coups[10][i],coups[6][i]);
663 
664  // Test coefficients from Kortelainen et al. PRC 85 (2012) 024304
665  if (i==0) {
666  t.test_rel(sk.t0*hc_mev_fm,-1883.68781034,1.0e-4,"");
667  t.test_rel(sk.t1*hc_mev_fm,277.50021224,1.0e-4,"");
668  t.test_rel(sk.t2*hc_mev_fm,608.43090559,1.0e-4,"");
669  t.test_rel(sk.t3*hc_mev_fm,13901.94834463,1.0e-4,"");
670  t.test_rel(sk.x0,0.00974375,1.0e-4,"");
671  t.test_rel(sk.x1,-1.77784395,1.0e-4,"");
672  t.test_rel(sk.x2,-1.67699035,1.0e-4,"");
673  t.test_rel(sk.x3,-0.38079041,1.0e-4,"");
674  t.test_rel(sk.b4*hc_mev_fm,125.16100000,1.0e-4,"");
675  t.test_rel(sk.b4p*hc_mev_fm,-91.2604000,1.0e-4,"");
676  } else if (i==1) {
677  t.test_rel(sk.t0*hc_mev_fm,-2078.32802326,1.0e-4,"");
678  t.test_rel(sk.t1*hc_mev_fm,239.40081204,1.0e-4,"");
679  t.test_rel(sk.t2*hc_mev_fm,1575.11954190,1.0e-4,"");
680  t.test_rel(sk.t3*hc_mev_fm,14263.64624708,1.0e-4,"");
681  t.test_rel(sk.x0,0.05375692,1.0e-4,"");
682  t.test_rel(sk.x1,-5.07723238,1.0e-4,"");
683  t.test_rel(sk.x2,-1.36650561,1.0e-4,"");
684  t.test_rel(sk.x3,-0.16249117,1.0e-4,"");
685  t.test_rel(sk.b4*hc_mev_fm,38.36807206,1.0e-4,"");
686  t.test_rel(sk.b4p*hc_mev_fm,71.31652223,1.0e-4,"");
687  }
688 
689  if (i==0) {
691  (0.160526,-16.0559/hc_mev_fm,230.0/hc_mev_fm,1.0/0.9,
692  30.5429/hc_mev_fm,45.0804/hc_mev_fm,1.0/1.249838,coups[7][i],
693  coups[8][i],coups[9][i],coups[10][i]);
694 
695  sk.saturation();
696  cout << "n0: " << sk.n0 << endl;
697  cout << "E/A: " << sk.eoa*hc_mev_fm << endl;
698  cout << "K: " << sk.comp*hc_mev_fm << endl;
699  cout << "Esym: " << sk.esym*hc_mev_fm << endl;
700  cout << "M_n^*: " << sk.f_effm_neut(sk.n0) << endl;
701  cout << "M_p^*: " << sk.f_effm_prot(sk.n0) << endl;
702  cout << "1/M_s^*: " << 1.0/sk.f_effm_scalar(sk.n0) << endl;
703  cout << "1/M_v^*: " << 1.0/sk.f_effm_vector(sk.n0) << endl;
704  cout << "L: " << sk.fesym_slope(sk.n0)*hc_mev_fm << endl;
705  cout << "alpha: " << sk.alpha << endl;
706  }
707 
708  sk.saturation();
709 
710  // These numbers from Table IV in Kortelainen et al. (2014)
711  if (i==0) {
712  t.test_rel(sk.n0,0.16053,1.0e-4,"n0 0");
713  } else if (i==1) {
714  t.test_rel(sk.n0,0.15871,1.0e-4,"n0 1");
715  } else {
716  t.test_rel(sk.n0,0.15631,1.0e-4,"n0 2");
717  }
718  if (i==0) {
719  t.test_rel(sk.eoa*hc_mev_fm,-16.056,1.0e-4,"eoa 0");
720  } else if (i==1) {
721  t.test_rel(sk.eoa*hc_mev_fm,-15.8,1.0e-4,"eoa 1");
722  } else {
723  t.test_rel(sk.eoa*hc_mev_fm,-15.8,1.0e-4,"eoa 2");
724  }
725  if (i==0) {
726  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,45.080,1.0e-4,"L 0");
727  } else if (i==1) {
728  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,40.005,1.0e-4,"L 1");
729  } else {
730  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,40.0,1.0e-4,"L 2");
731  }
732 
733  if (i==0) {
734  sk.reference=((string)"M. Kortelainen, T. Lesinski, ")+
735  "J. More, W. Nazarewicz, J. Sarich, N. Schunck, "+
736  "M. V. Stoitsov, and S. Wild, Phys. Rev. C 82, "+
737  "024313 (2010).";
738  } else if (i==1) {
739  sk.reference=((string)"M. Kortelainen, J. McDonnell, ")+
740  "W. Nazarewicz, P.-G. Reinhard, J. Sarich, N. Schunck, "+
741  "M. V. Stoitsov, and S. M. Wild, Phys. Rev. C 85, "+
742  "024304 (2012).";
743  } else {
744  sk.reference=((string)"M. Kortelainen, J. McDonnell, ")+
745  "W. Nazarewicz, E. Olsen, P.-G. Reinhard, J. Sarich, "+
746  "N. Schunck, S. M. Wild, D. Davesne, J. Erler, "+
747  "and A. Pastore, Phys. Rev. C 89, 054314 (2014)";
748  }
749 
750  hf.open_or_create(((string)"UNEDF")+szttos(i)+".o2");
751  skyrme_write(hf,sk,((string)"UNEDF")+szttos(i));
752  hf.close();
753  cout << endl;
754  }
755 
756  t.report();
757 
758  return 0;
759  }
760 
761  /// Load internally stored model
762  int load(vector<string> &sv, bool itive_com) {
763 
764  if (sv.size()<2) {
765  cout << "No model specified in 'load'." << endl;
766  return exc_efailed;
767  }
768 
769  name=sv[1];
770  skyrme_load(sk,name);
771 
772  if (verbose>0) {
773  cout << "Loaded model '" << name << "'." << endl;
774  }
775 
776  return 0;
777  }
778 
779  /// Run all the models
780  int run_all(vector<string> &sv, bool itive_com) {
781 
782  size_t nmods=0;
783  std::string mlist[200], stemp;
784 
785  string fname=o2scl_settings.get_data_dir()+"/skdata/model_list";
786  ifstream fin(fname.c_str());
787  fin >> nmods;
788  for(size_t i=0;i<nmods;i++) {
789  fin >> mlist[i];
790  }
791  fin.close();
792 
793  ofstream fouu("table.csv");
794  fouu << "Name, n0, B, K, ";
795  fouu << "S, L, Mmax, ";
796  fouu << "Rmax, nB_cent_max, R1.4, ";
797  fouu << "nB_cent_14, acausal, pressure_dec, ";
798  fouu << "neut_qual, max_mass_ok, ";
799  fouu << "inc_pressure, pos_neut, good_sat, ";
800  fouu << "pure_neut, other, success" << endl;
801 
802  ofstream fout("table.html");
803  fout << "<html><body>" << endl;
804  fout << "<table border=0 cellspacing=0><tr bgcolor=\"#bbbbbb\">" << endl;
805  fout << "<td>Name&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
806  fout << "<td>n<sub>0</sub>&nbsp;(fm<sup>-3</sup>)"
807  << "&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
808  fout << "<td>B&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
809  fout << "<td>K&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
810  fout << "<td>S&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
811  fout << "<td>L&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
812  fout << "<td>M<sub>max</sub>&nbsp;(M<sub>sun</sub>)"
813  << "&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
814  fout << "<td>R<sub>max</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
815  fout << "<td>n<sub>B,cent,max</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
816  fout << "<td>R<sub>1.4</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
817  fout << "<td>n<sub>B,cent,1.4</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
818  fout << "<td>acausal&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
819  fout << "<td>pressure_dec&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
820  fout << "<td>neut_qual&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
821  fout << "<td>max_mass_ok&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
822  fout << "<td>inc_pressure&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
823  fout << "<td>pos_neut&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
824  fout << "<td>good_sat&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
825  fout << "<td>pure_neut&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
826  fout << "<td>other&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
827  fout << "<td>success&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
828  fout << "</tr>" << endl;
829 
830  // Currently only models which don't give pure neutron matter work.
831  // This list rules out those which have pure neutron matter and
832  // the PeHF-type models which don't work.
833  static const size_t N=66;
834  int list[N]={0,100,101,102,103,109,110,113,114,115,121,122,123,124,
835  125,126,127,128,129,130,131,132,133,134,135,145,147,17,1,
836  25,26,27,28,29,3,40,41,42,43,44,4,51,53,54,5,
837  62,63,64,64,66,67,68,69,6,71,73,75,76,77,7,81,82,84,
838  97,98,99};
839 
840  for(size_t j=0;j<N;j++) {
841 
842  size_t i=list[j];
843 
844  i=2;
845 
846  cout << "Running model: " << i << endl;
847  vector<string> tmp;
848  tmp.push_back("x");
849  tmp.push_back(mlist[i]);
850 
851  // These models are the ones that I used to compute pressure
852  // corrections for neutron -> neutron star matter
853  //
854  //if (mlist[i]=="SkT3" || mlist[i]=="SLy3" || mlist[i]=="SLy4" ||
855  //mlist[i]=="SLy7" || mlist[i]=="SLy230a" || mlist[i]=="SV-mas07" ||
856  //mlist[i]=="SV-sym34" || mlist[i]=="BSk9" || mlist[i]=="KDE0v" ||
857  //mlist[i]=="KDE0v1" || mlist[i]=="Ly5" || mlist[i]=="mst0.81" ||
858  //mlist[i]=="NRAPR" || mlist[i]=="SkMP" || mlist[i]=="BSk14" ||
859  //mlist[i]=="SkO" || mlist[i]=="SkOp" || mlist[i]=="SkT1") {
860 
861  {
862 
863  res.success=true;
864  summary(tmp,true);
865  exit(-1);
866 
867  ofstream fx("jim.dat",ios::app);
868  fx.setf(ios::scientific);
869  fx.setf(ios::showpos);
870  fx.width(10);
871  fx << mlist[i] << " ";
872  fx << res.S << " " << res.alt_S << " "
873  << res.E_neut_n0 << " " << res.P_neut_n0 << " "
874  << res.L << " ";
875  fx << sk.t0 << " " << sk.t1 << " " << sk.t2 << " " << sk.t3 << " ";
876  fx << sk.x0 << " " << sk.x1 << " " << sk.x2 << " " << sk.x3 << " ";
877  fx << sk.alpha << " " << sk.n0 << " " << sk.comp*hc_mev_fm << " ";
878 
879  double c2;
880  {
881  double h=1.0e-4;
882  n.n=sk.n0-h;
883  p.n=0.0;
884  sk.calc_e(n,p,th);
885  double pr1=th.pr;
886  n.n=sk.n0+h;
887  p.n=0.0;
888  sk.calc_e(n,p,th);
889  double pr2=th.pr;
890  c2=(pr2-pr1)/2.0/h*9.0*hc_mev_fm;
891  }
892  fx << c2;
893 
894  fx << endl;
895  fx.close();
896 
897  cout << sk.t0 << " " << sk.t1 << " " << sk.t2 << " " << sk.t3 << endl;
898  cout << sk.x0 << " " << sk.x1 << " " << sk.x2 << " " << sk.x3 << endl;
899  cout << res.good_sat << endl;
900  if (res.success==true) {
901  fout << "<tr bgcolor=\"#dddddd\">";
902  } else {
903  fout << "<tr>";
904  }
905 
906  // Output HTML row
907  fout << "<td><a href=\"http://o2scl.svn.sourceforge.net/viewvc/"
908  << "o2scl/trunk/data/o2scl/skdata/" << res.name
909  << "\">" << res.name << "</a></td>";
910  fout << "<td>" << fd.convert(res.n0) << "</td>";
911  fout << "<td>" << fd.convert(res.B) << "</td>";
912  fout << "<td>" << fd.convert(res.K) << "</td>";
913  fout << "<td>" << fd.convert(res.S) << "</td>";
914  fout << "<td>" << fd.convert(res.L) << "</td>";
915  fout << "<td>" << fd.convert(res.m_max) << "</td>";
916  fout << "<td>" << fd.convert(res.r_max) << "</td>";
917  fout << "<td>" << fd.convert(res.nb_max) << "</td>";
918  fout << "<td>" << fd.convert(res.r_14) << "</td>";
919  fout << "<td>" << fd.convert(res.nb_14) << "</td>";
920  fout << "<td>" << fd.convert(res.acausal) << "</td>";
921  fout << "<td>" << fd.convert(res.pressure_dec) << "</td>";
922  fout << "<td>" << fd.convert(res.neut_qual) << "</td>";
923  if (res.max_mass_ok) fout << "<td>True</td>";
924  else fout << "<td>False</td>";
925  if (res.inc_pressure) fout << "<td>True</td>";
926  else fout << "<td>False</td>";
927  if (res.pos_neut) fout << "<td>True</td>";
928  else fout << "<td>False</td>";
929  if (res.good_sat) fout << "<td>True</td>";
930  else fout << "<td>False</td>";
931  if (res.pure_neut) fout << "<td>True</td>";
932  else fout << "<td>False</td>";
933  fout << "<td>" << res.other << "</td>";
934  if (res.success) fout << "<td>True</td>";
935  else fout << "<td>False</td>";
936  fout << "</tr>" << endl;
937 
938  // Output CSV row
939  fouu << res.name << ", ";
940  fouu << res.n0 << ", ";
941  fouu << res.B << ", ";
942  fouu << res.K << ", ";
943  fouu << res.S << ", ";
944  fouu << res.L << ", ";
945  fouu << res.m_max << ", ";
946  fouu << res.r_max << ", ";
947  fouu << res.nb_max << ", ";
948  fouu << res.r_14 << ", ";
949  fouu << res.nb_14 << ", ";
950  fouu << res.acausal << ", ";
951  fouu << res.pressure_dec << ", ";
952  fouu << res.neut_qual << ", ";
953  if (res.max_mass_ok) fouu << "True, ";
954  else fouu << "False, ";
955  if (res.inc_pressure) fouu << "True, ";
956  else fouu << "False, ";
957  if (res.pos_neut) fouu << "True, ";
958  else fouu << "False, ";
959  if (res.good_sat) fouu << "True, ";
960  else fouu << "False, ";
961  if (res.pure_neut) fouu << "True, ";
962  else fouu << "False, ";
963  fouu << res.other << ", ";
964  if (res.success) fouu << "True ";
965  else fouu << "False ";
966  fouu << endl;
967 
968  }
969  }
970 
971  fout << "</table></body></html>" << endl;
972  fout.close();
973 
974  fouu.close();
975 
976 
977  return 0;
978  }
979 
980 };
981 
982 
983 int main(int argc, char *argv[]) {
984 
985  cout.setf(ios::scientific);
986 
988 
989  // ---------------------------------------
990  // Specify command-line option object
991 
992  cli cl;
993  cl.prompt="ex_eos_had_skyrme> ";
994 
995  int comm_option_cl_param=1;
996  int comm_option_both=2;
997 
998  static const int narr=7;
999  comm_option_s options_arr[narr]={
1000  {0,"run-all","Run all internally stored Skyrme models.",0,0,"","",
1002  comm_option_both},
1003  {'s',"store","Store current model.",1,1,"","",
1005  comm_option_both},
1006  {'l',"load","Load internally stored model.",1,1,"","",
1008  comm_option_both},
1009  {0,"unedf","Desc.",0,0,"","",
1011  comm_option_both},
1012  {'t',"test","Test ex_eos_had_skyrme.",0,0,"","",
1014  comm_option_both},
1015  {'u',"summary","Summarize the properties of a Skyrme model.",
1016  1,1,"<model>","",
1018  comm_option_both},
1019  {'j',"json","Summarize the properties of a Skyrme model.",
1020  1,1,"<model>","",
1022  comm_option_both}
1023  };
1024 
1025  cl.set_comm_option_vec(narr,options_arr);
1026  cl.cmd_name="ex_eos_had_skyrme";
1027 
1028  // ---------------------------------------
1029  // Set the parameters
1030 
1031  cli::parameter_int p_verbose;
1032  p_verbose.i=&se.verbose;
1033  p_verbose.help="Verbose (default 1).";
1034  cl.par_list.insert(make_pair("verbose",&p_verbose));
1035 
1036  cli::parameter_bool p_output_files;
1037  p_output_files.b=&se.output_files;
1038  p_output_files.help="Output files (default 0).";
1039  cl.par_list.insert(make_pair("output-files",&p_output_files));
1040 
1041  cli::parameter_string p_file_prefix;
1042  p_file_prefix.str=&se.file_prefix;
1043  p_file_prefix.help="File prefix (default \"\").";
1044  cl.par_list.insert(make_pair("file-prefix",&p_file_prefix));
1045 
1046  cli::parameter_string p_name;
1047  p_name.str=&se.name;
1048  p_name.help="Model name (default \"\").";
1049  cl.par_list.insert(make_pair("name",&p_name));
1050 
1051  cli::parameter_string p_reference;
1052  p_reference.str=&se.sk.reference;
1053  p_reference.help="Model reference (default \"\").";
1054  cl.par_list.insert(make_pair("reference",&p_reference));
1055 
1056  cli::parameter_double p_t0hc;
1057  p_t0hc.d=&se.t0hc;
1058  p_t0hc.help="Model parameter t0 in MeV.";
1059  cl.par_list.insert(make_pair("t0hc",&p_t0hc));
1060 
1061  cli::parameter_double p_t1hc;
1062  p_t1hc.d=&se.t1hc;
1063  p_t1hc.help="Model parameter t1 in MeV.";
1064  cl.par_list.insert(make_pair("t1hc",&p_t1hc));
1065 
1066  cli::parameter_double p_t2hc;
1067  p_t2hc.d=&se.t2hc;
1068  p_t2hc.help="Model parameter t2 in MeV.";
1069  cl.par_list.insert(make_pair("t2hc",&p_t2hc));
1070 
1071  cli::parameter_double p_t3hc;
1072  p_t3hc.d=&se.t3hc;
1073  p_t3hc.help="Model parameter t3 in MeV.";
1074  cl.par_list.insert(make_pair("t3hc",&p_t3hc));
1075 
1076  cli::parameter_double p_x0;
1077  p_x0.d=&se.sk.x0;
1078  p_x0.help="Model parameter x0.";
1079  cl.par_list.insert(make_pair("x0",&p_x0));
1080 
1081  cli::parameter_double p_x1;
1082  p_x1.d=&se.sk.x1;
1083  p_x1.help="Model parameter x1.";
1084  cl.par_list.insert(make_pair("x1",&p_x1));
1085 
1086  cli::parameter_double p_x2;
1087  p_x2.d=&se.sk.x2;
1088  p_x2.help="Model parameter x2.";
1089  cl.par_list.insert(make_pair("x2",&p_x2));
1090 
1091  cli::parameter_double p_x3;
1092  p_x3.d=&se.sk.x3;
1093  p_x3.help="Model parameter x3.";
1094  cl.par_list.insert(make_pair("x3",&p_x3));
1095 
1097  p_a.d=&se.sk.a;
1098  p_a.help="Model parameter a.";
1099  cl.par_list.insert(make_pair("a",&p_a));
1100 
1102  p_b.d=&se.sk.b;
1103  p_b.help="Model parameter b.";
1104  cl.par_list.insert(make_pair("b",&p_b));
1105 
1106  cli::parameter_double p_W0hc;
1107  p_W0hc.d=&se.W0hc;
1108  p_W0hc.help="Model parameter W0hc.";
1109  cl.par_list.insert(make_pair("W0hc",&p_W0hc));
1110 
1111  cli::parameter_double p_alpha;
1112  p_alpha.d=&se.sk.alpha;
1113  p_alpha.help="Model parameter alpha.";
1114  cl.par_list.insert(make_pair("alpha",&p_alpha));
1115 
1116  cli::parameter_double p_b4;
1117  p_b4.d=&se.sk.b4;
1118  p_b4.help="Model parameter b4.";
1119  cl.par_list.insert(make_pair("b4",&p_b4));
1120 
1121  cli::parameter_double p_b4p;
1122  p_b4p.d=&se.sk.b4p;
1123  p_b4p.help="Model parameter b4p.";
1124  cl.par_list.insert(make_pair("b4p",&p_b4p));
1125 
1126  // ---------------------------------------
1127  // Process command-line options
1128 
1129  cl.run_auto(argc,argv);
1130 
1131  return 0;
1132 }
1133 
ex_skyrme_data::pressure_dec
double pressure_dec
True if the pressure is flat.
Definition: ex_eos_had_skyrme.cpp:76
ex_eos_had_skyrme::tneut2
table_units tneut2
Neutron matter.
Definition: ex_eos_had_skyrme.cpp:133
o2scl::eos_had_base::saturation
virtual int saturation()
Calculates some of the EOS properties at the saturation density.
o2scl::eos_had_skyrme::alt_params_set
void alt_params_set(double Crr00, double Crr10, double Crr0D, double Crr1D, double Crt0, double Crt1, double CrDr0, double CrDr1, double CrnJ0, double CrnJ1, double alpha2)
Set using alternate parameterization.
ex_skyrme_data::other
int other
Desc.
Definition: ex_eos_had_skyrme.cpp:90
ex_eos_had_skyrme::store
int store(vector< string > &sv, bool itive_com)
Write to a file.
Definition: ex_eos_had_skyrme.cpp:602
o2scl::cli::cmd_name
std::string cmd_name
thermo_tl< double >::ed
double ed
o2scl_const
hdf_output
void hdf_output(hdf_file &hf, o2scl::uniform_grid< double > &h, std::string name)
ex_eos_had_skyrme::t1hc
double t1hc
Parameter t1 in MeV.
Definition: ex_eos_had_skyrme.cpp:147
o2scl_const::pi2
const double pi2
o2scl::nstar_cold
Naive static cold neutron star.
Definition: nstar_cold.h:185
o2scl::nstar_cold::get_eos_results
std::shared_ptr< table_units<> > get_eos_results()
Get the eos table (after having called calc_eos())
Definition: nstar_cold.h:296
ex_eos_had_skyrme::n
fermion n
Neutron.
Definition: ex_eos_had_skyrme.cpp:112
o2scl::table_units::clear_table
virtual void clear_table()
ex_eos_had_skyrme::t2hc
double t2hc
Parameter t2 in MeV.
Definition: ex_eos_had_skyrme.cpp:150
ex_eos_had_skyrme::low_neutron_mat
int low_neutron_mat()
Check low-density neutron matter.
Definition: ex_eos_had_skyrme.cpp:275
exc_efailed
exc_efailed
ex_skyrme_data::inc_pressure
bool inc_pressure
True if the pressure is nondecreasing.
Definition: ex_eos_had_skyrme.cpp:82
ex_skyrme_data::n0
double n0
Saturation density.
Definition: ex_eos_had_skyrme.cpp:54
o2scl::lib_settings_class::get_data_dir
std::string get_data_dir()
o2scl::nstar_cold::set_eos
void set_eos(eos_had_base &he)
Set the equation of state.
Definition: nstar_cold.h:197
ex_eos_had_skyrme::res
ex_skyrme_data res
Results.
Definition: ex_eos_had_skyrme.cpp:124
o2scl::table_units::set_unit
void set_unit(std::string scol, std::string unit)
ex_eos_had_skyrme::W0hc
double W0hc
Parameter W0 in MeV.
Definition: ex_eos_had_skyrme.cpp:156
o2scl::eos_had_skyrme::b4p
double b4p
Isovector spin-orbit term (in )
Definition: eos_had_skyrme.h:480
o2scl::eos_had_base::msom
double msom
Effective mass (neutron)
Definition: eos_had_base.h:349
o2scl::test_mgr::report
bool report() const
o2scl::cli::parameter_bool::b
bool * b
o2scl::nstar_cold::calc_eos
int calc_eos(double np_0=0.0)
Calculate the given equation of state.
ex_skyrme_data::alt_S
double alt_S
Alternate description of symmetry energy.
Definition: ex_eos_had_skyrme.cpp:94
ex_eos_had_skyrme::json
int json(vector< string > &sv, bool itive_com)
Summarize the results of one model.
Definition: ex_eos_had_skyrme.cpp:504
o2scl_mks::mass_electron
const double mass_electron
o2scl::eos_had_base::f_effm_neut
virtual double f_effm_neut(double nb, double delta=0.0)
Neutron (reduced) effective mass.
ex_skyrme_data::name
string name
Name of model.
Definition: ex_eos_had_skyrme.cpp:52
ex_eos_had_skyrme::t3hc
double t3hc
Parameter t3 in MeV.
Definition: ex_eos_had_skyrme.cpp:153
thermo_tl< double >
o2scl::eos_had_base::n0
double n0
Saturation density in .
Definition: eos_had_base.h:346
o2scl::nstar_cold::acausal
double acausal
The density at which the EOS becomes acausal.
Definition: nstar_cold.h:261
o2scl::eos_had_base::f_effm_vector
virtual double f_effm_vector(double nb, double delta=1.0)
Vector effective mass.
ex_eos_had_skyrme::tneut
table_units tneut
Neutron matter.
Definition: ex_eos_had_skyrme.cpp:130
o2scl::format_float::html_mode
void html_mode()
o2scl::lib_settings_class::get_convert_units
convert_units< double > & get_convert_units()
o2scl_hdf::hdf_file::close
void close()
ex_eos_had_skyrme::nst
nstar_cold nst
To compute neutron stars.
Definition: ex_eos_had_skyrme.cpp:109
ex_skyrme_data::nb_max
double nb_max
Central baryon density of maximum mass star.
Definition: ex_eos_had_skyrme.cpp:68
ex_eos_had_skyrme::json_mode
bool json_mode
If true, output JSON.
Definition: ex_eos_had_skyrme.cpp:174
ex_eos_had_skyrme
Class to analyze Skyrme EOSs and output the results [Example class].
Definition: ex_eos_had_skyrme.cpp:104
o2scl::cli::parameter_bool
ex_skyrme_data::B
double B
Binding energy.
Definition: ex_eos_had_skyrme.cpp:56
ex_eos_had_skyrme::p
fermion p
Proton.
Definition: ex_eos_had_skyrme.cpp:115
ex_skyrme_data::pos_neut
bool pos_neut
True if neutron matter is always positive.
Definition: ex_eos_had_skyrme.cpp:84
o2scl::nstar_cold::pressure_dec
double pressure_dec
The smallest baryon density where the pressure starts to decrease.
Definition: nstar_cold.h:239
o2scl::nstar_cold::include_muons
bool include_muons
If true, include muons (default false)
Definition: nstar_cold.h:324
ex_eos_had_skyrme::b4phc
double b4phc
Parameter b4p.
Definition: ex_eos_had_skyrme.cpp:162
o2scl::cli::parameter_string
o2scl::eos_had_skyrme::b4
double b4
Isoscalar spin-orbit term (in )
Definition: eos_had_skyrme.h:477
ex_eos_had_skyrme::fd
format_float fd
Formatting output.
Definition: ex_eos_had_skyrme.cpp:127
ex_skyrme_data::E_neut_n0
double E_neut_n0
Energy of neutron matter at saturation.
Definition: ex_eos_had_skyrme.cpp:96
ex_skyrme_data::m_max
double m_max
Maximum mass.
Definition: ex_eos_had_skyrme.cpp:64
o2scl::table_units
o2scl::format_float::convert
std::string convert(double x, bool debug=false)
ex_skyrme_data::neut_qual
double neut_qual
Quality of neutron matter.
Definition: ex_eos_had_skyrme.cpp:78
o2scl::cli::par_list
std::map< std::string, parameter *, std::less< std::string > > par_list
ex_skyrme_data::P_neut_n0
double P_neut_n0
Pressure of neutron matter at saturation.
Definition: ex_eos_had_skyrme.cpp:98
o2scl_settings
lib_settings_class o2scl_settings
o2scl_hdf::skyrme_write
void skyrme_write(hdf_file &hf, o2scl::eos_had_skyrme &sk, std::string name)
Write a o2scl::eos_had_skyrme object to an HDF file.
ex_eos_had_skyrme::hf
hdf_file hf
File for I/O.
Definition: ex_eos_had_skyrme.cpp:121
o2scl::nstar_cold::def_eos_tov
eos_tov_interp def_eos_tov
Default EOS object for the TOV solver.
Definition: nstar_cold.h:370
o2scl::test_mgr::test_rel
bool test_rel(data_t result, data_t expected, data_t rel_error, std::string description)
ex_eos_had_skyrme::check_pressure
int check_pressure()
Check if the pressure of neutron matter is positive.
Definition: ex_eos_had_skyrme.cpp:240
ex_skyrme_data::max_mass_ok
bool max_mass_ok
True if the maximum mass is large enough.
Definition: ex_eos_had_skyrme.cpp:80
ex_eos_had_skyrme::run_all
int run_all(vector< string > &sv, bool itive_com)
Run all the models.
Definition: ex_eos_had_skyrme.cpp:780
o2scl::cli::parameter_int::i
int * i
exc_einval
exc_einval
ex_skyrme_data::success
bool success
Desc.
Definition: ex_eos_had_skyrme.cpp:92
o2scl::eos_had_base::esym
double esym
Symmetry energy in .
Definition: eos_had_base.h:343
ex_eos_had_skyrme::b4hc
double b4hc
Parameter b4.
Definition: ex_eos_had_skyrme.cpp:159
o2scl::eos_had_base::fesym_slope
virtual double fesym_slope(double nb, double delta=0.0)
The symmetry energy slope parameter in .
hc_mev_fm
const double hc_mev_fm
o2scl::eos_had_base::fesym_diff
virtual double fesym_diff(double nb)
Calculate symmetry energy of matter as energy of neutron matter minus the energy of nuclear matter in...
o2scl::nstar_cold::calc_nstar
int calc_nstar()
Calculate the M vs. R curve.
o2scl::eos_had_base::f_effm_scalar
virtual double f_effm_scalar(double nb, double delta=0.0)
Scalar effective mass.
o2scl::cli::parameter_int
o2scl::convert_units::convert
virtual fp_t convert(std::string from, std::string to, fp_t val)
thermo_tl< double >::pr
double pr
o2scl::test_mgr
o2scl_hdf
Additional functions to read and write EOS data to HDF5 files.
o2scl::nstar_cold::nb_end
double nb_end
The final baryon density (default 2.0)
Definition: nstar_cold.h:316
o2scl::eos_had_base::eoa
double eoa
Binding energy (without the rest mass) in .
Definition: eos_had_base.h:332
o2scl::comm_option_s
o2scl::cli
ex_eos_had_skyrme::name
string name
Model name.
Definition: ex_eos_had_skyrme.cpp:141
ex_eos_had_skyrme::verbose
int verbose
Verbose parameter.
Definition: ex_eos_had_skyrme.cpp:165
o2scl::eos_had_skyrme
Skyrme hadronic equation of state.
Definition: eos_had_skyrme.h:226
o2scl::cli::parameter_double
o2scl_mks::mass_neutron
const double mass_neutron
ex_skyrme_data::K
double K
Compressibility.
Definition: ex_eos_had_skyrme.cpp:58
ex_eos_had_skyrme::th
thermo th
Thermodynamics.
Definition: ex_eos_had_skyrme.cpp:118
o2scl::eos_tov::verbose
int verbose
Control for output (default 1)
Definition: eos_tov.h:64
o2scl::comm_option_mfptr
o2scl::cli::parameter_double::d
double * d
o2scl_mks::mass_proton
const double mass_proton
ex_skyrme_data::r_14
double r_14
Radius of a 1.4 solar mass star.
Definition: ex_eos_had_skyrme.cpp:70
o2scl::cli::prompt
std::string prompt
ex_skyrme_data::r_max
double r_max
Radius of maximum mass star.
Definition: ex_eos_had_skyrme.cpp:66
o2scl::nstar_cold::get_tov_results
std::shared_ptr< table_units<> > get_tov_results()
Get the results from the TOV (after having called calc_nstar())
Definition: nstar_cold.h:302
o2scl::test_mgr::set_output_level
void set_output_level(int l)
o2scl::format_float
ex_eos_had_skyrme::output_files
bool output_files
If true, create output files for individual EOSs.
Definition: ex_eos_had_skyrme.cpp:168
ex_eos_had_skyrme::load
int load(vector< string > &sv, bool itive_com)
Load internally stored model.
Definition: ex_eos_had_skyrme.cpp:762
o2scl_hdf::hdf_file
o2scl_hdf::hdf_file::open_or_create
void open_or_create(std::string fname)
o2scl::cli::run_auto
int run_auto(int argc, char *argv[], int debug=0)
o2scl_hdf::skyrme_load
void skyrme_load(o2scl::eos_had_skyrme &sk, std::string model, bool external=false, int verbose=0)
Input a o2scl::eos_had_skyrme object from an HDF file.
ex_eos_had_skyrme::mvsr
int mvsr()
Compute the M vs. R curve.
Definition: ex_eos_had_skyrme.cpp:389
ex_eos_had_skyrme::test
int test(vector< string > &sv, bool itive_com)
Test the code.
Definition: ex_eos_had_skyrme.cpp:575
o2scl::eos_had_base::def_neutron
fermion def_neutron
The defaut neutron.
Definition: eos_had_base.h:756
o2scl::eos_had_base::comp
double comp
Compression modulus in .
Definition: eos_had_base.h:340
ex_eos_had_skyrme::saturation_prop
int saturation_prop()
Test saturation density.
Definition: ex_eos_had_skyrme.cpp:330
ex_eos_had_skyrme::unedf
int unedf(vector< string > &sv, bool itive_com)
Create data files for the UNEDF forces.
Definition: ex_eos_had_skyrme.cpp:622
ex_skyrme_data::good_sat
bool good_sat
True if saturation is good.
Definition: ex_eos_had_skyrme.cpp:86
o2scl::cli::parameter_string::str
std::string * str
ex_skyrme_data::S
double S
Symmetry energy.
Definition: ex_eos_had_skyrme.cpp:60
o2scl::nstar_cold::verbose
int verbose
Verbosity parameter (default 0)
Definition: nstar_cold.h:282
o2scl::eos_had_base::def_proton
fermion def_proton
The defaut proton.
Definition: eos_had_base.h:764
ex_skyrme_data::nb_14
double nb_14
Central baryon density of a 1.4 solar mass neutron star.
Definition: ex_eos_had_skyrme.cpp:72
ex_skyrme_data::L
double L
Symmetry energy slope parameter.
Definition: ex_eos_had_skyrme.cpp:62
ex_skyrme_data::acausal
double acausal
True if the EOS is acausal.
Definition: ex_eos_had_skyrme.cpp:74
ex_eos_had_skyrme::file_prefix
string file_prefix
Prefix for output files.
Definition: ex_eos_had_skyrme.cpp:171
ex_skyrme_data::pure_neut
double pure_neut
Desc.
Definition: ex_eos_had_skyrme.cpp:88
ex_eos_had_skyrme::summary
int summary(vector< string > &sv, bool itive_com)
Summarize the results of one model.
Definition: ex_eos_had_skyrme.cpp:536
o2scl::convert_units::use_gnu_units
bool use_gnu_units
o2scl::eos_had_skyrme::reference
std::string reference
Bibliographic reference.
Definition: eos_had_skyrme.h:483
o2scl::tov_solve::verbose
int verbose
control for output (default 1)
Definition: tov_solve.h:558
o2scl::cli::set_comm_option_vec
int set_comm_option_vec(size_t list_size, vec_t &option_list)
o2scl::eos_had_base::f_effm_prot
virtual double f_effm_prot(double nb, double delta=0.0)
Proton (reduced) effective mass.
o2scl::eos_had_skyrme::W0
double W0
Spin-orbit splitting (in )
Definition: eos_had_skyrme.h:474
ex_eos_had_skyrme::compare_neut_nstar
void compare_neut_nstar()
Generate a table comparing neutron matter and neutron star matter.
Definition: ex_eos_had_skyrme.cpp:205
o2scl::eos_had_skyrme::calc_e
virtual int calc_e(fermion &ne, fermion &pr, thermo &lt)
Equation of state as a function of densities at zero temperature.
o2scl::eos_had_skyrme::alt_params_saturation
void alt_params_saturation(double n0, double EoA, double K, double Ms_star, double a, double L, double Mv_star, double CrDr0, double CrDr1, double CrnJ0, double CrnJ1)
Use the specified saturation properties and couplings and the function alt_params_set() to set the Sk...
szttos
std::string szttos(size_t x)
ex_eos_had_skyrme::t0hc
double t0hc
Parameter t0 in MeV.
Definition: ex_eos_had_skyrme.cpp:144
o2scl::cli::parameter::help
std::string help
ex_skyrme_data
Output data for a Skyrme EOS [Example class].
Definition: ex_eos_had_skyrme.cpp:47
ex_eos_had_skyrme::sk
eos_had_skyrme sk
Base EOS model.
Definition: ex_eos_had_skyrme.cpp:138
o2scl::nstar_cold::def_tov
tov_solve def_tov
The default TOV equation solver.
Definition: nstar_cold.h:363

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).