DOLFIN
DOLFIN C++ interface
LinearTimeDependentProblem.h
1 // Copyright (C) 2012 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: 2012-08-17
19 // Last changed: 2012-08-20
20 
21 #ifndef __LINEAR_TIME_DEPENDENT_PROBLEM_H
22 #define __LINEAR_TIME_DEPENDENT_PROBLEM_H
23 
24 #include <memory>
25 #include <dolfin/common/Hierarchical.h>
26 
27 // FIXME: Temporary fix
28 #include "Form.h"
29 
30 namespace dolfin
31 {
32 
35 
36  // Forward declarations
37  class BoundaryCondition;
38 
47 
48  class LinearTimeDependentProblem : public Hierarchical<LinearTimeDependentProblem>
49  {
50  public:
51 
54  LinearTimeDependentProblem(std::shared_ptr<const TensorProductForm> a,
55  std::shared_ptr<const TensorProductForm> L,
56  std::shared_ptr<Function> u,
57  std::vector<std::shared_ptr<const BoundaryCondition>> bcs);
58 
60  std::shared_ptr<const TensorProductForm> bilinear_form() const;
61 
63  std::shared_ptr<const TensorProductForm> linear_form() const;
64 
66  std::shared_ptr<Function> solution();
67 
69  std::shared_ptr<const Function> solution() const;
70 
72  std::vector<std::shared_ptr<const BoundaryCondition>> bcs() const;
73 
75  std::shared_ptr<const FunctionSpace> trial_space() const;
76 
78  std::shared_ptr<const FunctionSpace> test_space() const;
79 
80  private:
81 
82  // Check forms
83  void check_forms() const;
84 
85  // The bilinear form
86  std::shared_ptr<const TensorProductForm> _a;
87 
88  // The linear form
89  std::shared_ptr<const TensorProductForm> _l;
90 
91  // The solution
92  std::shared_ptr<Function> _u;
93 
94  // The boundary conditions
95  std::vector<std::shared_ptr<const BoundaryCondition>> _bcs;
96 
97  };
98 
99 }
100 
101 #endif
std::shared_ptr< const FunctionSpace > test_space() const
Return test space.
Definition: LinearTimeDependentProblem.cpp:72
Base class for UFC code generated by FFC for DOLFIN with option -l.
Definition: Form.h:85
Definition: Hierarchical.h:43
Definition: adapt.h:29
Form TensorProductForm
FIXME: Temporary fix.
Definition: LinearTimeDependentProblem.h:34
std::shared_ptr< Function > solution()
Return solution variable.
Definition: LinearTimeDependentProblem.cpp:48
std::shared_ptr< const FunctionSpace > trial_space() const
Return trial space.
Definition: LinearTimeDependentProblem.cpp:65
std::vector< std::shared_ptr< const BoundaryCondition > > bcs() const
Return boundary conditions.
Definition: LinearTimeDependentProblem.cpp:59
Definition: LinearTimeDependentProblem.h:48
std::shared_ptr< const TensorProductForm > linear_form() const
Return linear form.
Definition: LinearTimeDependentProblem.cpp:43
std::shared_ptr< const TensorProductForm > bilinear_form() const
Return bilinear form.
Definition: LinearTimeDependentProblem.cpp:37
LinearTimeDependentProblem(std::shared_ptr< const TensorProductForm > a, std::shared_ptr< const TensorProductForm > L, std::shared_ptr< Function > u, std::vector< std::shared_ptr< const BoundaryCondition >> bcs)
Definition: LinearTimeDependentProblem.cpp:24