libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::RBTemporalDiscretization Class Reference

Define a class that encapsulates the details of a "generalized Euler" temporal discretization to be used in the rbOOmit framework. More...

#include <rb_temporal_discretization.h>

Inheritance diagram for libMesh::RBTemporalDiscretization:
[legend]

Public Member Functions

 RBTemporalDiscretization ()
 Constructor. More...
 
Real get_delta_t () const
 Get/set delta_t, the time-step size. More...
 
void set_delta_t (const Real delta_t_in)
 
Real get_euler_theta () const
 Get/set euler_theta, parameter that determines the temporal discretization. More...
 
void set_euler_theta (const Real euler_theta_in)
 
unsigned int get_time_step () const
 Get/set the current time-step. More...
 
void set_time_step (const unsigned int k)
 
unsigned int get_n_time_steps () const
 Get/set the total number of time-steps. More...
 
void set_n_time_steps (const unsigned int K)
 
Real get_control (const unsigned int k) const
 Get/set the RHS control. More...
 
void set_control (const std::vector< Real > &control)
 
void process_temporal_parameters_file (const std::string &parameters_filename)
 Read in and initialize parameters from parameters_filename. More...
 
void pull_temporal_discretization_data (RBTemporalDiscretization &other)
 Pull the temporal discretization data from other. More...
 

Private Attributes

Real _delta_t
 The time-step size. More...
 
Real _euler_theta
 The parameter that determines the generalized Euler scheme discretization that we employ. More...
 
unsigned int _current_time_step
 The current time-step. More...
 
unsigned int _n_time_steps
 The number of time-steps. More...
 
std::vector< Real_control
 The RHS control (scalar function of time). More...
 

Detailed Description

Define a class that encapsulates the details of a "generalized Euler" temporal discretization to be used in the rbOOmit framework.

Author
David Knezevic
Date
2012 Encapsulates the details of the generalized Euler discretization.

Definition at line 40 of file rb_temporal_discretization.h.

Constructor & Destructor Documentation

libMesh::RBTemporalDiscretization::RBTemporalDiscretization ( )

Constructor.

Definition at line 29 of file rb_temporal_discretization.C.

30  : _delta_t(0.),
31  _euler_theta(0.),
33  _n_time_steps(0)
34 {}
unsigned int _current_time_step
The current time-step.
unsigned int _n_time_steps
The number of time-steps.
Real _euler_theta
The parameter that determines the generalized Euler scheme discretization that we employ...

Member Function Documentation

Real libMesh::RBTemporalDiscretization::get_control ( const unsigned int  k) const

Get/set the RHS control.

Definition at line 79 of file rb_temporal_discretization.C.

References _control, and get_n_time_steps().

