1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 09:45:36 +00:00
Grid/tests/solver/Test_wilson_gmres_unprec.cc

66 lines
2.1 KiB
C++
Raw Normal View History

2017-07-17 20:02:10 +01:00
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
2017-07-17 20:02:10 +01:00
Source file: ./tests/solver/Test_wilson_gmres_unprec.cc
2017-07-17 20:02:10 +01:00
Copyright (C) 2015-2018
2017-07-17 20:02:10 +01:00
Author: Daniel Richtmann <daniel.richtmann@ur.de>
2017-07-17 20:02:10 +01:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
2017-07-17 20:02:10 +01:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2017-07-17 20:02:10 +01:00
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2017-07-17 20:02:10 +01:00
See the full license in the file "LICENSE" in the top level distribution
directory
2017-07-17 20:02:10 +01:00
*************************************************************************************/
/* END LEGAL */
#include <Grid/Grid.h>
using namespace Grid;
2017-07-17 20:02:10 +01:00
int main (int argc, char ** argv)
{
Grid_init(&argc,&argv);
2019-06-04 20:45:20 +01:00
Coordinate latt_size = GridDefaultLatt();
Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
Coordinate mpi_layout = GridDefaultMpi();
2017-07-17 20:02:10 +01:00
GridCartesian Grid(latt_size,simd_layout,mpi_layout);
2017-10-27 13:08:48 +01:00
GridRedBlackCartesian RBGrid(&Grid);
2017-07-17 20:02:10 +01:00
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
LatticeFermion src(&Grid); random(pRNG,src);
RealD nrm = norm2(src);
2019-06-04 20:45:20 +01:00
LatticeFermion result(&Grid); result=Zero();
LatticeGaugeField Umu(&Grid); SU<Nc>::HotConfiguration(pRNG,Umu);
2017-07-17 20:02:10 +01:00
double volume=1;
for(int mu=0;mu<Nd;mu++){
volume=volume*latt_size[mu];
}
2017-07-17 20:02:10 +01:00
RealD mass=0.5;
2022-11-17 01:15:51 +00:00
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
2017-07-17 20:02:10 +01:00
2022-11-17 01:15:51 +00:00
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
GeneralisedMinimalResidual<LatticeFermion> GMRES(1.0e-8, 10000, 25);
2017-07-17 20:02:10 +01:00
GMRES(HermOp,src,result);
Grid_finalize();
}