<commit_before>#ifndef DERIVATIVEMATERIALINTERFACETHM_H
#define DERIVATIVEMATERIALINTERFACETHM_H

#include "DerivativeMaterialInterface.h"

template <class T>
class DerivativeMaterialInterfaceTHM : public DerivativeMaterialInterface<T>
{
public:
  DerivativeMaterialInterfaceTHM(const InputParameters & parameters);

protected:
  /**
   * Method for declaring derivative material properties
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param var_name The name of the coupled variable vector containing the variable to take the
   * derivative with respect to
   * @param i The index of the variable to take the derivative with respect to within the coupled
   * variable vector
   */
  template <typename U>
  MaterialProperty<U> & declarePropertyDerivativeTHM(const std::string & base,
                                                     const std::string & var_name,
                                                     const unsigned int i = 0);

  /**
   * Method for retrieving derivative material properties
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param var_name The name of the coupled variable vector containing the variable to take the
   * derivative with respect to
   * @param i The index of the variable to take the derivative with respect to within the coupled
   * variable vector
   */
  template <typename U>
  const MaterialProperty<U> & getMaterialPropertyDerivativeTHM(const std::string & base,
                                                               const std::string & var_name,
                                                               const unsigned int i = 0);

  /**
   * Method for retrieving derivative material properties corresponding to phase-dependent
   * derivatives.
   *
   * The intended behavior of this function is as follows. If the material property
   * and derivative variable correspond to the same phase, then the material property
   * is retrieved as usual. Else, a zero-valued material property is returned, as
   * it is assumed that the material property depends only upon the variables
   * corresponding to its phase.
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param property_is_liquid  Does the property correspond to the liquid phase?
   * @param var_name The name of the coupled variable vector containing the variable to take the
   *   derivative with respect to
   * @param var_is_liquid  Does the derivative variable correspond to the liquid phase?
   * @param i The index of the variable to take the derivative with respect to within the coupled
   *   variable vector
   */
  template <typename U>
  const MaterialProperty<U> & getMaterialPropertyDerivativeTHMPhase(const std::string & base,
                                                                    bool property_is_liquid,
                                                                    const std::string & var_name,
                                                                    bool var_is_liquid,
                                                                    const unsigned int i = 0);
};

template <class T>
DerivativeMaterialInterfaceTHM<T>::DerivativeMaterialInterfaceTHM(
    const InputParameters & parameters)
  : DerivativeMaterialInterface<T>(parameters)
{
}

template <class T>
template <typename U>
MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::declarePropertyDerivativeTHM(const std::string & base,
                                                                const std::string & var_name,
                                                                const unsigned int i)
{
  return this->template declarePropertyDerivative<U>(base, this->getVar(var_name, i)->name());
}

template <class T>
template <typename U>
const MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::getMaterialPropertyDerivativeTHM(const std::string & base,
                                                                    const std::string & var_name,
                                                                    const unsigned int i)
{
  // get the base property name
  const std::string prop_name = this->deducePropertyName(base);

  // get the name of the variable which derivative is respect to
  const std::string der_var_name = this->getVar(var_name, i)->name();

  return this->template getMaterialPropertyByName<U>(
      this->propertyNameFirst(prop_name, der_var_name));
}

template <class T>
template <typename U>
const MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::getMaterialPropertyDerivativeTHMPhase(
    const std::string & base,
    bool property_is_liquid,
    const std::string & var_name,
    bool var_is_liquid,
    const unsigned int i)
{
  if (property_is_liquid == var_is_liquid)
  {
    return getMaterialPropertyDerivativeTHM<U>(base, var_name, i);
  }
  else
  {
    const std::string prop_name = this->deducePropertyName(base);
    const std::string der_var_name = this->getVar(var_name, i)->name();
    const std::string der_prop_name = this->propertyNameFirst(prop_name, der_var_name);
    return this->template getZeroMaterialProperty<U>(der_prop_name);
  }
}

#endif // DERIVATIVEMATERIALINTERFACETHM_H<commit_msg>Fixed call to deprecated function 'propertyNameFirst'<commit_after>#ifndef DERIVATIVEMATERIALINTERFACETHM_H
#define DERIVATIVEMATERIALINTERFACETHM_H

#include "DerivativeMaterialInterface.h"

