BubbleProfiler  0.3.0
by Peter Athron, Csaba Balazs, Michael Bardsley, Andrew Fowlie, Dylan Harries & Graham White
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BubbleProfiler::Instream_profile_guesser Class Reference

Provides guess for field profiles read from an input stream. More...

#include <instream_profile_guesser.hpp>

Inheritance diagram for BubbleProfiler::Instream_profile_guesser:
Inheritance graph
[legend]
Collaboration diagram for BubbleProfiler::Instream_profile_guesser:
Collaboration graph
[legend]

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_guesseroperator= (const Instream_profile_guesser &)=default
 
 Instream_profile_guesser (Instream_profile_guesser &&)=default
 
Instream_profile_guesseroperator= (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...
 
- Public Member Functions inherited from BubbleProfiler::Profile_guesser
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 {}
 

Detailed Description

Provides guess for field profiles read from an input stream.

Definition at line 41 of file instream_profile_guesser.hpp.

Constructor & Destructor Documentation

BubbleProfiler::Instream_profile_guesser::Instream_profile_guesser ( std::istream &  input_stream_)
explicit

reads a profile guess from the given input stream

Parameters
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

Parameters
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

Parameters
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().

virtual BubbleProfiler::Instream_profile_guesser::~Instream_profile_guesser ( )
virtualdefault
BubbleProfiler::Instream_profile_guesser::Instream_profile_guesser ( const Instream_profile_guesser )
default
BubbleProfiler::Instream_profile_guesser::Instream_profile_guesser ( Instream_profile_guesser &&  )
default

Member Function Documentation

Eigen::MatrixXd BubbleProfiler::Instream_profile_guesser::get_field_values ( ) const

returns the values of the fields read from the stream

Returns
the field values at each grid point

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().

std::size_t BubbleProfiler::Instream_profile_guesser::get_number_of_fields ( ) const
inline

returns the number of fields for which values were read

Returns
the number of fields found in the input stream

Definition at line 84 of file instream_profile_guesser.hpp.

References field_values, get_field_values(), and get_spatial_grid().

std::size_t BubbleProfiler::Instream_profile_guesser::get_number_of_grid_points ( ) const
inline

returns the number of grid points read from the stream

Returns
the number of grid points read

Definition at line 78 of file instream_profile_guesser.hpp.

References spatial_grid.

Field_profiles BubbleProfiler::Instream_profile_guesser::get_profile_guess ( const Potential potential,
const Eigen::VectorXd &  true_vacuum,
int  n_dimensions,
double  domain_start,
double  domain_end,
double  initial_step_size,
double  interpolation_points_fraction_ 
)
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.

Note
The false vacuum is assumed to be at the origin in field space.
Parameters
potentialthe potential for which the profiles are to be computed
true_vacuumthe location of the true vacuum in field space
n_dimensionsthe number of space-time dimensions
domain_startthe minimum value of the radial coordinate at which the profiles are evaluated. If negative, the function should guess an appropriate value.
domain_endthe maximum value of the radial coordinate at which the profiles are evaluated. If negative, the function should guess an appropriate value.
initial_step_sizethe initial step size to be used in constructing the discretized solution
interpolation_points_fractionfraction of grid points to use for interpolation
Returns
an initial guess for the field profiles

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

Returns
the grid of discretized coordinate values

Definition at line 206 of file instream_profile_guesser.cpp.

References spatial_grid.

Referenced by get_number_of_fields(), and get_profile_guess().

Instream_profile_guesser& BubbleProfiler::Instream_profile_guesser::operator= ( const Instream_profile_guesser )
default
Instream_profile_guesser& BubbleProfiler::Instream_profile_guesser::operator= ( Instream_profile_guesser &&  )
default
void BubbleProfiler::Instream_profile_guesser::process_line ( const std::string &  line)
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

Parameters
input_streamthe 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().

void BubbleProfiler::Instream_profile_guesser::reset ( )
private

Definition at line 58 of file instream_profile_guesser.cpp.

References field_values, has_n_fields, and spatial_grid.

Referenced by read_profiles().

void BubbleProfiler::Instream_profile_guesser::set_delimiters ( const std::string &  d)
inline

set the characters to use as delimiters between fields

Parameters
da string containing the characters to be used as delimiters

Definition at line 115 of file instream_profile_guesser.hpp.

References delimiters.

void BubbleProfiler::Instream_profile_guesser::set_line_comment ( const std::string &  c)
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.

Parameters
cthe 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().

void BubbleProfiler::Instream_profile_guesser::set_spatial_tolerance ( double  t)
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() .

Parameters
tthe tolerance to be used
See also
get_profile_guess()

Definition at line 109 of file instream_profile_guesser.hpp.

References tolerance.

void BubbleProfiler::Instream_profile_guesser::strip_comments ( std::string &  line) const
private

Definition at line 98 of file instream_profile_guesser.cpp.

References line_comment_start.

Referenced by read_profiles().

Member Data Documentation

std::string BubbleProfiler::Instream_profile_guesser::delimiters {" \t"}
private

Definition at line 136 of file instream_profile_guesser.hpp.

Referenced by process_line(), and set_delimiters().

std::vector<std::vector<double> > BubbleProfiler::Instream_profile_guesser::field_values {}
private
bool BubbleProfiler::Instream_profile_guesser::has_n_fields {false}
private
std::string BubbleProfiler::Instream_profile_guesser::line_comment_start {"#"}
private

Definition at line 137 of file instream_profile_guesser.hpp.

Referenced by set_line_comment(), and strip_comments().

logging::Basic_logger BubbleProfiler::Instream_profile_guesser::logger {}
private

Definition at line 143 of file instream_profile_guesser.hpp.

Referenced by read_profiles().

std::size_t BubbleProfiler::Instream_profile_guesser::n_fields {0}
private
std::vector<double> BubbleProfiler::Instream_profile_guesser::spatial_grid {}
private
double BubbleProfiler::Instream_profile_guesser::tolerance {1.e-6}
private

Definition at line 140 of file instream_profile_guesser.hpp.

Referenced by get_profile_guess(), and set_spatial_tolerance().


The documentation for this class was generated from the following files: