Flow123d  JS_before_hm-2199-g85616a0ec
first_order_reaction.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file first_order_reaction.hh
15  * @brief
16  */
17 
18 #ifndef FIRST_ORDER_REACTION_H_
19 #define FIRST_ORDER_REACTION_H_
20 
21 #include <vector> // for vector
22 #include "reaction/first_order_reaction_base.hh" // for FirstOrderReactionBase
23 #include "reaction/reaction_term.hh" // for ReactionTerm
24 
25 class Mesh;
26 namespace Input {
27  class Record;
28  namespace Type {
29  class Record;
30  }
31 }
32 
33 
34 /** @brief Class implements the linear reactions.
35  *
36  * This class implements the user interface for linear reactions and prepares the reaction matrix.
37  * Common features are inherited from the @p FirstOrderReactionBase class.
38  */
40 {
41 public:
43 
44  DECLARE_EXCEPTION( ExcTooManyReactants, << "More than one reactant is not available at the moment.\n" );
45 
46  static const Input::Type::Record & get_input_type(); ///< Input record for class FirstOrderReaction.
47  static const Input::Type::Record & get_input_type_single_reaction(); ///< Input record which defines particular reaction.
48  static const Input::Type::Record & get_input_type_reactant(); ///< Input record for a reactant of a reaction.
49  static const Input::Type::Record & get_input_type_product(); ///< Input record for a product of a reaction.
50 
51  /// Constructor.
52  FirstOrderReaction(Mesh &init_mesh, Input::Record in_rec);
53 
54  /// Destructor.
55  ~FirstOrderReaction(void);
56 
57 protected:
58 
59  /// Implements the assembly of the system matrix of the ODEs.
60  void assemble_ode_matrix(void) override;
61 
62  /// Initializes private members of sorption from the input record.
63  void initialize_from_input() override;
64 
65  std::vector<double> reaction_rates_; ///< Vector of reaction rates of the transported substances.
66 
67 private:
68  /// Registrar of class to factory
69  static const int registrar;
70 };
71 
72 #endif // FIRST_ORDER_REACTION_H_
FirstOrderReaction::DECLARE_EXCEPTION
DECLARE_EXCEPTION(ExcTooManyReactants,<< "More than one reactant is not available at the moment.\n")
Input
Abstract linear system class.
Definition: balance.hh:40
FirstOrderReaction::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: first_order_reaction.hh:42
FirstOrderReaction::~FirstOrderReaction
~FirstOrderReaction(void)
Destructor.
Definition: first_order_reaction.cc:88
std::vector< double >
FirstOrderReaction::get_input_type_product
static const Input::Type::Record & get_input_type_product()
Input record for a product of a reaction.
Definition: first_order_reaction.cc:41
FirstOrderReaction::get_input_type_single_reaction
static const Input::Type::Record & get_input_type_single_reaction()
Input record which defines particular reaction.
Definition: first_order_reaction.cc:55
FirstOrderReaction::FirstOrderReaction
FirstOrderReaction(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: first_order_reaction.cc:83
FirstOrderReaction::initialize_from_input
void initialize_from_input() override
Initializes private members of sorption from the input record.
Definition: first_order_reaction.cc:111
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
first_order_reaction_base.hh
FirstOrderReaction
Class implements the linear reactions.
Definition: first_order_reaction.hh:39
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
Mesh
Definition: mesh.h:355
FirstOrderReaction::assemble_ode_matrix
void assemble_ode_matrix(void) override
Implements the assembly of the system matrix of the ODEs.
Definition: first_order_reaction.cc:92
FirstOrderReactionBase
Base class for linear reactions and decay chain.
Definition: first_order_reaction_base.hh:41
FirstOrderReaction::reaction_rates_
std::vector< double > reaction_rates_
Vector of reaction rates of the transported substances.
Definition: first_order_reaction.hh:65
FirstOrderReaction::get_input_type_reactant
static const Input::Type::Record & get_input_type_reactant()
Input record for a reactant of a reaction.
Definition: first_order_reaction.cc:32
FirstOrderReaction::get_input_type
static const Input::Type::Record & get_input_type()
Input record for class FirstOrderReaction.
Definition: first_order_reaction.cc:67
FirstOrderReaction::registrar
static const int registrar
Registrar of class to factory.
Definition: first_order_reaction.hh:69
reaction_term.hh
Class ReactionTerm is an abstract class representing reaction term in transport.
ReactionTerm
Definition: reaction_term.hh:46