Skip to content

Commit

Permalink
Cleaned up inheritance structure in dirac_quda.h
Browse files Browse the repository at this point in the history
  • Loading branch information
weinbe2 committed Sep 3, 2024
1 parent 83d603f commit b4b9e91
Showing 1 changed file with 27 additions and 87 deletions.
114 changes: 27 additions & 87 deletions include/dirac_quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,10 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_WILSON_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
// neither isWilsonType nor isDwf are final because DiracDomainWall inherits from DiracWilson
virtual bool isWilsonType() const override { return true; }
virtual bool isDwf() const override { return false; }
bool isStaggered() const final { return false; }

/**
* @brief Create the coarse Wilson operator.
Expand Down Expand Up @@ -553,9 +554,8 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_WILSONPC_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return DiracWilson::isWilsonType(); }
bool isDwf() const final { return DiracWilson::isDwf(); }
};

// Full clover
Expand Down Expand Up @@ -589,9 +589,8 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_CLOVER_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return DiracWilson::isWilsonType(); }
bool isDwf() const final { return DiracWilson::isDwf(); }

/**
* @brief Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate.
Expand Down Expand Up @@ -675,9 +674,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_CLOVERPC_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse even-odd preconditioned clover
Expand Down Expand Up @@ -735,9 +731,6 @@ namespace quda {
return 2;
}
virtual QudaDiracType getDiracType() const { return QUDA_CLOVER_HASENBUSCH_TWIST_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse clover operator
Expand Down Expand Up @@ -790,9 +783,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_CLOVER_HASENBUSCH_TWISTPC_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse even-odd preconditioned clover
Expand Down Expand Up @@ -848,9 +838,8 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_DOMAIN_WALL_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
bool isWilsonType() const final { return false; }
bool isDwf() const final { return true; }
};

// 5d Even-odd preconditioned domain wall
Expand All @@ -875,9 +864,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_DOMAIN_WALLPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// Full domain wall, but with 4-d parity ordered fields
Expand Down Expand Up @@ -908,9 +894,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_DOMAIN_WALL_4D_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// 4d Even-odd preconditioned domain wall
Expand Down Expand Up @@ -938,9 +921,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_DOMAIN_WALL_4DPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// Full Mobius
Expand Down Expand Up @@ -990,9 +970,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_MOBIUS_DOMAIN_WALL_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// 4d even-odd preconditioned Mobius domain wall
Expand Down Expand Up @@ -1043,9 +1020,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_MOBIUS_DOMAIN_WALLPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// Full Mobius EOFA
Expand Down Expand Up @@ -1083,9 +1057,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_MOBIUS_DOMAIN_WALL_EOFA_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

// 4d Even-odd preconditioned Mobius domain wall with EOFA
Expand Down Expand Up @@ -1113,9 +1084,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_MOBIUS_DOMAIN_WALLPC_EOFA_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return true; }
};

void gamma5(cvector_ref<ColorSpinorField> &out, cvector_ref<const ColorSpinorField> &in);
Expand Down Expand Up @@ -1160,9 +1128,8 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_TWISTED_MASS_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return DiracWilson::isWilsonType(); }
bool isDwf() const final { return DiracWilson::isDwf(); }

double Mu() const { return mu; }

Expand Down Expand Up @@ -1217,9 +1184,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_TWISTED_MASSPC_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse even-odd preconditioned twisted-mass
Expand Down Expand Up @@ -1273,9 +1237,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_TWISTED_CLOVER_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

double Mu() const { return mu; }

Expand Down Expand Up @@ -1369,9 +1330,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_TWISTED_CLOVERPC_DIRAC; }
virtual bool isWilsonType() const { return true; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse even-odd preconditioned twisted-clover
Expand Down Expand Up @@ -1429,9 +1387,9 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_STAGGERED_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return false; }
bool isStaggered() const final { return true; }
bool isDwf() const final { return false; }

/**
@brief Return the one-hop field for staggered operators for MG setup
Expand Down Expand Up @@ -1501,9 +1459,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_STAGGEREDPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }

virtual bool hermitian() const { return true; }

Expand Down Expand Up @@ -1573,9 +1528,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_STAGGEREDKD_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }

/**
* @brief Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate.
Expand Down Expand Up @@ -1651,9 +1603,9 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_ASQTAD_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return false; }
bool isStaggered() const final { return true; }
bool isDwf() const final { return false; }

/**
@brief Return the one-hop field for staggered operators for MG setup
Expand Down Expand Up @@ -1755,9 +1707,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_ASQTADPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }

virtual bool hermitian() const { return true; }

Expand Down Expand Up @@ -1826,9 +1775,6 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_ASQTADKD_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return true; }
virtual bool isDwf() const { return false; }

/**
* @brief Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate.
Expand Down Expand Up @@ -2037,9 +1983,9 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_COARSE_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return false; }
bool isStaggered() const final { return false; }
bool isDwf() const final { return false; }

virtual void updateFields(GaugeField *gauge_in, GaugeField *, GaugeField *, CloverField *)
{
Expand Down Expand Up @@ -2167,9 +2113,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_COARSEPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }

/**
* @brief Create the coarse even-odd preconditioned coarse
Expand Down Expand Up @@ -2229,9 +2172,9 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_GAUGE_LAPLACE_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return false; }
bool isStaggered() const final { return false; }
bool isDwf() const final { return false; }
};

/**
Expand All @@ -2257,9 +2200,6 @@ namespace quda {

virtual int getStencilSteps() const { return 2; }
virtual QudaDiracType getDiracType() const { return QUDA_GAUGE_LAPLACEPC_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
};

/**
Expand Down Expand Up @@ -2300,9 +2240,9 @@ namespace quda {

virtual int getStencilSteps() const { return 1; }
virtual QudaDiracType getDiracType() const { return QUDA_GAUGE_COVDEV_DIRAC; }
virtual bool isWilsonType() const { return false; }
virtual bool isStaggered() const { return false; }
virtual bool isDwf() const { return false; }
bool isWilsonType() const final { return false; }
bool isStaggered() const final { return false; }
bool isDwf() const final { return false; }
};

// Functor base class for applying a given Dirac matrix (M, MdagM, etc.)
Expand Down

0 comments on commit b4b9e91

Please sign in to comment.