- 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
 
TotalFreeEnergy
The TotalFreeEnergy has not been documented. The content listed below should be used as a starting point for documenting the class, which includes the typical automatic documentation associated with a MooseObject; however, what is contained is ultimately determined by what is necessary to make the documentation clear for users.
Total free energy (both the bulk and gradient parts), where the bulk free energy has been defined in a material
Overview
Example Input File Syntax
Input Parameters
- additional_free_energyCoupled variable holding additional free energy contributions to be summed up
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Coupled variable holding additional free energy contributions to be summed up
 - 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
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM, PRE_DISPLACE
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.
 - f_nameF Base name of the free energy function
Default:F
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description: Base name of the free energy function
 - interfacial_varsVariable names that contribute to interfacial energy
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Variable names that contribute to interfacial energy
 - kappa_namesVector of kappa names corresponding to each variable name in interfacial_vars in the same order.
C++ Type:std::vector<MaterialPropertyName>
Unit:(no unit assumed)
Controllable:No
Description:Vector of kappa names corresponding to each variable name in interfacial_vars in the same order.
 
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.
 - search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
 - 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.
 
Material Property Retrieval Parameters
Input Files
- (modules/combined/examples/publications/rapid_dev/fig7b.i)
 - (modules/phase_field/examples/cahn-hilliard/Parsed_SplitCH.i)
 - (modules/phase_field/examples/multiphase/DerivativeMultiPhaseMaterial.i)
 - (modules/combined/examples/periodic_strain/global_strain_pfm.i)
 - (modules/combined/examples/phase_field-mechanics/Pattern1.i)
 - (modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialSintering_test.i)
 - (modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
 - (modules/phase_field/test/tests/actions/conserved_forward_split_1var.i)
 - (modules/combined/examples/publications/rapid_dev/fig8.i)
 - (modules/phase_field/test/tests/SplitCH/forward_split_math_test.i)
 - (modules/phase_field/examples/cahn-hilliard/Parsed_CH.i)
 - (modules/phase_field/examples/measure_interface_energy/1Dinterface_energy.i)
 - (modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
 - (modules/combined/examples/mortar/eigenstrain_action.i)
 - (modules/combined/examples/publications/rapid_dev/fig7a.i)
 - (modules/combined/examples/mortar/eigenstrain.i)
 - (modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_2var_test.i)
 - (modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
 - (modules/phase_field/test/tests/free_energy_material/CoupledValueFunctionFreeEnergy.i)
 - (modules/phase_field/test/tests/MultiPhase/crosstermfreeenergy.i)
 - (modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_test.i)
 
(modules/combined/examples/publications/rapid_dev/fig7b.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Dashed black curve (2)
# Eigenstrain is globally applied. Single global elastic free energies.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 32
  xmin = 0
  xmax = 100
  second_order = true
  coord_type = RSPHERICAL
[]
[GlobalParams]
  displacements = 'disp_r'
[]
[Functions]
  [./diff]
    type = ParsedFunction
    expression = '${RADIUS}-pos_c'
    symbol_names = pos_c
    symbol_values = pos_c
  [../]
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = SmoothCircleIC
      invalue = 1
      outvalue = 0
      x1 = 0
      y1 = 0
      radius = ${RADIUS}
      int_width = 3
    [../]
  [../]
  [./w]
  [../]
  # Phase order parameter
  [./eta]
    [./InitialCondition]
      type = SmoothCircleIC
      invalue = 1
      outvalue = 0
      x1 = 0
      y1 = 0
      radius = ${RADIUS}
      int_width = 3
    [../]
  [../]
  [./Fe_fit]
    order = SECOND
  [../]
[]
[Physics/SolidMechanics/QuasiStatic/all]
  add_variables = true
  eigenstrain_names = eigenstrain
[]
[Kernels]
  # Split Cahn-Hilliard kernels
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    coupled_variables = 'eta'
    kappa_name = kappa_c
    w = w
  [../]
  [./wres]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./time]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
  [./detadt]
    type = TimeDerivative
    variable = eta
  [../]
  [./ACBulk1]
    type = AllenCahn
    variable = eta
    coupled_variables = 'c'
    mob_name = L
    f_name = F
  [../]
  [./ACInterface]
    type = ACInterface
    variable = eta
    mob_name = L
    kappa_name = kappa_eta
  [../]
  [./Fe]
    type = MaterialPropertyValue
    prop_name = Fe
    variable = Fe_fit
  [../]
  [./autoadjust]
    type = MaskedBodyForce
    variable = w
    function = diff
    mask = mask
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   L   kappa_c kappa_eta'
    prop_values = '1.0 1.0 0.5     1'
  [../]
  # forcing function mask
  [./mask]
    type = ParsedMaterial
    property_name = mask
    expression = grad/dt
    material_property_names = 'grad dt'
  [../]
  [./grad]
    type = VariableGradientMaterial
    variable = c
    prop = grad
  [../]
  [./time]
    type = TimeStepMaterial
  [../]
  # global mechanical properties
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./stress]
    type = ComputeLinearElasticStress
  [../]
  # eigenstrain as a function of phase
  [./eigenstrain]
    type = ComputeVariableEigenstrain
    eigen_base = '0.05 0.05 0.05 0 0 0'
    prefactor = h
    args = eta
    eigenstrain_name = eigenstrain
  [../]
  # switching functions
  [./switching]
    type = SwitchingFunctionMaterial
    function_name = h
    eta = eta
    h_order = SIMPLE
  [../]
  [./barrier]
    type = BarrierFunctionMaterial
    eta = eta
  [../]
  # chemical free energies
  [./chemical_free_energy_1]
    type = DerivativeParsedMaterial
    property_name = Fc1
    expression = 'c^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_2]
    type = DerivativeParsedMaterial
    property_name = Fc2
    expression = '(1-c)^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # global chemical free energy
  [./chemical_free_energy]
    type = DerivativeTwoPhaseMaterial
    f_name = Fc
    fa_name = Fc1
    fb_name = Fc2
    eta = eta
    coupled_variables = 'c'
    W = 4
  [../]
  # global elastic free energy
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    coupled_variables = 'eta'
    output_properties = Fe
    outputs = 'all'
    derivative_order = 2
  [../]
  # free energy
  [./free_energy]
    type = DerivativeSumMaterial
    property_name = F
    sum_materials = 'Fc Fe'
    coupled_variables = 'c eta'
    derivative_order = 2
  [../]
[]
[BCs]
  [./left_r]
    type = DirichletBC
    variable = disp_r
    boundary = 'left'
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./pos_c]
    type = FindValueOnLine
    start_point = '0 0 0'
    end_point = '100 0 0'
    v = c
    target = 0.582
    tol = 1e-8
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./pos_eta]
    type = FindValueOnLine
    start_point = '0 0 0'
    end_point = '100 0 0'
    v = eta
    target = 0.5
    tol = 1e-8
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./c_min]
    type = ElementExtremeValue
    value_type = min
    variable = c
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
[]
[VectorPostprocessors]
  [./line]
    type = LineValueSampler
    variable = 'Fe_fit c w'
    start_point = '0 0 0'
    end_point =   '100 0 0'
    num_points = 5000
    sort_by = x
    outputs = vpp
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm      lu'
  l_max_its = 30
  nl_max_its = 15
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 2.0e-9
  start_time = 0.0
  end_time = 100000.0
  [./TimeStepper]
    type = IterationAdaptiveDT
    optimal_iterations = 8
    iteration_window = 1
    dt = 1
  [../]
  [./Adaptivity]
    initial_adaptivity = 5
    interval = 10
    max_h_level = 5
    refine_fraction = 0.9
    coarsen_fraction = 0.1
  [../]
[]
[Outputs]
  print_linear_residuals = false
  perf_graph = true
  execute_on = 'INITIAL TIMESTEP_END'
  [./table]
    type = CSV
    delimiter = ' '
    file_base = radius_${RADIUS}/eigenstrain_pp
  [../]
  [./vpp]
    type = CSV
    delimiter = ' '
    sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
    sync_only = true
    time_data = true
    file_base = radius_${RADIUS}/eigenstrain_vpp
  [../]
[]
(modules/phase_field/examples/cahn-hilliard/Parsed_SplitCH.i)
#
# Example problem showing how to use the DerivativeParsedMaterial with SplitCHParsed.
# The free energy is identical to that from SplitCHMath, f_bulk = 1/4*(1-c)^2*(1+c)^2.
#
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 150
  ny = 150
  xmax = 60
  ymax = 60
[]
[Modules]
  [./PhaseField]
    [./Conserved]
      [./c]
        free_energy = fbulk
        mobility = M
        kappa = kappa_c
        solve_type = REVERSE_SPLIT
      [../]
    [../]
  [../]
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[ICs]
  [./cIC]
    type = RandomIC
    variable = c
    min = -0.1
    max =  0.1
  [../]
[]
[AuxKernels]
  [./local_energy]
    type = TotalFreeEnergy
    variable = local_energy
    f_name = fbulk
    interfacial_vars = c
    kappa_names = kappa_c
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./Periodic]
    [./all]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Materials]
  [./mat]
    type = GenericConstantMaterial
    prop_names  = 'M kappa_c'
    prop_values = '1.0 0.5'
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    property_name = fbulk
    coupled_variables = c
    constant_names = W
    constant_expressions = 1.0/2^2
    expression = W*(1-c)^2*(1+c)^2
    enable_jit = true
    outputs = exodus
  [../]
[]
[Postprocessors]
  [./top]
    type = SideIntegralVariablePostprocessor
    variable = c
    boundary = top
  [../]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
[]
[Preconditioning]
  [./cw_coupling]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  scheme = bdf2
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm      lu          '
  l_max_its = 30
  l_tol = 1e-4
  nl_max_its = 20
  nl_rel_tol = 1e-9
  dt = 2.0
  end_time = 20.0
[]
[Outputs]
  exodus = true
  perf_graph = true
