Loading...
Searching...
No Matches
problem.h
Go to the documentation of this file.
#ifndef _RHEOLEF_PROBLEM_H
#define _RHEOLEF_PROBLEM_H
//
// This file is part of Rheolef.
//
// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
//
// Rheolef is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Rheolef is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rheolef; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// =========================================================================
// AUTHORS: Pierre.Saramito@imag.fr
// DATE: 21 february 2020
namespace rheolef {
} // namespace rheolef
#include "rheolef/form.h"
namespace rheolef {
// [verbatim_problem_basic]
template <class T, class M = rheo_default_memory_model>
class problem_basic {
public:
// typedefs:
typedef typename solver_basic<T,M>::size_type size_type;
typedef typename solver_basic<T,M>::determinant_type determinant_type;
// allocators:
problem_basic ();
problem_basic (const form_basic<T,M>& a,
const solver_option& sopt = solver_option());
void update_value (const form_basic<T,M>& a);
void set_preconditioner (const solver_basic<T,M>&);
// accessor:
void solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const;
void trans_solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const;
determinant_type det() const;
const solver_option& option() const;
bool initialized() const;
// [verbatim_problem_basic]
// internals:
// used by problem_mixed:
const solver_basic<T,M>& get_solver() const { return _sa; }
// data:
protected:
form_basic<T,M> _a;
solver_basic<T,M> _sa;
// [verbatim_problem_basic_cont]
};
// [verbatim_problem_basic_cont]
// [verbatim_problem]
typedef problem_basic<Float> problem;
// [verbatim_problem]
// -----------------------------------------------------------------------------
// inlined
// -----------------------------------------------------------------------------
template<class T, class M>
inline
problem_basic<T,M>::problem_basic()
: _a(),
_sa()
{
}
template<class T, class M>
inline
problem_basic<T,M>::problem_basic (
const form_basic<T,M>& a,
const solver_option& sopt)
: _a(a),
_sa (a.uu(), sopt)
{
}
template<class T, class M>
inline
void
problem_basic<T,M>::update_value (const form_basic<T,M>& a)
{
_a = a;
_sa.update_value (a.uu());
}
template<class T, class M>
inline
void
problem_basic<T,M>::set_preconditioner (const solver_basic<T,M>& m)
{
_sa.set_preconditioner (m);
}
template<class T, class M>
inline
void
problem_basic<T,M>::solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const
{
uh.set_u() = _sa.solve (lh.u() - _a.ub()*uh.b());
}
template<class T, class M>
void
problem_basic<T,M>::trans_solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const
{
uh.set_u() = _sa.trans_solve (lh.u() - _a.bu().trans_mult(uh.b()));
}
template<class T, class M>
inline
bool
problem_basic<T,M>::initialized() const
{
return _sa.initialized();
}
template<class T, class M>
inline
typename problem_basic<T,M>::determinant_type
problem_basic<T,M>::det() const
{
return _sa.det();
}
template<class T, class M>
inline
const solver_option&
problem_basic<T,M>::option() const
{
return _sa.option();
}
} // namespace rheolef
#endif // _RHEOLEF_PROBLEM_H
lh
field lh(Float epsilon, Float t, const test &v)
Definition burgers_diffusion_operators.icc:25
rheolef::field_basic
Definition field.h:219
rheolef::field_basic::b
const vec< T, M > & b() const
Definition field.h:283
rheolef::field_basic::set_u
vec< T, M > & set_u()
Definition field.h:284
rheolef::form_basic
Definition form.h:146
rheolef::problem_basic::get_solver
const solver_basic< T, M > & get_solver() const
Definition problem.h:151
rheolef::problem_basic::set_preconditioner
void set_preconditioner(const solver_basic< T, M > &)
Definition problem.h:196
rheolef::problem_basic::solve
void solve(const field_basic< T, M > &lh, field_basic< T, M > &uh) const
Definition problem.h:203
rheolef::problem_basic::update_value
void update_value(const form_basic< T, M > &a)
Definition problem.h:188
rheolef::problem_basic::determinant_type
solver_basic< T, M >::determinant_type determinant_type
Definition problem.h:126
rheolef::problem_basic::size_type
solver_basic< T, M >::size_type size_type
Definition problem.h:125
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::problem_basic::_sa
solver_basic< T, M > _sa
Definition problem.h:156
rheolef::problem_basic::option
const solver_option & option() const
Definition problem.h:230
rheolef::problem_basic::det
determinant_type det() const
Definition problem.h:223
rheolef::problem_basic::_a
form_basic< T, M > _a
Definition problem.h:155
rheolef::problem_basic::problem_basic
problem_basic()
Definition problem.h:171
rheolef::problem_basic::initialized
bool initialized() const
Definition problem.h:216
rheolef::solver_basic
Definition solver.h:264
rheolef::solver_basic::determinant_type
rep::determinant_type determinant_type
Definition solver.h:271
rheolef::solver_basic::size_type
rep::size_type size_type
Definition solver.h:270
rheolef::solver_option
see the solver_option page for the full documentation
Definition solver_option.h:155
rheolef::problem
problem_basic< Float > problem
Definition problem.h:163
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39