template <class T>
class DerivativeMaterialInterfaceTHM : public DerivativeMaterialInterface<T>
{
public:
  DerivativeMaterialInterfaceTHM(const InputParameters & parameters);

protected:
  /**
   * Method for declaring derivative material properties
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param var_name The name of the coupled variable vector containing the variable to take the
   * derivative with respect to
   * @param i The index of the variable to take the derivative with respect to within the coupled
   * variable vector
   */
  template <typename U>
  MaterialProperty<U> & declarePropertyDerivativeTHM(const std::string & base,
                                                     const std::string & var_name,
                                                     const unsigned int i = 0);

  /**
   * Method for retrieving derivative material properties
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param var_name The name of the coupled variable vector containing the variable to take the
   * derivative with respect to
   * @param i The index of the variable to take the derivative with respect to within the coupled
   * variable vector
   */
  template <typename U>
  const MaterialProperty<U> & getMaterialPropertyDerivativeTHM(const std::string & base,
                                                               const std::string & var_name,
                                                               const unsigned int i = 0);

  /**
   * Method for retrieving derivative material properties corresponding to phase-dependent
   * derivatives.
   *
   * The intended behavior of this function is as follows. If the material property
   * and derivative variable correspond to the same phase, then the material property
   * is retrieved as usual. Else, a zero-valued material property is returned, as
   * it is assumed that the material property depends only upon the variables
   * corresponding to its phase.
   *
   * @tparam U The material property type
   * @param base The name of the property to take the derivative of
   * @param property_is_liquid  Does the property correspond to the liquid phase?
   * @param var_name The name of the coupled variable vector containing the variable to take the
   *   derivative with respect to
   * @param var_is_liquid  Does the derivative variable correspond to the liquid phase?
   * @param i The index of the variable to take the derivative with respect to within the coupled
   *   variable vector
   */
  template <typename U>
  const MaterialProperty<U> & getMaterialPropertyDerivativeTHMPhase(const std::string & base,
                                                                    bool property_is_liquid,
                                                                    const std::string & var_name,
                                                                    bool var_is_liquid,
                                                                    const unsigned int i = 0);
};

template <class T>
DerivativeMaterialInterfaceTHM<T>::DerivativeMaterialInterfaceTHM(
    const InputParameters & parameters)
  : DerivativeMaterialInterface<T>(parameters)
{
}

template <class T>
template <typename U>
MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::declarePropertyDerivativeTHM(const std::string & base,
                                                                const std::string & var_name,
                                                                const unsigned int i)
{
  return this->template declarePropertyDerivative<U>(base, this->getVar(var_name, i)->name());
}

template <class T>
template <typename U>
const MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::getMaterialPropertyDerivativeTHM(const std::string & base,
                                                                    const std::string & var_name,
                                                                    const unsigned int i)
{
  // get the base property name
  const std::string prop_name = this->deducePropertyName(base);

  // get the name of the variable which derivative is respect to
  const std::string der_var_name = this->getVar(var_name, i)->name();

  return this->template getMaterialPropertyByName<U>(
      this->derivativePropertyNameFirst(prop_name, der_var_name));
}

template <class T>
template <typename U>
const MaterialProperty<U> &
DerivativeMaterialInterfaceTHM<T>::getMaterialPropertyDerivativeTHMPhase(
    const std::string & base,
    bool property_is_liquid,
    const std::string & var_name,
    bool var_is_liquid,
    const unsigned int i)
{
  if (property_is_liquid == var_is_liquid)
  {
    return getMaterialPropertyDerivativeTHM<U>(base, var_name, i);
  }
  else
  {
    const std::string prop_name = this->deducePropertyName(base);
    const std::string der_var_name = this->getVar(var_name, i)->name();
    const std::string der_prop_name = this->derivativePropertyNameFirst(prop_name, der_var_name);
    return this->template getZeroMaterialProperty<U>(der_prop_name);
  }
}

#endif // DERIVATIVEMATERIALINTERFACETHM_H
{'fraction_non_alphanumeric': 0.06415724086779158, 'fraction_numerical': 0.0005562766549230484, 'mean_word_length': 2.4309796437659035, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1563439', 'n_tokens_mistral': 2621, 'n_tokens_neox': 2555, 'n_words': 926}