[]
(modules/phase_field/examples/multiphase/DerivativeMultiPhaseMaterial.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 40
  ny = 40
  nz = 0
  xmin = -12
  xmax = 12
  ymin = -12
  ymax = 12
  elem_type = QUAD4
[]
[GlobalParams]
  # let's output all material properties for demonstration purposes
  outputs = exodus
  # prefactor on the penalty function kernels. The higher this value is, the
  # more rigorously the constraint is enforced
  penalty = 1e3
[]
#
# These AuxVariables hold the directly calculated free energy density in the
# simulation cell. They are provided for visualization purposes.
#
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
    additional_free_energy = cross_energy
  [../]
  #
  # Helper kernel to cpompute the gradient contribution from interfaces of order
  # parameters evolved using the ACMultiInterface kernel
  #
  [./cross_terms]
    type = CrossTermGradientFreeEnergy
    variable = cross_energy
    interfacial_vars = 'eta1 eta2 eta3'
    #
    # The interface coefficient matrix. This should be symmetrical!
    #
    kappa_names = 'kappa11 kappa12 kappa13
                   kappa21 kappa22 kappa23
                   kappa31 kappa32 kappa33'
  [../]
[]
[Variables]
  [./c]
    order = FIRST
    family = LAGRANGE
    #
    # We set up a smooth cradial concentrtaion gradient
    # The concentration will quickly change to adapt to the preset order
    # parameters eta1, eta2, and eta3
    #
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = 0.0
      y1 = 0.0
      radius = 5.0
      invalue = 1.0
      outvalue = 0.01
      int_width = 10.0
    [../]
  [../]
  [./eta1]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = FunctionIC
      #
      # Note: this initial conditions sets up a _sharp_ interface. Ideally
      # we should start with a smooth interface with a width consistent
      # with the kappa parameter supplied for the given interface.
      #
      function = 'r:=sqrt(x^2+y^2);if(r<=4,1,0)'
    [../]
  [../]
  [./eta2]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = FunctionIC
      function = 'r:=sqrt(x^2+y^2);if(r>4&r<=7,1,0)'
    [../]
  [../]
  [./eta3]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = FunctionIC
      function = 'r:=sqrt(x^2+y^2);if(r>7,1,0)'
    [../]
  [../]
[]
[Kernels]
  #
  # Cahn-Hilliard kernel for the concentration variable.
  # Note that we are not using an interfcae kernel on this variable, but rather
  # rely on the interface width enforced on the order parameters. This allows us
  # to use a direct solve using the CahnHilliard kernel _despite_ only using first
  # order elements.
  #
  [./c_res]
    type = CahnHilliard
    variable = c
    f_name = F
    coupled_variables = 'eta1 eta2 eta3'
  [../]
  [./time]
    type = TimeDerivative
    variable = c
  [../]
  #
  # Order parameter eta1
  # Each order parameter is acted on by 4 kernels:
  #  1. The stock time derivative deta_i/dt kernel
  #  2. The Allen-Cahn kernel that takes a Dervative Material for the free energy
  #  3. A gradient interface kernel that includes cross terms
  #     see https://mooseframework.inl.gov/wiki/PhysicsModules/PhaseField/DevelopingModels/MultiPhaseModels/ACMultiInterface/
  #  4. A penalty contribution that forces the interface contributions h(eta)
  #     to sum up to unity
  #
  [./deta1dt]
    type = TimeDerivative
    variable = eta1
  [../]
  [./ACBulk1]
    type = AllenCahn
    variable = eta1
    coupled_variables = 'eta2 eta3 c'
    mob_name = L1
    f_name = F
  [../]
  [./ACInterface1]
    type = ACMultiInterface
    variable = eta1
    etas = 'eta1 eta2 eta3'
    mob_name = L1
    kappa_names = 'kappa11 kappa12 kappa13'
  [../]
  [./penalty1]
    type = SwitchingFunctionPenalty
    variable = eta1
    etas    = 'eta1 eta2 eta3'
    h_names = 'h1   h2   h3'
  [../]
  #
  # Order parameter eta2
  #
  [./deta2dt]
    type = TimeDerivative
    variable = eta2
  [../]
  [./ACBulk2]
    type = AllenCahn
    variable = eta2
    coupled_variables = 'eta1 eta3 c'
    mob_name = L2
    f_name = F
  [../]
  [./ACInterface2]
    type = ACMultiInterface
    variable = eta2
    etas = 'eta1 eta2 eta3'
    mob_name = L2
    kappa_names = 'kappa21 kappa22 kappa23'
  [../]
  [./penalty2]
    type = SwitchingFunctionPenalty
    variable = eta2
    etas    = 'eta1 eta2 eta3'
    h_names = 'h1   h2   h3'
  [../]
  #
  # Order parameter eta3
  #
  [./deta3dt]
    type = TimeDerivative
    variable = eta3
  [../]
  [./ACBulk3]
    type = AllenCahn
    variable = eta3
    coupled_variables = 'eta1 eta2 c'
    mob_name = L3
    f_name = F
  [../]
  [./ACInterface3]
    type = ACMultiInterface
    variable = eta3
    etas = 'eta1 eta2 eta3'
    mob_name = L3
    kappa_names = 'kappa31 kappa32 kappa33'
  [../]
  [./penalty3]
    type = SwitchingFunctionPenalty
    variable = eta3
    etas    = 'eta1 eta2 eta3'
    h_names = 'h1   h2   h3'
  [../]
[]
[BCs]
  [./Periodic]
    [./All]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Materials]
  # here we declare some of the model parameters: the mobilities and interface
  # gradient prefactors. For this example we use arbitrary numbers. In an actual simulation
  # physical mobilities would be used, and the interface gradient prefactors would
  # be readjusted to the free energy magnitudes.
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   kappa_c L1 L2 L3  kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
    prop_values = '0.2 0.75    1  1  1   0.75    0.75    0.75    0.75    0.75    0.75    0.75    0.75    0.75   '
  [../]
  # This material sums up the individual phase contributions. It is written to the output file
  # (see GlobalParams section above) and can be used to check the constraint enforcement.
  [./etasummat]
    type = ParsedMaterial
    property_name = etasum
    material_property_names = 'h1 h2 h3'
    expression = 'h1+h2+h3'
  [../]
  # The phase contribution factors for each material point are computed using the
  # SwitchingFunctionMaterials. Each phase with an order parameter eta contributes h(eta)
  # to the global free energy density. h is a function that switches smoothly from 0 to 1
  [./switching1]
    type = SwitchingFunctionMaterial
    function_name = h1
    eta = eta1
    h_order = SIMPLE
  [../]
  [./switching2]
    type = SwitchingFunctionMaterial
    function_name = h2
    eta = eta2
    h_order = SIMPLE
  [../]
  [./switching3]
    type = SwitchingFunctionMaterial
    function_name = h3
    eta = eta3
    h_order = SIMPLE
  [../]
  # The barrier function adds a phase transformation energy barrier. It also
  # Drives order parameters toward the [0:1] interval to avoid negative or larger than 1
  # order parameters (these are set to 0 and 1 contribution by the switching functions
  # above)
  [./barrier]
    type = MultiBarrierFunctionMaterial
    etas = 'eta1 eta2 eta3'
  [../]
  # We use DerivativeParsedMaterials to specify three (very) simple free energy
  # expressions for the three phases. All necessary derivatives are built automatically.
  # In a real problem these expressions can be arbitrarily complex (or even provided
  # by custom kernels).
  [./phase_free_energy_1]
    type = DerivativeParsedMaterial
    property_name = F1
    expression = '(c-1)^2'
    coupled_variables = 'c'
  [../]
  [./phase_free_energy_2]
    type = DerivativeParsedMaterial
    property_name = F2
    expression = '(c-0.5)^2'
    coupled_variables = 'c'
  [../]
  [./phase_free_energy_3]
    type = DerivativeParsedMaterial
    property_name = F3
    expression = 'c^2'
    coupled_variables = 'c'
  [../]
  # The DerivativeMultiPhaseMaterial ties the phase free energies together into a global free energy.
  # https://mooseframework.inl.gov/wiki/PhysicsModules/PhaseField/DevelopingModels/MultiPhaseModels/
  [./free_energy]
    type = DerivativeMultiPhaseMaterial
    property_name = F
    # we use a constant free energy (GeneriConstantmaterial property Fx)
    fi_names = 'F1  F2  F3'
    hi_names = 'h1  h2  h3'
    etas     = 'eta1 eta2 eta3'
    coupled_variables = 'c'
    W = 1
  [../]
[]
[Postprocessors]
  # The total free energy of the simulation cell to observe the energy reduction.
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
  # for testing we also monitor the total solute amount, which should be conserved.
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
  [../]
[]
[Preconditioning]
  # This preconditioner makes sure the Jacobian Matrix is fully populated. Our
  # kernels compute all Jacobian matrix entries.
  # This allows us to use the Newton solver below.
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  # Automatic differentiation provedes a _full_ Jacobian in this example
  # so we can safely use NEWTON for a fast solve
  solve_type = 'NEWTON'
  l_max_its = 15
  l_tol = 1.0e-6
  nl_max_its = 50
  nl_rel_tol = 1.0e-6
  nl_abs_tol = 1.0e-6
  start_time = 0.0
  end_time   = 150.0
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.1
  [../]
[]
[Debug]
  # show_var_residual_norms = true
[]
[Outputs]
  execute_on = 'timestep_end'
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(modules/combined/examples/periodic_strain/global_strain_pfm.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = -0.5
    xmax = 0.5
    ymin = -0.5
    ymax = 0.5
  []
  [./cnode]
    input = gen
    type = ExtraNodesetGenerator
    coord = '0.0 0.0'
    new_boundary = 100
  [../]
[]
[Variables]
  [./u_x]
  [../]
  [./u_y]
  [../]
  [./global_strain]
    order = THIRD
    family = SCALAR
  [../]
  [./c]
    [./InitialCondition]
      type = FunctionIC
      function = 'sin(2*x*pi)*sin(2*y*pi)*0.05+0.6'
    [../]
  [../]
  [./w]
  [../]
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./s00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s11]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e11]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./disp_x]
    type = GlobalDisplacementAux
    variable = disp_x
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
    component = 0
  [../]
  [./disp_y]
    type = GlobalDisplacementAux
    variable = disp_y
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
    component = 1
  [../]
  [./local_free_energy]
    type = TotalFreeEnergy
    execute_on = 'initial LINEAR'
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
  [../]
  [./s00]
    type = RankTwoAux
    variable = s00
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
  [../]
  [./s01]
    type = RankTwoAux
    variable = s01
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
  [../]
  [./s10]
    type = RankTwoAux
    variable = s10
    rank_two_tensor = stress
    index_i = 1
    index_j = 0
  [../]
  [./s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
  [../]
  [./e00]
    type = RankTwoAux
    variable = e00
    rank_two_tensor = total_strain
    index_i = 0
    index_j = 0
  [../]
  [./e01]
    type = RankTwoAux
    variable = e01
    rank_two_tensor = total_strain
    index_i = 0
    index_j = 1
  [../]
  [./e10]
    type = RankTwoAux
    variable = e10
    rank_two_tensor = total_strain
    index_i = 1
    index_j = 0
  [../]
  [./e11]
    type = RankTwoAux
    variable = e11
    rank_two_tensor = total_strain
    index_i = 1
    index_j = 1
  [../]
[]
[GlobalParams]
  derivative_order = 2
  enable_jit = true
  displacements = 'u_x u_y'
  block = 0
[]
[Kernels]
  [./TensorMechanics]
  [../]
  # Cahn-Hilliard kernels
  [./c_dot]
    type = CoupledTimeDerivative
    variable = w
    v = c
    block = 0
  [../]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
    block = 0
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
    block = 0
  [../]
[]
[ScalarKernels]
  [./global_strain]
    type = GlobalStrain
    variable = global_strain
    global_strain_uo = global_strain_uo
  [../]
[]
[BCs]
  [./Periodic]
    [./all]
      auto_direction = 'x y'
      variable = 'c w u_x u_y'
    [../]
  [../]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = u_x
    value = 0
  [../]
  [./centerfix_y]
    type = DirichletBC
    boundary = 100
    variable = u_y
    value = 0
  [../]
[]
[Materials]
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   kappa_c'
    prop_values = '0.2 0.01   '
  [../]
  [./shear1]
    type = GenericConstantRankTwoTensor
    tensor_values = '0 0 0 0 0 0.5'
    tensor_name = shear1
  [../]
  [./shear2]
    type = GenericConstantRankTwoTensor
    tensor_values = '0 0 0 0 0 -0.5'
    tensor_name = shear2
  [../]
  [./expand3]
    type = GenericConstantRankTwoTensor
    tensor_values = '1 1 0 0 0 0'
    tensor_name = expand3
  [../]
  [./weight1]
    type = DerivativeParsedMaterial
    expression = '0.3*c^2'
    property_name = weight1
    coupled_variables = c
  [../]
  [./weight2]
    type = DerivativeParsedMaterial
    expression = '0.3*(1-c)^2'
    property_name = weight2
    coupled_variables = c
  [../]
  [./weight3]
    type = DerivativeParsedMaterial
    expression = '4*(0.5-c)^2'
    property_name = weight3
    coupled_variables = c
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./strain]
    type = ComputeSmallStrain
    global_strain = global_strain
    eigenstrain_names = eigenstrain
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    tensors = 'shear1  shear2  expand3'
    weights = 'weight1 weight2 weight3'
    coupled_variables = c
    eigenstrain_name = eigenstrain
  [../]
  [./global_strain]
    type = ComputeGlobalStrain
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
  [../]
  [./stress]
    type = ComputeLinearElasticStress
  [../]
  # chemical free energies
  [./chemical_free_energy]
    type = DerivativeParsedMaterial
    property_name = Fc
    expression = '4*c^2*(1-c)^2'
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fc
  [../]
  # elastic free energies
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fe
  [../]
  # free energy (chemical + elastic)
  [./free_energy]
    type = DerivativeSumMaterial
    block = 0
    property_name = F
    sum_materials = 'Fc Fe'
    coupled_variables = 'c'
  [../]
[]
[UserObjects]
  [./global_strain_uo]
    type = GlobalStrainUserObject
    execute_on = 'Initial Linear Nonlinear'
  [../]
[]
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    execute_on = 'initial TIMESTEP_END'
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    execute_on = 'initial TIMESTEP_END'
    variable = c
  [../]
  [./min]
    type = ElementExtremeValue
    execute_on = 'initial TIMESTEP_END'
    value_type = min
    variable = c
  [../]
  [./max]
    type = ElementExtremeValue
    execute_on = 'initial TIMESTEP_END'
    value_type = max
    variable = c
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  line_search = basic
  petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
  petsc_options_value = 'asm         31   preonly   lu      1'
  l_max_its = 30
  nl_max_its = 12
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  end_time = 2.0
  [./TimeStepper]
    type = IterationAdaptiveDT
    dt = 0.01
    growth_factor = 1.5
    cutback_factor = 0.8
    optimal_iterations = 9
    iteration_window = 2
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  print_linear_residuals = false
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(modules/combined/examples/phase_field-mechanics/Pattern1.i)
#
# Pattern example 1
#
# Phase changes driven by a combination mechanical (elastic) and chemical
# driving forces. In this three phase system a matrix phase, an oversized and
# an undersized precipitate phase compete. The chemical free energy favors a
# phase separation into either precipitate phase. A mix of both precipitate
# emerges to balance lattice expansion and contraction.
#
# This example demonstrates the use of
# * ACMultiInterface
# * SwitchingFunctionConstraintEta and SwitchingFunctionConstraintLagrange
# * DerivativeParsedMaterial
# * ElasticEnergyMaterial
# * DerivativeMultiPhaseMaterial
# * MultiPhaseStressMaterial
# which are the components to se up a phase field model with an arbitrary number
# of phases
#
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 80
  ny = 80
  nz = 0
  xmin = -20
  xmax = 20
  ymin = -20
  ymax = 20
  zmin = 0
  zmax = 0
  elem_type = QUAD4
[]
[GlobalParams]
  # CahnHilliard needs the third derivatives
  derivative_order = 3
  enable_jit = true
  displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
    additional_free_energy = cross_energy
  [../]
  [./cross_terms]
    type = CrossTermGradientFreeEnergy
    variable = cross_energy
    interfacial_vars = 'eta1 eta2 eta3'
    kappa_names = 'kappa11 kappa12 kappa13
                   kappa21 kappa22 kappa23
                   kappa31 kappa32 kappa33'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = RandomIC
      min = 0
      max = 0.8
      seed = 1235
    [../]
  [../]
  # Order parameter for the Matrix
  [./eta1]
    order = FIRST
    family = LAGRANGE
    initial_condition = 0.5
  [../]
  # Order parameters for the 2 different inclusion orientations
  [./eta2]
    order = FIRST
    family = LAGRANGE
    initial_condition = 0.1
  [../]
  [./eta3]
    order = FIRST
    family = LAGRANGE
    initial_condition = 0.1
  [../]
  # Mesh displacement
  [./disp_x]
    order = FIRST
    family = LAGRANGE
  [../]
  [./disp_y]
    order = FIRST
    family = LAGRANGE
  [../]
  # Lagrange-multiplier
  [./lambda]
    order = FIRST
    family = LAGRANGE
    initial_condition = 1.0
  [../]
[]
[Kernels]
  # Set up stress divergence kernels
  [./TensorMechanics]
  [../]
  # Cahn-Hilliard kernels
  [./c_res]
    type = CahnHilliard
    variable = c
    f_name = F
    coupled_variables = 'eta1 eta2 eta3'
  [../]
  [./time]
    type = TimeDerivative
    variable = c
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
  [./deta1dt]
    type = TimeDerivative
    variable = eta1
  [../]
  [./ACBulk1]
    type = AllenCahn
    variable = eta1
    coupled_variables = 'eta2 eta3 c'
    mob_name = L1
    f_name = F
  [../]
  [./ACInterface1]
    type = ACMultiInterface
    variable = eta1
    etas = 'eta1 eta2 eta3'
    mob_name = L1
    kappa_names = 'kappa11 kappa12 kappa13'
  [../]
  [./lagrange1]
    type = SwitchingFunctionConstraintEta
    variable = eta1
    h_name   = h1
    lambda = lambda
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 2
  [./deta2dt]
    type = TimeDerivative
    variable = eta2
  [../]
  [./ACBulk2]
    type = AllenCahn
    variable = eta2
    coupled_variables = 'eta1 eta3 c'
    mob_name = L2
    f_name = F
  [../]
  [./ACInterface2]
    type = ACMultiInterface
    variable = eta2
    etas = 'eta1 eta2 eta3'
    mob_name = L2
    kappa_names = 'kappa21 kappa22 kappa23'
  [../]
  [./lagrange2]
    type = SwitchingFunctionConstraintEta
    variable = eta2
    h_name   = h2
    lambda = lambda
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 3
  [./deta3dt]
    type = TimeDerivative
    variable = eta3
  [../]
  [./ACBulk3]
    type = AllenCahn
    variable = eta3
    coupled_variables = 'eta1 eta2 c'
    mob_name = L3
    f_name = F
  [../]
  [./ACInterface3]
    type = ACMultiInterface
    variable = eta3
    etas = 'eta1 eta2 eta3'
    mob_name = L3
    kappa_names = 'kappa31 kappa32 kappa33'
  [../]
  [./lagrange3]
    type = SwitchingFunctionConstraintEta
    variable = eta3
    h_name   = h3
    lambda = lambda
  [../]
  # Lagrange-multiplier constraint kernel for lambda
  [./lagrange]
    type = SwitchingFunctionConstraintLagrange
    variable = lambda
    etas    = 'eta1 eta2 eta3'
    h_names = 'h1   h2   h3'
    epsilon = 1e-6
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   kappa_c  L1 L2 L3  kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
    prop_values = '0.2 0        1  1  1   2.00    2.00    2.00    2.00    2.00    2.00    2.00    2.00    2.00   '
  [../]
  # We use this to output the level of constraint enforcement
  # ideally it should be 0 everywhere, if the constraint is fully enforced
  [./etasummat]
    type = ParsedMaterial
    property_name = etasum
    coupled_variables = 'eta1 eta2 eta3'
    material_property_names = 'h1 h2 h3'
    expression = 'h1+h2+h3-1'
    outputs = exodus
  [../]
  # This parsed material creates a single property for visualization purposes.
  # It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3
  [./phasemap]
    type = ParsedMaterial
    property_name = phase
    coupled_variables = 'eta2 eta3'
    expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
    outputs = exodus
  [../]
  # matrix phase
  [./elasticity_tensor_1]
    type = ComputeElasticityTensor
    base_name = phase1
    C_ijkl = '3 3'
    fill_method = symmetric_isotropic
  [../]
  [./strain_1]
    type = ComputeSmallStrain
    base_name = phase1
    displacements = 'disp_x disp_y'
  [../]
  [./stress_1]
    type = ComputeLinearElasticStress
    base_name = phase1
  [../]
  # oversized phase
  [./elasticity_tensor_2]
    type = ComputeElasticityTensor
    base_name = phase2
    C_ijkl = '7 7'
    fill_method = symmetric_isotropic
  [../]
  [./strain_2]
    type = ComputeSmallStrain
    base_name = phase2
    displacements = 'disp_x disp_y'
    eigenstrain_names = eigenstrain
  [../]
  [./stress_2]
    type = ComputeLinearElasticStress
    base_name = phase2
  [../]
  [./eigenstrain_2]
    type = ComputeEigenstrain
    base_name = phase2
    eigen_base = '0.02'
    eigenstrain_name = eigenstrain
  [../]
  # undersized phase
  [./elasticity_tensor_3]
    type = ComputeElasticityTensor
    base_name = phase3
    C_ijkl = '7 7'
    fill_method = symmetric_isotropic
  [../]
  [./strain_3]
    type = ComputeSmallStrain
    base_name = phase3
    displacements = 'disp_x disp_y'
    eigenstrain_names = eigenstrain
  [../]
  [./stress_3]
    type = ComputeLinearElasticStress
    base_name = phase3
  [../]
  [./eigenstrain_3]
    type = ComputeEigenstrain
    base_name = phase3
    eigen_base = '-0.05'
    eigenstrain_name = eigenstrain
  [../]
  # switching functions
  [./switching1]
    type = SwitchingFunctionMaterial
    function_name = h1
    eta = eta1
    h_order = SIMPLE
  [../]
  [./switching2]
    type = SwitchingFunctionMaterial
    function_name = h2
    eta = eta2
    h_order = SIMPLE
  [../]
  [./switching3]
    type = SwitchingFunctionMaterial
    function_name = h3
    eta = eta3
    h_order = SIMPLE
  [../]
  [./barrier]
    type = MultiBarrierFunctionMaterial
    etas = 'eta1 eta2 eta3'
  [../]
  # chemical free energies
  [./chemical_free_energy_1]
    type = DerivativeParsedMaterial
    property_name = Fc1
    expression = '4*c^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_2]
    type = DerivativeParsedMaterial
    property_name = Fc2
    expression = '(c-0.9)^2-0.4'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_3]
    type = DerivativeParsedMaterial
    property_name = Fc3
    expression = '(c-0.9)^2-0.5'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # elastic free energies
  [./elastic_free_energy_1]
    type = ElasticEnergyMaterial
    base_name = phase1
    f_name = Fe1
    derivative_order = 2
    coupled_variables = 'c' # should be empty
  [../]
  [./elastic_free_energy_2]
    type = ElasticEnergyMaterial
    base_name = phase2
    f_name = Fe2
    derivative_order = 2
    coupled_variables = 'c' # should be empty
  [../]
  [./elastic_free_energy_3]
    type = ElasticEnergyMaterial
    base_name = phase3
    f_name = Fe3
    derivative_order = 2
    coupled_variables = 'c' # should be empty
  [../]
  # phase free energies (chemical + elastic)
  [./phase_free_energy_1]
    type = DerivativeSumMaterial
    property_name = F1
    sum_materials = 'Fc1 Fe1'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./phase_free_energy_2]
    type = DerivativeSumMaterial
    property_name = F2
    sum_materials = 'Fc2 Fe2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./phase_free_energy_3]
    type = DerivativeSumMaterial
    property_name = F3
    sum_materials = 'Fc3 Fe3'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # global free energy
  [./free_energy]
    type = DerivativeMultiPhaseMaterial
    f_name = F
    fi_names = 'F1  F2  F3'
    hi_names = 'h1  h2  h3'
    etas     = 'eta1 eta2 eta3'
    coupled_variables = 'c'
    W = 3
  [../]
  # Generate the global stress from the phase stresses
  [./global_stress]
    type = MultiPhaseStressMaterial
    phase_base = 'phase1 phase2 phase3'
    h          = 'h1     h2     h3'
  [../]
[]
[BCs]
  # the boundary conditions on the displacement enforce periodicity
  # at zero total shear and constant volume
  [./bottom_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./top_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'top'
    value = 0
  [../]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./right_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'right'
    value = 0
  [../]
  [./Periodic]
    [./disp_x]
      auto_direction = 'y'
    [../]
    [./disp_y]
      auto_direction = 'x'
    [../]
    # all other phase field variables are fully periodic
    [./c]
      auto_direction = 'x y'
    [../]
    [./eta1]
      auto_direction = 'x y'
    [../]
    [./eta2]
      auto_direction = 'x y'
    [../]
    [./eta3]
      auto_direction = 'x y'
    [../]
    [./lambda]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm      ilu'
  l_max_its = 30
  nl_max_its = 10
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  num_steps = 200
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.1
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
[Debug]
  # show_var_residual_norms = true
[]
(modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialSintering_test.i)
#input file to test the materials GrandPotentialTensorMaterial
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 17
  ny = 17
  xmin = 0
  xmax = 680
  ymin = 0
  ymax = 680
  uniform_refine = 1
[]
[GlobalParams]
  op_num = 4
  var_name_base = gr
  int_width = 40
[]
[Variables]
  [./w]
  [../]
  [./phi]
  [../]
  [./PolycrystalVariables]
  [../]
[]
[AuxVariables]
  [./bnds]
  [../]
  [./T]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./F_loc]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[ICs]
  [./phi_IC]
    type = SpecifiedSmoothCircleIC
    variable = phi
    x_positions = '190 490 190 490'
    y_positions = '190 190 490 490'
    z_positions = '  0   0   0   0'
    radii = '150 150 150 150'
    invalue = 0
    outvalue = 1
  [../]
  [./gr0_IC]
    type = SmoothCircleIC
    variable = gr0
    x1 = 190
    y1 = 190
    z1 = 0
    radius = 150
    invalue = 1
    outvalue = 0
  [../]
  [./gr1_IC]
    type = SmoothCircleIC
    variable = gr1
    x1 = 490
    y1 = 190
    z1 = 0
    radius = 150
    invalue = 1
    outvalue = 0
  [../]
  [./gr2_IC]
    type = SmoothCircleIC
    variable = gr2
    x1 = 190
    y1 = 490
    z1 = 0
    radius = 150
    invalue = 1
    outvalue = 0
  [../]
  [./gr3_IC]
    type = SmoothCircleIC
    variable = gr3
    x1 = 490
    y1 = 490
    z1 = 0
    radius = 150
    invalue = 1
    outvalue = 0
  [../]
[]
[Functions]
  [./f_T]
    type = ConstantFunction
    value = 1600
  [../]
[]
[Materials]
  # Free energy coefficients for parabolic curves
  [./ks]
    type = ParsedMaterial
    property_name = ks
    coupled_variables = 'T'
    constant_names = 'a b'
    constant_expressions = '-0.0025 157.16'
    expression = 'a*T + b'
  [../]
  [./kv]
    type = ParsedMaterial
    property_name = kv
    material_property_names = 'ks'
    expression = '10*ks'
  [../]
  # Diffusivity and mobilities
  [./chiD]
    type = GrandPotentialTensorMaterial
    f_name = chiD
    solid_mobility = L
    void_mobility = Lv
    chi = chi
    surface_energy = 19.7
    c = phi
    T = T
    D0 = 2.0e11
    GBmob0 = 1.4759e9
    Q = 2.77
    Em = 2.40
    bulkindex = 1
    gbindex = 20
    surfindex = 100
    outputs = exodus
  [../]
  # Equilibrium vacancy concentration
  [./cs_eq]
    type = DerivativeParsedMaterial
    property_name = cs_eq
    coupled_variables = 'gr0 gr1 gr2 gr3 T'
    constant_names = 'Ef c_GB kB'
    constant_expressions = '2.69 0.189 8.617343e-5'
    expression = 'bnds:=gr0^2 + gr1^2 + gr2^2 + gr3^2; exp(-Ef/kB/T) + 4.0 * c_GB * (1 - bnds)^2'
  [../]
  # Everything else
  [./sintering]
    type = GrandPotentialSinteringMaterial
    chemical_potential = w
    void_op = phi
    Temperature = T
    surface_energy = 19.7
    grainboundary_energy = 9.86
    void_energy_coefficient = kv
    solid_energy_coefficient = ks
    equilibrium_vacancy_concentration = cs_eq
    solid_energy_model = PARABOLIC
  [../]
  # Concentration is only meant for output
  [./c]
    type = ParsedMaterial
    property_name = c
    material_property_names = 'hs rhos hv rhov'
    constant_names = 'Va'
    constant_expressions = '0.04092'
    expression = 'Va*(hs*rhos + hv*rhov)'
    outputs = exodus
  [../]
  [./f_bulk]
    type = ParsedMaterial
    property_name = f_bulk
    coupled_variables = 'phi gr0 gr1 gr2 gr3'
    material_property_names = 'mu gamma'
    expression = 'mu*(phi^4/4-phi^2/2 + gr0^4/4-gr0^2/2 + gr1^4/4-gr1^2/2
                  + gr2^4/4-gr2^2/2 + gr3^4/4-gr3^2/2
                  + gamma*(phi^2*(gr0^2+gr1^2+gr2^2+gr3^2) + gr0^2*(gr1^2+gr2^2+gr3^2)
                  + gr1^2*(gr2^2 + gr3^2) + gr2^2*gr3^2) + 0.25)'
    outputs = exodus
  [../]
  [./f_switch]
    type = ParsedMaterial
    property_name = f_switch
    coupled_variables = 'w'
    material_property_names = 'chi'
    expression = '0.5*w^2*chi'
    outputs = exodus
  [../]
  [./f0]
    type = ParsedMaterial
    property_name = f0
    material_property_names = 'f_bulk f_switch'
    expression = 'f_bulk + f_switch'
  [../]
[]
[Kernels]
  [./dt_gr0]
    type = TimeDerivative
    variable = gr0
  [../]
  [./dt_gr1]
    type = TimeDerivative
    variable = gr1
  [../]
  [./dt_gr2]
    type = TimeDerivative
    variable = gr2
  [../]
  [./dt_gr3]
    type = TimeDerivative
    variable = gr3
  [../]
  [./dt_phi]
    type = TimeDerivative
    variable = phi
  [../]
  [./dt_w]
    type = TimeDerivative
    variable = w
  [../]
[]
[AuxKernels]
  [./bnds_aux]
    type = BndsCalcAux
    variable = bnds
    execute_on = 'initial timestep_end'
  [../]
  [./T_aux]
    type = FunctionAux
    variable = T
    function = f_T
  [../]
  [./F_aux]
    type = TotalFreeEnergy
    variable = F_loc
    f_name = f0
    interfacial_vars = 'phi gr0 gr1 gr2 gr3'
    kappa_names = 'kappa kappa kappa kappa kappa'
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = JFNK
  dt = 1
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
#
# Example simulation of an iron-chromium alloy at 500 C. Equilibrium
# concentrations are at 23.6 and 82.3 mol% Cr. Kappa value, free energy equation,
# and mobility equation were provided by Lars Hoglund. Solved using the split
# form of the Cahn-Hilliard equation.
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  nx = 25
  ny = 25
  nz = 0
  xmin = 0
  xmax = 25
  ymin = 0
  ymax = 25
  zmin = 0
  zmax = 0
  uniform_refine = 2
[]
[Variables]
  [./c]   # Mole fraction of Cr (unitless)
    order = FIRST
    family = LAGRANGE
    scaling = 1e+04
  [../]
  [./w]   # Chemical potential (eV/mol)
    order = FIRST
    family = LAGRANGE
  [../]
[]
[AuxVariables]
  [./f_density]   # Local energy density (eV/mol)
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[ICs]
  [./concentrationIC]   # 46.774 mol% Cr with variations
    type = RandomIC
    min = 0.44774
    max = 0.48774
    seed = 210
    variable = c
  [../]
[]
[BCs]
  [./Periodic]
    [./c_bcs]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Kernels]
  [./w_dot]
    variable = w
    v = c
    type = CoupledTimeDerivative
  [../]
  [./coupled_res]
    variable = w
    type = SplitCHWRes
    mob_name = M
  [../]
  [./coupled_parsed]
    variable = c
    type = SplitCHParsed
    f_name = f_loc
    kappa_name = kappa_c
    w = w
  [../]
[]
[AuxKernels]
  # Calculates the energy density by combining the local and gradient energies
  [./f_density]   # (eV/mol/nm^2)
    type = TotalFreeEnergy
    variable = f_density
    f_name = 'f_loc'
    kappa_names = 'kappa_c'
    interfacial_vars = c
  [../]
[]
[Materials]
  # d is a scaling factor that makes it easier for the solution to converge
  # without changing the results. It is defined in each of the first three
  # materials and must have the same value in each one.
  [./kappa]                  # Gradient energy coefficient (eV nm^2/mol)
    type = GenericFunctionMaterial
    prop_names = 'kappa_c'
    prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27'
                  # kappa_c *eV_J*nm_m^2* d
  [../]
  [./mobility]               # Mobility (nm^2 mol/eV/s)
    # NOTE: This is a fitted equation, so only 'Conv' has units
    type = DerivativeParsedMaterial
    property_name = M
    coupled_variables = c
    constant_names =       'Acr    Bcr    Ccr    Dcr
                            Ecr    Fcr    Gcr
                            Afe    Bfe    Cfe    Dfe
                            Efe    Ffe    Gfe
                            nm_m   eV_J   d'
    constant_expressions = '-32.770969 -25.8186669 -3.29612744 17.669757
                            37.6197853 20.6941796  10.8095813
                            -31.687117 -26.0291774 0.2286581   24.3633544
                            44.3334237 8.72990497  20.956768
                            1e+09      6.24150934e+18          1e-27'
    expression = 'nm_m^2/eV_J/d*((1-c)^2*c*10^
                (Acr*c+Bcr*(1-c)+Ccr*c*log(c)+Dcr*(1-c)*log(1-c)+
                Ecr*c*(1-c)+Fcr*c*(1-c)*(2*c-1)+Gcr*c*(1-c)*(2*c-1)^2)
                +c^2*(1-c)*10^
                (Afe*c+Bfe*(1-c)+Cfe*c*log(c)+Dfe*(1-c)*log(1-c)+
                Efe*c*(1-c)+Ffe*c*(1-c)*(2*c-1)+Gfe*c*(1-c)*(2*c-1)^2))'
    derivative_order = 1
    outputs = exodus
  [../]
  [./local_energy]           # Local free energy function (eV/mol)
    type = DerivativeParsedMaterial
    property_name = f_loc
    coupled_variables = c
    constant_names = 'A   B   C   D   E   F   G  eV_J  d'
    constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
                            1.208993e+04 2.568625e+03 -2.354293e+03
                            6.24150934e+18 1e-27'
    expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
                E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
    derivative_order = 2
  [../]
  [./precipitate_indicator]  # Returns 1/625 if precipitate
    type = ParsedMaterial
    property_name = prec_indic
    coupled_variables = c
    expression = if(c>0.6,0.0016,0)
  [../]
[]
[Postprocessors]
  [./step_size]             # Size of the time step
    type = TimestepSize
  [../]
  [./iterations]            # Number of iterations needed to converge timestep
    type = NumNonlinearIterations
  [../]
  [./nodes]                 # Number of nodes in mesh
    type = NumNodes
  [../]
  [./evaluations]           # Cumulative residual calculations for simulation
    type = NumResidualEvaluations
  [../]
  [./total_energy]          # Total free energy at each timestep
    type = ElementIntegralVariablePostprocessor
    variable = f_density
    execute_on = 'initial timestep_end'
  [../]
  [./num_features]          # Number of precipitates formed
    type = FeatureFloodCount
    variable = c
    threshold = 0.6
  [../]
  [./precipitate_area]      # Fraction of surface devoted to precipitates
    type = ElementIntegralMaterialProperty
    mat_prop = prec_indic
  [../]
  [./active_time]           # Time computer spent on simulation
    type = PerfGraphData
    section_name = "Root"
    data_type = total
  [../]
[]
[Preconditioning]
  [./coupled]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  l_max_its = 30
  l_tol = 1e-6
  nl_max_its = 50
  nl_abs_tol = 1e-9
  end_time = 604800   # 7 days
  petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
                         -sub_pc_type -pc_asm_overlap'
  petsc_options_value = 'asm      31                  preonly
                         ilu          1'
  [./TimeStepper]
    type = IterationAdaptiveDT
    dt = 10
    cutback_factor = 0.8
    growth_factor = 1.5
    optimal_iterations = 7
  [../]
  [./Adaptivity]
    coarsen_fraction = 0.1
    refine_fraction = 0.7
    max_h_level = 2
  [../]
[]
[Outputs]
  exodus = true
  console = true
  csv = true
  [./console]
    type = Console
    max_rows = 10
  [../]
[]
(modules/phase_field/test/tests/actions/conserved_forward_split_1var.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 30
  ny = 30
  xmax = 25.0
  ymax = 25.0
  elem_type = QUAD
[]
[Debug]
  show_actions = true
[]
[Modules]
  [./PhaseField]
    [./Conserved]
      [./c]
        solve_type = FORWARD_SPLIT
        mobility = 1.0
        kappa = kappa_c
        free_energy = F
      [../]
    [../]
  [../]
[]
[ICs]
  [./c_IC]
    type = CrossIC
    variable = c
    x1 = 0.0
    x2 = 25.0
    y1 = 0.0
    y2 = 25.0
  [../]
[]
[AuxVariables]
  [./local_energy]
    family = MONOMIAL
    order = CONSTANT
  [../]
[]
[AuxKernels]
  [./local_energy]
    type = TotalFreeEnergy
    variable = local_energy
    f_name = F
    kappa_names = kappa_c
    interfacial_vars = c
  [../]
[]
[Materials]
  [./kappa_c]
    type = GenericConstantMaterial
    prop_names = kappa_c
    prop_values = 2.0
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    coupled_variables = c
    expression = '(1 - c)^2 * (1 + c)^2'
    property_name = F
  [../]
[]
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
  [./total_c]
    type = ElementIntegralVariablePostprocessor
    variable = c
    execute_on = 'initial TIMESTEP_END'
  [../]
[]
[Preconditioning]
  [./SMP]
   type = SMP
   full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  solve_type = 'NEWTON'
  l_max_its = 30
  l_tol = 1.0e-4
  nl_max_its = 10
  nl_rel_tol = 1.0e-10
  start_time = 0.0
  num_steps = 5
  dt = 0.7
[]
[Outputs]
  perf_graph = true
  exodus = true
[]
(modules/combined/examples/publications/rapid_dev/fig8.i)
#
# Fig. 8 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Two growing particles with differnet anisotropic Eigenstrains
#
[Mesh]
  [./gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 80
    ny = 40
    xmin = -20
    xmax = 20
    ymin = 0
    ymax = 20
    elem_type = QUAD4
  [../]
  [./cnode]
    type = ExtraNodesetGenerator
    input = gen
    coord = '0.0 0.0'
    new_boundary = 100
    tolerance = 0.1
  [../]
[]
[GlobalParams]
  # CahnHilliard needs the third derivatives
  derivative_order = 3
  enable_jit = true
  displacements = 'disp_x disp_y'
  int_width = 1
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
    additional_free_energy = cross_energy
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
  [./cross_terms]
    type = CrossTermGradientFreeEnergy
    variable = cross_energy
    interfacial_vars = 'eta1 eta2 eta3'
    kappa_names = 'kappa11 kappa12 kappa13
                   kappa21 kappa22 kappa23
                   kappa31 kappa32 kappa33'
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
# particle x positions and radius
P1X=8
P2X=-4
PR=2
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = SpecifiedSmoothCircleIC
      x_positions = '${P1X} ${P2X}'
      y_positions = '0 0'
      z_positions = '0 0'
      radii = '${PR} ${PR}'
      outvalue = 0.5
      invalue = 0.9
    [../]
  [../]
  [./w]
  [../]
  # Order parameter for the Matrix
  [./eta1]
    [./InitialCondition]
      type = SpecifiedSmoothCircleIC
      x_positions = '${P1X} ${P2X}'
      y_positions = '0 0'
      z_positions = '0 0'
      radii = '${PR} ${PR}'
      outvalue = 1.0
      invalue = 0.0
    [../]
  [../]
  # Order parameters for the 2 different inclusion orientations
  [./eta2]
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = ${P2X}
      y1 = 0
      radius = ${PR}
      invalue = 1.0
      outvalue = 0.0
    [../]
  [../]
  [./eta3]
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = ${P1X}
      y1 = 0
      radius = ${PR}
      invalue = 1.0
      outvalue = 0.0
    [../]
  [../]
  # Lagrange-multiplier
  [./lambda]
    initial_condition = 1.0
  [../]
[]
[Physics/SolidMechanics/QuasiStatic/all]
  add_variables = true
  strain = SMALL
  eigenstrain_names = eigenstrain
[]
[Kernels]
  # Split Cahn-Hilliard kernels
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    coupled_variables = 'eta1 eta2 eta3'
    kappa_name = kappa_c
    w = w
  [../]
  [./wres]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./time]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
  [./deta1dt]
    type = TimeDerivative
    variable = eta1
  [../]
  [./ACBulk1]
    type = AllenCahn
    variable = eta1
    coupled_variables = 'eta2 eta3 c'
    mob_name = L1
    f_name = F
  [../]
  [./ACInterface1]
    type = ACMultiInterface
    variable = eta1
    etas = 'eta1 eta2 eta3'
    mob_name = L1
    kappa_names = 'kappa11 kappa12 kappa13'
  [../]
  [./lagrange1]
    type = SwitchingFunctionConstraintEta
    variable = eta1
    h_name   = h1
    lambda = lambda
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 2
  [./deta2dt]
    type = TimeDerivative
    variable = eta2
  [../]
  [./ACBulk2]
    type = AllenCahn
    variable = eta2
    coupled_variables = 'eta1 eta3 c'
    mob_name = L2
    f_name = F
  [../]
  [./ACInterface2]
    type = ACMultiInterface
    variable = eta2
    etas = 'eta1 eta2 eta3'
    mob_name = L2
    kappa_names = 'kappa21 kappa22 kappa23'
  [../]
  [./lagrange2]
    type = SwitchingFunctionConstraintEta
    variable = eta2
    h_name   = h2
    lambda = lambda
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 3
  [./deta3dt]
    type = TimeDerivative
    variable = eta3
  [../]
  [./ACBulk3]
    type = AllenCahn
    variable = eta3
    coupled_variables = 'eta1 eta2 c'
    mob_name = L3
    f_name = F
  [../]
  [./ACInterface3]
    type = ACMultiInterface
    variable = eta3
    etas = 'eta1 eta2 eta3'
    mob_name = L3
    kappa_names = 'kappa31 kappa32 kappa33'
  [../]
  [./lagrange3]
    type = SwitchingFunctionConstraintEta
    variable = eta3
    h_name   = h3
    lambda = lambda
  [../]
  # Lagrange-multiplier constraint kernel for lambda
  [./lagrange]
    type = SwitchingFunctionConstraintLagrange
    variable = lambda
    etas    = 'eta1 eta2 eta3'
    h_names = 'h1   h2   h3'
    epsilon = 1e-6
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    block = 0
    prop_names  = 'M   kappa_c  L1 L2 L3  kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
    prop_values = '0.2 0.5      1  1  1   2.00    2.00    2.00    2.00    2.00    2.00    2.00    2.00    2.00   '
  [../]
  # We use this to output the level of constraint enforcement
  # ideally it should be 0 everywhere, if the constraint is fully enforced
  [./etasummat]
    type = ParsedMaterial
    property_name = etasum
    coupled_variables = 'eta1 eta2 eta3'
    material_property_names = 'h1 h2 h3'
    expression = 'h1+h2+h3-1'
    outputs = exodus
  [../]
  # This parsed material creates a single property for visualization purposes.
  # It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3
  [./phasemap]
    type = ParsedMaterial
    property_name = phase
    coupled_variables = 'eta2 eta3'
    expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
    outputs = exodus
  [../]
  # global mechanical properties
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    C_ijkl = '400 400'
    fill_method = symmetric_isotropic
  [../]
  [./stress]
    type = ComputeLinearElasticStress
  [../]
  # eigenstrain
  [./eigenstrain_2]
    type = GenericConstantRankTwoTensor
    tensor_name = s2
    tensor_values = '0 -0.05 0  0 0 0'
  [../]
  [./eigenstrain_3]
    type = GenericConstantRankTwoTensor
    tensor_name = s3
    tensor_values =  '-0.05 0 0  0 0 0'
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    weights = 'h2 h3'
    tensors = 's2 s3'
    coupled_variables = 'eta2 eta3'
    eigenstrain_name = eigenstrain
  [../]
  # switching functions
  [./switching1]
    type = SwitchingFunctionMaterial
    function_name = h1
    eta = eta1
    h_order = SIMPLE
  [../]
  [./switching2]
    type = SwitchingFunctionMaterial
    function_name = h2
    eta = eta2
    h_order = SIMPLE
  [../]
  [./switching3]
    type = SwitchingFunctionMaterial
    function_name = h3
    eta = eta3
    h_order = SIMPLE
  [../]
  [./barrier]
    type = MultiBarrierFunctionMaterial
    etas = 'eta1 eta2 eta3'
  [../]
  # chemical free energies
  [./chemical_free_energy_1]
    type = DerivativeParsedMaterial
    property_name = Fc1
    expression = '4*c^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_2]
    type = DerivativeParsedMaterial
    property_name = Fc2
    expression = '(c-0.9)^2-0.4'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_3]
    type = DerivativeParsedMaterial
    property_name = Fc3
    expression = '(c-0.9)^2-0.5'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # global chemical free energy
  [./chemical_free_energy]
    type = DerivativeMultiPhaseMaterial
    f_name = Fc
    fi_names = 'Fc1  Fc2  Fc3'
    hi_names = 'h1  h2  h3'
    etas     = 'eta1 eta2 eta3'
    coupled_variables = 'c'
    W = 3
  [../]
  # global elastic free energy
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    coupled_variables = 'eta2 eta3'
    outputs = exodus
    output_properties = Fe
    derivative_order = 2
  [../]
  # Penalize phase 2 and 3 coexistence
  [./multi_phase_penalty]
    type = DerivativeParsedMaterial
    property_name = Fp
    expression = '50*(eta2*eta3)^2'
    coupled_variables = 'eta2 eta3'
    derivative_order = 2
    outputs = exodus
    output_properties = Fp
  [../]
  # free energy
  [./free_energy]
    type = DerivativeSumMaterial
    property_name = F
    sum_materials = 'Fc Fe Fp'
    coupled_variables = 'c eta1 eta2 eta3'
    derivative_order = 2
  [../]
