Rheolef
7.1
an efficient C++ finite element environment
continuation_option.h
Go to the documentation of this file.
1
#ifndef _RHEOLEF_CONTINUATION_OPTION_H
2
#define _RHEOLEF_CONTINUATION_OPTION_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
24
namespace
rheolef
{
69
}
// namespace rheolef
70
71
#include "rheolef/adapt.h"
72
73
namespace
rheolef
{
74
75
// [verbatim_continuation_option]
77
struct
continuation_option
:
adapt_option
{
78
Float
ini_direction
;
79
Float
kappa
;
80
Float
tol
;
81
size_t
max_iter
;
82
size_t
newton_max_iter
;
83
Float
min_delta_parameter
;
84
Float
max_delta_parameter
;
85
Float
ini_delta_parameter
;
86
Float
theta_decr
;
87
Float
theta_incr
;
88
Float
theta_variation
;
89
size_t
min_delta_parameter_successive_count_max
;
90
Float
tol_cos_angle
;
91
bool
do_prediction
;
92
bool
do_check_going_back
;
93
size_t
n_adapt
;
94
continuation_option
(
const
adapt_option
& aopt =
adapt_option
());
95
void
check
()
const
;
96
};
97
// [verbatim_continuation_option]
98
99
// backward compat:
100
using
continuation_option_type
=
continuation_option
;
101
102
inline
103
continuation_option::continuation_option
(
const
adapt_option
& aopt)
104
:
adapt_option
(aopt),
105
ini_direction(1),
106
kappa (0.5),
107
tol (
std
::numeric_limits<
Float
>::
epsilon
()),
108
max_iter (10000),
109
newton_max_iter(100),
110
min_delta_parameter (0.001),
111
max_delta_parameter (0.025),
112
ini_delta_parameter (0.01),
113
theta_decr(0.75),
114
theta_incr(1.1),
115
theta_variation(0.25),
116
min_delta_parameter_successive_count_max(3),
117
tol_cos_angle(0.1),
118
do_prediction(true),
119
do_check_going_back(true),
120
n_adapt(0)
121
{}
122
inline
123
void
124
continuation_option::check
()
const
{
125
check_macro
(
ini_direction
== 1 ||
ini_direction
== -1,
"ini_direction="
<<
tol
<<
" may be 1 or -1"
);
126
check_macro
(
tol
> 0,
"tol="
<<
tol
<<
" may be > 0"
);
127
check_macro
(
min_delta_parameter
> 0,
"min_delta_parameter="
<<
min_delta_parameter
<<
" may be > 0"
);
128
check_macro
(
min_delta_parameter
<=
max_delta_parameter
,
"min_delta_parameter="
<<
min_delta_parameter
129
<<
" may be <= max_delta_parameter="
<<
max_delta_parameter
);
130
check_macro
(
min_delta_parameter
<=
ini_delta_parameter
&&
ini_delta_parameter
<=
max_delta_parameter
,
131
"ini_delta_parameter="
<<
ini_delta_parameter
<<
" may be in range ["
132
<<
min_delta_parameter
<<
":"
<<
max_delta_parameter
<<
"]"
);
133
check_macro
(0 <
kappa
&&
kappa
< 1,
"kappa="
<<
kappa
<<
" may be in range ]0:1["
);
134
check_macro
(0 <
theta_variation
&&
theta_variation
< 1,
"theta_variation="
<<
theta_variation
<<
" may be in range ]0:1["
);
135
check_macro
(1 <
theta_incr
,
"theta_incr="
<<
theta_incr
<<
" may be > 1"
);
136
check_macro
(0 <
theta_decr
&&
theta_decr
< 1,
"theta_decr="
<<
theta_decr
<<
" may be in range ]0:1["
);
137
check_macro
(0 <
tol_cos_angle
&&
tol_cos_angle
<= 1,
"tol_cos_angle="
<<
tol_cos_angle
<<
" may be in range ]0:1]"
);
138
}
139
140
}
// namespace rheolef
141
#endif // _RHEOLEF_CONTINUATION_OPTION_H
rheolef::continuation_option::theta_decr
Float theta_decr
Definition:
continuation_option.h:86
rheolef::continuation_option::ini_delta_parameter
Float ini_delta_parameter
Definition:
continuation_option.h:85
rheolef::continuation_option::newton_max_iter
size_t newton_max_iter
Definition:
continuation_option.h:82
rheolef::continuation_option::kappa
Float kappa
Definition:
continuation_option.h:79
rheolef::continuation_option::theta_incr
Float theta_incr
Definition:
continuation_option.h:87
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef::continuation_option
see the continuation_option page for the full documentation
Definition:
continuation_option.h:77
rheolef::continuation_option::tol
Float tol
Definition:
continuation_option.h:80
rheolef::continuation_option::ini_direction
Float ini_direction
Definition:
continuation_option.h:78
rheolef::continuation_option::min_delta_parameter_successive_count_max
size_t min_delta_parameter_successive_count_max
Definition:
continuation_option.h:89
rheolef::adapt_option
adapt_option: see the adapt page for the full documentation
Definition:
adapt.h:147
rheolef::continuation_option::theta_variation
Float theta_variation
Definition:
continuation_option.h:88
rheolef::adapt_option::adapt_option
adapt_option()
Definition:
adapt.h:168
rheolef::continuation_option::check
void check() const
Definition:
continuation_option.h:124
rheolef::continuation_option::min_delta_parameter
Float min_delta_parameter
Definition:
continuation_option.h:83
rheolef::continuation_option::max_iter
size_t max_iter
Definition:
continuation_option.h:81
rheolef::continuation_option::continuation_option
continuation_option(const adapt_option &aopt=adapt_option())
Definition:
continuation_option.h:103
rheolef
This file is part of Rheolef.
Definition:
compiler_eigen.h:37
Float
see the Float page for the full documentation
rheolef::continuation_option::n_adapt
size_t n_adapt
Definition:
continuation_option.h:93
rheolef::continuation_option::do_prediction
bool do_prediction
Definition:
continuation_option.h:91
rheolef::continuation_option::tol_cos_angle
Float tol_cos_angle
Definition:
continuation_option.h:90
rheolef::continuation_option::max_delta_parameter
Float max_delta_parameter
Definition:
continuation_option.h:84
epsilon
Float epsilon
Definition:
transmission_error.cc:25
rheolef::std
Definition:
vec_expr_v2.h:391
rheolef::continuation_option::do_check_going_back
bool do_check_going_back
Definition:
continuation_option.h:92