21 #ifndef __POINTINTEGRALSOLVER_H 22 #define __POINTINTEGRALSOLVER_H 28 #include <dolfin/common/Variable.h> 29 #include <dolfin/fem/Assembler.h> 34 class MultiStageScheme;
62 std::shared_ptr<MultiStageScheme>
scheme()
const 70 p.
add(
"reset_stage_solutions",
true);
74 pn.
add(
"maximum_iterations", 40);
75 pn.
add(
"always_recompute_jacobian",
false);
76 pn.
add(
"recompute_jacobian_each_solve",
true);
77 pn.
add(
"relaxation_parameter", 1., 0., 1.);
78 pn.
add(
"relative_tolerance", 1e-10, 1e-20, 2.);
79 pn.
add(
"absolute_tolerance", 1e-15, 1e-20, 2.);
81 pn.
add(
"kappa", 0.1, 0.05, 1.0);
82 pn.
add(
"eta_0", 1., 1e-15, 1.0);
83 pn.
add(
"max_relative_previous_residual", 1e-1, 1e-5, 1.);
84 pn.
add(
"reset_each_step",
true);
85 pn.
add(
"report",
false);
86 pn.
add(
"report_vertex", 0, 0, 32767);
87 pn.
add(
"verbose_report",
false);
102 {
return _num_jacobian_computations; }
107 void _lu_factorize(std::vector<double>& A);
111 void _forward_backward_subst(
const std::vector<double>& A,
112 const std::vector<double>& b,
113 std::vector<double>& x)
const;
116 void _compute_jacobian(std::vector<double>& jac,
117 const std::vector<double>& u,
118 unsigned int local_vert,
UFC& loc_ufc,
119 const Cell& cell,
const ufc::cell& ufc_cell,
120 int coefficient_index,
121 const std::vector<double>& coordinate_dofs);
124 double _norm(
const std::vector<double>& vec)
const;
135 void _solve_explicit_stage(std::size_t vert_ind,
unsigned int stage,
136 const ufc::cell& ufc_cell,
137 const std::vector<double>& coordinate_dofs);
140 void _solve_implicit_stage(std::size_t vert_ind,
unsigned int stage,
141 const Cell& cell,
const ufc::cell& ufc_cell,
142 const std::vector<double>& coordinate_dofs);
145 _simplified_newton_solve(std::size_t vert_ind,
unsigned int stage,
146 const Cell& cell,
const ufc::cell& ufc_cell,
147 const std::vector<double>& coordinate_dofs);
150 std::shared_ptr<MultiStageScheme> _scheme;
153 std::shared_ptr<const Mesh> _mesh;
159 const std::size_t _system_size;
163 const unsigned int _dof_offset;
166 const unsigned int _num_stages;
169 std::vector<std::size_t> _local_to_local_dofs;
173 std::vector<std::pair<std::size_t, unsigned int>> _vertex_map;
177 std::vector<dolfin::la_index> _local_to_global_dofs;
180 std::vector<std::vector<double>> _local_stage_solutions;
183 std::vector<double> _u0;
184 std::vector<double> _residual;
185 std::vector<double> _y;
186 std::vector<double> _dx;
189 std::vector<std::vector<std::shared_ptr<UFC>>> _ufcs;
192 std::shared_ptr<UFC> _last_stage_ufc;
195 std::vector<std::vector<int>> _coefficient_index;
198 std::vector<bool> _recompute_jacobian;
201 std::vector<std::vector<double>> _jacobians;
209 std::size_t _num_jacobian_computations;
Common base class for DOLFIN variables.
Definition: Variable.h:35
void reset_stage_solutions()
Reset stage solutions.
Definition: PointIntegralSolver.cpp:88
This class provides a generic interface for dof maps.
Definition: GenericDofMap.h:49
void add(std::string key)
Definition: Parameters.h:128
void step(double dt)
Step solver with time step dt.
Definition: PointIntegralSolver.cpp:102
void step_interval(double t0, double t1, double dt)
Step solver an interval using dt as time step.
Definition: PointIntegralSolver.cpp:309
std::size_t num_jacobian_computations() const
Return number of computations of jacobian.
Definition: PointIntegralSolver.h:101
A Cell is a MeshEntity of topological codimension 0.
Definition: Cell.h:42
PointIntegralSolver(std::shared_ptr< MultiStageScheme > scheme)
Definition: PointIntegralSolver.cpp:53
This class is a time integrator for general Runge Kutta forms.
Definition: PointIntegralSolver.h:43
Definition: Parameters.h:94
void reset_newton_solver()
Reset newton solver.
Definition: PointIntegralSolver.cpp:80
std::shared_ptr< MultiStageScheme > scheme() const
Return the MultiStageScheme.
Definition: PointIntegralSolver.h:62
~PointIntegralSolver()
Destructor.
Definition: PointIntegralSolver.cpp:75
static Parameters default_parameters()
Default parameter values.
Definition: PointIntegralSolver.h:66