Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
emfield::base_electromagnetic_field Class Referenceabstract

Abstract base class for all electromagnetic field. More...

#include <bayeux/emfield/base_electromagnetic_field.h>

Inheritance diagram for emfield::base_electromagnetic_field:
datatools::i_tree_dumpable emfield::linear_combination_field emfield::multi_zone_field emfield::oscillating_field emfield::placement_field emfield::polynomial_magnetic_field emfield::uniform_electric_field emfield::uniform_magnetic_field

Public Types

enum  flag_type {
  DEBUG = datatools::bit_mask::bit01, ELECTRIC_FIELD = datatools::bit_mask::bit02, MAGNETIC_FIELD = datatools::bit_mask::bit03, ELECTRIC_FIELD_CAN_BE_COMBINED = datatools::bit_mask::bit04,
  MAGNETIC_FIELD_CAN_BE_COMBINED = datatools::bit_mask::bit05, ELECTRIC_FIELD_IS_TIME_DEPENDENT = datatools::bit_mask::bit06, MAGNETIC_FIELD_IS_TIME_DEPENDENT = datatools::bit_mask::bit07
}
 Initialization flags. More...
 
enum  status_type {
  STATUS_SUCCESS = 0, STATUS_ERROR = 1, STATUS_NOT_INITIALIZED = 2, STATUS_INVALID_POSITION_TIME = 3,
  STATUS_NO_ELECTRIC_FIELD = 4, STATUS_NO_MAGNETIC_FIELD = 5
}
 Status at field computation. More...
 
typedef datatools::handle< base_electromagnetic_fieldhandle_type
 
typedef std::map< std::string, handle_typefield_dict_type
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

void set_logging_priority (datatools::logger::priority priority_)
 Return the logging priority. More...
 
datatools::logger::priority get_logging_priority () const
 Set the logging priority. More...
 
bool is_initialized () const
 Check initialization status. More...
 
void set_name (const std::string &)
 Set the name of the field. More...
 
const std::string & get_name () const
 Return the name of the field. More...
 
bool is_debug () const
 Check debug status. More...
 
void set_debug (bool debug_)
 Set debug status. More...
 
bool is_electric_field () const
 Check if the field is an electric field. More...
 
bool is_magnetic_field () const
 Check if the field is a magnetic field. More...
 
bool electric_field_can_be_combined () const
 Check if the electric field can be combined. More...
 
bool magnetic_field_can_be_combined () const
 Check if the magnetic field can be combined. More...
 
bool electric_field_is_time_dependent () const
 Check if the electric field depends on time. More...
 
bool magnetic_field_is_time_dependent () const
 Check if the magnetic field depends on time. More...
 
 base_electromagnetic_field (uint32_t flags_=0)
 Constructor. More...
 
virtual ~base_electromagnetic_field ()
 Destructor. More...
 
virtual int compute_electromagnetic_field (const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &electric_field_, geomtools::vector_3d &magnetic_field_) const
 Compute the coordinates of the electric and magnetic fields at given position and time. More...
 
virtual int compute_field (char label_, const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &field_) const
 Compute the coordinates of the electric or magnetic field at given position and time. More...
 
virtual void initialize_simple ()
 Naked initialization. More...
 
virtual void initialize_standalone (const datatools::properties &setup_)
 Standalone initialization, no external resources are needed, only a set of parameters. More...
 
virtual void initialize_with_service_only (const datatools::properties &setup_, datatools::service_manager &service_manager_)
 Initialization using a set of parameters and a service manager. More...
 
virtual void initialize_with_dictionary_only (const datatools::properties &setup_, field_dict_type &dictionary_)
 Initialization using a set of parameters and an external dictionary of EM fields. More...
 
virtual void initialize (const datatools::properties &setup_, datatools::service_manager &service_manager_, field_dict_type &dictionary_)=0
 Main initialization. More...
 
virtual void reset ()=0
 Reset the field. More...
 
virtual std::string get_class_id () const =0
 Return the class string identifier. More...
 
virtual bool position_and_time_are_valid (const geomtools::vector_3d &position_, double time_) const
 Check if position and time are valid for this field. More...
 
virtual int compute_electric_field (const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &electric_field_) const
 Compute the coordinates of the electric field at given position and time. More...
 
