- ad_prop_nameThe name of the material property to take the derivative of.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:The name of the material property to take the derivative of.
- coupled_varThe variable with respect to which the derivative is taken.
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The variable with respect to which the derivative is taken.
- variableThe name of the variable that this object applies to
C++ Type:AuxVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this object applies to
ADCoupledVarMaterialDerivativeAux
Description
The AuxKernel
calculates the derivative of a material property with respect to a coupled variable using automatic differentiation. This kernel is particularly useful when you need to compute the sensitivity of a material property with respect to a given variable, which can be crucial for optimization, sensitivity analysis, or other numerical studies.
Example Input File Syntax
[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
[generated]
type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "../meshgenerators/GeneratedMeshGenerator.html"}>>>
dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
nx<<<{"description": "Number of elements in the X direction"}>>> = 5
ny<<<{"description": "Number of elements in the Y direction"}>>> = 5
[]
[]
[Variables<<<{"href": "../../syntax/Variables/index.html"}>>>]
[u]
[]
[v]
[]
[]
[AuxVariables<<<{"href": "../../syntax/AuxVariables/index.html"}>>>]
[dmat_du]
family<<<{"description": "Specifies the family of FE shape functions to use for this variable"}>>> = MONOMIAL
order<<<{"description": "Specifies the order of the FE shape function to use for this variable (additional orders not listed are allowed)"}>>> = CONSTANT
[]
[dmat_dv]
family<<<{"description": "Specifies the family of FE shape functions to use for this variable"}>>> = MONOMIAL
order<<<{"description": "Specifies the order of the FE shape function to use for this variable (additional orders not listed are allowed)"}>>> = CONSTANT
[]
[]
[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
[diff]
type = Diffusion<<<{"description": "The Laplacian operator ($-\\nabla \\cdot \\nabla u$), with the weak form of $(\\nabla \\phi_i, \\nabla u_h)$.", "href": "../kernels/Diffusion.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
[]
[diff_v]
type = Diffusion<<<{"description": "The Laplacian operator ($-\\nabla \\cdot \\nabla u$), with the weak form of $(\\nabla \\phi_i, \\nabla u_h)$.", "href": "../kernels/Diffusion.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = v
[]
[]
[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
[left]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
value<<<{"description": "Value of the BC"}>>> = 1e-8
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = left
[]
[right]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
value<<<{"description": "Value of the BC"}>>> = 1
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = right
[]
[left_v]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
value<<<{"description": "Value of the BC"}>>> = 1
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = left
[]
[right_v]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
value<<<{"description": "Value of the BC"}>>> = 2
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = right
[]
[]
[AuxKernels<<<{"href": "../../syntax/AuxKernels/index.html"}>>>]
[deriv_aux_u]
type = ADCoupledVarMaterialDerivativeAux<<<{"description": "An auxkernel that calculates the derivative of a material property with respect to a coupled variable.", "href": "ADCoupledVarMaterialDerivativeAux.html"}>>>
variable<<<{"description": "The name of the variable that this object applies to"}>>> = dmat_du
ad_prop_name<<<{"description": "The name of the material property to take the derivative of."}>>> = parsed_mat
coupled_var<<<{"description": "The variable with respect to which the derivative is taken."}>>> = u
[]
[deriv_aux_v]
type = ADCoupledVarMaterialDerivativeAux<<<{"description": "An auxkernel that calculates the derivative of a material property with respect to a coupled variable.", "href": "ADCoupledVarMaterialDerivativeAux.html"}>>>
variable<<<{"description": "The name of the variable that this object applies to"}>>> = dmat_dv
ad_prop_name<<<{"description": "The name of the material property to take the derivative of."}>>> = parsed_mat
coupled_var<<<{"description": "The variable with respect to which the derivative is taken."}>>> = v
[]
[]
[Materials<<<{"href": "../../syntax/Materials/index.html"}>>>]
[parsed_mat]
type = ADParsedMaterial<<<{"description": "Parsed expression Material.", "href": "../materials/ParsedMaterial.html"}>>>
coupled_variables<<<{"description": "Vector of variables used in the parsed function"}>>> = 'u v'
property_name<<<{"description": "Name of the parsed material property"}>>> = parsed_mat
expression<<<{"description": "Parsed function (see FParser) expression for the parsed material"}>>> = '(u+v) + u*v + atan2(v,u)'
[]
[parsed_mat_deriv_exact_u]
type = ADParsedMaterial<<<{"description": "Parsed expression Material.", "href": "../materials/ParsedMaterial.html"}>>>
coupled_variables<<<{"description": "Vector of variables used in the parsed function"}>>> = 'u v'
property_name<<<{"description": "Name of the parsed material property"}>>> = parsed_mat_deriv_exact_u
expression<<<{"description": "Parsed function (see FParser) expression for the parsed material"}>>> = '1 + v - v / (u^2 + v^2)'
output_properties<<<{"description": "List of material properties, from this material, to output (outputs must also be defined to an output type)"}>>> = parsed_mat_deriv_exact_u
outputs<<<{"description": "Vector of output names where you would like to restrict the output of variables(s) associated with this object"}>>> = exodus
[]
[parsed_mat_deriv_exact_v]
type = ADParsedMaterial<<<{"description": "Parsed expression Material.", "href": "../materials/ParsedMaterial.html"}>>>
coupled_variables<<<{"description": "Vector of variables used in the parsed function"}>>> = 'u v'
property_name<<<{"description": "Name of the parsed material property"}>>> = parsed_mat_deriv_exact_v
expression<<<{"description": "Parsed function (see FParser) expression for the parsed material"}>>> = '1 + u + u / (u^2 + v^2)'
output_properties<<<{"description": "List of material properties, from this material, to output (outputs must also be defined to an output type)"}>>> = parsed_mat_deriv_exact_v
outputs<<<{"description": "Vector of output names where you would like to restrict the output of variables(s) associated with this object"}>>> = exodus
[]
[]
[Executioner<<<{"href": "../../syntax/Executioner/index.html"}>>>]
type = Steady
[]
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
[difference_u]
type = ElementL2Difference<<<{"description": "Computes the element-wise L2 difference between the current variable and a coupled variable.", "href": "../postprocessors/ElementL2Difference.html"}>>>
variable<<<{"description": "The name of the variable that this object operates on"}>>> = dmat_du
other_variable<<<{"description": "The variable to compare to"}>>> = parsed_mat_deriv_exact_u
execute_on<<<{"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."}>>> = TIMESTEP_END
[]
[difference_v]
type = ElementL2Difference<<<{"description": "Computes the element-wise L2 difference between the current variable and a coupled variable.", "href": "../postprocessors/ElementL2Difference.html"}>>>
variable<<<{"description": "The name of the variable that this object operates on"}>>> = dmat_dv
other_variable<<<{"description": "The variable to compare to"}>>> = parsed_mat_deriv_exact_v
execute_on<<<{"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."}>>> = TIMESTEP_END
[]
[]
[Outputs<<<{"href": "../../syntax/Outputs/index.html"}>>>]
exodus<<<{"description": "Output the results using the default settings for Exodus output."}>>> = true
execute_on<<<{"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."}>>> = 'TIMESTEP_END'
[]
(test/tests/auxkernels/coupledmatderivative/adcoupled_mat.i)Input Parameters
- 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
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
Default:True
C++ Type:bool
Controllable:No
Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
- execute_onLINEAR TIMESTEP_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:LINEAR TIMESTEP_END
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.
Optional 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.
- 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
- 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
- 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.