27 "output_postprocessor",
28 "Postprocessor holding the sub-app output to compare against the target.");
30 "parameter_postprocessor",
31 "Postprocessor (e.g. a Receiver) holding the parameter value; read and updated in place.");
33 "converged_parameter_postprocessor",
34 "Optional postprocessor to which the parameter value that produced the current output is "
35 "written each iteration; at convergence this holds the inverse-problem solution.");
37 "target_function",
"Function f(t) giving the target output value at each time step.");
39 "residual_postprocessor",
40 "Postprocessor (e.g. a Receiver) the control writes with the normalized convergence "
42 "point the fixed-point Convergence object at it with a tolerance of 1.");
45 "absolute_tolerance>0",
46 "Absolute tolerance on |output - target|.");
50 "relative_tolerance>0",
51 "Relative tolerance on |output - target|, taken relative to |target|.");
61 _output(getPostprocessorValue(
"output_postprocessor")),
62 _param(getPostprocessorValue(
"parameter_postprocessor")),
63 _param_name(getParam<PostprocessorName>(
"parameter_postprocessor")),
64 _converged_param_name(
65 isParamValid(
"converged_parameter_postprocessor")
66 ?
std::make_optional(getParam<PostprocessorName>(
"converged_parameter_postprocessor"))
68 _target_function(getFunction(
"target_function")),
69 _residual_name(getParam<PostprocessorName>(
"residual_postprocessor")),
70 _abs_tol(getParam<Real>(
"absolute_tolerance")),
71 _rel_tol(getParam<Real>(
"relative_tolerance"))
87 "requires an executioner configured to perform fixed-point (MultiApp) iterations; set "
88 "'fixed_point_max_its' greater than 1 (or otherwise enable fixed-point iteration) on "
105 const Real p_used =
_param;
136 const Real dp = p_b - p_a;
137 const Real dy = y_b - y_a;
142 if (!std::isfinite(dp) || !std::isfinite(dy) || std::abs(dp) < 1e-15 ||
143 std::abs(dy) < 1e-15 * (std::abs(y_b) + std::abs(y_a) + 1.0))
147 " has a vanishing or non-finite denominator or slope; leaving the parameter "
151 return p_b - (y_b - y_target) * dp / dy;
const std::vector< double > y
const ExecFlagType EXEC_TIMESTEP_BEGIN
static InputParameters validParams()
FEProblemBase & _fe_problem
bool hasSolveObject() const
FixedPointSolve & fixedPointSolve()
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
unsigned int numFixedPointIts() const
bool hasFixedPointIteration()
virtual Real value(Real t, const Point &p) const
virtual IterationUpdate computeUpdate(unsigned int it, Real p_used, Real y, Real y_target)=0
Compute this iteration's update from the current sample: the 1-based fixed-point iteration it and the...
Real normalizedResidual(Real y) const
Normalized convergence residual for output value y: |y - targetValue()| / max(absolute_tolerance,...
const Real _rel_tol
Relative tolerance on |output - target|, relative to |target|.
const Real _abs_tol
Absolute tolerance on |output - target|.
const PostprocessorName _residual_name
Name of the postprocessor the control writes with the normalized convergence residual.
void setResidual(Real value)
Write a value to the residual postprocessor that the Convergence object compares against 1.
Real linearRootUpdate(Real p_a, Real y_a, Real p_b, Real y_b, Real y_target)
One guarded linear-model root update from two (parameter, output) samples – a secant step shared by t...
unsigned int fixedPointIteration() const
1-based fixed-point iteration (1 on the first iteration of each fixed-point solve,...
const PostprocessorValue & _param
Parameter value consumed by the most recent sub-app solve (read in place)
void publishConvergedParameter(Real p)
Publish a parameter value to the optional converged-parameter postprocessor (no-op if unset)
const std::optional< PostprocessorName > _converged_param_name
Optional postprocessor to publish the parameter value that produced the current output.
void setParameter(Real p)
Write the next parameter guess to the parameter postprocessor.
const PostprocessorName _param_name
Name of the parameter postprocessor to update with the next guess.
virtual void execute() override final
Template method: reads the current (parameter, output) sample, delegates the scheme-specific decision...
const PostprocessorValue & _output
Sub-app output value transferred back to the main app (compared against the target)
Real targetValue() const
Target output value at the current time.
const Function & _target_function
Target output as a function of time.
static InputParameters validParams()
InversionControlBase(const InputParameters ¶meters)
Executioner * getExecutioner() const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
One iteration's update, produced by the derived scheme and applied by execute().
bool publish
Whether the current (already-evaluated) parameter is the solution of record to publish.
Real residual
Residual to report for the current sample (compared against 1 by the Convergence object)
Real next_parameter
Parameter guess to write for the next solve.