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]
  type = GeneralOptimization
  objective_name = objective_value
  parameter_names = 'parameter_results'
  num_values = '3'
[]

[Transfers]
  # FORWARD transfers
  [toForward_measument]
    type = MultiAppReporterTransfer
    to_multi_app = forward
    from_reporters = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/measurement_values
                      OptimizationReporter/parameter_results'
    to_reporters = '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
    from_multi_app = forward
    # Note: We are transferring the misfit values into main misfit
    from_reporters = 'measure_data/objective_value measure_data/misfit_values'
    to_reporters = 'OptimizationReporter/objective_value main/misfit_values'
  []

  # ADJOINT transfers
  #NOTE:  the adjoint variable we are transferring is actually the gradient
  [toAdjoint]
    type = MultiAppReporterTransfer
    to_multi_app = adjoint
    from_reporters = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/misfit_values'
    to_reporters = 'misfit/measurement_xcoord
                    misfit/measurement_ycoord
                    misfit/measurement_zcoord
                    misfit/measurement_time
                    misfit/misfit_values'
  []
  [fromAdjoint]
    type = MultiAppReporterTransfer
    from_multi_app = adjoint
    from_reporters = 'gradient/adjoint'
    to_reporters = 'OptimizationReporter/grad_parameter_results'
  []

  # HESSIAN transfers.  Same as forward.
  [toHomoForward]
    type = MultiAppReporterTransfer
    multi_app = homogeneousForward
    direction = to_multiapp
    from_reporters = 'main/measurement_xcoord
                      main/measurement_ycoord
                      main/measurement_zcoord
                      main/measurement_time
                      main/measurement_values
                      OptimizationReporter/parameter_results'
    to_reporters = '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
    multi_app = homogeneousForward
    direction = 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 = 'measure_data/simulation_values'
    to_reporters = 'main/misfit_values'
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/main.i)
[Reporters]
  [measure_data]
    type = OptimizationData
    objective_name = objective_value
    variable = temperature
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/forward.i)
[Reporters]
  [measure_data]
    type = OptimizationData
    variable = temperature
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/forward_homogeneous.i)
[Reporters]
  [misfit]
    type = OptimizationData
  []
[]

[DiracKernels]
  [pt]
    type = ReporterPointSource
    variable = adjoint
    x_coord_name = misfit/measurement_xcoord
    y_coord_name = misfit/measurement_ycoord
    z_coord_name = misfit/measurement_zcoord
    value_name = misfit/misfit_values
    extra_vector_tags = 'ref'
  []
[]
(modules/optimization/test/tests/optimizationreporter/point_loads/adjoint.i)

Input Parameters

  • 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

    Unit:(no unit assumed)

    Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, 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. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • objective_nameName of reporter value defining the objective.

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of reporter value defining the objective.

  • 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

    Unit:(no unit assumed)

    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>

    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>

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    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

Input Files