[]
[BCs]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = disp_x
    value = 0
  [../]
  # fix side point x coordinate to inhibit rotation
  [./angularfix]
    type = DirichletBC
    boundary = bottom
    variable = disp_y
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm      lu'
  l_max_its = 30
  nl_max_its = 10
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  end_time = 12.0
  [./TimeStepper]
    type = IterationAdaptiveDT
    optimal_iterations = 8
    iteration_window = 1
    dt = 0.01
  [../]
[]
[Outputs]
  print_linear_residuals = false
  execute_on = 'INITIAL TIMESTEP_END'
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
[Debug]
  # show_var_residual_norms = true
[]
(modules/phase_field/test/tests/SplitCH/forward_split_math_test.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 30
  ny = 30
  xmax = 25.0
  ymax = 25.0
  elem_type = QUAD
[]
[Variables]
  [./c]
  [../]
  [./w]
  [../]
[]
[ICs]
  [./c_IC]
    type = CrossIC
    variable = c
    x1 = 0
    x2 = 25
    y1 = 0
    y2 = 25
  [../]
[]
[Kernels]
  [./cdot]
    type = TimeDerivative
    variable = c
  [../]
  [./grad_w]
    type = MatDiffusion
    variable = c
    v = w
    diffusivity = 1.0
  [../]
  [./grad_c]
    type = MatDiffusion
    variable = w
    v = c
    diffusivity = 2.0
  [../]
  [./w2]
    type = CoupledMaterialDerivative
    variable = w
    v = c
    f_name = F
  [../]
  [./w3]
    type = CoefReaction
    variable = w
    coefficient = -1.0
  [../]
[]
[AuxVariables]
  [./local_energy]
    family = MONOMIAL
    order = CONSTANT
  [../]
[]
[AuxKernels]
  [./local_energy]
    type = TotalFreeEnergy
    variable = local_energy
    f_name = F
    kappa_names = kappa_c
    interfacial_vars = c
  [../]
[]
[Materials]
  [./kappa_c]
    type = GenericConstantMaterial
    prop_names = kappa_c
    prop_values = 2.0
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    coupled_variables = c
    expression = '(1 - c)^2 * (1 + c)^2'
    property_name = F
  [../]
[]
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
  [./total_c]
    type = ElementIntegralVariablePostprocessor
    variable = c
    execute_on = 'initial TIMESTEP_END'
  [../]
[]
[Preconditioning]
  [./SMP]
   type = SMP
   full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  solve_type = 'NEWTON'
  l_max_its = 30
  l_tol = 1.0e-4
  nl_max_its = 10
  nl_rel_tol = 1.0e-10
  start_time = 0.0
  num_steps = 5
  dt = 0.7
[]
[Outputs]
  exodus = true
[]
(modules/phase_field/examples/cahn-hilliard/Parsed_CH.i)
#
# Example problem showing how to use the DerivativeParsedMaterial with CahnHilliard.
# The free energy is identical to that from CHMath, f_bulk = 1/4*(1-c)^2*(1+c)^2.
#
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 100
  ny = 100
  xmax = 60
  ymax = 60
[]
[Modules]
  [./PhaseField]
    [./Conserved]
      [./c]
        free_energy = fbulk
        mobility = M
        kappa = kappa_c
        solve_type = DIRECT
      [../]
    [../]
  [../]
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[ICs]
  [./cIC]
    type = RandomIC
    variable = c
    min = -0.1
    max =  0.1
  [../]
[]
[AuxKernels]
  [./local_energy]
    type = TotalFreeEnergy
    variable = local_energy
    f_name = fbulk
    interfacial_vars = c
    kappa_names = kappa_c
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./Periodic]
    [./all]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Materials]
  [./mat]
    type = GenericConstantMaterial
    prop_names  = 'M   kappa_c'
    prop_values = '1.0 0.5'
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    property_name = fbulk
    coupled_variables = c
    constant_names = W
    constant_expressions = 1.0/2^2
    expression = W*(1-c)^2*(1+c)^2
    enable_jit = true
  [../]
[]
[Postprocessors]
  [./top]
    type = SideIntegralVariablePostprocessor
    variable = c
    boundary = top
  [../]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  scheme = bdf2
  # Alternative preconditioning using the additive Schwartz method and LU decomposition
  #petsc_options_iname = '-pc_type -sub_ksp_type -sub_pc_type'
  #petsc_options_value = 'asm      preonly       lu          '
  # Preconditioning options using Hypre (algebraic multi-grid)
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre    boomeramg'
  l_max_its = 30
  l_tol = 1e-4
  nl_max_its = 20
  nl_rel_tol = 1e-9
  dt = 2.0
  end_time = 20.0
[]
[Outputs]
  exodus = true
  perf_graph = true
[]
(modules/phase_field/examples/measure_interface_energy/1Dinterface_energy.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 100
  xmax = 100
  xmin = 0
  elem_type = EDGE
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    kappa_names = kappa_c
    interfacial_vars = c
  [../]
[]
[Variables]
  [./c]
    order = FIRST
    family = LAGRANGE
    scaling = 1e1
    [./InitialCondition]
      type = RampIC
      variable = c
      value_left = 0
      value_right = 1
    [../]
  [../]
  [./w]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[Kernels]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./time]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
[]
[Functions]
  [./Int_energy]
    type = ParsedFunction
    symbol_values = 'total_solute Cleft Cright Fleft Fright volume'
    expression = '((total_solute-Cleft*volume)/(Cright-Cleft))*Fright+(volume-(total_solute-Cleft*volume)/(Cright-Cleft))*Fleft'
    symbol_names = 'total_solute Cleft Cright Fleft Fright volume'
  [../]
  [./Diff]
    type = ParsedFunction
    symbol_values = 'total_free_energy total_no_int'
    symbol_names = 'total_free_energy total_no_int'
    expression = total_free_energy-total_no_int
  [../]
[]
[Materials]
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'kappa_c M'
    prop_values = '25      150'
  [../]
  [./Free_energy]
    type = DerivativeParsedMaterial
    property_name = F
    expression = 'c^2*(c-1)^2'
    coupled_variables = c
    derivative_order = 2
  [../]
[]
[Postprocessors]
  # The total free energy of the simulation cell to observe the energy reduction.
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
  # for testing we also monitor the total solute amount, which should be conserved,
  # gives Cavg in % for this problem.
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
  [../]
  # Get simulation cell size (1D volume) from postprocessor
  [./volume]
    type = ElementIntegralMaterialProperty
    mat_prop = 1
  [../]
  # Find concentration in each phase using SideAverageValue
  [./Cleft]
    type = SideAverageValue
    boundary = left
    variable = c
  [../]
  [./Cright]
    type = SideAverageValue
    boundary = right
    variable = c
  [../]
  # Find local energy in each phase by checking boundaries
  [./Fleft]
    type = SideAverageValue
    boundary = left
    variable = local_energy
  [../]
  [./Fright]
    type = SideAverageValue
    boundary = right
    variable = local_energy
  [../]
  # Use concentrations and energies to find total free energy without any interface,
  # only applies once equilibrium is reached!!
  # Difference between energy with and without interface
  # gives interface energy per unit area.
  [./total_no_int]
    type = FunctionValuePostprocessor
    function = Int_energy
  [../]
  [./Energy_of_Interface]
    type = FunctionValuePostprocessor
    function = Diff
  [../]
[]
[Preconditioning]
  # This preconditioner makes sure the Jacobian Matrix is fully populated. Our
  # kernels compute all Jacobian matrix entries.
  # This allows us to use the Newton solver below.
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  # Automatic differentiation provides a _full_ Jacobian in this example
  # so we can safely use NEWTON for a fast solve
  solve_type = 'NEWTON'
  l_max_its = 15
  l_tol = 1.0e-6
  nl_max_its = 15
  nl_rel_tol = 1.0e-10
  nl_abs_tol = 1.0e-4
  start_time = 0.0
  # make sure that the result obtained for the interfacial free energy is fully converged
  end_time   = 40
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.5
  [../]
[]
[Outputs]
  gnuplot = true
  csv = true
  [./exodus]
    type = Exodus
    show = 'c local_energy'
    execute_on = 'failed initial nonlinear timestep_end final'
  [../]
  [./console]
    type = Console
    execute_on = 'FAILED INITIAL NONLINEAR TIMESTEP_END final'
  [../]
  perf_graph = true