virtual int compute_magnetic_field (const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &magnetic_field_) const
 Compute the coordinates of the magnetic field at given position and time. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Attributes

static const char ELECTRIC_FIELD_LABEL = 'E'
 
static const char MAGNETIC_FIELD_LABEL = 'B'
 

Protected Member Functions

void _set_initialized (bool initialized_)
 
void _set_electric_field (bool=true)
 
void _set_magnetic_field (bool=true)
 
void _set_electric_field_can_be_combined (bool=true)
 
void _set_magnetic_field_can_be_combined (bool=true)
 
void _set_electric_field_is_time_dependent (bool=true)
 
void _set_magnetic_field_is_time_dependent (bool=true)
 
void _parse_basic_parameters (const datatools::properties &setup_, datatools::service_manager &service_manager_, field_dict_type &dictionary_)
 
void _set_defaults ()
 Set default attributes values. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Detailed Description

Abstract base class for all electromagnetic field.

Member Typedef Documentation

◆ field_dict_type

◆ handle_type

Member Enumeration Documentation

◆ flag_type

Initialization flags.

Enumerator
DEBUG 
ELECTRIC_FIELD 
MAGNETIC_FIELD 
ELECTRIC_FIELD_CAN_BE_COMBINED 
MAGNETIC_FIELD_CAN_BE_COMBINED 
ELECTRIC_FIELD_IS_TIME_DEPENDENT 
MAGNETIC_FIELD_IS_TIME_DEPENDENT 

◆ status_type

Status at field computation.

Enumerator
STATUS_SUCCESS 
STATUS_ERROR 
STATUS_NOT_INITIALIZED 
STATUS_INVALID_POSITION_TIME 
STATUS_NO_ELECTRIC_FIELD 
STATUS_NO_MAGNETIC_FIELD 

Constructor & Destructor Documentation

◆ base_electromagnetic_field()

emfield::base_electromagnetic_field::base_electromagnetic_field ( uint32_t  flags_ = 0)

Constructor.

◆ ~base_electromagnetic_field()

virtual emfield::base_electromagnetic_field::~base_electromagnetic_field ( )
virtual

Destructor.

Member Function Documentation

◆ _parse_basic_parameters()

void emfield::base_electromagnetic_field::_parse_basic_parameters ( const datatools::properties setup_,
datatools::service_manager service_manager_,
field_dict_type dictionary_ 
)
protected

◆ _set_defaults()

void emfield::base_electromagnetic_field::_set_defaults ( )
protected

Set default attributes values.

◆ _set_electric_field()

void emfield::base_electromagnetic_field::_set_electric_field ( bool  = true)
protected

◆ _set_electric_field_can_be_combined()

void emfield::base_electromagnetic_field::_set_electric_field_can_be_combined ( bool  = true)
protected

◆ _set_electric_field_is_time_dependent()

void emfield::base_electromagnetic_field::_set_electric_field_is_time_dependent ( bool  = true)
protected

◆ _set_initialized()

void emfield::base_electromagnetic_field::_set_initialized ( bool  initialized_)
protected

◆ _set_magnetic_field()

void emfield::base_electromagnetic_field::_set_magnetic_field ( bool  = true)
protected

◆ _set_magnetic_field_can_be_combined()

void emfield::base_electromagnetic_field::_set_magnetic_field_can_be_combined ( bool  = true)
protected

◆ _set_magnetic_field_is_time_dependent()

void emfield::base_electromagnetic_field::_set_magnetic_field_is_time_dependent ( bool  = true)
protected

◆ compute_electric_field()

virtual int emfield::base_electromagnetic_field::compute_electric_field ( const geomtools::vector_3d position_,
double  time_,
geomtools::vector_3d electric_field_ 
) const
virtual

Compute the coordinates of the electric field at given position and time.

Reimplemented in emfield::polynomial_magnetic_field.

◆ compute_electromagnetic_field()

virtual int emfield::base_electromagnetic_field::compute_electromagnetic_field ( const geomtools::vector_3d position_,
double  time_,
geomtools::vector_3d electric_field_,
geomtools::vector_3d magnetic_field_ 
) const
virtual

Compute the coordinates of the electric and magnetic fields at given position and time.

◆ compute_field()

virtual int emfield::base_electromagnetic_field::compute_field ( char  label_,
const geomtools::vector_3d position_,
double  time_,
geomtools::vector_3d field_ 
) const
virtual

