BubbleProfiler
0.3.0
by Peter Athron, Csaba Balazs, Michael Bardsley, Andrew Fowlie, Dylan Harries & Graham White
|
Provides guess for field profiles read from an input stream. More...
#include <instream_profile_guesser.hpp>
Public Member Functions | |
Instream_profile_guesser (std::istream &) | |
reads a profile guess from the given input stream More... | |
Instream_profile_guesser (std::istream &, const std::string &) | |
reads a profile guess from the given input stream More... | |
Instream_profile_guesser (std::istream &, const std::string &, const std::string &) | |
reads a profile guess from the given input stream More... | |
virtual | ~Instream_profile_guesser ()=default |
Instream_profile_guesser (const Instream_profile_guesser &)=default | |
Instream_profile_guesser & | operator= (const Instream_profile_guesser &)=default |
Instream_profile_guesser (Instream_profile_guesser &&)=default | |
Instream_profile_guesser & | operator= (Instream_profile_guesser &&)=default |
virtual Field_profiles | get_profile_guess (const Potential &, const Eigen::VectorXd &, int, double, double, double, double) override |
Calculate an initial guess for the bubble profile. More... | |
std::size_t | get_number_of_grid_points () const |
returns the number of grid points read from the stream More... | |
std::size_t | get_number_of_fields () const |
Eigen::VectorXd | get_spatial_grid () const |
returns the values of the spacetime coordinate read from the stream More... | |
Eigen::MatrixXd | get_field_values () const |
returns the values of the fields read from the stream More... | |
void | set_spatial_tolerance (double t) |
sets the spatial tolerance used when comparing grid points More... | |
void | set_delimiters (const std::string &d) |
set the characters to use as delimiters between fields More... | |
void | set_line_comment (const std::string &c) |
sets the character sequence used to indicate a comment More... | |
void | read_profiles (std::istream &) |
read a profile guess from the given stream More... | |
![]() | |
virtual | ~Profile_guesser ()=default |
Private Member Functions | |
void | reset () |
void | strip_comments (std::string &) const |
void | process_line (const std::string &) |
Private Attributes | |
std::string | delimiters {" \t"} |
std::string | line_comment_start {"#"} |
bool | has_n_fields {false} |
std::size_t | n_fields {0} |
double | tolerance {1.e-6} |
std::vector< double > | spatial_grid {} |
std::vector< std::vector< double > > | field_values {} |
logging::Basic_logger | logger {} |
Provides guess for field profiles read from an input stream.
Definition at line 41 of file instream_profile_guesser.hpp.
|
explicit |
reads a profile guess from the given input stream
input_stream_ | the stream to read from |
Definition at line 36 of file instream_profile_guesser.cpp.
References read_profiles().
BubbleProfiler::Instream_profile_guesser::Instream_profile_guesser | ( | std::istream & | input_stream_, |
const std::string & | delimiters_ | ||
) |
reads a profile guess from the given input stream
input_stream_ | the stream to read from |
delimiters_ | a set of characters to use as field delimiters |
Definition at line 42 of file instream_profile_guesser.cpp.
References read_profiles().
BubbleProfiler::Instream_profile_guesser::Instream_profile_guesser | ( | std::istream & | input_stream_, |
const std::string & | delimiters_, | ||
const std::string & | line_comment_start_ | ||
) |
reads a profile guess from the given input stream
input_stream_ | the stream to read from |
delimiters_ | a set of characters to use as field delimiters |
line_comment_start_ | characters indicating the start of a comment |
Definition at line 49 of file instream_profile_guesser.cpp.
References read_profiles().
|
virtualdefault |
|
default |
|
default |
Eigen::MatrixXd BubbleProfiler::Instream_profile_guesser::get_field_values | ( | ) | const |
returns the values of the fields read from the stream
Definition at line 213 of file instream_profile_guesser.cpp.
References field_values, n_fields, and spatial_grid.
Referenced by get_number_of_fields(), and get_profile_guess().
|
inline |
returns the number of fields for which values were read
Definition at line 84 of file instream_profile_guesser.hpp.
References field_values, get_field_values(), and get_spatial_grid().
|
inline |
returns the number of grid points read from the stream
Definition at line 78 of file instream_profile_guesser.hpp.
References spatial_grid.
|
overridevirtual |
Calculate an initial guess for the bubble profile.
The calculated profiles should be evaluated at the requested number of points, n_grid_points
, between the minimum and maximum radial coordinate values, domain_start
and domain_end
, respectively. If a negative value is given for either of these, appropriate values are to be guessed based on the given potential and vacuum location.
potential | the potential for which the profiles are to be computed |
true_vacuum | the location of the true vacuum in field space |
n_dimensions | the number of space-time dimensions |
domain_start | the minimum value of the radial coordinate at which the profiles are evaluated. If negative, the function should guess an appropriate value. |
domain_end | the maximum value of the radial coordinate at which the profiles are evaluated. If negative, the function should guess an appropriate value. |
initial_step_size | the initial step size to be used in constructing the discretized solution |
interpolation_points_fraction | fraction of grid points to use for interpolation |
Implements BubbleProfiler::Profile_guesser.
Definition at line 144 of file instream_profile_guesser.cpp.
References BubbleProfiler::Abs(), get_field_values(), BubbleProfiler::Potential::get_number_of_fields(), get_spatial_grid(), has_n_fields, n_fields, BubbleProfiler::Field_profiles::set_number_of_dimensions(), spatial_grid, and tolerance.
Eigen::VectorXd BubbleProfiler::Instream_profile_guesser::get_spatial_grid | ( | ) | const |
returns the values of the spacetime coordinate read from the stream
Definition at line 206 of file instream_profile_guesser.cpp.
References spatial_grid.
Referenced by get_number_of_fields(), and get_profile_guess().
|
default |
|
default |
|
private |
Definition at line 106 of file instream_profile_guesser.cpp.
References delimiters, field_values, has_n_fields, n_fields, and spatial_grid.
Referenced by read_profiles().
void BubbleProfiler::Instream_profile_guesser::read_profiles | ( | std::istream & | input_stream | ) |
read a profile guess from the given stream
input_stream | the stream to read from |
Definition at line 65 of file instream_profile_guesser.cpp.
References has_n_fields, BubbleProfiler::logging::Basic_logger::log_message(), logger, n_fields, process_line(), reset(), spatial_grid, strip_comments(), and BubbleProfiler::logging::Trace.
Referenced by Instream_profile_guesser(), and set_line_comment().
|
private |
Definition at line 58 of file instream_profile_guesser.cpp.
References field_values, has_n_fields, and spatial_grid.
Referenced by read_profiles().
|
inline |
set the characters to use as delimiters between fields
d | a string containing the characters to be used as delimiters |
Definition at line 115 of file instream_profile_guesser.hpp.
References delimiters.
|
inline |
sets the character sequence used to indicate a comment
Lines in the provided input stream may contain a sequence of one or more characters indicating a comment. All content in the line following a comment sequence is ignored by the profile guesser.
c | the string used to indicate the start of a comment |
Definition at line 127 of file instream_profile_guesser.hpp.
References line_comment_start, and read_profiles().
|
inline |
sets the spatial tolerance used when comparing grid points
When using the read-in data to construct a set of guessed profiles, the boundaries of the stored domain must agree to within the specified tolerance with the values of domain_start
and domain_end
provided to get_profile_guess() .
t | the tolerance to be used |
Definition at line 109 of file instream_profile_guesser.hpp.
References tolerance.
|
private |
Definition at line 98 of file instream_profile_guesser.cpp.
References line_comment_start.
Referenced by read_profiles().
|
private |
Definition at line 136 of file instream_profile_guesser.hpp.
Referenced by process_line(), and set_delimiters().
|
private |
Definition at line 142 of file instream_profile_guesser.hpp.
Referenced by get_field_values(), get_number_of_fields(), process_line(), and reset().
|
private |
Definition at line 138 of file instream_profile_guesser.hpp.
Referenced by get_profile_guess(), process_line(), read_profiles(), and reset().
|
private |
Definition at line 137 of file instream_profile_guesser.hpp.
Referenced by set_line_comment(), and strip_comments().
|
private |
Definition at line 143 of file instream_profile_guesser.hpp.
Referenced by read_profiles().
|
private |
Definition at line 139 of file instream_profile_guesser.hpp.
Referenced by get_field_values(), get_profile_guess(), process_line(), and read_profiles().
|
private |
Definition at line 141 of file instream_profile_guesser.hpp.
Referenced by get_field_values(), get_number_of_grid_points(), get_profile_guess(), get_spatial_grid(), process_line(), read_profiles(), and reset().
|
private |
Definition at line 140 of file instream_profile_guesser.hpp.
Referenced by get_profile_guess(), and set_spatial_tolerance().