Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Member Functions | Protected Attributes | List of all members
EquationBase Class Reference

#include <equation.hh>

Inheritance diagram for EquationBase:
Inheritance graph
[legend]
Collaboration diagram for EquationBase:
Collaboration graph
[legend]

Public Member Functions

 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual ~EquationBase ()
 
virtual void zero_time_step ()
 
virtual void update_solution ()
 
virtual void initialize ()
 Initialize fields. More...
 
virtual void choose_next_time ()
 
virtual void set_time_upper_constraint (double dt)
 
virtual void set_time_lower_constraint (double dt)
 
TimeGovernor const & time ()
 
virtual void set_time_governor (TimeGovernor &time)
 
double planned_time ()
 
double solved_time ()
 
Meshmesh ()
 
TimeMark::Type mark_type ()
 
FieldSetdata ()
 
virtual void get_solution_vector (double *&vector, unsigned int &size)
 
virtual void get_parallel_solution_vector (Vec &vector)
 
virtual void output_data ()
 Write computed fields. More...
 

Protected Attributes

bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
FieldSeteq_data_
 

Detailed Description

Class EquationBase is abstract base class for a general time dependent model. This class should provide general interface that can be used for general coupling of various particular models. By a model we mean a discrete solver of an partial or ordinary differential equation. Result of the model at one discrete time level should be a discrete field class (not yet implemented). Until we have field classes we only provide method get_solution_vector(), which returns pointer to sequential C array with linear combination of base functions that represents the solution.

Computation of one time step (method compute_one_step() ) is split into update_solution() and choose_next_time().

This class does not implement any constructor. In particular it does not initialize mesh and time. This has to be done in the constructor of particular child class.

Any constructor of child class should set solved = true. We assume, that after initialization an equation object stay solve in init time. For the first time step one calls method chose_next_time() which setup time frame of the first time step.

TODO: clarify initialization of data members

Definition at line 70 of file equation.hh.

Constructor & Destructor Documentation

EquationBase::EquationBase ( )

Default constructor. Sets all virtual methods empty. Necessary to make tests fixtures for equations. TODO: Replace setting all in constructor with appropriate getters and setters. Make appropriate checks if key ingredients are initialized.

Definition at line 61 of file equation.cc.

EquationBase::EquationBase ( Mesh mesh,
const Input::Record  in_rec 
)

Common initialization constructor.

Definition at line 71 of file equation.cc.

virtual EquationBase::~EquationBase ( )
inlinevirtual

Require virtual destructor also for child classes.

Definition at line 89 of file equation.hh.

Member Function Documentation

virtual void EquationBase::choose_next_time ( void  )
inlinevirtual

Fix the next discrete time for computation. Can be rewritten in child class to set possible constrains according to possible equation coefficients or other data which can be result of another model.

Reimplemented in ReactionTerm.

Definition at line 125 of file equation.hh.

Here is the caller graph for this function:

FieldSet& EquationBase::data ( )
inline

Return reference to the equation data object containing all fields that the equation needs or produce.

Definition at line 188 of file equation.hh.

Here is the caller graph for this function:

virtual void EquationBase::get_parallel_solution_vector ( Vec &  vector)
inlinevirtual

Child class have to implement getter for parallel solution vector. DEPRECATED

Reimplemented in DarcyFlowMH_Steady.

Definition at line 205 of file equation.hh.

virtual void EquationBase::get_solution_vector ( double *&  vector,
unsigned int &  size 
)
inlinevirtual

Child class have to implement getter for sequential solution vector. DEPRECATED

Reimplemented in DarcyFlowMH_Steady.

Definition at line 198 of file equation.hh.

Here is the caller graph for this function:

virtual void EquationBase::initialize ( )
inlinevirtual

Initialize fields.

All members that are needed to set fields must be set at this moment (e.g. number of components).

Reimplemented in SorptionBase, DualPorosity, LinearReaction, and PadeApproximant.

Definition at line 114 of file equation.hh.

Here is the caller graph for this function:

TimeMark::Type EquationBase::mark_type ( )
inline

Getter for equation time mark type.

Definition at line 179 of file equation.hh.

Here is the caller graph for this function:

Mesh& EquationBase::mesh ( )
inline

This getter method provides the computational mesh currently used by the model.

Definition at line 171 of file equation.hh.

virtual void EquationBase::output_data ( void  )
inlinevirtual

Write computed fields.

Reimplemented in DarcyFlowMH_Steady, TransportDG< Model >, TransportOperatorSplitting, ConvectionTransport, TransportNothing, SorptionBase, DualPorosity, and ReactionTerm.

Definition at line 211 of file equation.hh.

Here is the caller graph for this function:

double EquationBase::planned_time ( )
inline

Most actual planned time for solution.

Definition at line 159 of file equation.hh.

Here is the caller graph for this function:

void EquationBase::set_time_governor ( TimeGovernor time)
virtual

Set time governor.

Used to set pointer to common time governor (e.g. in Transport Operator Splitting, Reaction).

Definition at line 80 of file equation.cc.

Here is the caller graph for this function:

virtual void EquationBase::set_time_lower_constraint ( double  dt)
inlinevirtual

Set external lower time step constrain for time governor of the equation.

Definition at line 137 of file equation.hh.

virtual void EquationBase::set_time_upper_constraint ( double  dt)
inlinevirtual

Set external upper time step constrain for time governor of the equation.

Definition at line 131 of file equation.hh.

Here is the caller graph for this function:

double EquationBase::solved_time ( )
inline

Time of actual solution returned by get_solution_vector().

Definition at line 165 of file equation.hh.

Here is the caller graph for this function:

TimeGovernor const& EquationBase::time ( )
inline

Basic getter method returns constant TimeGovernor reference which provides full read access to the time information.

Definition at line 143 of file equation.hh.

Here is the caller graph for this function:

virtual void EquationBase::update_solution ( void  )
inlinevirtual

Calculation of the next time step and its output.

Reimplemented in DarcyFlowMH_Steady, TransportDG< Model >, TransportOperatorSplitting, ConvectionTransport, SorptionBase, DualPorosity, and LinearReaction.

Definition at line 105 of file equation.hh.

Here is the caller graph for this function:

virtual void EquationBase::zero_time_step ( )
inlinevirtual

Initialization of the solution in the zero time. There is lot of things that can not be done in the constructor since we have not fully initialized fields yet. Fields coming from coupling has to be set after the constructor and before zero_time_step.

Reimplemented in TransportDG< Model >, TransportOperatorSplitting, ConvectionTransport, SorptionBase, DualPorosity, LinearReaction, and PadeApproximant.

Definition at line 97 of file equation.hh.

Here is the caller graph for this function:

Member Data Documentation

FieldSet* EquationBase::eq_data_
protected

Pointer to the equation data object. Every particular equation is responsible to set the pointer in its constructor. This is used by the general method EqData::data(). This approach is simpler than making EqData::data() a virtual method.

Definition at line 227 of file equation.hh.

bool EquationBase::equation_empty_
protected

flag is true if only default constructor was called

Definition at line 217 of file equation.hh.

Input::Record EquationBase::input_record_
protected

Definition at line 220 of file equation.hh.

Mesh* EquationBase::mesh_
protected

Definition at line 218 of file equation.hh.

TimeGovernor* EquationBase::time_
protected

Definition at line 219 of file equation.hh.


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