mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-17 07:17:06 +01:00
updates for deflation in the RB solver
This commit is contained in:
@ -31,6 +31,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
namespace Grid {
|
||||
|
||||
|
||||
struct LanczosParams : Serializable {
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParams,
|
||||
@ -240,21 +241,6 @@ private:
|
||||
std::vector<CoarseField> _evec_coarse;
|
||||
|
||||
public:
|
||||
static void Deflate(std::vector<FineField> subspace,
|
||||
std::vector<CoarseField> evec_coarse,
|
||||
std::vector<RealD> eval_coarse,
|
||||
const FineField& src_orig,FineField& result)
|
||||
{
|
||||
int N = (int)evec_coarse.size();
|
||||
CoarseField src_coarse(evec_coarse[0]._grid);
|
||||
CoarseField res_coarse(evec_coarse[0]._grid); res_coarse = zero;
|
||||
blockProject(src_orig,src_coarse,subspace);
|
||||
for (int i=0;i<N;i++) {
|
||||
CoarseField & tmp = evec_coarse[i];
|
||||
axpy(res_coarse,TensorRemove(innerProduct(tmp,src_coarse)) / eval_coarse[i],tmp,res_coarse);
|
||||
}
|
||||
blockPromote(res_coarse,result,subspace);
|
||||
};
|
||||
|
||||
LocalCoherenceLanczos(GridBase *FineGrid,
|
||||
GridBase *CoarseGrid,
|
||||
|
Reference in New Issue
Block a user