Commit af0c2fac authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Fix of DistributedGrid: Distribution output for single node shows now zeros corectly.

Improve of DistributedGrid: Distributed grid teak overlap size as parameter.
parent 85a48758
Loading
Loading
Loading
Loading
+13 −15
Original line number Diff line number Diff line
@@ -98,11 +98,9 @@ class DistributedGrid <GridType,1>
     
   public:
       //compute everithing 
       DistributedGrid(GridType globalGrid, int *distribution=NULL)
       DistributedGrid(GridType globalGrid, CoordinatesType overlap, int *distribution=NULL)
       {      
           
           //fuj
           overlap.x()=1;
           this->overlap=overlap;
           
           left=-1;
           right=-1;
@@ -246,12 +244,9 @@ class DistributedGrid <GridType,2>
     
   public:
       //compute everithing 
       DistributedGrid(GridType globalGrid,int *distribution=NULL)
       DistributedGrid(GridType globalGrid,CoordinatesType overlap,int *distribution=NULL)
       {
           
           //fuj
           overlap.x()=1;
           overlap.y()=1;
           this->overlap=overlap;
           
           for (int i=0;i<8;i++)
                neighbors[i]=-1;
@@ -279,6 +274,8 @@ class DistributedGrid <GridType,2>
               //Without MPI
               myproccoord[0]=0;
               myproccoord[1]=0;
               procsdistr[0]=1;
               procsdistr[1]=1;
               localorigin=GlobalGrid.getOrigin();
               localgridsize=GlobalGrid.getDimensions();
               localsize=GlobalGrid.getDimensions();
@@ -487,13 +484,10 @@ class DistributedGrid <GridType,3>
     
   public:
       //compute everithing 
       DistributedGrid(GridType globalGrid,int *distribution=NULL)
       DistributedGrid(GridType globalGrid,CoordinatesType overlap,int *distribution=NULL)
       {
           
           //fuj
           overlap.x()=1;
           overlap.y()=1;
           overlap.z()=1;
           this->overlap=overlap;
           
           for (int i=0;i<26;i++)
                neighbors[i]=-1;
@@ -523,6 +517,10 @@ class DistributedGrid <GridType,3>
               myproccoord[1]=0;
               myproccoord[2]=0;
               
               procsdistr[0]=1;
               procsdistr[1]=1;
               procsdistr[2]=1;               
               
               localorigin=GlobalGrid.getOrigin();
               localsize=GlobalGrid.getDimensions();
               localgridsize=localsize;
+4 −1
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ typedef Vector<double,Host,int> DofType;
typedef typename MeshType::Cell Cell;
typedef typename MeshType::IndexType IndexType; 
typedef typename MeshType::PointType PointType; 
typedef DistributedGrid<MeshType> DistributedGridType;
	 
class DistributedGirdTest_1D : public ::testing::Test {
 protected:
@@ -131,7 +132,9 @@ class DistributedGirdTest_1D : public ::testing::Test {
	globalGrid.setDimensions(size);
	globalGrid.setDomain(globalOrigin,globalProportions);
	
	distrgrid=new DistributedGrid<MeshType> (globalGrid);
	typename DistributedGridType::CoordinatesType overlap;
	overlap.setValue(1);
	distrgrid=new DistributedGrid<MeshType> (globalGrid,overlap);
	
	distrgrid->SetupGrid(*gridptr);
	dof=new DofType(gridptr->template getEntitiesCount< Cell >());
+4 −1
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ typedef Vector<double,Host,int> DofType;
typedef typename MeshType::Cell Cell;
typedef typename MeshType::IndexType IndexType; 
typedef typename MeshType::PointType PointType; 
typedef DistributedGrid<MeshType> DistributedGridType;
	 
class DistributedGirdTest_2D : public ::testing::Test {
 protected:
@@ -396,7 +397,9 @@ class DistributedGirdTest_2D : public ::testing::Test {
	globalGrid.setDimensions(size,size);
	globalGrid.setDomain(globalOrigin,globalProportions);
	
	distrgrid=new DistributedGrid<MeshType> (globalGrid);
	typename DistributedGridType::CoordinatesType overlap;
	overlap.setValue(1);
	distrgrid=new DistributedGrid<MeshType> (globalGrid,overlap);
	
	distrgrid->SetupGrid(*gridptr);
	dof=new DofType(gridptr->template getEntitiesCount< Cell >());
+4 −1
Original line number Diff line number Diff line
@@ -599,6 +599,7 @@ typedef Vector<double,Host,int> DofType;
typedef typename MeshType::Cell Cell;
typedef typename MeshType::IndexType IndexType; 
typedef typename MeshType::PointType PointType; 
typedef DistributedGrid<MeshType> DistributedGridType;
	 
class DistributedGirdTest_3D : public ::testing::Test {
 protected:
@@ -642,7 +643,9 @@ class DistributedGirdTest_3D : public ::testing::Test {
	globalGrid.setDimensions(size,size,size);
	globalGrid.setDomain(globalOrigin,globalProportions);
	
	distrgrid=new DistributedGrid<MeshType> (globalGrid);
	typename DistributedGridType::CoordinatesType overlap;
	overlap.setValue(1);
	distrgrid=new DistributedGrid<MeshType> (globalGrid,overlap);
	
	distrgrid->SetupGrid(*gridptr);
	dof=new DofType(gridptr->template getEntitiesCount< Cell >());
+3 −1
Original line number Diff line number Diff line
@@ -99,7 +99,9 @@ int main ( int argc, char *argv[])
 	distr[2]=0;
 #endif

 DistributedGridType distrgrid(globalGrid, distr); 
 typename DistributedGridType::CoordinatesType overlap;
 overlap.setValue(1);
 DistributedGridType distrgrid(globalGrid,overlap, distr); 
   
 SharedPointer<MeshType> gridptr;
 SharedPointer<MeshFunctionType> meshFunctionptr;
+7 −7

File changed.

Contains only whitespace changes.

Loading