Flow123d  JS_before_hm-1601-gc6ac32d
equation.cc
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 equation.cc
15  * @brief Abstract base class for equation clasess.
16  * @author Jan Brezina
17  */
18 
19 #include <petscmat.h>
20 #include "tools/time_governor.hh"
21 
22 
23 #include "equation.hh"
24 #include "system/system.hh"
25 #include "input/accessors.hh"
26 #include "fields/field_set.hh"
27 
28 
29 
30 
31 /*****************************************************************************************
32  * Implementation of EqBase
33  */
34 
36  return Input::Type::Record("EquationBase_AUX", "Auxiliary record with keys common for equations. Should not be used.")
38  "Time governor setting.")
39  .close();
40 }
41 
43 : equation_empty_(true),
44  mesh_(NULL),
45  time_(NULL),
46  input_record_(),
47  eq_fieldset_(nullptr)
48 {}
49 
50 
51 
53 : equation_empty_(false),
54  mesh_(&mesh),
55  time_(NULL),
56  input_record_(in_rec),
57  eq_fieldset_(nullptr)
58 {}
59 
60 
62 {
63  time_ = &time;
64 }
65 
TimeGovernor & time()
Definition: equation.hh:149
Abstract base class for equation clasess.
Class Input::Type::Default specifies default value of keys of a Input::Type::Record.
Definition: type_record.hh:61
Definition: mesh.h:77
Basic time management functionality for unsteady (and steady) solvers (class Equation).
Record & close() const
Close the Record for further declarations of keys.
Definition: type_record.cc:304
Basic time management class.
static Input::Type::Record & record_template()
Template Record with common keys for derived equations.
Definition: equation.cc:35
Mesh & mesh()
Definition: equation.hh:177
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
FieldSet * eq_fieldset_
Definition: equation.hh:227
Mesh * mesh_
Definition: equation.hh:218
Record & declare_key(const string &key, std::shared_ptr< TypeBase > type, const Default &default_value, const string &description, TypeBase::attribute_map key_attributes=TypeBase::attribute_map())
Declares a new key of the Record.
Definition: type_record.cc:503
virtual void set_time_governor(TimeGovernor &time)
Definition: equation.cc:61
bool equation_empty_
flag is true if only default constructor was called
Definition: equation.hh:217
Input::Record input_record_
Definition: equation.hh:220
static const Input::Type::Record & get_input_type()
Record type proxy class.
Definition: type_record.hh:182
TimeGovernor * time_
Definition: equation.hh:219