Flow123d
release_3.0.0-1193-g9220a69
|
#include <equation.hh>
Public Member Functions | |
EquationBase () | |
EquationBase (Mesh &mesh, const Input::Record in_rec) | |
virtual void | initialize () |
virtual void | zero_time_step () |
virtual | ~EquationBase () |
virtual void | update_solution () |
virtual void | choose_next_time () |
virtual void | set_time_upper_constraint (double dt, std::string message) |
virtual void | set_time_lower_constraint (double dt, std::string message) |
TimeGovernor & | time () |
virtual void | set_time_governor (TimeGovernor &time) |
double | planned_time () |
double | solved_time () |
Mesh & | mesh () |
TimeMark::Type | mark_type () |
FieldSet & | data () |
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... | |
Mesh * | mesh_ |
TimeGovernor * | time_ |
Input::Record | input_record_ |
FieldSet * | eq_data_ |
std::shared_ptr< Balance > | balance_ |
object for calculation and writing the mass balance to file. More... | |
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 59 of file equation.hh.
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 36 of file equation.cc.
EquationBase::EquationBase | ( | Mesh & | mesh, |
const Input::Record | in_rec | ||
) |
Common initialization constructor. Implementation of particular equation should set just basic things in the constructor and postpone its initialization including initialization of its fields to the initialize method. The reason is that when the equation is part of a coupling the coupling may set some setting of the equation from the coupling level so that initialization use correct parameters. TODO: Which mechanism we use to pass setting form the coupling to its equations. Either use dedicated setters this however prevent generic coupling or use input storage to set data from upper level.
Definition at line 46 of file equation.cc.
|
inlinevirtual |
Require virtual destructor also for child classes.
Definition at line 109 of file equation.hh.
|
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 130 of file equation.hh.
|
inline |
Return reference to the equation data object containing all fields that the equation needs or produce.
Definition at line 193 of file equation.hh.
|
inlinevirtual |
Child class have to implement getter for parallel solution vector. DEPRECATED
Reimplemented in DarcyMH.
Definition at line 210 of file equation.hh.
|
inlinevirtual |
Child class have to implement getter for sequential solution vector. DEPRECATED
Reimplemented in DarcyMH.
Definition at line 203 of file equation.hh.
|
inlinevirtual |
This method should initialize fields of the equation. All members (e.g. number of components) that are necessary for the field initialization must be set between construction and call of initialize. After this method the upper level coupling may set sharing of some fields between equations.
Reimplemented in DarcyMH, TransportOperatorSplitting, Elasticity, ConvectionTransport, SorptionBase, DualPorosity, HM_Iterative, and FirstOrderReactionBase.
Definition at line 88 of file equation.hh.
|
inline |
Getter for equation time mark type.
Definition at line 184 of file equation.hh.
|
inline |
This getter method provides the computational mesh currently used by the model.
Definition at line 176 of file equation.hh.
|
inlinevirtual |
Write computed fields.
Reimplemented in HeatTransferModel, DarcyMH, TransportOperatorSplitting, TransportNothing, ConvectionTransport, Elasticity, SorptionBase, DualPorosity, and ReactionTerm.
Definition at line 216 of file equation.hh.
|
inline |
Most actual planned time for solution.
Definition at line 164 of file equation.hh.
|
virtual |
Set time governor.
Used to set pointer to common time governor (e.g. in Transport Operator Splitting, Reaction).
Definition at line 55 of file equation.cc.
|
inlinevirtual |
Set external lower time step constrain for time governor of the equation.
Definition at line 142 of file equation.hh.
|
inlinevirtual |
Set external upper time step constrain for time governor of the equation.
Definition at line 136 of file equation.hh.
|
inline |
Time of actual solution returned by get_solution_vector().
Definition at line 170 of file equation.hh.
|
inline |
Basic getter method returns TimeGovernor reference which provides full access to the time information.
Definition at line 148 of file equation.hh.
|
inlinevirtual |
Calculation of the next time step and its output.
Reimplemented in DarcyMH, TransportOperatorSplitting, Elasticity, ConvectionTransport, SorptionBase, DualPorosity, FirstOrderReactionBase, and HM_Iterative.
Definition at line 117 of file equation.hh.
|
inlinevirtual |
Initialization of the solution in the zero time.
There may be fields that can not be initialized in the initialize method as they are provided by the coupling. Fields coming from coupling has to be set after the initialize method and before zero_time_step.
Reimplemented in DarcyMH, TransportOperatorSplitting, Elasticity, ConvectionTransport, SorptionBase, DualPorosity, HM_Iterative, and FirstOrderReactionBase.
Definition at line 100 of file equation.hh.
|
protected |
object for calculation and writing the mass balance to file.
Definition at line 235 of file equation.hh.
|
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 232 of file equation.hh.
|
protected |
flag is true if only default constructor was called
Definition at line 222 of file equation.hh.
|
protected |
Definition at line 225 of file equation.hh.
|
protected |
Definition at line 223 of file equation.hh.
|
protected |
Definition at line 224 of file equation.hh.