OptimizationData

Reporter to hold measurement and simulation data for optimization problems

Overview

OptimizationData is a reporter typically used for storing measurement data in a inverse optimization simulation. This reporter creates the following vectors:

  • measurement_xcoord

  • measurement_ycoord

  • measurement_zcoord

  • measurement_time

  • measurement_values

  • simulation_values

  • misfit_values

The measurement_ vectors can be filled in using "measurement_values", "measurement_points", and "measurement_times" or with a CSV file using "measurement_file", "file_xcoord", "file_ycoord", "file_zcoord", "file_value", and "file_time". The simulation_values and misfit_values are calculated in this object if "variable" is specified and the measurement location and values are filled. See OptimizationData for more information on these input parameters and what the vectors mean.

For cases where more than one variable is being sampled, the contribution of each sampled variable to the measurement value are specified by weights in csv file input using "file_variable_weights". These weights are then multiplied by each variable in the forward problem by specifying "variable_weight_names". There must be one "variable_weight_names" per "variable" being sampled and their ordering must be the same. A typical use case for this would be to specify "file_variable_weights" in the main optimization application input file to be read in along with the other parameters normally read from file. Next, these reporter weights would be transferred to the forward and adjoint problem subapps. In the forward subapp, "file_variable_weights" and "variable" would both be specified in the OptimizationData block and would weight the different variable contributions to the simulation_values and misfit_values. In the adjoint subapp, the weights are transferred into a reporter that is used to scale the misfit applied by the ReporterPointSource using "weight_name".

If the "objective_name" is set by the user OptimizationData will create and store the L2 Norm of the misfit values divided by two. This can be useful for running an inverse optimization problem with the GeneralOptimization reporter.

Example Input File Syntax

OptimizationData is typically used in the forward and homogeneous optimization sub-applications to sample the solution for simulation_values, calculating misfit_values, and storing the objective value provided by objective_name. The measurement data can either be specified directly on each subapp or transferred from the optimization main application which would also require the simulation and misfit values to be transferred back to the main application. OptimizationData is also used in the adjoint/gradient sub-application to hold the misfit values to apply the ReporterPointSource Dirac kernel. The following code blocks demonstrate this utilization of OptimizationData. The OptimizationData in the main application reads the measurement locations and values. A MultiAppReporterTransfer transfers the measurement data to the forward, adjoint/gradient, and homogeneous application within the OptimizationData reporter declared in those inputs. The forward and homogeneous applications then sample the specified vector specified in "variable". The main application then receives the simulation data using a MultiAppReporterTransfer, which OptimizationReporter uses to calculate the misfit and transfer to the adjoint/gradient sub-application, which uses that data to apply the ReporterPointSource kernel.

[OptimizationReporter<<<{"href": "../../syntax/OptimizationReporter/index.html"}>>>]
  type = GeneralOptimization
  objective_name = objective_value
  parameter_names = 'parameter_results'
  num_values = '3'
[]