[]
(modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 20
    ny = 20
    nz = 20
    xmin = -0.5
    xmax = 0.5
    ymin = -0.5
    ymax = 0.5
    zmin = -0.5
    zmax = 0.5
  []
  [./cnode]
    input = gen
    type = ExtraNodesetGenerator
    coord = '0.0 0.0 0.0'
    new_boundary = 100
  [../]
[]
[Variables]
  [./u_x]
  [../]
  [./u_y]
  [../]
  [./u_z]
  [../]
  [./global_strain]
    order = SIXTH
    family = SCALAR
  [../]
  [./c]
    [./InitialCondition]
      type = FunctionIC
      function = 'sin(2*x*pi)*sin(2*y*pi)*sin(2*z*pi)*0.05+0.6'
    [../]
  [../]
  [./w]
  [../]
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./s00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./s11]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e11]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./disp_x]
    type = GlobalDisplacementAux
    variable = disp_x
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
    component = 0
  [../]
  [./disp_y]
    type = GlobalDisplacementAux
    variable = disp_y
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
    component = 1
  [../]
  [./disp_z]
    type = GlobalDisplacementAux
    variable = disp_z
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
    component = 2
  [../]
  [./local_free_energy]
    type = TotalFreeEnergy
    execute_on = 'initial LINEAR'
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
  [../]
  [./s00]
    type = RankTwoAux
    variable = s00
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
  [../]
  [./s01]
    type = RankTwoAux
    variable = s01
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
  [../]
  [./s10]
    type = RankTwoAux
    variable = s10
    rank_two_tensor = stress
    index_i = 1
    index_j = 0
  [../]
  [./s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
  [../]
  [./e00]
    type = RankTwoAux
    variable = e00
    rank_two_tensor = total_strain
    index_i = 0
    index_j = 0
  [../]
  [./e01]
    type = RankTwoAux
    variable = e01
    rank_two_tensor = total_strain
    index_i = 0
    index_j = 1
  [../]
  [./e10]
    type = RankTwoAux
    variable = e10
    rank_two_tensor = total_strain
    index_i = 1
    index_j = 0
  [../]
  [./e11]
    type = RankTwoAux
    variable = e11
    rank_two_tensor = total_strain
    index_i = 1
    index_j = 1
  [../]
[]
[GlobalParams]
  derivative_order = 2
  enable_jit = true
  displacements = 'u_x u_y u_z'
  block = 0
[]
[Kernels]
  [./TensorMechanics]
  [../]
  # Cahn-Hilliard kernels
  [./c_dot]
    type = CoupledTimeDerivative
    variable = w
    v = c
    block = 0
  [../]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
    block = 0
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
    block = 0
  [../]
[]
[ScalarKernels]
  [./global_strain]
    type = GlobalStrain
    variable = global_strain
    global_strain_uo = global_strain_uo
  [../]
[]
[BCs]
  [./Periodic]
    [./all]
      auto_direction = 'x y z'
      variable = 'c w u_x u_y u_z'
    [../]
  [../]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = u_x
    value = 0
  [../]
  [./centerfix_y]
    type = DirichletBC
    boundary = 100
    variable = u_y
    value = 0
  [../]
  [./centerfix_z]
    type = DirichletBC
    boundary = 100
    variable = u_z
    value = 0
  [../]
[]
[Materials]
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   kappa_c'
    prop_values = '0.2 0.01   '
  [../]
  [./shear1]
    type = GenericConstantRankTwoTensor
    tensor_values = '0 0 0 0.5 0.5 0.5'
    tensor_name = shear1
  [../]
  [./shear2]
    type = GenericConstantRankTwoTensor
    tensor_values = '0 0 0 -0.5 -0.5 -0.5'
    tensor_name = shear2
  [../]
  [./expand3]
    type = GenericConstantRankTwoTensor
    tensor_values = '1 1 1 0 0 0'
    tensor_name = expand3
  [../]
  [./weight1]
    type = DerivativeParsedMaterial
    expression = '0.3*c^2'
    property_name = weight1
    coupled_variables = c
  [../]
  [./weight2]
    type = DerivativeParsedMaterial
    expression = '0.3*(1-c)^2'
    property_name = weight2
    coupled_variables = c
  [../]
  [./weight3]
    type = DerivativeParsedMaterial
    expression = '4*(0.5-c)^2'
    property_name = weight3
    coupled_variables = c
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./strain]
    type = ComputeSmallStrain
    global_strain = global_strain
    eigenstrain_names = eigenstrain
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    tensors = 'shear1  shear2  expand3'
    weights = 'weight1 weight2 weight3'
    coupled_variables = c
    eigenstrain_name = eigenstrain
  [../]
  [./global_strain]
    type = ComputeGlobalStrain
    scalar_global_strain = global_strain
    global_strain_uo = global_strain_uo
  [../]
  [./stress]
    type = ComputeLinearElasticStress
  [../]
  # chemical free energies
  [./chemical_free_energy]
    type = DerivativeParsedMaterial
    property_name = Fc
    expression = '4*c^2*(1-c)^2'
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fc
  [../]
  # elastic free energies
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fe
  [../]
  # free energy (chemical + elastic)
  [./free_energy]
    type = DerivativeSumMaterial
    block = 0
    property_name = F
    sum_materials = 'Fc Fe'
    coupled_variables = 'c'
  [../]
[]
[UserObjects]
  [./global_strain_uo]
    type = GlobalStrainUserObject
    execute_on = 'Initial Linear Nonlinear'
  [../]
[]
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    execute_on = 'initial TIMESTEP_END'
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    execute_on = 'initial TIMESTEP_END'
    variable = c
  [../]
  [./min]
    type = ElementExtremeValue
    execute_on = 'initial TIMESTEP_END'
    value_type = min
    variable = c
  [../]
  [./max]
    type = ElementExtremeValue
    execute_on = 'initial TIMESTEP_END'
    value_type = max
    variable = c
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  line_search = basic
  petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
  petsc_options_value = 'asm         31   preonly   lu      1'
  l_max_its = 30
  nl_max_its = 12
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  end_time = 2.0
  [./TimeStepper]
    type = IterationAdaptiveDT
    dt = 0.01
    growth_factor = 1.5
    cutback_factor = 0.8
    optimal_iterations = 9
    iteration_window = 2
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  print_linear_residuals = false
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(modules/combined/examples/mortar/eigenstrain_action.i)
#
# Eigenstrain with Mortar gradient periodicity
#
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = -0.5
    xmax = 0.5
    ymin = -0.5
    ymax = 0.5
  []
  [./cnode]
    input = gen
    type = ExtraNodesetGenerator
    coord = '0.0 0.0'
    new_boundary = 100
  [../]
  [./anode]
    input = cnode
    type = ExtraNodesetGenerator
    coord = '0.0 0.5'
    new_boundary = 101
  [../]
[]
[Modules/PhaseField/MortarPeriodicity]
  [./strain]
    variable = 'disp_x disp_y'
    periodicity = gradient
    periodic_directions = 'x y'
  [../]
[]
[GlobalParams]
  derivative_order = 2
  enable_jit = true
  displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    block = 0
    execute_on = 'initial LINEAR'
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = RandomIC
      min = 0.49
      max = 0.51
    [../]
    block = 0
  [../]
  [./w]
    block = 0
  [../]
  # Mesh displacement
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
[]
[Kernels]
  # Set up stress divergence kernels
  [./TensorMechanics]
  [../]
  # Cahn-Hilliard kernels
  [./c_dot]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    block = '0'
    prop_names  = 'M   kappa_c'
    prop_values = '0.2 0.01   '
  [../]
  [./shear1]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 0.5'
    tensor_name = shear1
  [../]
  [./shear2]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 -0.5'
    tensor_name = shear2
  [../]
  [./expand3]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '1 1 0 0 0 0'
    tensor_name = expand3
  [../]
  [./weight1]
    type = DerivativeParsedMaterial
    block = 0
    expression = '0.3*c^2'
    property_name = weight1
    coupled_variables = c
  [../]
  [./weight2]
    type = DerivativeParsedMaterial
    block = 0
    expression = '0.3*(1-c)^2'
    property_name = weight2
    coupled_variables = c
  [../]
  [./weight3]
    type = DerivativeParsedMaterial
    block = 0
    expression = '4*(0.5-c)^2'
    property_name = weight3
    coupled_variables = c
  [../]
  # matrix phase
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./strain]
    type = ComputeSmallStrain
    block = 0
    displacements = 'disp_x disp_y'
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    block = 0
    tensors = 'shear1  shear2  expand3'
    weights = 'weight1 weight2 weight3'
    coupled_variables = c
    eigenstrain_name = eigenstrain
  [../]
  [./stress]
    type = ComputeLinearElasticStress
    block = 0
  [../]
  # chemical free energies
  [./chemical_free_energy]
    type = DerivativeParsedMaterial
    block = 0
    property_name = Fc
    expression = '4*c^2*(1-c)^2'
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fc
  [../]
  # elastic free energies
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    block = 0
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fe
  [../]
  # free energy (chemical + elastic)
  [./free_energy]
    type = DerivativeSumMaterial
    block = 0
    property_name = F
    sum_materials = 'Fc Fe'
    coupled_variables = 'c'
  [../]
[]
[BCs]
  [./Periodic]
    [./up_down]
      primary = top
      secondary = bottom
      translation = '0 -1 0'
      variable = 'c w'
    [../]
    [./left_right]
      primary = left
      secondary = right
      translation = '1 0 0'
      variable = 'c w'
    [../]
  [../]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = disp_x
    value = 0
  [../]
  [./centerfix_y]
    type = DirichletBC
    boundary = 100
    variable = disp_y
    value = 0
  [../]
  # fix side point x coordinate to inhibit rotation
  [./angularfix]
    type = DirichletBC
    boundary = 101
    variable = disp_x
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = c
  [../]
  [./min]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = min
    variable = c
  [../]
  [./max]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = max
    variable = c
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  line_search = basic
  # mortar currently does not support MPI parallelization
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  l_max_its = 30
  nl_max_its = 12
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  num_steps = 200
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.01
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  print_linear_residuals = false
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(modules/combined/examples/publications/rapid_dev/fig7a.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Solid gray curve (1)
# Eigenstrain and elastic energies ar computed per phase and then interpolated.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 32
  xmin = 0
  xmax = 100
  second_order = true
  coord_type = RSPHERICAL
[]
[GlobalParams]
  displacements = 'disp_r'
[]
[Functions]
  [./diff]
    type = ParsedFunction
    expression = '${RADIUS}-pos_c'
    symbol_names = pos_c
    symbol_values = pos_c
  [../]
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = SmoothCircleIC
      invalue = 1
      outvalue = 0
      x1 = 0
      y1 = 0
      radius = ${RADIUS}
      int_width = 3
    [../]
  [../]
  [./w]
  [../]
  # Phase order parameter
  [./eta]
    [./InitialCondition]
      type = SmoothCircleIC
      invalue = 1
      outvalue = 0
      x1 = 0
      y1 = 0
      radius = ${RADIUS}
      int_width = 3
    [../]
  [../]
  # Mesh displacement
  [./disp_r]
    order = SECOND
  [../]
  [./Fe_fit]
    order = SECOND
  [../]
[]
[Kernels]
  # Set up stress divergence kernels
  [./TensorMechanics]
  [../]
  # Split Cahn-Hilliard kernels
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    coupled_variables = 'eta'
    kappa_name = kappa_c
    w = w
  [../]
  [./wres]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./time]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
  # Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
  [./detadt]
    type = TimeDerivative
    variable = eta
  [../]
  [./ACBulk1]
    type = AllenCahn
    variable = eta
    coupled_variables = 'c'
    mob_name = L
    f_name = F
  [../]
  [./ACInterface]
    type = ACInterface
    variable = eta
    mob_name = L
    kappa_name = kappa_eta
  [../]
  [./Fe]
    type = MaterialPropertyValue
    prop_name = Fe
    variable = Fe_fit
  [../]
  [./autoadjust]
    type = MaskedBodyForce
    variable = w
    function = diff
    mask = mask
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'M   L   kappa_c kappa_eta'
    prop_values = '1.0 1.0 0.5     1'
  [../]
  # forcing function mask
  [./mask]
    type = ParsedMaterial
    property_name = mask
    expression = grad/dt
    material_property_names = 'grad dt'
  [../]
  [./grad]
    type = VariableGradientMaterial
    variable = c
    prop = grad
  [../]
  [./time]
    type = TimeStepMaterial
  [../]
  # global mechanical properties
  [./elasticity_tensor_1]
    type = ComputeElasticityTensor
    C_ijkl = '1 1'
    base_name = phase1
    fill_method = symmetric_isotropic
  [../]
  [./elasticity_tensor_2]
    type = ComputeElasticityTensor
    C_ijkl = '1 1'
    base_name = phase2
    fill_method = symmetric_isotropic
  [../]
  [./strain_1]
    type = ComputeRSphericalSmallStrain
    base_name = phase1
  [../]
  [./strain_2]
    type = ComputeRSphericalSmallStrain
    base_name = phase2
    eigenstrain_names = eigenstrain
  [../]
  [./stress_1]
    type = ComputeLinearElasticStress
    base_name = phase1
  [../]
  [./stress_2]
    type = ComputeLinearElasticStress
    base_name = phase2
  [../]
  # eigenstrain per phase
  [./eigenstrain2]
    type = ComputeEigenstrain
    eigen_base = '0.05 0.05 0.05 0 0 0'
    base_name = phase2
    eigenstrain_name = eigenstrain
  [../]
  # switching functions
  [./switching]
    type = SwitchingFunctionMaterial
    function_name = h
    eta = eta
    h_order = SIMPLE
  [../]
  [./barrier]
    type = BarrierFunctionMaterial
    eta = eta
  [../]
  # chemical free energies
  [./chemical_free_energy_1]
    type = DerivativeParsedMaterial
    property_name = Fc1
    expression = 'c^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./chemical_free_energy_2]
    type = DerivativeParsedMaterial
    property_name = Fc2
    expression = '(1-c)^2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # elastic free energies
  [./elastic_free_energy_1]
    type = ElasticEnergyMaterial
    f_name = Fe1
    coupled_variables = ''
    base_name = phase1
    derivative_order = 2
  [../]
  [./elastic_free_energy_2]
    type = ElasticEnergyMaterial
    f_name = Fe2
    coupled_variables = ''
    base_name = phase2
    derivative_order = 2
  [../]
  # per phase free energies
  [./free_energy_1]
    type = DerivativeSumMaterial
    property_name = F1
    sum_materials = 'Fc1 Fe1'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  [./free_energy_2]
    type = DerivativeSumMaterial
    property_name = F2
    sum_materials = 'Fc2 Fe2'
    coupled_variables = 'c'
    derivative_order = 2
  [../]
  # global chemical free energy
  [./global_free_energy]
    type = DerivativeTwoPhaseMaterial
    f_name = F
    fa_name = F1
    fb_name = F2
    eta = eta
    coupled_variables = 'c'
    W = 4
  [../]
  # global stress
  [./global_stress]
    type = TwoPhaseStressMaterial
    base_A = phase1
    base_B = phase2
  [../]
  [./elastic_free_energy]
    type = DerivativeTwoPhaseMaterial
    f_name = Fe
    fa_name = Fe1
    fb_name = Fe2
    eta = eta
    coupled_variables = 'c'
    W = 0
  [../]
