NearestPointTrainer

Loops over and saves sample values for NearestPointSurrogate.

Overview

This trainer is meant to produce training data to be used with NearestPointSurrogate. The data saved (_sample_points) is an array of the sample points and the results from the full model:

where is the point from the sampler at column and sample , is the result of the full model at sample , is the number of training samples, and is the number of sampler columns. NearestPointSurrogate then uses this array to find the closest point to the given input point and outputs the full model result.

Example Input File Syntax

A sampler is created to produce points for the training data:

[Samplers]
  [sample]
    type = CartesianProduct
    linear_space_items = '0 1 10
                          0 1 10
                          0 1 10'
  []
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)

The example full model is the GFunction vector postprocessor, see SobolStatistics for more details. This vector postprocessor takes in the sampler and evaluates the function at the training points.

[VectorPostprocessors]
  [values]
    type = GFunction
    sampler = sample
    q_vector = '0 0 0'
    execute_on = INITIAL
    outputs = none
  []
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)

The trainer then takes in the data from the sampler and the results from the vector postprocessor to create the _sample_points array:

[Trainers]
  [train]
    type = NearestPointTrainer
    sampler = sample
    response = values/g_values
  []
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)

We then output the training data to file:

[Outputs]
  [out]
    type = SurrogateTrainerOutput
    trainers = 'train'
    execute_on = FINAL
  []
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/train.i)

Input Parameters

  • responseReporter value of response results, can be vpp with / or sampler column with 'sampler/col_'.

    C++ Type:ReporterName

    Options:

    Description:Reporter value of response results, can be vpp with / or sampler column with 'sampler/col_'.

  • samplerSampler used to create predictor and response data.

    C++ Type:SamplerName

    Options:

    Description:Sampler used to create predictor and response data.

Required Parameters

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

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM

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

  • predictor_colsSampler columns used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.

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

    Options:

    Description:Sampler columns used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.

  • predictorsReporter values used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.

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

    Options:

    Description:Reporter values used as the independent random variables, If 'predictors' and 'predictor_cols' are both empty, all sampler columns are used.

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

    Options:

    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>

    Options:

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

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Options:

    Description:Set the enabled status of the MooseObject.

  • force_preauxFalseForces the GeneralUserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Options:

    Description:Forces the GeneralUserObject to be executed in PREAUX

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

    Default:False

    C++ Type:bool

    Options:

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

  • 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

    Options:

    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

Input Files