ex_eos_had_skyrme.cpp
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, 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
113 
114  /// Proton
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 
582  // Just summarize SLy4
583  vector<string> args;
584  args.push_back("summary");
585  args.push_back("SLy4");
586  summary(args,0);
587 
588  // And compare to expected results
589  t.test_rel(res.n0,0.1595468,1.0e-5,"n0");
590  t.test_rel(res.m_max,2.050391,4.0e-4,"m_max");
591  t.test_rel(res.r_14,11.72476,4.0e-3,"R_1.4");
592 
593  t.report();
594 
595  output_files=of_old;
596 
597  return 0;
598  }
599 
600  /// Write to a file
601  int store(vector<string> &sv, bool itive_com) {
602 
603  if (sv.size()<2) {
604  cout << "No filename specified in 'store'." << endl;
605  return exc_efailed;
606  }
607 
608  hf.open_or_create(sv[1]);
609  skyrme_write(hf,sk,name);
610  hf.close();
611 
612  if (verbose>0) {
613  cout << "Wrote model '" << name << "' to file named '"
614  << sv[1] << "'." << endl;
615  }
616 
617  return 0;
618  }
619 
620  /// Create data files for the UNEDF forces
621  int unedf(vector<string> &sv, bool itive_com) {
622 
623  test_mgr t;
624  t.set_output_level(1);
625 
626  /*
627  These couplings are in the supplemental material
628  for Kortelainen et al. PRC 89 (2014)
629  */
630  double coups[13][3]={
631  {-706.382928878428856,-779.3730087208653,-650.796319465688839},
632  {240.049520427681131,287.722131583286796,291.664014339185485},
633  {868.871771539645351,891.47789044234969,768.32770588203357},
634  {-69.0518957481631617,-200.587774317884879,-283.187292227492492},
635  {-12.9172408208016112,-0.989915057807676746,9.78520558824309639},
636  {-45.1894169426759476,-33.6320970701835549,-23.3573612977035339},
637  {0.321955989588264435,0.2700180115027076,0.351455132555483607},
638  {-55.2606,-45.135131022237303,-46.8314091470605973},
639  {-55.6226,-145.382167908057,-113.163790795259004},
640  {-79.5308,-74.0263331764599,-64.3088624157838069},
641  {45.6302,-35.6582611147917,-38.6501946851355029},
642  {0.0,0.0,-54.4333635973721002},
643  {0.0,0.0,-65.9030310445938028}
644  };
645 
646  sk.def_neutron.m=hc_mev_fm/20.73553/2.0;
647  sk.def_proton.m=hc_mev_fm/20.73553/2.0;
648 
649  for(size_t i=0;i<3;i++) {
650  cout << "UNEDF" << i << ":" << endl;
651 
652  // Convert to O2scl units
653  for(size_t j=0;j<13;j++) {
654  if (j!=6) {
655  coups[j][i]/=hc_mev_fm;
656  }
657  }
658 
659  sk.alt_params_set(coups[0][i],coups[1][i],coups[2][i],coups[3][i],
660  coups[4][i],coups[5][i],coups[7][i],coups[8][i],
661  coups[9][i],coups[10][i],coups[6][i]);
662 
663  // Test coefficients from Kortelainen et al. PRC 85 (2012) 024304
664  if (i==0) {
665  t.test_rel(sk.t0*hc_mev_fm,-1883.68781034,1.0e-4,"");
666  t.test_rel(sk.t1*hc_mev_fm,277.50021224,1.0e-4,"");
667  t.test_rel(sk.t2*hc_mev_fm,608.43090559,1.0e-4,"");
668  t.test_rel(sk.t3*hc_mev_fm,13901.94834463,1.0e-4,"");
669  t.test_rel(sk.x0,0.00974375,1.0e-4,"");
670  t.test_rel(sk.x1,-1.77784395,1.0e-4,"");
671  t.test_rel(sk.x2,-1.67699035,1.0e-4,"");
672  t.test_rel(sk.x3,-0.38079041,1.0e-4,"");
673  t.test_rel(sk.b4*hc_mev_fm,125.16100000,1.0e-4,"");
674  t.test_rel(sk.b4p*hc_mev_fm,-91.2604000,1.0e-4,"");
675  } else if (i==1) {
676  t.test_rel(sk.t0*hc_mev_fm,-2078.32802326,1.0e-4,"");
677  t.test_rel(sk.t1*hc_mev_fm,239.40081204,1.0e-4,"");
678  t.test_rel(sk.t2*hc_mev_fm,1575.11954190,1.0e-4,"");
679  t.test_rel(sk.t3*hc_mev_fm,14263.64624708,1.0e-4,"");
680  t.test_rel(sk.x0,0.05375692,1.0e-4,"");
681  t.test_rel(sk.x1,-5.07723238,1.0e-4,"");
682  t.test_rel(sk.x2,-1.36650561,1.0e-4,"");
683  t.test_rel(sk.x3,-0.16249117,1.0e-4,"");
684  t.test_rel(sk.b4*hc_mev_fm,38.36807206,1.0e-4,"");
685  t.test_rel(sk.b4p*hc_mev_fm,71.31652223,1.0e-4,"");
686  }
687 
688  if (i==0) {
690  (0.160526,-16.0559/hc_mev_fm,230.0/hc_mev_fm,1.0/0.9,
691  30.5429/hc_mev_fm,45.0804/hc_mev_fm,1.0/1.249838,coups[7][i],
692  coups[8][i],coups[9][i],coups[10][i]);
693 
694  sk.saturation();
695  cout << "n0: " << sk.n0 << endl;
696  cout << "E/A: " << sk.eoa*hc_mev_fm << endl;
697  cout << "K: " << sk.comp*hc_mev_fm << endl;
698  cout << "Esym: " << sk.esym*hc_mev_fm << endl;
699  cout << "M_n^*: " << sk.f_effm_neut(sk.n0) << endl;
700  cout << "M_p^*: " << sk.f_effm_prot(sk.n0) << endl;
701  cout << "1/M_s^*: " << 1.0/sk.f_effm_scalar(sk.n0) << endl;
702  cout << "1/M_v^*: " << 1.0/sk.f_effm_vector(sk.n0) << endl;
703  cout << "L: " << sk.fesym_slope(sk.n0)*hc_mev_fm << endl;
704  cout << "alpha: " << sk.alpha << endl;
705  }
706 
707  sk.saturation();
708 
709  // These numbers from Table IV in Kortelainen et al. (2014)
710  if (i==0) {
711  t.test_rel(sk.n0,0.16053,1.0e-4,"n0 0");
712  } else if (i==1) {
713  t.test_rel(sk.n0,0.15871,1.0e-4,"n0 1");
714  } else {
715  t.test_rel(sk.n0,0.15631,1.0e-4,"n0 2");
716  }
717  if (i==0) {
718  t.test_rel(sk.eoa*hc_mev_fm,-16.056,1.0e-4,"eoa 0");
719  } else if (i==1) {
720  t.test_rel(sk.eoa*hc_mev_fm,-15.8,1.0e-4,"eoa 1");
721  } else {
722  t.test_rel(sk.eoa*hc_mev_fm,-15.8,1.0e-4,"eoa 2");
723  }
724  if (i==0) {
725  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,45.080,1.0e-4,"L 0");
726  } else if (i==1) {
727  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,40.005,1.0e-4,"L 1");
728  } else {
729  t.test_rel(sk.fesym_slope(sk.n0)*hc_mev_fm,40.0,1.0e-4,"L 2");
730  }
731 
732  if (i==0) {
733  sk.reference=((string)"M. Kortelainen, T. Lesinski, ")+
734  "J. More, W. Nazarewicz, J. Sarich, N. Schunck, "+
735  "M. V. Stoitsov, and S. Wild, Phys. Rev. C 82, "+
736  "024313 (2010).";
737  } else if (i==1) {
738  sk.reference=((string)"M. Kortelainen, J. McDonnell, ")+
739  "W. Nazarewicz, P.-G. Reinhard, J. Sarich, N. Schunck, "+
740  "M. V. Stoitsov, and S. M. Wild, Phys. Rev. C 85, "+
741  "024304 (2012).";
742  } else {
743  sk.reference=((string)"M. Kortelainen, J. McDonnell, ")+
744  "W. Nazarewicz, E. Olsen, P.-G. Reinhard, J. Sarich, "+
745  "N. Schunck, S. M. Wild, D. Davesne, J. Erler, "+
746  "and A. Pastore, Phys. Rev. C 89, 054314 (2014)";
747  }
748 
749  hf.open_or_create(((string)"UNEDF")+szttos(i)+".o2");
750  skyrme_write(hf,sk,((string)"UNEDF")+szttos(i));
751  hf.close();
752  cout << endl;
753  }
754 
755  t.report();
756 
757  return 0;
758  }
759 
760  /// Load internally stored model
761  int load(vector<string> &sv, bool itive_com) {
762 
763  if (sv.size()<2) {
764  cout << "No model specified in 'load'." << endl;
765  return exc_efailed;
766  }
767 
768  name=sv[1];
769  skyrme_load(sk,name);
770 
771  if (verbose>0) {
772  cout << "Loaded model '" << name << "'." << endl;
773  }
774 
775  return 0;
776  }
777 
778  /// Run all the models
779  int run_all(vector<string> &sv, bool itive_com) {
780 
781  size_t nmods=0;
782  std::string mlist[200], stemp;
783 
784  string fname=o2scl_settings.get_data_dir()+"/skdata/model_list";
785  ifstream fin(fname.c_str());
786  fin >> nmods;
787  for(size_t i=0;i<nmods;i++) {
788  fin >> mlist[i];
789  }
790  fin.close();
791 
792  ofstream fouu("table.csv");
793  fouu << "Name, n0, B, K, ";
794  fouu << "S, L, Mmax, ";
795  fouu << "Rmax, nB_cent_max, R1.4, ";
796  fouu << "nB_cent_14, acausal, pressure_dec, ";
797  fouu << "neut_qual, max_mass_ok, ";
798  fouu << "inc_pressure, pos_neut, good_sat, ";
799  fouu << "pure_neut, other, success" << endl;
800 
801  ofstream fout("table.html");
802  fout << "<html><body>" << endl;
803  fout << "<table border=0 cellspacing=0><tr bgcolor=\"#bbbbbb\">" << endl;
804  fout << "<td>Name&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
805  fout << "<td>n<sub>0</sub>&nbsp;(fm<sup>-3</sup>)"
806  << "&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
807  fout << "<td>B&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
808  fout << "<td>K&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
809  fout << "<td>S&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
810  fout << "<td>L&nbsp;(MeV)&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
811  fout << "<td>M<sub>max</sub>&nbsp;(M<sub>sun</sub>)"
812  << "&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
813  fout << "<td>R<sub>max</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
814  fout << "<td>n<sub>B,cent,max</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
815  fout << "<td>R<sub>1.4</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
816  fout << "<td>n<sub>B,cent,1.4</sub>&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
817  fout << "<td>acausal&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
818  fout << "<td>pressure_dec&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
819  fout << "<td>neut_qual&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
820  fout << "<td>max_mass_ok&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
821  fout << "<td>inc_pressure&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
822  fout << "<td>pos_neut&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
823  fout << "<td>good_sat&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
824  fout << "<td>pure_neut&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
825  fout << "<td>other&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
826  fout << "<td>success&nbsp;&nbsp;&nbsp;&nbsp;</td>" << endl;
827  fout << "</tr>" << endl;
828 
829  // Currently only models which don't give pure neutron matter work.
830  // This list rules out those which have pure neutron matter and
831  // the PeHF-type models which don't work.
832  static const size_t N=66;
833  int list[N]={0,100,101,102,103,109,110,113,114,115,121,122,123,124,
834  125,126,127,128,129,130,131,132,133,134,135,145,147,17,1,
835  25,26,27,28,29,3,40,41,42,43,44,4,51,53,54,5,
836  62,63,64,64,66,67,68,69,6,71,73,75,76,77,7,81,82,84,
837  97,98,99};
838 
839  for(size_t j=0;j<N;j++) {
840 
841  size_t i=list[j];
842 
843  i=2;
844 
845  cout << "Running model: " << i << endl;
846  vector<string> tmp;
847  tmp.push_back("x");
848  tmp.push_back(mlist[i]);
849 
850  // These models are the ones that I used to compute pressure
851  // corrections for neutron -> neutron star matter
852  //
853  //if (mlist[i]=="SkT3" || mlist[i]=="SLy3" || mlist[i]=="SLy4" ||
854  //mlist[i]=="SLy7" || mlist[i]=="SLy230a" || mlist[i]=="SV-mas07" ||
855  //mlist[i]=="SV-sym34" || mlist[i]=="BSk9" || mlist[i]=="KDE0v" ||
856  //mlist[i]=="KDE0v1" || mlist[i]=="Ly5" || mlist[i]=="mst0.81" ||
857  //mlist[i]=="NRAPR" || mlist[i]=="SkMP" || mlist[i]=="BSk14" ||
858  //mlist[i]=="SkO" || mlist[i]=="SkOp" || mlist[i]=="SkT1") {
859 
860  {
861 
862  res.success=true;
863  summary(tmp,true);
864  exit(-1);
865 
866  ofstream fx("jim.dat",ios::app);
867  fx.setf(ios::scientific);
868  fx.setf(ios::showpos);
869  fx.width(10);
870  fx << mlist[i] << " ";
871  fx << res.S << " " << res.alt_S << " "
872  << res.E_neut_n0 << " " << res.P_neut_n0 << " "
873  << res.L << " ";
874  fx << sk.t0 << " " << sk.t1 << " " << sk.t2 << " " << sk.t3 << " ";
875  fx << sk.x0 << " " << sk.x1 << " " << sk.x2 << " " << sk.x3 << " ";
876  fx << sk.alpha << " " << sk.n0 << " " << sk.comp*hc_mev_fm << " ";
877 
878  double c2;
879  {
880  double h=1.0e-4;
881  n.n=sk.n0-h;
882  p.n=0.0;
883  sk.calc_e(n,p,th);
884  double pr1=th.pr;
885  n.n=sk.n0+h;
886  p.n=0.0;
887  sk.calc_e(n,p,th);
888  double pr2=th.pr;
889  c2=(pr2-pr1)/2.0/h*9.0*hc_mev_fm;
890  }
891  fx << c2;
892 
893  fx << endl;
894  fx.close();
895 
896  cout << sk.t0 << " " << sk.t1 << " " << sk.t2 << " " << sk.t3 << endl;
897  cout << sk.x0 << " " << sk.x1 << " " << sk.x2 << " " << sk.x3 << endl;
898  cout << res.good_sat << endl;
899  if (res.success==true) {
900  fout << "<tr bgcolor=\"#dddddd\">";
901  } else {
902  fout << "<tr>";
903  }
904 
905  // Output HTML row
906  fout << "<td><a href=\"http://o2scl.svn.sourceforge.net/viewvc/"
907  << "o2scl/trunk/data/o2scl/skdata/" << res.name
908  << "\">" << res.name << "</a></td>";
909  fout << "<td>" << fd.convert(res.n0) << "</td>";
910  fout << "<td>" << fd.convert(res.B) << "</td>";
911  fout << "<td>" << fd.convert(res.K) << "</td>";
912  fout << "<td>" << fd.convert(res.S) << "</td>";
913  fout << "<td>" << fd.convert(res.L) << "</td>";
914  fout << "<td>" << fd.convert(res.m_max) << "</td>";
915  fout << "<td>" << fd.convert(res.r_max) << "</td>";
916  fout << "<td>" << fd.convert(res.nb_max) << "</td>";
917  fout << "<td>" << fd.convert(res.r_14) << "</td>";
918  fout << "<td>" << fd.convert(res.nb_14) << "</td>";
919  fout << "<td>" << fd.convert(res.acausal) << "</td>";
920  fout << "<td>" << fd.convert(res.pressure_dec) << "</td>";
921  fout << "<td>" << fd.convert(res.neut_qual) << "</td>";
922  if (res.max_mass_ok) fout << "<td>True</td>";
923  else fout << "<td>False</td>";
924  if (res.inc_pressure) fout << "<td>True</td>";
925  else fout << "<td>False</td>";
926  if (res.pos_neut) fout << "<td>True</td>";
927  else fout << "<td>False</td>";
928  if (res.good_sat) fout << "<td>True</td>";
929  else fout << "<td>False</td>";
930  if (res.pure_neut) fout << "<td>True</td>";
931  else fout << "<td>False</td>";
932  fout << "<td>" << res.other << "</td>";
933  if (res.success) fout << "<td>True</td>";
934  else fout << "<td>False</td>";
935  fout << "</tr>" << endl;
936 
937  // Output CSV row
938  fouu << res.name << ", ";
939  fouu << res.n0 << ", ";
940  fouu << res.B << ", ";
941  fouu << res.K << ", ";
942  fouu << res.S << ", ";
943  fouu << res.L << ", ";
944  fouu << res.m_max << ", ";
945  fouu << res.r_max << ", ";
946  fouu << res.nb_max << ", ";
947  fouu << res.r_14 << ", ";
948  fouu << res.nb_14 << ", ";
949  fouu << res.acausal << ", ";
950  fouu << res.pressure_dec << ", ";
951  fouu << res.neut_qual << ", ";
952  if (res.max_mass_ok) fouu << "True, ";
953  else fouu << "False, ";
954  if (res.inc_pressure) fouu << "True, ";
955  else fouu << "False, ";
956  if (res.pos_neut) fouu << "True, ";
957  else fouu << "False, ";
958  if (res.good_sat) fouu << "True, ";
959  else fouu << "False, ";
960  if (res.pure_neut) fouu << "True, ";
961  else fouu << "False, ";
962  fouu << res.other << ", ";
963  if (res.success) fouu << "True ";
964  else fouu << "False ";
965  fouu << endl;
966 
967  }
968  }
969 
970  fout << "</table></body></html>" << endl;
971  fout.close();
972 
973  fouu.close();
974 
975 
976  return 0;
977  }
978 
979 };
980 
981 
982 int main(int argv, char *argc[]) {
983 
984  cout.setf(ios::scientific);
985 
987 
988  // ---------------------------------------
989  // Specify command-line option object
990 
991  cli cl;
992  cl.prompt="ex_eos_had_skyrme> ";
993 
994  int comm_option_cl_param=1;
995  int comm_option_both=2;
996 
997  static const int narr=7;
998  comm_option_s options_arr[narr]={
999  {0,"run-all","Run all internally stored Skyrme models.",0,0,"","",
1001  comm_option_both},
1002  {'s',"store","Store current model.",1,1,"","",
1004  comm_option_both},
1005  {'l',"load","Load internally stored model.",1,1,"","",
1007  comm_option_both},
1008  {0,"unedf","Desc.",0,0,"","",
1010  comm_option_both},
1011  {'t',"test","Test ex_eos_had_skyrme.",0,0,"","",
1013  comm_option_both},
1014  {'u',"summary","Summarize the properties of a Skyrme model.",
1015  1,1,"<model>","",
1017  comm_option_both},
1018  {'j',"json","Summarize the properties of a Skyrme model.",
1019  1,1,"<model>","",
1021  comm_option_both}
1022  };
1023 
1024  cl.set_comm_option_vec(narr,options_arr);
1025  cl.cmd_name="ex_eos_had_skyrme";
1026 
1027  // ---------------------------------------
1028  // Set the parameters
1029 
1030  cli::parameter_int p_verbose;
1031  p_verbose.i=&se.verbose;
1032  p_verbose.help="Verbose (default 1).";
1033  cl.par_list.insert(make_pair("verbose",&p_verbose));
1034 
1035  cli::parameter_bool p_output_files;
1036  p_output_files.b=&se.output_files;
1037  p_output_files.help="Output files (default 0).";
1038  cl.par_list.insert(make_pair("output-files",&p_output_files));
1039 
1040  cli::parameter_string p_file_prefix;
1041  p_file_prefix.str=&se.file_prefix;
1042  p_file_prefix.help="File prefix (default \"\").";
1043  cl.par_list.insert(make_pair("file-prefix",&p_file_prefix));
1044 
1045  cli::parameter_string p_name;
1046  p_name.str=&se.name;
1047  p_name.help="Model name (default \"\").";
1048  cl.par_list.insert(make_pair("name",&p_name));
1049 
1050  cli::parameter_string p_reference;
1051  p_reference.str=&se.sk.reference;
1052  p_reference.help="Model reference (default \"\").";
1053  cl.par_list.insert(make_pair("reference",&p_reference));
1054 
1055  cli::parameter_double p_t0hc;
1056  p_t0hc.d=&se.t0hc;
1057  p_t0hc.help="Model parameter t0 in MeV.";
1058  cl.par_list.insert(make_pair("t0hc",&p_t0hc));
1059 
1060  cli::parameter_double p_t1hc;
1061  p_t1hc.d=&se.t1hc;
1062  p_t1hc.help="Model parameter t1 in MeV.";
1063  cl.par_list.insert(make_pair("t1hc",&p_t1hc));
1064 
1065  cli::parameter_double p_t2hc;
1066  p_t2hc.d=&se.t2hc;
1067  p_t2hc.help="Model parameter t2 in MeV.";
1068  cl.par_list.insert(make_pair("t2hc",&p_t2hc));
1069 
1070  cli::parameter_double p_t3hc;
1071  p_t3hc.d=&se.t3hc;
1072  p_t3hc.help="Model parameter t3 in MeV.";
1073  cl.par_list.insert(make_pair("t3hc",&p_t3hc));
1074 
1075  cli::parameter_double p_x0;
1076  p_x0.d=&se.sk.x0;
1077  p_x0.help="Model parameter x0.";
1078  cl.par_list.insert(make_pair("x0",&p_x0));
1079 
1080  cli::parameter_double p_x1;
1081  p_x1.d=&se.sk.x1;
1082  p_x1.help="Model parameter x1.";
1083  cl.par_list.insert(make_pair("x1",&p_x1));
1084 
1085  cli::parameter_double p_x2;
1086  p_x2.d=&se.sk.x2;
1087  p_x2.help="Model parameter x2.";
1088  cl.par_list.insert(make_pair("x2",&p_x2));
1089 
1090  cli::parameter_double p_x3;
1091  p_x3.d=&se.sk.x3;
1092  p_x3.help="Model parameter x3.";
1093  cl.par_list.insert(make_pair("x3",&p_x3));
1094 
1096  p_a.d=&se.sk.a;
1097  p_a.help="Model parameter a.";
1098  cl.par_list.insert(make_pair("a",&p_a));
1099 
1101  p_b.d=&se.sk.b;
1102  p_b.help="Model parameter b.";
1103  cl.par_list.insert(make_pair("b",&p_b));
1104 
1105  cli::parameter_double p_W0hc;
1106  p_W0hc.d=&se.W0hc;
1107  p_W0hc.help="Model parameter W0hc.";
1108  cl.par_list.insert(make_pair("W0hc",&p_W0hc));
1109 
1110  cli::parameter_double p_alpha;
1111  p_alpha.d=&se.sk.alpha;
1112  p_alpha.help="Model parameter alpha.";
1113  cl.par_list.insert(make_pair("alpha",&p_alpha));
1114 
1115  cli::parameter_double p_b4;
1116  p_b4.d=&se.sk.b4;
1117  p_b4.help="Model parameter b4.";
1118  cl.par_list.insert(make_pair("b4",&p_b4));
1119 
1120  cli::parameter_double p_b4p;
1121  p_b4p.d=&se.sk.b4p;
1122  p_b4p.help="Model parameter b4p.";
1123  cl.par_list.insert(make_pair("b4p",&p_b4p));
1124 
1125  // ---------------------------------------
1126  // Process command-line options
1127 
1128  cl.run_auto(argv,argc);
1129 
1130  return 0;
1131 }
1132 
bool max_mass_ok
True if the maximum mass is large enough.
eos_tov_interp def_eos_tov
Default EOS object for the TOV solver.
Definition: nstar_cold.h:372
string name
Name of model.
void clear_table()
bool good_sat
True if saturation is good.
double S
Symmetry energy.
hdf_file hf
File for I/O.
std::string reference
Bibliographic reference.
std::string cmd_name
double comp
Compression modulus in .
Definition: eos_had_base.h:340
const double mass_proton
std::shared_ptr< table_units<> > get_tov_results()
Get the results from the TOV (after having called calc_nstar())
Definition: nstar_cold.h:304
virtual int calc_e(fermion &ne, fermion &pr, thermo &lt)
Equation of state as a function of density.
Naive static cold neutron star.
Definition: nstar_cold.h:188
ex_skyrme_data res
Results.
double neut_qual
Quality of neutron matter.
virtual double f_effm_neut(double nb, double delta=0.0)
Neutron (reduced) effective mass.
string name
Model name.
int check_pressure()
Check if the pressure of neutron matter is positive.
void compare_neut_nstar()
Generate a table comparing neutron matter and neutron star matter.
int verbose
Verbosity parameter (default 0)
Definition: nstar_cold.h:284
Class to analyze Skyrme EOSs and output the results [Example class].
virtual double convert(std::string from, std::string to, double val)
int verbose
Verbose parameter.
int verbose
control for output (default 1)
Definition: tov_solve.h:471
lib_settings_class o2scl_settings
thermo th
Thermodynamics.
const double mass_neutron
exc_einval
std::string get_data_dir()
int saturation_prop()
Test saturation density.
double W0
Spin-orbit splitting (in )
virtual double f_effm_scalar(double nb, double delta=0.0)
Scalar effective mass.
format_float fd
Formatting output.
void hdf_output(hdf_file &hf, o2scl::table3d &h, std::string name)
bool test_rel(data_t result, data_t expected, data_t rel_error, std::string description)
double esym
Symmetry energy in .
Definition: eos_had_base.h:343
const double hc_mev_fm
virtual double fesym_diff(double nb)
Calculate symmetry energy of matter as energy of neutron matter minus the energy of nuclear matter in...
int run_auto(int argc, char *argv[], int debug=0)
int json(vector< string > &sv, bool itive_com)
Summarize the results of one model.
bool report() const
double n0
Saturation density in .
Definition: eos_had_base.h:346
double L
Symmetry energy slope parameter.
double nb_14
Central baryon density of a 1.4 solar mass neutron star.
double r_max
Radius of maximum mass star.
std::string prompt
bool json_mode
If true, output JSON.
exc_efailed
double pressure_dec
True if the pressure is flat.
double t2hc
Parameter t2 in MeV.
double W0hc
Parameter W0 in MeV.
double pressure_dec
The smallest baryon density where the pressure starts to decrease.
Definition: nstar_cold.h:241
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...
void set_unit(std::string scol, std::string unit)
int test(vector< string > &sv, bool itive_com)
Test the code.
void skyrme_load(o2scl::eos_had_skyrme &sk, std::string model, bool external=false)
Input a o2scl::eos_had_skyrme object from an HDF file.
double acausal
True if the EOS is acausal.
double interp(std::string sx, double x0, std::string sy)
double K
Compressibility.
void open_or_create(std::string fname)
int store(vector< string > &sv, bool itive_com)
Write to a file.
int load(vector< string > &sv, bool itive_com)
Load internally stored model.
double B
Binding energy.
double r_14
Radius of a 1.4 solar mass star.
double alt_S
Alternate description of symmetry energy.
void line_of_names(std::string newheads)
Additional functions to read and write EOS data to HDF5 files.
virtual double f_effm_vector(double nb, double delta=1.0)
Vector effective mass.
table_units tneut
Neutron matter.
eos_had_skyrme sk
Base EOS model.
convert_units & get_convert_units()
bool output_files
If true, create output files for individual EOSs.
std::map< std::string, parameter *, std::less< std::string > > par_list
void line_of_data(size_t nv, const vec2_t &v)
int unedf(vector< string > &sv, bool itive_com)
Create data files for the UNEDF forces.
virtual void add_constant(std::string name, double val)
int set_comm_option_vec(size_t list_size, vec_t &option_list)
Skyrme hadronic equation of state.
double m_max
Maximum mass.
virtual void init(double mass, double dof)
double pure_neut
Desc.
double P_neut_n0
Pressure of neutron matter at saturation.
fermion def_proton
The defaut proton.
Definition: eos_had_base.h:759
tov_solve def_tov
The default TOV equation solver.
Definition: nstar_cold.h:365
std::string convert(double x, bool debug=false)
double t0hc
Parameter t0 in MeV.
double nb_max
Central baryon density of maximum mass star.
double nb_end
The final baryon density (default 2.0)
Definition: nstar_cold.h:318
void new_column(std::string head)
double b4
Isoscalar spin-orbit term (in )
Output data for a Skyrme EOS [Example class].
void set_eos(eos_had_base &he)
Set the equation of state.
Definition: nstar_cold.h:200
virtual double f_effm_prot(double nb, double delta=0.0)
Proton (reduced) effective mass.
virtual double fesym_slope(double nb, double delta=0.0)
The symmetry energy slope parameter in .
double t3hc
Parameter t3 in MeV.
table_units tneut2
Neutron matter.
bool inc_pressure
True if the pressure is nondecreasing.
double n0
Saturation density.
double t1hc
Parameter t1 in MeV.
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.
int summary(vector< string > &sv, bool itive_com)
Summarize the results of one model.
fermion n
Neutron.
std::shared_ptr< table_units<> > get_eos_results()
Get the eos table (after having called calc_eos())
Definition: nstar_cold.h:298
double acausal
The density at which the EOS becomes acausal.
Definition: nstar_cold.h:263
bool non_interacting
void set_output_level(int l)
string file_prefix
Prefix for output files.
int verbose
Control for output (default 1)
Definition: eos_tov.h:63
double b4phc
Parameter b4p.
double msom
Effective mass (neutron)
Definition: eos_had_base.h:349
int calc_nstar()
Calculate the M vs. R curve.
const double mass_electron
nstar_cold nst
To compute neutron stars.
int run_all(vector< string > &sv, bool itive_com)
Run all the models.
int low_neutron_mat()
Check low-density neutron matter.
bool pos_neut
True if neutron matter is always positive.
bool include_muons
If true, include muons (default false)
Definition: nstar_cold.h:326
std::string szttos(size_t x)
virtual void saturation()
Calculates some of the EOS properties at the saturation density.
int calc_eos(double np_0=0.0)
Calculate the given equation of state.
double eoa
Binding energy (without the rest mass) in .
Definition: eos_had_base.h:332
double E_neut_n0
Energy of neutron matter at saturation.
double b4hc
Parameter b4.
double b4p
Isovector spin-orbit term (in )
const double pi2
int mvsr()
Compute the M vs. R curve.
fermion def_neutron
The defaut neutron.
Definition: eos_had_base.h:751
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.

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