[]
[BCs]
  [./left_r]
    type = DirichletBC
    variable = disp_r
    boundary = 'left'
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    variable = c
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./pos_c]
    type = FindValueOnLine
    start_point = '0 0 0'
    end_point = '100 0 0'
    v = c
    target = 0.582
    tol = 1e-8
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./pos_eta]
    type = FindValueOnLine
    start_point = '0 0 0'
    end_point = '100 0 0'
    v = eta
    target = 0.5
    tol = 1e-8
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
  [./c_min]
    type = ElementExtremeValue
    value_type = min
    variable = c
    execute_on = 'INITIAL TIMESTEP_END'
    outputs = 'table console'
  [../]
[]
[VectorPostprocessors]
  [./line]
    type = LineValueSampler
    variable = 'Fe_fit c w'
    start_point = '0 0 0'
    end_point =   '100 0 0'
    num_points = 5000
    sort_by = x
    outputs = vpp
    execute_on = 'INITIAL TIMESTEP_END'
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm      lu'
  l_max_its = 30
  nl_max_its = 15
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 2.0e-9
  start_time = 0.0
  end_time = 100000.0
  [./TimeStepper]
    type = IterationAdaptiveDT
    optimal_iterations = 7
    iteration_window = 1
    dt = 1
  [../]
  [./Adaptivity]
    initial_adaptivity = 5
    interval = 10
    max_h_level = 5
    refine_fraction = 0.9
    coarsen_fraction = 0.1
  [../]
[]
[Outputs]
  print_linear_residuals = false
  perf_graph = true
  execute_on = 'INITIAL TIMESTEP_END'
  [./table]
    type = CSV
    delimiter = ' '
    file_base = radius_${RADIUS}/energy_pp
  [../]
  [./vpp]
    type = CSV
    delimiter = ' '
    sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
    sync_only = true
    time_data = true
    file_base = radius_${RADIUS}/energy_vpp
  [../]
[]
(modules/combined/examples/mortar/eigenstrain.i)
#
# Eigenstrain with Mortar gradient periodicity
#
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = -0.5
    xmax = 0.5
    ymin = -0.5
    ymax = 0.5
  []
  [./cnode]
    input = gen
    type = ExtraNodesetGenerator
    coord = '0.0 0.0'
    new_boundary = 100
  [../]
  [./anode]
    input = cnode
    type = ExtraNodesetGenerator
    coord = '0.0 0.5'
    new_boundary = 101
  [../]
  [secondary_x]
    input = anode
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10
    new_block_name = "secondary_x"
  []
  [primary_x]
    input = secondary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = 12
    new_block_name = "primary_x"
  []
  [secondary_y]
    input = primary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '0'
    new_block_id = 11
    new_block_name = "secondary_y"
  []
  [primary_y]
    input = secondary_y
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 13
    new_block_name = "primary_y"
  []
[]
[GlobalParams]
  derivative_order = 2
  enable_jit = true
  displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    block = 0
    execute_on = 'initial LINEAR'
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = RandomIC
      min = 0.49
      max = 0.51
    [../]
    block = 0
  [../]
  [./w]
    block = 0
  [../]
  # Mesh displacement
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
  # Lagrange multipliers for gradient component periodicity
  [./lm_left_right_xx]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_xy]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_yx]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_yy]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_up_down_xx]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_xy]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_yx]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_yy]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
[]
[Constraints]
  [./ud_disp_x_grad_x]
    type = EqualGradientConstraint
    variable = lm_up_down_xx
    component = 0
    secondary_variable = disp_x
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_x_grad_y]
    type = EqualGradientConstraint
    variable = lm_up_down_xy
    component = 1
    secondary_variable = disp_x
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_y_grad_x]
    type = EqualGradientConstraint
    variable = lm_up_down_yx
    component = 0
    secondary_variable = disp_y
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_y_grad_y]
    type = EqualGradientConstraint
    variable = lm_up_down_yy
    component = 1
    secondary_variable = disp_y
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./lr_disp_x_grad_x]
    type = EqualGradientConstraint
    variable = lm_left_right_xx
    component = 0
    secondary_variable = disp_x
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_x_grad_y]
    type = EqualGradientConstraint
    variable = lm_left_right_xy
    component = 1
    secondary_variable = disp_x
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_y_grad_x]
    type = EqualGradientConstraint
    variable = lm_left_right_yx
    component = 0
    secondary_variable = disp_y
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_y_grad_y]
    type = EqualGradientConstraint
    variable = lm_left_right_yy
    component = 1
    secondary_variable = disp_y
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
[]
[Kernels]
  # Set up stress divergence kernels
  [./TensorMechanics]
    block = 0
  [../]
  # Cahn-Hilliard kernels
  [./c_dot]
    type = CoupledTimeDerivative
    variable = w
    v = c
    block = 0
  [../]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
    block = 0
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
    block = 0
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    block = '0 10 11'
    prop_names  = 'M   kappa_c'
    prop_values = '0.2 0.01   '
  [../]
  [./shear1]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 0.5'
    tensor_name = shear1
  [../]
  [./shear2]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 -0.5'
    tensor_name = shear2
  [../]
  [./expand3]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '1 1 0 0 0 0'
    tensor_name = expand3
  [../]
  [./weight1]
    type = DerivativeParsedMaterial
    block = 0
    expression = '0.3*c^2'
    property_name = weight1
    coupled_variables = c
  [../]
  [./weight2]
    type = DerivativeParsedMaterial
    block = 0
    expression = '0.3*(1-c)^2'
    property_name = weight2
    coupled_variables = c
  [../]
  [./weight3]
    type = DerivativeParsedMaterial
    block = 0
    expression = '4*(0.5-c)^2'
    property_name = weight3
    coupled_variables = c
  [../]
  # matrix phase
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./strain]
    type = ComputeSmallStrain
    block = 0
    displacements = 'disp_x disp_y'
    eigenstrain_names = eigenstrain
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    block = 0
    tensors = 'shear1  shear2  expand3'
    weights = 'weight1 weight2 weight3'
    coupled_variables = c
    eigenstrain_name = eigenstrain
  [../]
  [./stress]
    type = ComputeLinearElasticStress
    block = 0
  [../]
  # chemical free energies
  [./chemical_free_energy]
    type = DerivativeParsedMaterial
    block = 0
    property_name = Fc
    expression = '4*c^2*(1-c)^2'
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fc
  [../]
  # elastic free energies
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    block = 0
    coupled_variables = 'c'
    outputs = exodus
    output_properties = Fe
  [../]
  # free energy (chemical + elastic)
  [./free_energy]
    type = DerivativeSumMaterial
    block = 0
    property_name = F
    sum_materials = 'Fc Fe'
    coupled_variables = 'c'
  [../]
[]
[BCs]
  [./Periodic]
    [./up_down]
      primary = top
      secondary = bottom
      translation = '0 -1 0'
      variable = 'c w'
    [../]
    [./left_right]
      primary = left
      secondary = right
      translation = '1 0 0'
      variable = 'c w'
    [../]
  [../]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = disp_x
    value = 0
  [../]
  [./centerfix_y]
    type = DirichletBC
    boundary = 100
    variable = disp_y
    value = 0
  [../]
  # fix side point x coordinate to inhibit rotation
  [./angularfix]
    type = DirichletBC
    boundary = 101
    variable = disp_x
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = c
  [../]
  [./min]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = min
    variable = c
  [../]
  [./max]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = max
    variable = c
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  line_search = basic
  # mortar currently does not support MPI parallelization
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  l_max_its = 30
  nl_max_its = 12
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  num_steps = 200
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.01
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  print_linear_residuals = false
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_2var_test.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 10
  ny = 10
  nz = 0
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1000
  zmin = 0
  zmax = 0
  elem_type = QUAD4
  uniform_refine = 2
[]
[GlobalParams]
  op_num = 2
  var_name_base = gr
[]
[Variables]
  [./PolycrystalVariables]
  [../]
[]
[ICs]
  [./PolycrystalICs]
    [./BicrystalCircleGrainIC]
      radius = 333.333
      x = 500
      y = 500
      int_width = 60
    [../]
  [../]
[]
[AuxVariables]
  [./bnds]
    order = FIRST
    family = LAGRANGE
  [../]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./gr0dot]
    type = TimeDerivative
    variable = gr0
  [../]
  [./gr0bulk]
    type = AllenCahn
    variable = gr0
    f_name = F
    coupled_variables = gr1
  [../]
  [./gr0int]
    type = ACInterface
    variable = gr0
    kappa_name = kappa_op
  [../]
  [./gr1dot]
    type = TimeDerivative
    variable = gr1
  [../]
  [./gr1bulk]
    type = AllenCahn
    variable = gr1
    f_name = F
    coupled_variables = gr0
  [../]
  [./gr1int]
    type = ACInterface
    variable = gr1
    kappa_name = kappa_op
  [../]
[]
[AuxKernels]
  [./BndsCalc]
    type = BndsCalcAux
    variable = bnds
  [../]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    kappa_names = 'kappa_op kappa_op'
    interfacial_vars = 'gr0 gr1'
  [../]
[]
[BCs]
  [./Periodic]
    [./All]
      auto_direction = 'x y'
    [../]
  [../]
[]
[Materials]
  [./Copper]
    type = GBEvolution
    T = 500 # K
    wGB = 60 # nm
    GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
    Q = 0.23 # Migration energy in eV
    GBenergy = 0.708 # GB energy in J/m^2
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    coupled_variables = 'gr0 gr1'
    material_property_names = 'mu gamma_asymm'
    expression = 'mu*( gr0^4/4.0 - gr0^2/2.0 + gr1^4/4.0 - gr1^2/2.0 + gamma_asymm*gr0^2*gr1^2) + 1.0/4.0'
    derivative_order = 2
    enable_jit = true
  [../]
[]
[Postprocessors]
  [./total_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
  petsc_options_value = 'hypre boomeramg 31'
  l_tol = 1.0e-4
  l_max_its = 30
  nl_max_its = 30
  nl_rel_tol = 1.0e-10
  start_time = 0.0
  num_steps = 7
  dt = 80.0
  [./Adaptivity]
    initial_adaptivity = 2
    refine_fraction = 0.8
    coarsen_fraction = 0.05
    max_h_level = 2
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  exodus = true
[]
(modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
# Tests the rigid body motion due to applied force of multiple particles.
# ***COPY AND PASTE THESE AS NEEDED***
# 'gr0 gr1 gr2 gr3 gr4 gr5 gr6 gr7 gr8 gr9 gr10 gr11 gr12 gr13 gr14 gr15 gr16 gr17 gr18 gr19'
# (gr0^2+gr1^2+gr2^2+gr3^2+gr4^2+gr5^2+gr6^2+gr7^2+gr8^2+gr9^2+gr10^2+gr11^2+gr12^2+gr13^2+gr14^2+gr15^2+gr16^2+gr17^2+gr18^2+gr19^2)
# (gr0^3+gr1^3+gr2^3+gr3^3+gr4^3+gr5^3+gr6^3+gr7^3+gr8^3+gr9^3+gr10^3+gr11^3+gr12^3+gr13^3+gr14^3+gr15^3+gr16^3+gr17^3+gr18^3+gr19^3)
[GlobalParams]
  op_num = 4
  var_name_base = gr
[]
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 15
  ny = 15
  xmin = 0
  xmax = 600
  ymin = 0
  ymax = 600
  elem_type = QUAD4
  uniform_refine = 1
[]
[Variables]
  [./c]
  [../]
  [./w]
  [../]
  [./PolycrystalVariables] # Automatically creates order parameter variables
  [../]
[]
[AuxVariables]
  [./bnds]
  [../]
  [./force]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./free_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./unique_grains]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./var_indices]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./centroids]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./load_x]
    # Defines the force on the grains in the x-direction
    type = ParsedFunction
    expression = 0.005*cos(x*pi/600)
  [../]
  [./load_y]
    # Defines the force on the grains in the y-direction
    type = ConstantFunction
    value = 0.002
  [../]
