- ad_props_inThe names of the AD functors to convert to regular functors
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:The names of the AD functors to convert to regular functors
- ad_props_outThe names of the output AD functors
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:The names of the output AD functors
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- declare_suffixAn optional suffix parameter that can be appended to any declared 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 declared properties. The suffix will be prepended with a '_' character.
- execute_onALWAYSThe 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:ALWAYS
C++ Type:ExecFlagEnum
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.
- reg_props_inThe names of the regular functors to convert to AD functors
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:The names of the regular functors to convert to AD functors
- reg_props_outThe names of the output regular functors
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:The names of the output regular functors
FunctorADConverter
Converts regular functors to AD functors and AD functors to regular functors
Converting from AD to regular functors or vice versa can both lead to irremediable loss of derivative information when using the automatic differentiation system. Missing derivative information (from using a converted regular functor where a true AD functor should have been used) can lead to an imperfect Jacobian which can impact convergence properties of Newton solves.
Some examples of safe conversions:
Functions to ADFunctions and vice-versa are safe since functions do not hold derivative data
AuxVariables to regular functors is safe since auxiliary variables do not hold derivative data
Example input syntax
An example of some gymnastics with functor conversions is shown in this example. The reader should note that only the conversion to an AD functor from a regular functor (from a regular Function) was necessary.
[Materials]
[converter_to_regular]
type = FunctorADConverter
ad_props_in = 'sink'
reg_props_out = 'regular_sink_0'
[]
# Just to change the name
[functor]
type = GenericFunctorMaterial
prop_names = 'regular_sink_1'
prop_values = 'regular_sink_0'
[]
[converter_to_ad]
type = FunctorADConverter
reg_props_in = 'regular_sink_1'
ad_props_out = 'ad_sink'
[]
[]
(moose/test/tests/materials/functor_properties/ad_conversion/1d_dirichlet.i)Input 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.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
Advanced Parameters
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Controllable:No
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
- outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object
Default:none
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