[Transfers<<<{"href": "../../syntax/Transfers/index.html"}>>>]
  # FORWARD transfers
  [toForward_measument]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    to_multi_app<<<{"description": "The name of the MultiApp to transfer the data to"}>>> = forward
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/measurement_values
                      OptimizationReporter/parameter_results'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'measure_data/measurement_xcoord
                    measure_data/measurement_ycoord
                    measure_data/measurement_zcoord
                    measure_data/measurement_time
                    measure_data/measurement_values
                    point_source/value'
  []
  [fromForward]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    from_multi_app<<<{"description": "The name of the MultiApp to receive data from"}>>> = forward
    # Note: We are transferring the misfit values into main misfit
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'measure_data/objective_value measure_data/misfit_values'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'OptimizationReporter/objective_value main/misfit_values'
  []

  # ADJOINT transfers
  #NOTE:  the adjoint variable we are transferring is actually the gradient
  [toAdjoint]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    to_multi_app<<<{"description": "The name of the MultiApp to transfer the data to"}>>> = adjoint
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/misfit_values'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'misfit/measurement_xcoord
                    misfit/measurement_ycoord
                    misfit/measurement_zcoord
                    misfit/measurement_time
                    misfit/misfit_values'
  []
  [fromAdjoint]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    from_multi_app<<<{"description": "The name of the MultiApp to receive data from"}>>> = adjoint
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'gradient/adjoint'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'OptimizationReporter/grad_parameter_results'
  []

  # HESSIAN transfers.  Same as forward.
  [toHomoForward]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    multi_app<<<{"description": "The name of the MultiApp to transfer data with"}>>> = homogeneousForward
    direction<<<{"description": "Whether this Transfer will be 'to' or 'from' a MultiApp, or bidirectional, by providing both FROM_MULTIAPP and TO_MULTIAPP."}>>> = to_multiapp
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/measurement_values
                      OptimizationReporter/parameter_results'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'measure_data/measurement_xcoord
                    measure_data/measurement_ycoord
                    measure_data/measurement_zcoord
                    measure_data/measurement_time
                    measure_data/measurement_values
                    point_source/value'
  []
  [fromHomoForward]
    type = MultiAppReporterTransfer<<<{"description": "Transfers reporter data between two applications.", "href": "../transfers/MultiAppReporterTransfer.html"}>>>
    multi_app<<<{"description": "The name of the MultiApp to transfer data with"}>>> = homogeneousForward
    direction<<<{"description": "Whether this Transfer will be 'to' or 'from' a MultiApp, or bidirectional, by providing both FROM_MULTIAPP and TO_MULTIAPP."}>>> = from_multiapp
    # Note: We are transferring the simulation values into misfit
    # this has to be done when using general opt and homogenous forward.
    from_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value from."}>>> = 'measure_data/simulation_values'
    to_reporters<<<{"description": "List of the reporter names (object_name/value_name) to transfer the value to."}>>> = 'main/misfit_values'
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/main.i)
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
  [measure_data]
    type = OptimizationData<<<{"description": "Reporter to hold measurement and simulation data for optimization problems", "href": "OptimizationData.html"}>>>
    objective_name<<<{"description": "Name of reporter value defining the objective."}>>> = objective_value
    variable<<<{"description": "Vector of variable names to sample at measurement points."}>>> = temperature
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/forward.i)
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
  [measure_data]
    type = OptimizationData<<<{"description": "Reporter to hold measurement and simulation data for optimization problems", "href": "OptimizationData.html"}>>>
    variable<<<{"description": "Vector of variable names to sample at measurement points."}>>> = temperature
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/forward_homogeneous.i)
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
  [misfit]
    type = OptimizationData<<<{"description": "Reporter to hold measurement and simulation data for optimization problems", "href": "OptimizationData.html"}>>>
  []
[]

[DiracKernels<<<{"href": "../../syntax/DiracKernels/index.html"}>>>]
  [pt]
    type = ReporterPointSource<<<{"description": "Apply a point load defined by Reporter.", "href": "../dirackernels/ReporterPointSource.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = adjoint
    x_coord_name<<<{"description": "reporter x-coordinate name.  This uses the reporter syntax <reporter>/<name>."}>>> = misfit/measurement_xcoord
    y_coord_name<<<{"description": "reporter y-coordinate name.  This uses the reporter syntax <reporter>/<name>."}>>> = misfit/measurement_ycoord
    z_coord_name<<<{"description": "reporter z-coordinate name.  This uses the reporter syntax <reporter>/<name>."}>>> = misfit/measurement_zcoord
    value_name<<<{"description": "reporter value name.  This uses the reporter syntax <reporter>/<name>."}>>> = misfit/misfit_values
    extra_vector_tags<<<{"description": "The extra tags for the vectors this Kernel should fill"}>>> = 'ref'
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/adjoint.i)

Input Parameters

  • objective_nameName of reporter value defining the objective.

    C++ Type:ReporterValueName

    Controllable:No

    Description:Name of reporter value defining the objective.

  • variableVector of variable names to sample at measurement points.

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

    Unit:(no unit assumed)

    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).

  • execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • 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

Execution Scheduling Parameters

  • 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.

  • 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>

    Unit:(no unit assumed)

    Controllable:No

    Description:Times corresponding to each measurement value

  • measurement_valuesMeasurement values collected from locations given by measurement_points

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

    Unit:(no unit assumed)

    Controllable:No

    Description:Measurement values collected from locations given by measurement_points

Input Measurement Data Parameters

  • 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

    Unit:(no unit assumed)

    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.

  • 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.

Material Property Retrieval Parameters

Input Files