void
DerivativeFunctionMaterialBase::initialSetup()
{
  // set the _prop_* pointers of all material properties that are not beeing used back to NULL
  unsigned int i, j, k;
  bool needs_third_derivatives = false;

  if (!_fe_problem.isMatPropRequested(_F_name))
    _prop_F = NULL;

  for (i = 0; i < _nargs; ++i)
  {
    if (!_fe_problem.isMatPropRequested(propertyNameFirst(_F_name, _arg_names[i])))
      _prop_dF[i] = NULL;

    // second derivatives
    for (j = i; j < _nargs; ++j)
    {
      if (!_fe_problem.isMatPropRequested(propertyNameSecond(_F_name, _arg_names[i], _arg_names[j])))
        _prop_d2F[i][j] =
        _prop_d2F[j][i] = NULL;

      // third derivatives
      if (_third_derivatives)
      {
        for (k = j; k < _nargs; ++k)
        {
          if (!_fe_problem.isMatPropRequested(propertyNameThird(_F_name, _arg_names[i], _arg_names[j], _arg_names[k])))
            _prop_d3F[i][j][k] =
            _prop_d3F[k][i][j] =
            _prop_d3F[j][k][i] =
            _prop_d3F[k][j][i] =
            _prop_d3F[j][i][k] =
            _prop_d3F[i][k][j] = NULL;
          else
            needs_third_derivatives = true;
        }

        if (!needs_third_derivatives)
          mooseWarning("This simulation does not actually need the third derivatives of DerivativeFunctionMaterialBase " + _name);
      }
    }
  }
}
void
ComputeVolumetricEigenstrain::initialSetup()
{
  for (auto vmn : _volumetric_material_names)
    validateCoupling<Real>(vmn);

  for (unsigned int i = 0; i < _num_args; ++i)
  {
    const VariableName & iname = getVar("args", i)->name();
    if (_fe_problem.isMatPropRequested(propertyNameFirst(_base_name + "elastic_strain", iname)))
      mooseError("Derivative of elastic_strain requested, but not yet implemented");
    else
      _delastic_strain[i] = nullptr;
    for (unsigned int j = 0; j < _num_args; ++j)
    {
      const VariableName & jname = getVar("args", j)->name();
      if (_fe_problem.isMatPropRequested(
              propertyNameSecond(_base_name + "elastic_strain", iname, jname)))
        mooseError("Second Derivative of elastic_strain requested, but not yet implemented");
      else
        _d2elastic_strain[i][j] = nullptr;
    }
  }
}