Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CustomStellarEvolution.cpp
Go to the documentation of this file.
1 
11 #define BUILDING_LIBRARY
12 #include "CustomStellarEvolution.h"
13 
14 namespace CustomStellarEvolution {
15 
16  Evolution::Evolution(const std::string &filename,
17  const std::vector<Columns> &format,
18  const std::vector<double> &smoothing,
19  const std::vector<int> &nodes)
20  {
21  std::ifstream track(filename.c_str(), std::ios_base::in);
22  std::vector<int> column_numbers(NUM_TRACK_QUANTITIES, -1);
23  for(size_t i=0; i<format.size(); ++i) {
24  std::cerr << "Initial column_numbers[" << format[i] << "]=" << i
25  << std::endl;
26  column_numbers[format[i]]=i;
27  }
28  std::valarray< std::list<double> >
29  quantities=parse_columns(track, column_numbers, false);
30  track.close();
31  interpolate_from(
32  std::valarray<double>(1.0, 1),
33  std::list< std::valarray<double> >(
34  1,
35  list_to_valarray(quantities[AGE])
36  ),
37  std::list< std::valarray<double> >(
38  1,
39  list_to_valarray(quantities[RSTAR])
40  ),
41  std::list< std::valarray<double> >(
42  1,
43  list_to_valarray(quantities[ICONV])
44  ),
45  std::list< std::valarray<double> >(
46  1,
47  list_to_valarray(quantities[IRAD])
48  ),
49  std::list< std::valarray<double> >(
50  1,
51  list_to_valarray(quantities[MRAD])
52  ),
53  std::list< std::valarray<double> >(
54  1,
55  list_to_valarray(quantities[RRAD])
56  ),
57 
58  smoothing[RSTAR],
59  smoothing[ICONV],
60  smoothing[IRAD],
61  smoothing[MRAD],
62  smoothing[RRAD],
63 
64  nodes[RSTAR],
65  nodes[ICONV],
66  nodes[IRAD],
67  nodes[MRAD],
68  nodes[RRAD],
69 
70  (column_numbers[LSTAR]==-1 ?
71  std::list< std::valarray<double> >() :
72  std::list< std::valarray<double> >(1,
73  list_to_valarray(quantities[LSTAR]))),
74  smoothing[LSTAR],
75  nodes[LSTAR],
76 
77  (column_numbers[MRAD]==-1
78  ? 0
79  : std::numeric_limits<double>::max()),
80 
81  0,
82  0
83  );
84  }
85 };
86 
LIB_LOCAL std::valarray< double > list_to_valarray(const std::list< double > &inlist)
Creates a valarray containing the values in the given list.
Definition: Common.h:74
Defines the class which implements a custom single track stellar evolution.
The number of different input quantities supported.
Radius of the star in .
Definition: IOColumns.h:119
Moment of inertia of the radiative zone of the star (low mass stars only) in .
Definition: IOColumns.h:114
AGE
The derivative w.r.t. age, excluding the dependence through the body&#39;s radius and the moments of iner...
Moment of inertia of the convective zone of the star (low mass stars only) in .
Definition: IOColumns.h:110
Luminosity of the star in .
Definition: IOColumns.h:120
Radius of the stellar core in (low mass stars only).
Definition: IOColumns.h:123
Mass of the stellar core in (low mass stars only).
Definition: IOColumns.h:126