Flow123d  release_3.0.0-973-g92f55e826
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | Friends | List of all members
DarcyLMH Class Reference

Mixed-hybrid model of linear Darcy flow, possibly unsteady. More...

#include <darcy_flow_lmh.hh>

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

Classes

class  EqData
 

Public Member Functions

 TYPEDEF_ERR_INFO (EI_Reason, string)
 
 DECLARE_EXCEPTION (ExcSolverDiverge,<< "Diverged nonlinear solver. Reason: "<< EI_Reason::val)
 
 DECLARE_INPUT_EXCEPTION (ExcMissingTimeGovernor,<< "Missing the key 'time', obligatory for the transient problems.")
 
 DarcyLMH (Mesh &mesh, const Input::Record in_rec, TimeGovernor *tm=nullptr)
 
void init_eq_data ()
 
void initialize () override
 
virtual void initialize_specific ()
 
void zero_time_step () override
 
void update_solution () override
 
void solve_time_step (bool output=true)
 Solve the problem without moving to next time and without output. More...
 
virtual void accept_time_step ()
 postprocess velocity field (add sources) More...
 
virtual void postprocess ()
 
virtual void output_data () override
 Write computed fields. More...
 
EqDatadata ()
 
void set_extra_storativity (const Field< 3, FieldValue< 3 >::Scalar > &extra_stor)
 Sets external storarivity field (coupling with other equation). More...
 
void set_extra_source (const Field< 3, FieldValue< 3 >::Scalar > &extra_src)
 Sets external source field (coupling with other equation). More...
 
virtual ~DarcyLMH () override
 
- Public Member Functions inherited from DarcyFlowInterface
 DarcyFlowInterface (Mesh &mesh, const Input::Record in_rec)
 
virtual const MH_DofHandlerget_mh_dofhandler ()=0
 
virtual ~DarcyFlowInterface ()
 
- Public Member Functions inherited from EquationBase
 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual ~EquationBase ()
 
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)
 
TimeGovernortime ()
 
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)
 

Static Public Member Functions

static const Input::Type::Selectionget_mh_mortar_selection ()
 Selection for enum MortarMethod. More...
 
static const Input::Type::Recordtype_field_descriptor ()
 
static const Input::Type::Recordget_input_type ()
 
- Static Public Member Functions inherited from DarcyFlowInterface
static Input::Type::Abstractget_input_type ()
 

Protected Member Functions

virtual bool zero_time_term (bool time_global=false)
 
void solve_nonlinear ()
 Solve method common to zero_time_step and update solution. More...
 
void create_linear_system (Input::AbstractRecord rec)
 
void read_initial_condition ()
 
virtual void initial_condition_postprocess ()
 
void allocate_mh_matrix ()
 
void assembly_mh_matrix (MultidimAssembly &assembler)
 
void reconstruct_solution_from_schur (MultidimAssembly &assembler)
 
virtual void assembly_linear_system ()
 
virtual double solution_precision () const
 
void print_matlab_matrix (string matlab_file)
 Print darcy flow matrix in matlab format into a file. More...
 
std::vector< int > get_component_indices_vec (unsigned int component) const
 Get vector of all DOF indices of given component (0..side, 1..element, 2..edge) More...
 
LinSyslin_sys_schur ()
 Getter for the linear system of the 2. Schur complement. More...
 

Protected Attributes

std::shared_ptr< Balancebalance_
 
DarcyFlowMHOutputoutput_object
 
int size
 
bool data_changed_
 
double tolerance_
 
unsigned int min_n_it_
 
unsigned int max_n_it_
 
unsigned int nonlinear_iteration_
 
std::shared_ptr< EqDatadata_
 
- Protected Attributes inherited from EquationBase
bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
FieldSeteq_data_
 
std::shared_ptr< Balancebalance_
 object for calculation and writing the mass balance to file. More...
 

Static Private Attributes

static const int registrar
 Registrar of class to factory. More...
 

Friends

class DarcyFlowMHOutput
 

Additional Inherited Members

- Public Types inherited from DarcyFlowInterface
typedef DarcyFlowInterface FactoryBaseType
 Typedef for usage of Input::Factory in child classes. More...
 

Detailed Description

Mixed-hybrid model of linear Darcy flow, possibly unsteady.

