30 const std::string& output_path_,
33 , output_path(output_path_)
34 , potential(potential_)
46 << std::setw(12) <<
"perturbation" <<
' ' 47 << std::setw(16) <<
"action" << std::endl;
58 << std::setw(12) <<
"perturbation" <<
' ' 59 << std::setw(16) <<
"rho";
60 for (
const std::string& name:
fields) {
71 << std::setw(12) <<
"perturbation" <<
' ' 72 << std::setw(16) <<
"rho";
73 for (
const std::string& name:
fields) {
85 const int n_grid_points = coord_values.size();
88 for (
int i = 0; i < n_grid_points; ++i) {
91 << std::setw(16) << std::setprecision(8)
92 << std::scientific << coord_values(i);
95 << std::setw(16) << std::setprecision(8)
96 << std::scientific << field_values(i, j);
107 + std::to_string(action));
111 << std::setw(16) << std::setprecision(8)
112 << std::scientific << action << std::endl;
contains the definition of the Field_profiles clas
contains helper functions for calculating the Euclidean action
const Eigen::VectorXd & get_spatial_grid() const
Get a vector of the grid point coordinates.
void write_action_to_file(const Field_profiles &profiles)
void write_initial_action_to_file(const Field_profiles &profiles)
void write_initial_profiles_to_file(const Field_profiles &profiles)
std::ofstream profiles_file
std::ofstream perturbations_file
void write_field_profiles_to_file(std::ofstream &stream, const Field_profiles &profiles)
void log_message(Log_level level, const std::string &msg) const
void operator()(const Field_profiles &profile, const Field_profiles &perturbation)
std::ofstream action_file
Profile_observer(const std::vector< std::string > &fields_, const std::string &output_path_, const Potential &potential_)
std::vector< std::string > fields
logging::Basic_logger logger
void write_initial_perturbations_to_file()
const Potential & potential
Abstract base class for a generic potential.
double calculate_action(const Potential &potential, const Field_profiles &profiles, std::size_t max_intervals=1000, double rel_tol=1.e-4, double abs_tol=1.e-4, Integration_rule rule=Integration_rule::GK31, bool use_kinetic=true)
Calculates the action using either the kinetic or potential terms.
Discretized set of field profiles.
const Eigen::MatrixXd & get_field_profiles() const
Get the field profile data in matrix form.