mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-28 06:35:55 +01:00
Namespace, indent
This commit is contained in:
parent
06ab7f5661
commit
8aed4181e1
@ -23,12 +23,12 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
See the full license in the file "LICENSE" in the top level distribution directory
|
See the full license in the file "LICENSE" in the top level distribution directory
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#ifndef GRID_LATTICE_TRANSFER_H
|
#ifndef GRID_LATTICE_TRANSFER_H
|
||||||
#define GRID_LATTICE_TRANSFER_H
|
#define GRID_LATTICE_TRANSFER_H
|
||||||
|
|
||||||
namespace Grid {
|
NAMESPACE_BEGIN(Grid);
|
||||||
|
|
||||||
inline void subdivides(GridBase *coarse,GridBase *fine)
|
inline void subdivides(GridBase *coarse,GridBase *fine)
|
||||||
{
|
{
|
||||||
@ -45,10 +45,10 @@ inline void subdivides(GridBase *coarse,GridBase *fine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// remove and insert a half checkerboard
|
// remove and insert a half checkerboard
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
template<class vobj> inline void pickCheckerboard(int cb,Lattice<vobj> &half,const Lattice<vobj> &full){
|
template<class vobj> inline void pickCheckerboard(int cb,Lattice<vobj> &half,const Lattice<vobj> &full){
|
||||||
half.checkerboard = cb;
|
half.checkerboard = cb;
|
||||||
|
|
||||||
parallel_for(int ss=0;ss<full._grid->oSites();ss++){
|
parallel_for(int ss=0;ss<full._grid->oSites();ss++){
|
||||||
@ -62,8 +62,8 @@ inline void subdivides(GridBase *coarse,GridBase *fine)
|
|||||||
half._odata[ssh] = full._odata[ss];
|
half._odata[ssh] = full._odata[ss];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<class vobj> inline void setCheckerboard(Lattice<vobj> &full,const Lattice<vobj> &half){
|
template<class vobj> inline void setCheckerboard(Lattice<vobj> &full,const Lattice<vobj> &half){
|
||||||
int cb = half.checkerboard;
|
int cb = half.checkerboard;
|
||||||
parallel_for(int ss=0;ss<full._grid->oSites();ss++){
|
parallel_for(int ss=0;ss<full._grid->oSites();ss++){
|
||||||
std::vector<int> coor;
|
std::vector<int> coor;
|
||||||
@ -77,7 +77,7 @@ inline void subdivides(GridBase *coarse,GridBase *fine)
|
|||||||
full._odata[ss]=half._odata[ssh];
|
full._odata[ss]=half._odata[ssh];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class vobj,class CComplex,int nbasis>
|
template<class vobj,class CComplex,int nbasis>
|
||||||
@ -115,7 +115,7 @@ inline void blockProject(Lattice<iVector<CComplex,nbasis > > &coarseData,
|
|||||||
for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d];
|
for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d];
|
||||||
Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions);
|
Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions);
|
||||||
|
|
||||||
PARALLEL_CRITICAL
|
PARALLEL_CRITICAL
|
||||||
for(int i=0;i<nbasis;i++) {
|
for(int i=0;i<nbasis;i++) {
|
||||||
|
|
||||||
coarseData._odata[sc](i)=coarseData._odata[sc](i)
|
coarseData._odata[sc](i)=coarseData._odata[sc](i)
|
||||||
@ -169,7 +169,7 @@ inline void blockZAXPY(Lattice<vobj> &fineZ,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
template<class vobj,class CComplex>
|
template<class vobj,class CComplex>
|
||||||
inline void blockInnerProduct(Lattice<CComplex> &CoarseInner,
|
inline void blockInnerProduct(Lattice<CComplex> &CoarseInner,
|
||||||
const Lattice<vobj> &fineX,
|
const Lattice<vobj> &fineX,
|
||||||
const Lattice<vobj> &fineY)
|
const Lattice<vobj> &fineY)
|
||||||
{
|
{
|
||||||
@ -230,7 +230,7 @@ inline void blockSum(Lattice<vobj> &coarseData,const Lattice<vobj> &fineData)
|
|||||||
for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d];
|
for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d];
|
||||||
Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions);
|
Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions);
|
||||||
|
|
||||||
PARALLEL_CRITICAL
|
PARALLEL_CRITICAL
|
||||||
coarseData._odata[sc]=coarseData._odata[sc]+fineData._odata[sf];
|
coarseData._odata[sc]=coarseData._odata[sc]+fineData._odata[sf];
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -987,5 +987,5 @@ void Grid_unsplit(std::vector<Lattice<Vobj> > & full,Lattice<Vobj> & split)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
NAMESPACE_END(Grid);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user