DOLFIN
DOLFIN C++ interface
Equation.h
1 // Copyright (C) 2011 Anders Logg
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2011-06-21
19 // Last changed: 2011-06-22
20 
21 #ifndef __EQUATION_H
22 #define __EQUATION_H
23 
24 #include <memory>
25 
26 namespace dolfin
27 {
28 
29  // Forward declarations
30  class Form;
31 
39 
40  class Equation
41  {
42  public:
43 
49  Equation(std::shared_ptr<const Form> a,
50  std::shared_ptr<const Form> L);
51 
55  Equation(std::shared_ptr<const Form> F, int rhs);
56 
58  ~Equation();
59 
62  bool is_linear() const;
63 
67  std::shared_ptr<const Form> lhs() const;
68 
72  std::shared_ptr<const Form> rhs() const;
73 
76  int rhs_int() const;
77 
78  private:
79 
80  // Left-hand side form
81  std::shared_ptr<const Form> _lhs;
82 
83  // Right-hand side form
84  std::shared_ptr<const Form> _rhs;
85 
86  // Right-hand side value (should be zero)
87  int _rhs_int;
88 
89  // Flag for whether equation is linear
90  bool _is_linear;
91 
92  };
93 
94 }
95 
96 #endif
bool is_linear() const
Definition: Equation.cpp:46
~Equation()
Destructor.
Definition: Equation.cpp:41
Definition: adapt.h:29
int rhs_int() const
Definition: Equation.cpp:63
Equation(std::shared_ptr< const Form > a, std::shared_ptr< const Form > L)
Definition: Equation.cpp:28
std::shared_ptr< const Form > lhs() const
Definition: Equation.cpp:51
std::shared_ptr< const Form > rhs() const
Definition: Equation.cpp:57
Definition: Equation.h:40