mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-12 16:55:37 +00:00
Best setup and introduce an HDCG refine method
This commit is contained in:
parent
b4cc788b8c
commit
36a14e4ee3
@ -340,11 +340,15 @@ public:
|
|||||||
Chebyshev<FineField> Cheb4(0.05,hi,500);
|
Chebyshev<FineField> Cheb4(0.05,hi,500);
|
||||||
Chebyshev<FineField> Cheb5(0.01,hi,2000);
|
Chebyshev<FineField> Cheb5(0.01,hi,2000);
|
||||||
*/
|
*/
|
||||||
/* 242
|
/* 242 */
|
||||||
Chebyshev<FineField> Cheb1(0.1,hi,300);
|
/*
|
||||||
|
Chebyshev<FineField> Cheb3(0.1,hi,300);
|
||||||
Chebyshev<FineField> Cheb2(0.02,hi,1000);
|
Chebyshev<FineField> Cheb2(0.02,hi,1000);
|
||||||
Chebyshev<FineField> Cheb3(0.003,hi,2000);
|
Chebyshev<FineField> Cheb1(0.003,hi,2000);
|
||||||
*/
|
8?
|
||||||
|
*/
|
||||||
|
/* How many??
|
||||||
|
*/
|
||||||
Chebyshev<FineField> Cheb2(0.001,hi,2500);
|
Chebyshev<FineField> Cheb2(0.001,hi,2500);
|
||||||
Chebyshev<FineField> Cheb1(0.02,hi,600);
|
Chebyshev<FineField> Cheb1(0.02,hi,600);
|
||||||
Cheb1(hermop,noise,Mn); scale = std::pow(norm2(Mn),-0.5); noise=Mn*scale;
|
Cheb1(hermop,noise,Mn); scale = std::pow(norm2(Mn),-0.5); noise=Mn*scale;
|
||||||
@ -424,6 +428,7 @@ public:
|
|||||||
RealD MirsShift = Lo;
|
RealD MirsShift = Lo;
|
||||||
ConjugateGradient<FineField> CGsloppy(tol,maxit,false);
|
ConjugateGradient<FineField> CGsloppy(tol,maxit,false);
|
||||||
ShiftedHermOpLinearOperator<FineField> ShiftedFineHermOp(hermop,MirsShift);
|
ShiftedHermOpLinearOperator<FineField> ShiftedFineHermOp(hermop,MirsShift);
|
||||||
|
tmp=Zero();
|
||||||
CGsloppy(hermop,subspace[b],tmp);
|
CGsloppy(hermop,subspace[b],tmp);
|
||||||
RealD scale = std::pow(norm2(tmp),-0.5); tmp=tmp*scale;
|
RealD scale = std::pow(norm2(tmp),-0.5); tmp=tmp*scale;
|
||||||
subspace[b]=tmp;
|
subspace[b]=tmp;
|
||||||
@ -431,6 +436,30 @@ public:
|
|||||||
std::cout<<GridLogMessage << "filt ["<<b<<"] <n|MdagM|n> "<<norm2(tmp)<<std::endl;
|
std::cout<<GridLogMessage << "filt ["<<b<<"] <n|MdagM|n> "<<norm2(tmp)<<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
virtual void RefineSubspaceHDCG(LinearOperatorBase<FineField> &hermop,
|
||||||
|
TwoLevelADEF2mrhs<FineField,CoarseVector> & theHDCG,
|
||||||
|
int nrhs)
|
||||||
|
{
|
||||||
|
std::vector<FineField> src_mrhs(nrhs,FineGrid);
|
||||||
|
std::vector<FineField> res_mrhs(nrhs,FineGrid);
|
||||||
|
FineField tmp(FineGrid);
|
||||||
|
for(int b =0;b<nbasis;b+=nrhs)
|
||||||
|
{
|
||||||
|
for(int r=0;r<MIN(nbasis-b,nrhs);r++){
|
||||||
|
src_mrhs[r] = subspace[b+r];
|
||||||
|
}
|
||||||
|
for(int r=0;r<nrhs;r++){
|
||||||
|
res_mrhs[r] = Zero();
|
||||||
|
}
|
||||||
|
theHDCG(src_mrhs,res_mrhs);
|
||||||
|
|
||||||
|
for(int r=0;r<MIN(nbasis-b,nrhs);r++){
|
||||||
|
subspace[b+r]=res_mrhs[r];
|
||||||
|
}
|
||||||
|
hermop.Op(subspace[b],tmp);
|
||||||
|
std::cout<<GridLogMessage << "filt ["<<b<<"] <n|MdagM|n> "<<norm2(tmp)<<std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user