OptimizationReporter

Computes objective function, gradient and contains reporters for communicating between optimizeSolve and subapps

Overview

This optimization reporter provides a basic interface for inverse optimization with measurement data where all data is provided in the input file or from csv file. The objective function is defined as:

where represents the simulation solution with being the solution value at measurement location . is the measurement value at location . is the vector of parameters being optimized that the simulation solution depends on. provides regularization of the objective function. We currently only support the Tikhonov regularization given by

where is the Tikhonov coefficient specified in the input file by "tikhonov_coeff".

Measurement Data

The measurement locations and values are defined either by a CSV file or are specified at input.

The CSV file is specified with the "measurement_file". This file must be at least four columns: x-coordinates indicated by "file_xcoord", y-coordinates indicated by "file_ycoord", z-coordinates indicated by "file_zcoord", and values indicated by "file_value". A column for time coordinates can also be included and indicated by "file_time".

Additionally, locations and values can be specified at input using "measurement_points" for x-y-z coordinates, "measurement_times" for time coordinates, and "measurement_values" for the values.

Optimization Parameters

OptimizationReporter is also responsible for creating parameter vector(s) for optimization, setting the initial condition for the optimization, and setting parameter bounds. Although the Optimize executioner holds a single vector for parameter values, this vector can be split into groups of parameters. This is done by specifying a name for each group with "parameter_names" and the number of parameters in each group with "num_values". The total number of parameters is ultimately defined by the sum of "num_values". The initial condition for the optimization can then be defined with "initial_condition", where a vector of data must defined for each group. This vector an be a single value in which case all parameters in that group are set to that value or a value can be set for every parameter in that group. The lower and upper bounds for the parameters can then specified by "lower_bounds" and "upper_bounds", respectively. The bounds follow the same input format rules as the initial_condtion. If no initial conditions are provided, the parameters are initialized with 0. Default values for upper_bounds and lower_bounds are std::numeric<Real>::max() and std::numeric<Real>::lower(), respectively. These bounds are only applied if a bounded optimization algorithm is used.

Declared Data

OptimizationReporter declares a number of vector reporter values that can be read by other objects and/or transferred to sub-applications with MultiAppReporterTransfer. Table 1 lists each of these vectors. These vectors can be supplied or transferred by specifying OptimizationReporter/<Vector Name> at input.

Table 1: List of vectors declared by OptimizationReporter. is the number of measurement points.

DescriptionVector NameSize
-coordinatemeasurement_xcoord
-coordinatemeasurement_ycoord
-coordinatemeasurement_zcoord
Time coordinatemeasurement_time
Measured valuesmeasurement_values
Simulation valuessimulation_values
misfit_values
Values of parameter group "parameter_names""num_values"
Parameter Gradient of parameter group grad_"parameter_names""num_values"

Example Input Syntax

The following example creates three groups of parameters named p1, p2, and p3 with two, four, and six parameters, respectively. There are several ways to define the initial conditions and upper and lower bounds. Starting with the initial_condition, all parameters are specified for the p1 parameter group, only one parameter is defined for the p2 group making all parameter values in this group set to this value, and all parameters are defined for the p3 group. A similar mix of defining one or all of the lower and upper bounds are demonstrated in this input file.

It sets an initial condition and upper and lower bounds for every parameter. The measurement data is taken from a CSV file where the x-coordinate, y-coordinate, z-coordinate, and measurement value columns are specified with the header names of the file.

[OptimizationReporter]
  type = OptimizationReporter
  parameter_names = 'p1 p2 p3'
  num_values = '2 4 6'
  initial_condition = '1 2; 3; 7 8 9 10 11 12'
  upper_bounds = '101; 103; 107 108 109 110 111 112'
  lower_bounds = '-1 -2; -3 -4 -5 -6; -7'
  measurement_file = 'measurementData.csv'
  file_xcoord = 'coordx'
  file_ycoord = 'y'
  file_zcoord = 'z'
  file_value = 'measured_value'
  outputs = out
[]
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_mixBounds.i)
measured_value,coordx,y,z
11,0.1,0.2,0.3
12,0.4,0.5,0.6
13,0.7,0.8,0.9
14,1.0,1.1,1.2
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/measurementData.csv)