Referenced by libMesh::TransientRBEvaluation::compute_residual_dual_norm(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::rb_solve_again(), and libMesh::TransientRBConstruction::truth_assembly().

80 {
81  libmesh_assert_less_equal (k, get_n_time_steps());
82  return _control[k];
83 }
std::vector< Real > _control
The RHS control (scalar function of time).
unsigned int get_n_time_steps() const
Get/set the total number of time-steps.
Real libMesh::RBTemporalDiscretization::get_delta_t ( ) const
Real libMesh::RBTemporalDiscretization::get_euler_theta ( ) const
unsigned int libMesh::RBTemporalDiscretization::get_n_time_steps ( ) const
unsigned int libMesh::RBTemporalDiscretization::get_time_step ( ) const
void libMesh::RBTemporalDiscretization::process_temporal_parameters_file ( const std::string &  parameters_filename)

Read in and initialize parameters from parameters_filename.

Definition at line 93 of file rb_temporal_discretization.C.

References get_delta_t(), get_euler_theta(), get_n_time_steps(), libMesh::Real, set_delta_t(), set_euler_theta(), set_n_time_steps(), and set_time_step().

Referenced by libMesh::TransientRBConstruction::process_parameters_file().

94 {
95  // Read in data from parameters_filename
96  GetPot infile(parameters_filename);
97 
98  // Read in parameters related to temporal discretization
99  unsigned int n_time_steps_in = infile("n_time_steps", get_n_time_steps());
100  const Real delta_t_in = infile("delta_t", get_delta_t());
101  const Real euler_theta_in = infile("euler_theta", get_euler_theta());
102 
103  // and set the relevant member variables
104  set_n_time_steps(n_time_steps_in);
105  set_delta_t(delta_t_in);
106  set_euler_theta(euler_theta_in);
107  set_time_step(0);
108 }
Real get_euler_theta() const
Get/set euler_theta, parameter that determines the temporal discretization.
Real get_delta_t() const
Get/set delta_t, the time-step size.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_euler_theta(const Real euler_theta_in)
unsigned int get_n_time_steps() const
Get/set the total number of time-steps.
void set_n_time_steps(const unsigned int K)
void libMesh::RBTemporalDiscretization::pull_temporal_discretization_data ( RBTemporalDiscretization other)

Pull the temporal discretization data from other.

Definition at line 110 of file rb_temporal_discretization.C.

References _control, get_delta_t(), get_euler_theta(), get_n_time_steps(), get_time_step(), set_control(), set_delta_t(), set_euler_theta(), set_n_time_steps(), and set_time_step().

Referenced by libMesh::TransientRBConstruction::process_parameters_file().

111 {
112  this->set_delta_t( other.get_delta_t() );
113  this->set_euler_theta( other.get_euler_theta() );
114  this->set_n_time_steps( other.get_n_time_steps() );
115  this->set_time_step( other.get_time_step() );
116  this->set_control( other._control );
117 }
void set_euler_theta(const Real euler_theta_in)
void set_n_time_steps(const unsigned int K)
void set_control(const std::vector< Real > &control)
void libMesh::RBTemporalDiscretization::set_control ( const std::vector< Real > &  control)

Definition at line 85 of file rb_temporal_discretization.C.

References _control, and _n_time_steps.

Referenced by pull_temporal_discretization_data().

86 {
87  libmesh_assert_less_equal(control.size(),_n_time_steps+1);
88  _control = control;
89  // If the input vector is smaller than the number of time steps (+1), we complete it with zeros
90  _control.resize(_n_time_steps+1);
91 }
std::vector< Real > _control
The RHS control (scalar function of time).
unsigned int _n_time_steps
The number of time-steps.
void libMesh::RBTemporalDiscretization::set_delta_t ( const Real  delta_t_in)
void libMesh::RBTemporalDiscretization::set_euler_theta ( const Real  euler_theta_in)

Definition at line 51 of file rb_temporal_discretization.C.

References _euler_theta, and libMesh::libmesh_assert().

Referenced by libMesh::TransientRBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBDataDeserialization::load_transient_rb_evaluation_data(), process_temporal_parameters_file(), and pull_temporal_discretization_data().

52 {
53  libmesh_assert((0. <= euler_theta_in ) && (euler_theta_in <= 1.));
54  _euler_theta = euler_theta_in;
55 }
libmesh_assert(j)
Real _euler_theta
The parameter that determines the generalized Euler scheme discretization that we employ...
void libMesh::RBTemporalDiscretization::set_n_time_steps ( const unsigned int  K)
void libMesh::RBTemporalDiscretization::set_time_step ( const unsigned int  k)

Member Data Documentation

std::vector<Real> libMesh::RBTemporalDiscretization::_control
private

The RHS control (scalar function of time).

A function h(t) that is used in the RHS as h(t)*f(x, $ \mu $). See Martin Grepl's thesis

Definition at line 121 of file rb_temporal_discretization.h.

Referenced by get_control(), pull_temporal_discretization_data(), set_control(), and set_n_time_steps().

unsigned int libMesh::RBTemporalDiscretization::_current_time_step
private

The current time-step.

Definition at line 109 of file rb_temporal_discretization.h.

Referenced by get_time_step(), and set_time_step().

Real libMesh::RBTemporalDiscretization::_delta_t
private

The time-step size.

Definition at line 95 of file rb_temporal_discretization.h.

Referenced by get_delta_t(), and set_delta_t().

Real libMesh::RBTemporalDiscretization::_euler_theta
private

The parameter that determines the generalized Euler scheme discretization that we employ.

euler_theta = 0 —> Forward Euler euler_theta = 0.5 —> Crank-Nicolson euler_theta = 1 —> Backward Euler

Definition at line 104 of file rb_temporal_discretization.h.

Referenced by get_euler_theta(), and set_euler_theta().

unsigned int libMesh::RBTemporalDiscretization::_n_time_steps
private

The number of time-steps.

Definition at line 114 of file rb_temporal_discretization.h.

Referenced by get_n_time_steps(), set_control(), and set_n_time_steps().


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