Abstract class for various implementations of Darcy flow. In future there should be one further level of abstraction for general time dependent problem.

maybe TODO: split compute_one_step to : 1) prepare_next_timestep 2) actualize_solution - this is for iterative nonlinear solvers

Mixed-hybrid of steady Darcy flow with sources and variable density.

solve equations:

\[ q= -{\mathbf{K}} \nabla h -{\mathbf{K}} R \nabla z \]

\[ \mathrm{div} q = f \]

where

The time key is optional, when not specified the equation is forced to steady regime. Using Steady TimeGovernor which have no dt constraints.

TODO: Make solution regular field (need FeSeystem and parallel DofHandler for edge pressures), then remove get_solution_vector from Equation interface. Model for transition coefficients due to Martin, Jaffre, Roberts (see manual for full reference)

TODO:

Definition at line 131 of file darcy_flow_lmh.hh.

Constructor & Destructor Documentation

◆ DarcyLMH()

DarcyLMH::DarcyLMH ( Mesh mesh,
const Input::Record  in_rec,
TimeGovernor tm = nullptr 
)

◆ ~DarcyLMH()

virtual DarcyLMH::~DarcyLMH ( )
overridevirtual

Member Function Documentation

◆ accept_time_step()

virtual void DarcyLMH::accept_time_step ( )
virtual

postprocess velocity field (add sources)

◆ allocate_mh_matrix()

void DarcyLMH::allocate_mh_matrix ( )
protected

Allocates linear system matrix for MH. TODO:

  • use general preallocation methods in DofHandler

◆ assembly_linear_system()

virtual void DarcyLMH::assembly_linear_system ( )
protectedvirtual

Assembly or update whole linear system.

◆ assembly_mh_matrix()

void DarcyLMH::assembly_mh_matrix ( MultidimAssembly &  assembler)
protected

Assembles linear system matrix for MH. Element by element assembly is done using dim-template assembly class. Assembles only steady part of the equation. TODO:

  • include time term - DONE
  • add support for Robin type sources
  • support for nonlinear solvers - assembly either residual vector, matrix, or both (using FADBAD++)

◆ create_linear_system()

void DarcyLMH::create_linear_system ( Input::AbstractRecord  rec)
protected

Create and preallocate MH linear system (including matrix, rhs and solution vectors)

◆ data()

EqData& DarcyLMH::data ( )
inline

Definition at line 198 of file darcy_flow_lmh.hh.

◆ DECLARE_EXCEPTION()

DarcyLMH::DECLARE_EXCEPTION ( ExcSolverDiverge  ,
<< "Diverged nonlinear solver. Reason: "<< EI_Reason::val   
)

◆ DECLARE_INPUT_EXCEPTION()

DarcyLMH::DECLARE_INPUT_EXCEPTION ( ExcMissingTimeGovernor  ,
<< "Missing the key 'time ,
obligatory for the transient problems."   
)

◆ get_component_indices_vec()

std::vector<int> DarcyLMH::get_component_indices_vec ( unsigned int  component) const
protected

Get vector of all DOF indices of given component (0..side, 1..element, 2..edge)

◆ get_input_type()

static const Input::Type::Record& DarcyLMH::get_input_type ( )
static

◆ get_mh_mortar_selection()

static const Input::Type::Selection& DarcyLMH::get_mh_mortar_selection ( )
static

Selection for enum MortarMethod.

◆ init_eq_data()

void DarcyLMH::init_eq_data ( )

◆ initial_condition_postprocess()

virtual void DarcyLMH::initial_condition_postprocess ( )
protectedvirtual

In some circumstances, the intial condition must be processed. It is called at the end of read_initial_condition(). This is used in Richards equation due the update of water content.

◆ initialize()

void DarcyLMH::initialize ( )
overridevirtual

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 from EquationBase.

◆ initialize_specific()

virtual void DarcyLMH::initialize_specific ( )
virtual

◆ lin_sys_schur()

LinSys& DarcyLMH::lin_sys_schur ( )
inlineprotected

Getter for the linear system of the 2. Schur complement.

Definition at line 284 of file darcy_flow_lmh.hh.

◆ output_data()

virtual void DarcyLMH::output_data ( )
overridevirtual

Write computed fields.

Reimplemented from EquationBase.

