Flow123d  JS_before_hm-1621-g63a12c7
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_
Abstract linear system class.
Definition: balance.hh:40
Definition: mesh.h:77
Base class for linear reactions and decay chain.
Class ReactionTerm is an abstract class representing reaction term in transport.
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
DECLARE_EXCEPTION(ExcWrongDefaultJSON,<< "Consistency Error: Not valid JSON of Default value "<< EI_DefaultStr::qval<< " of type "<< EI_TypeName::qval<< ";\n"<< "During declaration of the key: "<< EI_KeyName::qval)
static const int registrar
Registrar of class to factory.
Record type proxy class.
Definition: type_record.hh:182
Class implements the linear reactions.
std::vector< double > reaction_rates_
Vector of reaction rates of the transported substances.