BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
en_Opt_Status.hpp
Go to the documentation of this file.
1
/*
2
* BELFEM -- The Berkeley Lab Finite Element Framework
3
* Copyright (c) 2026, The Regents of the University of California,
4
* through Lawrence Berkeley National Laboratory (subject to receipt of any required
5
* approvals from the U.S. Dept. of Energy). All rights reserved.
6
*
7
* Developers: Christian Messe, Gregory Giard
8
*
9
* See the top-level LICENSE file for the complete license and disclaimer.
10
*/
11
12
#ifndef BELFEM_EN_OPT_STATUS_HPP
13
#define BELFEM_EN_OPT_STATUS_HPP
14
15
#include "
typedefs.hpp
"
16
17
namespace
belfem
18
{
19
namespace
opt
20
{
26
enum class
Status
27
{
28
// --- success: the optimizer converged on a stopping criterion ---
29
SUCCESS
= 0,
// generic success
30
STOPVAL_REACHED
= 1,
// objective dropped below the stop value
31
FTOL_REACHED
= 2,
// relative change of objective below ftol
32
XTOL_REACHED
= 3,
// relative change of design vector below xtol
33
MAXEVAL_REACHED
= 4,
// reached the maximum number of evaluations
34
MAXTIME_REACHED
= 5,
// reached the maximum wall-clock time
35
36
// --- failure: no usable result was produced -------------------
37
FAILURE
= 6,
// generic failure
38
INVALID_ARGS
= 7,
// bounds/tolerances inconsistent
39
OUT_OF_MEMORY
= 8,
// allocation failed
40
ROUNDOFF_LIMITED
= 9,
// halted by roundoff, result may be inaccurate
41
FORCED_STOP
= 10
// objective requested an early stop
42
};
43
44
//------------------------------------------------------------------------------
45
49
inline
bool
50
is_success
(
const
Status
aStatus )
51
{
52
return
aStatus <=
Status::MAXTIME_REACHED
;
53
}
54
55
//------------------------------------------------------------------------------
56
67
inline
bool
68
is_usable
(
const
Status
aStatus )
69
{
70
return
is_success
( aStatus )
71
|| aStatus ==
Status::ROUNDOFF_LIMITED
72
|| aStatus ==
Status::FORCED_STOP
;
73
}
74
75
//------------------------------------------------------------------------------
76
82
string
83
error_message
(
const
Status
aStatus );
84
85
//------------------------------------------------------------------------------
86
}
87
}
88
#endif
//BELFEM_EN_OPT_STATUS_HPP
belfem::opt
Definition
cl_Objective.hpp:21
belfem::opt::is_usable
bool is_usable(const Status aStatus)
true if the returned design point is usable, even when the solver did not terminate on a clean conver...
Definition
en_Opt_Status.hpp:68
belfem::opt::error_message
string error_message(const Status aStatus)
human-readable explanation of an optimizer status, suitable for a BELFEM_ERROR message when is_usable...
Definition
cl_Optimizer.cpp:62
belfem::opt::is_success
bool is_success(const Status aStatus)
true if the status corresponds to a converged / usable result
Definition
en_Opt_Status.hpp:50
belfem::opt::Status
Status
outcome of an optimization run.
Definition
en_Opt_Status.hpp:27
belfem::opt::Status::FAILURE
@ FAILURE
Definition
en_Opt_Status.hpp:37
belfem::opt::Status::MAXEVAL_REACHED
@ MAXEVAL_REACHED
Definition
en_Opt_Status.hpp:33
belfem::opt::Status::XTOL_REACHED
@ XTOL_REACHED
Definition
en_Opt_Status.hpp:32
belfem::opt::Status::STOPVAL_REACHED
@ STOPVAL_REACHED
Definition
en_Opt_Status.hpp:30
belfem::opt::Status::INVALID_ARGS
@ INVALID_ARGS
Definition
en_Opt_Status.hpp:38
belfem::opt::Status::FORCED_STOP
@ FORCED_STOP
Definition
en_Opt_Status.hpp:41
belfem::opt::Status::FTOL_REACHED
@ FTOL_REACHED
Definition
en_Opt_Status.hpp:31
belfem::opt::Status::OUT_OF_MEMORY
@ OUT_OF_MEMORY
Definition
en_Opt_Status.hpp:39
belfem::opt::Status::SUCCESS
@ SUCCESS
Definition
en_Opt_Status.hpp:29
belfem::opt::Status::ROUNDOFF_LIMITED
@ ROUNDOFF_LIMITED
Definition
en_Opt_Status.hpp:40
belfem::opt::Status::MAXTIME_REACHED
@ MAXTIME_REACHED
Definition
en_Opt_Status.hpp:34
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
typedefs.hpp
src
numerics
opt
en_Opt_Status.hpp
Generated by
1.18.0