The measurement data can also be given directly, like in the following example.

[OptimizationReporter]
  type = OptimizationReporter
  parameter_names = 'parameter_results'
  num_values = '3'
  measurement_points = '0.5 0.28 0
                        0.5 0.6 0
                        0.5 0.8 0
                        0.5 1.1 0'
  measurement_values = '293 304 315 320'
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/main.i)

Input Parameters

  • num_valuesNumber of parameter values associated with each parameter group in 'parameter_names'.

    C++ Type:std::vector<unsigned long>

    Controllable:No

    Description:Number of parameter values associated with each parameter group in 'parameter_names'.

  • parameter_namesList of parameter names, one for each group of parameters.

    C++ Type:std::vector<ReporterValueName>

    Controllable:No

    Description:List of parameter names, one for each group of parameters.

Required Parameters

  • equality_namesList of equality names.

    C++ Type:std::vector<ReporterValueName>

    Controllable:No

    Description:List of equality names.

  • execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

  • inequality_namesList of inequality names.

    C++ Type:std::vector<ReporterValueName>

    Controllable:No

    Description:List of inequality names.

  • initial_conditionInitial conditions for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value. The default value is 0.

    C++ Type:std::vector<std::vector<double>>

    Controllable:No

    Description:Initial conditions for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value. The default value is 0.

  • lower_boundsLower bound for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value

    C++ Type:std::vector<std::vector<double>>

    Controllable:No

    Description:Lower bound for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • tikhonov_coeff0Coefficient for Tikhonov Regularization.

    Default:0

    C++ Type:double

    Controllable:No

    Description:Coefficient for Tikhonov Regularization.

  • upper_boundsUpper bound for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value

    C++ Type:std::vector<std::vector<double>>

    Controllable:No

    Description:Upper bound for each parameter. A vector is given for each parameter group. A single value can be given for each group and all parameters in that group will be set to that value

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

  • variableVector of variable names to sample at measurement points.

    C++ Type:std::vector<VariableName>

    Controllable:No

    Description:Vector of variable names to sample at measurement points.

  • variable_weight_namesVector of weight reporter names that will create a reporter to transfer weights into. The ordering of these weight reporter names corresponds to the ordering used in variable.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Vector of weight reporter names that will create a reporter to transfer weights into. The ordering of these weight reporter names corresponds to the ordering used in variable.

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

    C++ Type:std::vector<OutputName>

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • file_timetimetime column name from csv file being read in.

    Default:time

    C++ Type:std::string

    Controllable:No

    Description:time column name from csv file being read in.

  • file_valuevaluemeasurement value column name from csv file being read in.

    Default:value

    C++ Type:std::string

    Controllable:No

    Description:measurement value column name from csv file being read in.

  • file_variable_weightsvariable weight column names from csv file being read in.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:variable weight column names from csv file being read in.

  • file_xcoordxx coordinate column name from measurement_file csv being read in.

    Default:x

    C++ Type:std::string

    Controllable:No

    Description:x coordinate column name from measurement_file csv being read in.

  • file_ycoordyy coordinate column name from csv file being read in.

    Default:y

    C++ Type:std::string

    Controllable:No

    Description:y coordinate column name from csv file being read in.

  • file_zcoordzz coordinate column name from csv file being read in.

    Default:z

    C++ Type:std::string

    Controllable:No

    Description:z coordinate column name from csv file being read in.

  • measurement_fileCSV file with measurement value and coordinates (value, x, y, z).

    C++ Type:FileName

    Controllable:No

    Description:CSV file with measurement value and coordinates (value, x, y, z).

File Measurement Data Parameters

  • measurement_pointsPoint locations corresponding to each measurement value

    C++ Type:std::vector<libMesh::Point>

    Controllable:No

    Description:Point locations corresponding to each measurement value

  • measurement_timesTimes corresponding to each measurement value

    C++ Type:std::vector<double>

    Controllable:No

    Description:Times corresponding to each measurement value

  • measurement_valuesMeasurement values collected from locations given by measurement_points

    C++ Type:std::vector<double>

    Controllable:No

    Description:Measurement values collected from locations given by measurement_points

Input Measurement Data Parameters

Input Files

Child Objects