[]
[Kernels]
  [./RigidBodyMultiKernel]
    # Creates all of the necessary Allen Cahn kernels automatically
    c = c
    f_name = f_loc
    mob_name = L
    kappa_name = kappa_gr
    grain_force = grain_force
    grain_volumes = grain_volumes
    grain_tracker_object = grain_center
  [../]
  # Cahn Hilliard kernels
  [./dt_w]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
  [./CH_wres]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./CH_Parsed]
    type = SplitCHParsed
    variable = c
    f_name = f_loc
    w = w
    kappa_name = kappa_c
    coupled_variables = 'gr0 gr1 gr2 gr3' # Must be changed as op_num changes. Copy/paste from line 4
  [../]
  [./CH_RBM]
    type = MultiGrainRigidBodyMotion
    variable = w
    c = c
    v = 'gr0 gr1 gr2 gr3'
    grain_force = grain_force
    grain_volumes = grain_volumes
    grain_tracker_object = grain_center
  [../]
[]
[AuxKernels]
  [./force_x]
    type = FunctionAux
    variable = force
    function = load_x
  [../]
  [./force_y]
    type = FunctionAux
    variable = force
    function = load_y
  [../]
  [./energy_density]
    type = TotalFreeEnergy
    variable = free_energy
    f_name = f_loc
    kappa_names = kappa_c
    interfacial_vars = c
  [../]
  [./bnds]
    type = BndsCalcAux
    variable = bnds
  [../]
[]
[BCs]
  [./bcs]
    #zero flux BC
    type = NeumannBC
    value = 0
    variable = c
    boundary = '0 1 2 3'
  [../]
[]
[Materials]
  [./constants]
    type = GenericConstantMaterial
    prop_names = 'kappa_gr kappa_c M L'
    prop_values = '250 4000 4.5 60'
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    property_name = f_loc
    constant_names = 'A B'
    constant_expressions = '450 1.5'
    coupled_variables = 'c gr0 gr1 gr2 gr3' #Must be changed as op_num changes. Copy/paste from line 4
    expression = 'A*c^2*(1-c)^2+B*(c^2+6*(1-c)*(gr0^2+gr1^2+gr2^2+gr3^2)
                -4*(2-c)*(gr0^3+gr1^3+gr2^3+gr3^3)
                +3*(gr0^2+gr1^2+gr2^2+gr3^2)^2)'
                                 #Copy/paste from lines 5-6
    derivative_order = 2
  [../]
  [./force_density]
    type = ExternalForceDensityMaterial
    c = c
    k = 10.0
    force_x = load_x
    force_y = load_y
  [../]
[]
[Postprocessors]
  [./total_energy]
    type = ElementIntegralVariablePostprocessor
    variable = free_energy
    execute_on = 'initial timestep_end'
  [../]
[]
[VectorPostprocessors]
  [./forces]
    type = GrainForcesPostprocessor
    grain_force = grain_force
  [../]
  [./grain_volumes]
    type = FeatureVolumeVectorPostprocessor
    flood_counter = grain_center
    execute_on = 'initial timestep_begin'
  [../]
[]
[UserObjects]
  [./grain_center]
    type = GrainTracker
    outputs = none
    compute_var_to_feature_map = true
    execute_on = 'initial timestep_begin'
  [../]
  [./grain_force]
    type = ComputeExternalGrainForceAndTorque
    grain_data = grain_center
    c = c
    etas = 'gr0 gr1 gr2 gr3'
    force_density = force_density_ext
    execute_on = 'linear nonlinear'
  [../]
[]
[Preconditioning]
  [./coupled]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
                         -sub_pc_type -pc_asm_overlap'
  petsc_options_value = 'asm      31                  preonly
                         ilu          2'
  l_tol = 1e-05
  nl_max_its = 30
  l_max_its = 30
  nl_rel_tol = 1e-07
  nl_abs_tol = 1e-09
  start_time = 0.0
  end_time = 4
  dt = 0.05
[]
[Outputs]
  exodus = true
  perf_graph = true
  [./display]
    type = Console
    max_rows = 12
  [../]
[]
[ICs]
  [./concentration_IC]
    type = SpecifiedSmoothCircleIC
    x_positions = '150 450 150 450'
    y_positions = '150 150 450 450'
    z_positions = '0   0   0   0'
    radii =       '120 120 120 120'
    variable = c
    invalue = 1.0
    outvalue = 0.0
    int_width = 25
  [../]
  [./gr0_IC]
    type = SmoothCircleIC
    variable = gr0
    x1 = 150
    y1 = 150
    radius = 120
    invalue = 1.0
    outvalue = 0.0
    int_width = 25
  [../]
  [./gr1_IC]
    type = SmoothCircleIC
    variable = gr1
    x1 = 450
    y1 = 150
    radius = 120
    invalue = 1.0
    outvalue = 0.0
    int_width = 25
  [../]
  [./gr2_IC]
    type = SmoothCircleIC
    variable = gr2
    x1 = 150
    y1 = 450
    radius = 120
    invalue = 1.0
    outvalue = 0.0
    int_width = 25
  [../]
  [./gr3_IC]
    type = SmoothCircleIC
    variable = gr3
    x1 = 450
    y1 = 450
    radius = 120
    invalue = 1.0
    outvalue = 0.0
    int_width = 25
  [../]
[]
(modules/phase_field/test/tests/free_energy_material/CoupledValueFunctionFreeEnergy.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 10
  ny = 10
  nz = 0
  xmin = 0
  xmax = 500
  ymin = 0
  ymax = 500
  zmin = 0
  zmax = 0
  elem_type = QUAD4
[]
[GlobalParams]
  op_num = 4
  var_name_base = gr
[]
[Variables]
  [PolycrystalVariables]
  []
[]
[Functions]
  [grain_growth_energy]
    type = PiecewiseMultilinear
    data_file = grain_growth_energy.data
  []
  [grain_growth_mu0]
    type = PiecewiseMultilinear
    data_file = grain_growth_mu0.data
  []
  [grain_growth_mu1]
    type = PiecewiseMultilinear
    data_file = grain_growth_mu1.data
  []
  [grain_growth_mu2]
    type = PiecewiseMultilinear
    data_file = grain_growth_mu2.data
  []
  [grain_growth_mu3]
    type = PiecewiseMultilinear
    data_file = grain_growth_mu3.data
  []
  [matrix]
    type = ParsedFunction
    expression = '1-x-y-z'
  []
[]
[ICs]
  [gr1]
    type = SmoothCircleIC
    variable = gr1
    x1 = 0
    y1 = 0
    radius = 150
    int_width = 90
    invalue = 1
    outvalue = 0
  []
  [gr2]
    type = SmoothCircleIC
    variable = gr2
    x1 = 500
    y1 = 0
    radius = 120
    int_width = 90
    invalue = 1
    outvalue = 0
  []
  [gr3]
    type = SmoothCircleIC
    variable = gr3
    x1 = 250
    y1 = 500
    radius = 300
    int_width = 90
    invalue = 1
    outvalue = 0
  []
  [gr0]
    type = CoupledValueFunctionIC
    variable = gr0
    v = 'gr1 gr2 gr3'
    function = matrix
  []
[]
[AuxVariables]
  [bnds]
    order = FIRST
    family = LAGRANGE
  []
  [local_energy]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Kernels]
  [gr0dot]
    type = TimeDerivative
    variable = gr0
  []
  [gr0bulk]
    type = AllenCahn
    variable = gr0
    f_name = F
    coupled_variables = 'gr1 gr2 gr3'
  []
  [gr0int]
    type = ACInterface
    variable = gr0
    kappa_name = kappa_op
  []
  [gr1dot]
    type = TimeDerivative
    variable = gr1
  []
  [gr1bulk]
    type = AllenCahn
    variable = gr1
    f_name = F
    coupled_variables = 'gr0 gr2 gr3'
  []
  [gr1int]
    type = ACInterface
    variable = gr1
    kappa_name = kappa_op
  []
  [gr2dot]
    type = TimeDerivative
    variable = gr2
  []
  [gr2bulk]
    type = AllenCahn
    variable = gr2
    f_name = F
    coupled_variables = 'gr0 gr1 gr3'
  []
  [gr2int]
    type = ACInterface
    variable = gr2
    kappa_name = kappa_op
  []
  [gr3dot]
    type = TimeDerivative
    variable = gr3
  []
  [gr3bulk]
    type = AllenCahn
    variable = gr3
    f_name = F
    coupled_variables = 'gr0 gr1 gr2'
  []
  [gr3int]
    type = ACInterface
    variable = gr3
    kappa_name = kappa_op
  []
[]
[AuxKernels]
  [BndsCalc]
    type = BndsCalcAux
    variable = bnds
  []
  [local_free_energy]
    type = TotalFreeEnergy
    variable = local_energy
    kappa_names = 'kappa_op kappa_op kappa_op kappa_op'
    interfacial_vars = 'gr0 gr1 gr2 gr3'
  []
[]
[Materials]
  [Copper]
    type = GBEvolution
    T = 500 # K
    wGB = 60 # nm
    GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
    Q = 0.23 # Migration energy in eV
    GBenergy = 0.708 # GB energy in J/m^2
  []
  [Tabulated]
    type = CoupledValueFunctionFreeEnergy
    free_energy_function = grain_growth_energy
    chemical_potential_functions = 'grain_growth_mu0 grain_growth_mu1 grain_growth_mu2 '
                                   'grain_growth_mu3'
    v = 'gr0 gr1 gr2 gr3'
  []
[]
[Postprocessors]
  [total_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_energy
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    coupled_groups = 'gr0,gr1 gr0,gr2 gr0,gr3'
  []
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = NEWTON
  l_tol = 1.0e-4
  l_max_its = 30
  nl_max_its = 30
  nl_rel_tol = 1.0e-9
  start_time = 0.0
  num_steps = 3
  dt = 100.0
[]
[Outputs]
  exodus = true
  print_linear_residuals = false
  perf_graph = true
[]
(modules/phase_field/test/tests/MultiPhase/crosstermfreeenergy.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 20
  ny = 20
  nz = 0
  xmin = -8
  xmax = 8
  ymin = -8
  ymax = 8
  elem_type = QUAD4
[]
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./cross_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    f_name = F0
    variable = local_energy
    additional_free_energy = cross_energy
  [../]
  [./cross_terms]
    type = CrossTermGradientFreeEnergy
    variable = cross_energy
    interfacial_vars = 'eta1 eta2 eta3'
    kappa_names = 'kappa11 kappa12 kappa13
                   kappa21 kappa22 kappa23
                   kappa31 kappa32 kappa33'
  [../]
[]
[Variables]
  [./eta1]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = 0.0
      y1 = 5.0
      radius = 5.0
      invalue = 1.0
      outvalue = 0.0
      int_width = 10.0
    [../]
  [../]
  [./eta2]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = -4.0
      y1 = -2.0
      radius = 5.0
      invalue = 1.0
      outvalue = 0.0
      int_width = 10.0
    [../]
  [../]
  [./eta3]
    order = FIRST
    family = LAGRANGE
    [./InitialCondition]
      type = SmoothCircleIC
      x1 = 4.0
      y1 = -2.0
      radius = 5.0
      invalue = 1.0
      outvalue = 0.0
      int_width = 10.0
    [../]
  [../]
[]
[Kernels]
  [./dummy_diff1]
    type = Diffusion
    variable = eta1
  [../]
  [./dummy_time1]
    type = TimeDerivative
    variable = eta1
  [../]
  [./dummy_diff2]
    type = Diffusion
    variable = eta2
  [../]
  [./dummy_time2]
    type = TimeDerivative
    variable = eta2
  [../]
  [./dummy_diff3]
    type = Diffusion
    variable = eta3
  [../]
  [./dummy_tim3]
    type = TimeDerivative
    variable = eta3
  [../]
[]
[Materials]
  [./consts]
    type = GenericConstantMaterial
    prop_names  = 'F0   kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
    prop_values = '0    11      12      13      12      22      23      13      23      33     '
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.001
  num_steps = 1
[]
[Outputs]
  execute_on = 'timestep_end'
  [./out]
    type = Exodus
    hide = 'eta1 eta2 eta3 local_energy'
  [../]
[]
(modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_test.i)
#
# Test the TotalFreeEnergy auxkernel, which outputs both the sum of the bulk and interfacial free energies. This test has only one variable.
#
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 30
  ny = 30
  nz = 0
  xmin = 0
  xmax = 250
  ymin = 0
  ymax = 250
  zmin = 0
  zmax = 0
  elem_type = QUAD4
[]
[Variables]
  [./c]
  [../]
  [./w]
  [../]
[]
[AuxVariables]
  [./local_free_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[ICs]
  [./cIC]
    type = SmoothCircleIC
    variable = c
    x1 = 125.0
    y1 = 125.0
    radius = 60.0
    invalue = 1.0
    outvalue = 0.1
    int_width = 30.0
  [../]
[]
[Kernels]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
  [../]
  [./time]
    type = CoupledTimeDerivative
    variable = w
    v = c
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    variable = local_free_energy
    kappa_names = kappa_c
    interfacial_vars = c
  [../]
[]
[Materials]
  [./pfmobility]
    type = GenericConstantMaterial
    prop_names  = 'M kappa_c'
    prop_values = '1e-3 0.1'
  [../]
  [./free_energy]
    type = DerivativeParsedMaterial
    coupled_variables = c
    constant_names = 'barr_height  cv_eq'
    constant_expressions = '0.1          1.0e-2'
    expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
    derivative_order = 2
  [../]
[]
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    variable = local_free_energy
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = NEWTON
  petsc_options_iname = -pc_type
  petsc_options_value = lu
  l_max_its = 30
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-10
  start_time = 0.0
  num_steps = 6
  dt = 200
[]
[Outputs]
  execute_on = 'timestep_end'
  exodus = true
[]