Rheolef  7.1
an efficient C++ finite element environment
problem.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_PROBLEM_H
2 #define _RHEOLEF_PROBLEM_H
3 //
4 // This file is part of Rheolef.
5 //
6 // Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7 //
8 // Rheolef is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Rheolef is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Rheolef; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 //
22 // =========================================================================
23 // AUTHORS: Pierre.Saramito@imag.fr
24 // DATE: 21 february 2020
25 
26 namespace rheolef {
112 } // namespace rheolef
113 
114 #include "rheolef/form.h"
115 
116 namespace rheolef {
117 
118 // [verbatim_problem_basic]
119 template <class T, class M = rheo_default_memory_model>
121 public:
122 
123 // typedefs:
124 
127 
128 // allocators:
129 
132  const solver_option& sopt = solver_option());
133 
135 
137 
138 // accessor:
139 
140  void solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const;
142 
144  const solver_option& option() const;
145  bool initialized() const;
146 // [verbatim_problem_basic]
147 
148 // internals:
149 
150  // used by problem_mixed:
151  const solver_basic<T,M>& get_solver() const { return _sa; }
152 
153 // data:
154 protected:
157 
158 // [verbatim_problem_basic_cont]
159 };
160 // [verbatim_problem_basic_cont]
161 
162 // [verbatim_problem]
163 typedef problem_basic<Float> problem;
164 // [verbatim_problem]
165 
166 // -----------------------------------------------------------------------------
167 // inlined
168 // -----------------------------------------------------------------------------
169 template<class T, class M>
170 inline
172  : _a(),
173  _sa()
174 {
175 }
176 template<class T, class M>
177 inline
179  const form_basic<T,M>& a,
180  const solver_option& sopt)
181  : _a(a),
182  _sa (a.uu(), sopt)
183 {
184 }
185 template<class T, class M>
186 inline
187 void
189 {
190  _a = a;
191  _sa.update_value (a.uu());
192 }
193 template<class T, class M>
194 inline
195 void
197 {
198  _sa.set_preconditioner (m);
199 }
200 template<class T, class M>
201 inline
202 void
204 {
205  uh.set_u() = _sa.solve (lh.u() - _a.ub()*uh.b());
206 }
207 template<class T, class M>
208 void
210 {
211  uh.set_u() = _sa.trans_solve (lh.u() - _a.bu().trans_mult(uh.b()));
212 }
213 template<class T, class M>
214 inline
215 bool
217 {
218  return _sa.initialized();
219 }
220 template<class T, class M>
221 inline
224 {
225  return _sa.det();
226 }
227 template<class T, class M>
228 inline
229 const solver_option&
231 {
232  return _sa.option();
233 }
234 
235 } // namespace rheolef
236 #endif // _RHEOLEF_PROBLEM_H
rheolef::problem
problem_basic< Float > problem
Definition: problem.h:163
rheolef::problem_basic
Definition: problem.h:120
rheolef::problem_basic::size_type
solver_basic< T, M >::size_type size_type
Definition: problem.h:125
rheolef::problem_basic::problem_basic
problem_basic(const form_basic< T, M > &a, const solver_option &sopt=solver_option())
Definition: problem.h:178
rheolef::solver_basic::size_type
rep::size_type size_type
Definition: solver.h:270
rheolef::problem_basic::_a
form_basic< T, M > _a
Definition: problem.h:155
rheolef::solver_basic
Definition: solver.h:264
rheolef::problem_basic::problem_basic
problem_basic()
Definition: problem.h:171
rheolef::solver_abstract_rep::determinant_type
Definition: solver.h:215
rheolef::problem_basic::determinant_type
solver_basic< T, M >::determinant_type determinant_type
Definition: problem.h:126
rheolef::field_basic::set_u
vec< T, M > & set_u()
Definition: field.h:312
a
Definition: diffusion_isotropic.h:25
rheolef::field_basic
Definition: field.h:235
lh
field lh(Float epsilon, Float t, const test &v)
Definition: burgers_diffusion_operators.icc:25
mkgeo_sector.m
m
Definition: mkgeo_sector.sh:118
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::problem_basic::_sa
solver_basic< T, M > _sa
Definition: problem.h:156
rheolef::problem_basic::get_solver
const solver_basic< T, M > & get_solver() const
Definition: problem.h:151
rheolef::problem_basic::update_value
void update_value(const form_basic< T, M > &a)
Definition: problem.h:188
rheolef::problem_basic::trans_solve
void trans_solve(const field_basic< T, M > &lh, field_basic< T, M > &uh) const
Definition: problem.h:209
rheolef::form_basic
Definition: form.h:144
rheolef::problem_basic::det
determinant_type det() const
Definition: problem.h:223
rheolef::problem_basic::set_preconditioner
void set_preconditioner(const solver_basic< T, M > &)
Definition: problem.h:196
rheolef::field_basic::b
const vec< T, M > & b() const
Definition: field.h:311
rheolef::problem_basic::initialized
bool initialized() const
Definition: problem.h:216
rheolef::problem_basic::option
const solver_option & option() const
Definition: problem.h:230
mkgeo_ball.a
int a
Definition: mkgeo_ball.sh:151
rheolef::problem_basic::solve
void solve(const field_basic< T, M > &lh, field_basic< T, M > &uh) const
Definition: problem.h:203
rheolef::solver_option
see the solver_option page for the full documentation
Definition: solver_option.h:155