From d1daa0e3f7c0b919d79ebfc8776d2069cdc12c24 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 14 May 2021 11:47:27 -0400 Subject: [PATCH] Allow DD only in subset of dimensions --- .../fermion/SchurFactoredFermionOperator.h | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h b/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h index d04ad1f2..1ccf0950 100644 --- a/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h +++ b/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h @@ -77,17 +77,15 @@ public: SchurFactoredFermionOperator(FermionOperator & _FermOp, FermionOperator & _DirichletFermOp, OperatorFunction &_Solver, - Coordinate & _Block) + Coordinate &_Block) : Block(_Block), FermOp(_FermOp), DirichletFermOp(_DirichletFermOp), Solver(_Solver) { - // FIXME -- could check that the DirichletFermOp block matches this. // Pass in Dirichlet FermOp because we really need two dirac operators - // as double stored gauge fields differ. - - assert(_FermOp.FermionGrid() = _DirichletFermOp.FermionGrid()); // May not be true in future if change communicator scheme + // as double stored gauge fields differ and they will otherwise overwrite + assert(_FermOp.FermionGrid() == _DirichletFermOp.FermionGrid()); // May not be true in future if change communicator scheme }; enum Domain { Omega=0, OmegaBar=1 }; @@ -117,39 +115,44 @@ public: LatticeInteger nface(grid); nface=Zero(); ComplexField zz(grid); zz=Zero(); - FermionField projected(grid); projected=Zero(); FermionField sp_proj (grid); int dims = grid->Nd(); int isDWF= (dims==Nd+1); assert((dims==Nd)||(dims==Nd+1)); + Coordinate Global=grid->GlobalDimensions(); for(int mu=0;mu=2 projected = where(nface>Integer(1),f,projected); + f=projected; } void ProjectDomain(FermionField &f,int domain) { @@ -182,6 +185,7 @@ public: { ProjectBoundaryBothDomains(f,1); ProjectOmegaBar(f); + // DumpSliceNorm("ProjectBoundary",f,f.Grid()->Nd()-1); }; void dBoundary (FermionField &in,FermionField &out) @@ -240,7 +244,6 @@ public: DirichletFermOp.Mdag(tmp,out); ProjectOmegaBar(out); }; - void dOmegaInv (FermionField &in,FermionField &out) { FermionField tmp(in); @@ -285,7 +288,8 @@ public: { FermionField tmp1(FermOp.FermionGrid()); FermionField tmp2(FermOp.FermionGrid()); - out = in; ProjectBoundaryBar(out); + out = in; + ProjectBoundaryBar(out); dOmegaDagInv(out,tmp1); dBoundaryDag(tmp1,tmp2); dOmegaBarDagInv(tmp2,tmp1); @@ -306,6 +310,7 @@ public: dOmegaInv(tmp1,tmp2); out = in - tmp2 ; ProjectBoundaryBar(out); + // DumpSliceNorm("R",out,out.Grid()->Nd()-1); }; // R = Pdbar - Pdbar Dinv Ddbar @@ -327,7 +332,7 @@ public: dBoundaryBarDag(out,tmp); out =Pin -tmp; }; - + // Non-dirichlet inverter using red-black preconditioning void Dinverse(FermionField &in,FermionField &out) { SchurRedBlackDiagMooeeSolve Solve(Solver);