Compute the coordinates of the electric or magnetic field at given position and time.

◆ compute_magnetic_field()

virtual int emfield::base_electromagnetic_field::compute_magnetic_field ( const geomtools::vector_3d position_,
double  time_,
geomtools::vector_3d magnetic_field_ 
) const
virtual

Compute the coordinates of the magnetic field at given position and time.

Reimplemented in emfield::polynomial_magnetic_field.

◆ electric_field_can_be_combined()

bool emfield::base_electromagnetic_field::electric_field_can_be_combined ( ) const

Check if the electric field can be combined.

◆ electric_field_is_time_dependent()

bool emfield::base_electromagnetic_field::electric_field_is_time_dependent ( ) const

Check if the electric field depends on time.

◆ get_class_id()

virtual std::string emfield::base_electromagnetic_field::get_class_id ( ) const
pure virtual

Return the class string identifier.

◆ get_logging_priority()

datatools::logger::priority emfield::base_electromagnetic_field::get_logging_priority ( ) const

Set the logging priority.

◆ get_name()

const std::string& emfield::base_electromagnetic_field::get_name ( ) const

Return the name of the field.

◆ initialize()

virtual void emfield::base_electromagnetic_field::initialize ( const datatools::properties setup_,
datatools::service_manager service_manager_,
field_dict_type dictionary_ 
)
pure virtual

Main initialization.

Implemented in emfield::polynomial_magnetic_field.

◆ initialize_simple()

virtual void emfield::base_electromagnetic_field::initialize_simple ( )
virtual

Naked initialization.

◆ initialize_standalone()

virtual void emfield::base_electromagnetic_field::initialize_standalone ( const datatools::properties setup_)
virtual

Standalone initialization, no external resources are needed, only a set of parameters.

◆ initialize_with_dictionary_only()

virtual void emfield::base_electromagnetic_field::initialize_with_dictionary_only ( const datatools::properties setup_,
field_dict_type dictionary_ 
)
virtual

Initialization using a set of parameters and an external dictionary of EM fields.

◆ initialize_with_service_only()

virtual void emfield::base_electromagnetic_field::initialize_with_service_only ( const datatools::properties setup_,
datatools::service_manager service_manager_ 
)
virtual

Initialization using a set of parameters and a service manager.

◆ is_debug()

bool emfield::base_electromagnetic_field::is_debug ( ) const

Check debug status.

◆ is_electric_field()

bool emfield::base_electromagnetic_field::is_electric_field ( ) const

Check if the field is an electric field.

◆ is_initialized()

bool emfield::base_electromagnetic_field::is_initialized ( ) const

Check initialization status.

◆ is_magnetic_field()

bool emfield::base_electromagnetic_field::is_magnetic_field ( ) const

Check if the field is a magnetic field.

◆ magnetic_field_can_be_combined()

bool emfield::base_electromagnetic_field::magnetic_field_can_be_combined ( ) const

Check if the magnetic field can be combined.

◆ magnetic_field_is_time_dependent()

bool emfield::base_electromagnetic_field::magnetic_field_is_time_dependent ( ) const

Check if the magnetic field depends on time.

◆ position_and_time_are_valid()

virtual bool emfield::base_electromagnetic_field::position_and_time_are_valid ( const geomtools::vector_3d position_,
double  time_ 
) const
virtual

Check if position and time are valid for this field.

◆ reset()

virtual void emfield::base_electromagnetic_field::reset ( )
pure virtual

◆ set_debug()

void emfield::base_electromagnetic_field::set_debug ( bool  debug_)

Set debug status.

◆ set_logging_priority()

void emfield::base_electromagnetic_field::set_logging_priority ( datatools::logger::priority  priority_)

Return the logging priority.

◆ set_name()

void emfield::base_electromagnetic_field::set_name ( const std::string &  )

Set the name of the field.

◆ tree_dump()

virtual void emfield::base_electromagnetic_field::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Member Data Documentation

◆ ELECTRIC_FIELD_LABEL

const char emfield::base_electromagnetic_field::ELECTRIC_FIELD_LABEL = 'E'
static

◆ MAGNETIC_FIELD_LABEL

const char emfield::base_electromagnetic_field::MAGNETIC_FIELD_LABEL = 'B'
static

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