- exodus_meshFile containing parameter mesh.
C++ Type:FileName
Unit:(no unit assumed)
Controllable:No
Description:File containing parameter mesh.
- parameter_nameReporter or VectorPostprocessor vector containing parameter values.
C++ Type:ReporterName
Unit:(no unit assumed)
Controllable:No
Description:Reporter or VectorPostprocessor vector containing parameter values.
ParameterMeshFunction
Optimization function with parameters represented by a mesh and finite-element shape functions.
Overview
This function is similar to NearestReporterCoordinatesFunction, except it uses an inputted exodus mesh ("exodus_mesh") to represent the parameter field and uses finite-element shape functions (defined with "family" and "order") to perform spatial interpolation. This function also interpolates in time using "time_name", which can be a vector-postprocessor or a vector reporter. The parameter data is specified using "parameter_name", which can be a vector-postprocessor or a vector reporter. Table 1 shows common interpolation types for the parameters.
Table 1: Common interpolation type with associated finite-element function
Interpolation Type | Family | Order |
---|---|---|
Piecewise constant | MONOMIAL | CONSTANT |
Linear | LAGRANGE | FIRST |
Quadratic | LAGRANGE | SECOND |
The mesh created must be replicated. Ensure this by having Mesh/parallel_type=REPLICATED
when creating the mesh.
Example Input File Syntax
First step is to define a mesh for the parameters, which is most easily done by creating a separate input file. The following creates a two-by-two mesh and sets an auxiliary variable to , which is then outputted using NodalValueSampler.
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
parallel_type = REPLICATED
[]
[AuxVariables/params]
[]
[ICs/params_ic]
type = FunctionIC
function = params_fun
variable = params
[]
[Functions]
[params_fun]
type = ParsedFunction
value = 'x*(x-1)*y*(y-1)'
[]
[]
[VectorPostprocessors]
[param_vec]
type = NodalValueSampler
sort_by = id
variable = params
[]
[]
[Outputs]
csv = true
exodus = true
execute_on = timestep_end
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/optimization/test/tests/functions/parameter_mesh/create_mesh.i)Running this input will create a create_mesh_out.e
exodus file and create_mesh_out_param_vec_0001.csv
CSV file. The CSV file is read by a CSVReaderVectorPostprocessor to create a vector-postprocessor of the parameter data. A ParameterMeshFunction then reads in the exodus file and retrieves the vector for the interpolation.
[VectorPostprocessors]
[param_vec]
type = CSVReader
csv_file = create_mesh_out_param_vec_0001.csv
[]
[]
[Functions]
[parameter_mesh]
type = ParameterMeshFunction
exodus_mesh = create_mesh_out.e
parameter_name = param_vec/params
[]
[]
(modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh.i)Input Parameters
- familyLAGRANGEFamily of FE shape functions for parameter.
Default:LAGRANGE
C++ Type:MooseEnum
Unit:(no unit assumed)
Controllable:No
Description:Family of FE shape functions for parameter.
- orderFIRSTOrder of FE shape functions for parameter.
Default:FIRST
C++ Type:MooseEnum
Unit:(no unit assumed)
Controllable:No
Description:Order of FE shape functions for parameter.
- time_nameName of vector-postprocessor or reporter vector containing time, default assumes time independence.
C++ Type:ReporterName
Unit:(no unit assumed)
Controllable:No
Description:Name of vector-postprocessor or reporter vector containing time, default assumes time independence.
Optional Parameters
- 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:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh_dg.i)
- (modules/optimization/examples/simpleTransient/adjoint_mesh.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/adjoint.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/forward_and_adjoint.i)
- (modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh.i)
- (modules/optimization/examples/diffusion_reaction/forward_and_adjoint.i)
- (modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh_transient.i)
- (modules/optimization/test/tests/functions/parameter_mesh/parameter_mesh_second.i)
- (modules/optimization/test/tests/optimizationreporter/mesh_source/forward.i)
- (modules/optimization/examples/simpleTransient/forward_mesh.i)