◆ postprocess()

virtual void DarcyLMH::postprocess ( )
virtual

◆ print_matlab_matrix()

void DarcyLMH::print_matlab_matrix ( string  matlab_file)
protected

Print darcy flow matrix in matlab format into a file.

◆ read_initial_condition()

void DarcyLMH::read_initial_condition ( )
protected

Read initial condition into solution vector. Must be called after create_linear_system.

For the LMH scheme we have to be able to save edge pressures in order to restart simulation or use results of one simulation as initial condition for other one.

◆ reconstruct_solution_from_schur()

void DarcyLMH::reconstruct_solution_from_schur ( MultidimAssembly &  assembler)
protected

◆ set_extra_source()

void DarcyLMH::set_extra_source ( const Field< 3, FieldValue< 3 >::Scalar > &  extra_src)
inline

Sets external source field (coupling with other equation).

Definition at line 205 of file darcy_flow_lmh.hh.

◆ set_extra_storativity()

void DarcyLMH::set_extra_storativity ( const Field< 3, FieldValue< 3 >::Scalar > &  extra_stor)
inline

Sets external storarivity field (coupling with other equation).

Definition at line 201 of file darcy_flow_lmh.hh.

◆ solution_precision()

virtual double DarcyLMH::solution_precision ( ) const
protectedvirtual

Return a norm of residual vector. TODO: Introduce Equation::compute_residual() updating residual field, standard part of EqData.

◆ solve_nonlinear()

void DarcyLMH::solve_nonlinear ( )
protected

Solve method common to zero_time_step and update solution.

◆ solve_time_step()

void DarcyLMH::solve_time_step ( bool  output = true)

Solve the problem without moving to next time and without output.

◆ type_field_descriptor()

static const Input::Type::Record& DarcyLMH::type_field_descriptor ( )
static

◆ TYPEDEF_ERR_INFO()

DarcyLMH::TYPEDEF_ERR_INFO ( EI_Reason  ,
string   
)

◆ update_solution()

void DarcyLMH::update_solution ( )
overridevirtual

Calculation of the next time step and its output.

Reimplemented from EquationBase.

◆ zero_time_step()

void DarcyLMH::zero_time_step ( )
overridevirtual

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 from EquationBase.

◆ zero_time_term()

virtual bool DarcyLMH::zero_time_term ( bool  time_global = false)
protectedvirtual

Returns true is the fields involved in the time term have values that makes the time term zero. For time_global==true, it returns true if there are no field descriptors in the input list, so the fields )of the time ter) have their default values for whole simulation. If time_global==false (default), only the actual values are considered.

Friends And Related Function Documentation

◆ DarcyFlowMHOutput

friend class DarcyFlowMHOutput
friend

Definition at line 303 of file darcy_flow_lmh.hh.

Member Data Documentation

◆ balance_

std::shared_ptr<Balance> DarcyLMH::balance_
protected

Definition at line 287 of file darcy_flow_lmh.hh.

◆ data_

std::shared_ptr<EqData> DarcyLMH::data_
protected

Definition at line 301 of file darcy_flow_lmh.hh.

◆ data_changed_

bool DarcyLMH::data_changed_
protected

Definition at line 293 of file darcy_flow_lmh.hh.

◆ max_n_it_

unsigned int DarcyLMH::max_n_it_
protected

Definition at line 298 of file darcy_flow_lmh.hh.

◆ min_n_it_

unsigned int DarcyLMH::min_n_it_
protected

Definition at line 297 of file darcy_flow_lmh.hh.

◆ nonlinear_iteration_

unsigned int DarcyLMH::nonlinear_iteration_
protected

Definition at line 299 of file darcy_flow_lmh.hh.

◆ output_object

DarcyFlowMHOutput* DarcyLMH::output_object
protected

Definition at line 289 of file darcy_flow_lmh.hh.

◆ registrar

const int DarcyLMH::registrar
staticprivate

Registrar of class to factory.

Definition at line 309 of file darcy_flow_lmh.hh.

◆ size

int DarcyLMH::size
protected

Definition at line 291 of file darcy_flow_lmh.hh.

◆ tolerance_

double DarcyLMH::tolerance_
protected

Definition at line 296 of file darcy_flow_lmh.hh.


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