Flow123d  release_3.0.0-916-g95df358
field_flag.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 field_flag.hh
15  * @brief
16  */
17 
18 #ifndef FIELD_FLAGS_HH_
19 #define FIELD_FLAGS_HH_
20 
21 #include "system/flag_array.hh"
22 
23 class FieldFlag
24 {
25 public:
27  typedef Flags::Mask Mask;
28 
29  /// Number of bits used by Field itself.
30  static constexpr unsigned int flags_size_ = 3;
31 
32  /// The field is data parameter of the owning equation. (default on)
33  static constexpr Mask equation_input{1 << 0};
34  /// The field can be set from input. The key in input field descriptor is declared. (default on)
35  static constexpr Mask declare_input{1 << 1};
36  /// The field can output. Is part of generated output selection. (default on)
37  static constexpr Mask allow_output{1 << 2};
38 
39 
40  /**
41  * A field that is input of its equation and can not read from input, thus must be set by copy.
42  * Disabled flag 'declare_input' still allow initialization of the field from a default value.
43  */
44  static constexpr Mask input_copy = ~declare_input & equation_input;
45 
46  /// A field is part of time term of the equation.
47  static constexpr Mask in_time_term{1 << 8};
48  /// A field is part of main "stiffness matrix" of the equation.
49  static constexpr Mask in_main_matrix{1 << 9};
50  /// A field is part of the right hand side of the equation.
51  static constexpr Mask in_rhs{1 << 10};
52 
53 
54  /// Match result fields. These are never given by input or copy of input.
55  static constexpr Mask equation_result = allow_output & ~declare_input & ~equation_input;
56 
57  /// Match an output field, that can be also copy of other field.
59 
60 };
61 
62 
63 
64 
65 
66 
67 
68 #endif /* FIELD_FLAGS_HH_ */
static constexpr Mask in_main_matrix
A field is part of main "stiffness matrix" of the equation.
Definition: field_flag.hh:49
static constexpr Mask allow_output
The field can output. Is part of generated output selection. (default on)
Definition: field_flag.hh:37
static constexpr Mask equation_result
Match result fields. These are never given by input or copy of input.
Definition: field_flag.hh:55
static constexpr Mask input_copy
Definition: field_flag.hh:44
static constexpr Mask in_time_term
A field is part of time term of the equation.
Definition: field_flag.hh:47
static constexpr Mask equation_external_output
Match an output field, that can be also copy of other field.
Definition: field_flag.hh:58
static constexpr Mask in_rhs
A field is part of the right hand side of the equation.
Definition: field_flag.hh:51
static constexpr unsigned int flags_size_
Number of bits used by Field itself.
Definition: field_flag.hh:30
Flags::Mask Mask
Definition: field_flag.hh:27
FlagArray< FieldFlag > Flags
Definition: field_flag.hh:26
static constexpr Mask equation_input
The field is data parameter of the owning equation. (default on)
Definition: field_flag.hh:33
static constexpr Mask declare_input
The field can be set from input. The key in input field descriptor is declared. (default on) ...
Definition: field_flag.hh:35