From 649b8c9acaac8a58683b63574c0c3a7ffd5b20cc Mon Sep 17 00:00:00 2001 From: Daniel Richtmann Date: Fri, 24 Nov 2017 10:43:34 +0100 Subject: [PATCH] Save current state --- tests/solver/Test_wilson_ddalphaamg.cc | 100 +++++++++++++++++-------- 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/tests/solver/Test_wilson_ddalphaamg.cc b/tests/solver/Test_wilson_ddalphaamg.cc index 7269bf64..85617a05 100644 --- a/tests/solver/Test_wilson_ddalphaamg.cc +++ b/tests/solver/Test_wilson_ddalphaamg.cc @@ -699,42 +699,43 @@ int main (int argc, char ** argv) params.steps = 1; const int Ls=params.Ls; + const int ds=params.domainsize; - GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi()); - GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid); + GridCartesian * FGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi()); + GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(FGrid); /////////////////////////////////////////////////// // Construct a coarsened grid; utility for this? /////////////////////////////////////////////////// - std::vector block ({4,4,4,4}); - const int nbasis= 32; + std::vector blockSize({2,2,2,2}); + const int nbasis= 16; - std::vector clatt = GridDefaultLatt(); - for(int d=0;d cLattSize = GridDefaultLatt(); + for(int d=0;d seedsFine({1,2,3,4}); std::vector seedsCoarse({5,6,7,8}); - GridParallelRNG pRNGFine(UGrid); pRNGFine.SeedFixedIntegers(seedsFine); - GridParallelRNG pRNGCoarse(Coarse4d); pRNGCoarse.SeedFixedIntegers(seedsCoarse); + GridParallelRNG pRNGFine(FGrid); pRNGFine.SeedFixedIntegers(seedsFine); + GridParallelRNG pRNGCoarse(CGrid); pRNGCoarse.SeedFixedIntegers(seedsCoarse); Gamma g5(Gamma::Algebra::Gamma5); - LatticeFermion src(UGrid); gaussian(pRNGFine,src);// src=src+g5*src; - LatticeFermion result(UGrid); result=zero; - LatticeFermion ref(UGrid); ref=zero; - LatticeFermion tmp(UGrid); - LatticeFermion err(UGrid); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(pRNGFine,Umu); - LatticeGaugeField UmuDD(UGrid); - LatticeColourMatrix U(UGrid); - LatticeColourMatrix zz(UGrid); + LatticeFermion src(FGrid); gaussian(pRNGFine,src);// src=src+g5*src; + LatticeFermion result(FGrid); result=zero; + LatticeFermion ref(FGrid); ref=zero; + LatticeFermion tmp(FGrid); + LatticeFermion err(FGrid); + LatticeGaugeField Umu(FGrid); SU3::HotConfiguration(pRNGFine,Umu); + LatticeGaugeField UmuDD(FGrid); + LatticeColourMatrix U(FGrid); + LatticeColourMatrix zz(FGrid); - if ( params.domaindecompose ) { - Lattice > coor(UGrid); + if ( params.domaindecompose ) { + Lattice > coor(FGrid); zz=zero; for(int mu=0;mu Subspace; typedef CoarsenedMatrix CoarseOperator; @@ -770,37 +770,73 @@ int main (int argc, char ** argv) std::cout< HermOp(Dw); + Subspace Aggregates(CGrid,FGrid,0); assert ( (nbasis & 0x1)==0); int nb=nbasis/2; std::cout< LDOp(*Coarse4d); - // LDOp.CoarsenOperator(UGrid,Dw,Aggregates); // problem with this line + Gamma5HermitianLinearOperator Blah(Dw); + Gamma5HermitianLinearOperator BlahDD(DwDD); + CoarsenedMatrix LDOp(*CGrid); + LDOp.CoarsenOperator(FGrid,Blah,Aggregates); // problem with this line since it enforces hermiticity std::cout< PosdefLdop(LDOp); + // ConjugateGradient CG(1.0e-6,100000); + // // CG(PosdefLdop,c_src,c_res); + + // // std::cout< HermIndefLdop(LDOp); + // // ConjugateResidual MCR(1.0e-6,100000); + // //MCR(HermIndefLdop,c_src,c_res); + + std::cout< Precon (Aggregates, LDOp, + Blah,Dw, + BlahDD,DwDD); + + MultiGridPreconditioner PreconDD(Aggregates, LDOp, + Blah,Dw, + BlahDD,DwDD); + // MultiGridPreconditioner(Aggregates &Agg, CoarseOperator &Coarse, + // FineOperator &Fine,Matrix &FineMatrix, + // FineOperator &Smooth,Matrix &SmootherMatrix) + TrivialPrecon simple; + Grid_finalize(); } #endif