1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-11-24 00:19:32 +00:00

Improvements

This commit is contained in:
Peter Boyle
2025-11-14 18:12:27 -05:00
parent c54d87a472
commit 2e684028de
3 changed files with 16 additions and 5 deletions

View File

@@ -27,6 +27,8 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
/* END LEGAL */ /* END LEGAL */
#include <Grid/GridCore.h> #include <Grid/GridCore.h>
void GridAbort(void) { abort(); }
NAMESPACE_BEGIN(Grid); NAMESPACE_BEGIN(Grid);
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -34,7 +36,6 @@ NAMESPACE_BEGIN(Grid);
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
Grid_MPI_Comm CartesianCommunicator::communicator_world; Grid_MPI_Comm CartesianCommunicator::communicator_world;
void GridAbort(void) { abort(); }
void CartesianCommunicator::Init(int *argc, char *** arv) void CartesianCommunicator::Init(int *argc, char *** arv)
{ {

View File

@@ -291,8 +291,8 @@ public:
int idx=0; int idx=0;
for(int mu=0;mu<4;mu++){ for(int mu=0;mu<4;mu++){
for(int nu=0;nu<4;nu++){ for(int nu=0;nu<4;nu++){
if ( mu!=nu) GRID_ASSERT(this->StoutSmearing->SmearRho[idx]==rho); if ( mu!=nu) assert(this->StoutSmearing->SmearRho[idx]==rho);
else GRID_ASSERT(this->StoutSmearing->SmearRho[idx]==0.0); else assert(this->StoutSmearing->SmearRho[idx]==0.0);
idx++; idx++;
}} }}
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
@@ -825,6 +825,7 @@ public:
virtual void fill_smearedSet(GaugeField &U) virtual void fill_smearedSet(GaugeField &U)
{ {
this->ThinLinks = &U; // attach the smearing routine to the field U this->ThinLinks = &U; // attach the smearing routine to the field U
std::cout << GridLogMessage << " fill_smearedSet " << WilsonLoops<PeriodicGimplR>::avgPlaquette(U) << std::endl;
// check the pointer is not null // check the pointer is not null
if (this->ThinLinks == NULL) if (this->ThinLinks == NULL)
@@ -846,6 +847,8 @@ public:
ApplyMask(smeared_A,smearLvl); ApplyMask(smeared_A,smearLvl);
smeared_B = previous_u; smeared_B = previous_u;
ApplyMask(smeared_B,smearLvl); ApplyMask(smeared_B,smearLvl);
std::cout << GridLogMessage << " smeared_A " << norm2(smeared_A) << std::endl;
std::cout << GridLogMessage << " smeared_B " << norm2(smeared_B) << std::endl;
// Replace only the masked portion // Replace only the masked portion
this->SmearedSet[smearLvl] = previous_u-smeared_B + smeared_A; this->SmearedSet[smearLvl] = previous_u-smeared_B + smeared_A;
previous_u = this->SmearedSet[smearLvl]; previous_u = this->SmearedSet[smearLvl];
@@ -934,10 +937,10 @@ public:
SmearedConfigurationMasked(GridCartesian* _UGrid, unsigned int Nsmear, Smear_Stout<Gimpl>& Stout) SmearedConfigurationMasked(GridCartesian* _UGrid, unsigned int Nsmear, Smear_Stout<Gimpl>& Stout)
: SmearedConfiguration<Gimpl>(_UGrid, Nsmear,Stout) : SmearedConfiguration<Gimpl>(_UGrid, Nsmear,Stout)
{ {
GRID_ASSERT(Nsmear%(2*Nd)==0); // Or multiply by 8?? assert(Nsmear%(2*Nd)==0); // Or multiply by 8??
// was resized in base class // was resized in base class
GRID_ASSERT(this->SmearedSet.size()==Nsmear); assert(this->SmearedSet.size()==Nsmear);
GridRedBlackCartesian * UrbGrid; GridRedBlackCartesian * UrbGrid;
UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(_UGrid); UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(_UGrid);

View File

@@ -62,6 +62,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
Gimpl::generate_momenta(P,sRNG,RNG4); Gimpl::generate_momenta(P,sRNG,RNG4);
// Filter.applyFilter(P); // Filter.applyFilter(P);
std::cout << GridLogMessage << "Initial momenta " << norm2(P) << std::endl;
action.refresh(smU,sRNG,RNG4); action.refresh(smU,sRNG,RNG4);
@@ -70,6 +71,8 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl; std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl;
RealD S1 = action.S(smU); RealD S1 = action.S(smU);
std::cout << GridLogMessage << "Initial action " << S1 << std::endl;
Gimpl::update_field(P,U,eps); Gimpl::update_field(P,U,eps);
smU.set_Field(U); smU.set_Field(U);
@@ -80,6 +83,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
action.deriv(smU,UdSdU); action.deriv(smU,UdSdU);
UdSdU = Ta(UdSdU); UdSdU = Ta(UdSdU);
// Filter.applyFilter(UdSdU); // Filter.applyFilter(UdSdU);
std::cout << GridLogMessage << "Derivative " << norm2(UdSdU) << std::endl;
DumpSliceNorm("Force",UdSdU,Nd-1); DumpSliceNorm("Force",UdSdU,Nd-1);
@@ -91,6 +95,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl; std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl;
RealD S2 = action.S(smU); RealD S2 = action.S(smU);
std::cout << GridLogMessage << "Final action " << S1 << std::endl;
// Use the derivative // Use the derivative
LatticeComplex dS(UGrid); dS = Zero(); LatticeComplex dS(UGrid); dS = Zero();
@@ -145,6 +150,8 @@ int main (int argc, char ** argv)
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds); GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds);
SU<Nc>::HotConfiguration(RNG4,U); SU<Nc>::HotConfiguration(RNG4,U);
#endif #endif
std::cout << GridLogMessage << "Initial plaquette: " << WilsonLoops<PeriodicGimplR>::avgPlaquette(U) << std::endl;
WilsonGaugeActionR PlaqAction(6.0); WilsonGaugeActionR PlaqAction(6.0);