Commit c6344062 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing test function.

parent 0c5f7db7
Loading
Loading
Loading
Loading
+12 −21
Original line number Diff line number Diff line
@@ -106,26 +106,17 @@ setInitialCondition( const Config::ParameterContainer& parameters,
   const String& beginChoice = parameters.getParameter< String >( "begin" );
   std::cout << beginChoice << " " << dimensions << "   " << size << "   " << count << "   "<< 1/dimensions << std::endl;
   //getchar();
   if (beginChoice == "sin_square")
   /*if (beginChoice == "step")
   {
	   double constantFunction;
	   if (dimensions == 1)
	   {
                  std::cout << "adding DOFS" << std::endl;
		   ( *dofs )[0] = 0;
		   double expValue;
		   for (IndexType i = 1; i < count-2; i++)
         for( IndexType i = 0; i < count; i++)
         {
			expValue = std::exp(-std::pow(size*i-2,2));
			if( (i>0.4*count) && (i<0.5*count))
                            constantFunction=1;
            if( i > 0.45*count  && i<0.55*count )
               dofs->setElement( i, 1.0 );
            else
                            constantFunction=0;
			if(expValue>constantFunction)
                           ( *dofs )[i] = expValue;
                        else ( *dofs )[i] = constantFunction;
		   };
		   ( *dofs )[count-1] = 0;
               dofs->setElement( i, 0.0 );
         }
		}
      else if (dimensions == 2)
	       {
@@ -164,7 +155,7 @@ setInitialCondition( const Config::ParameterContainer& parameters,
			   ( *dofs )[i * count + j] = std::exp(-std::pow(size*i-2,2)-std::pow(size*j-2,2));
		      };
		};
     };
     };*/
   //setting velocity field
   //std::cout << *dofs << std::endl;
   //getchar();
+1 −2
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ struct ConfigEntryBase

   virtual void printEnumValues() const {};

   // TODO: Fix this -- uncommenting leads to SIGSEGV (for example in tnl-init)
   //virtual ~ConfigEntryBase() {};
   virtual ~ConfigEntryBase() {};
};

} // namespace Config
+4 −4
Original line number Diff line number Diff line
@@ -687,8 +687,8 @@ tnlParallelMapSolver<2,SchemeHost, SchemeDevice, Device, double, int>::runSubgri
	{
		if(u[0]*u[i] <= 0.0)
			tmp=true;
		int centreGID = (this->n*(subGridID / this->gridRows)+ (this->n >> 1))*(this->n*this->gridCols) + this->n*(subGridID % this->gridRows) + (this->n >> 1);
		if(this->unusedCell[centreGID] == 0 || boundaryCondition == 0)
		int centerGID = (this->n*(subGridID / this->gridRows)+ (this->n >> 1))*(this->n*this->gridCols) + this->n*(subGridID % this->gridRows) + (this->n >> 1);
		if(this->unusedCell[centerGID] == 0 || boundaryCondition == 0)
			tmp = true;
	}

@@ -876,8 +876,8 @@ void tnlParallelMapSolver<2,SchemeHost, SchemeDevice, Device, double, int>::runS
	if(l == 0)
	{
		tmp = 0;
		int centreGID = (blockDim.y*blockIdx.y + (blockDim.y>>1))*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1);
		if(this->unusedCell_cuda[centreGID] == 0 || boundaryCondition == 0)
		int centerGID = (blockDim.y*blockIdx.y + (blockDim.y>>1))*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1);
		if(this->unusedCell_cuda[centerGID] == 0 || boundaryCondition == 0)
			tmp = 1;
	}
	__syncthreads();
+4 −4
Original line number Diff line number Diff line
@@ -884,8 +884,8 @@ tnlParallelEikonalSolver<2,SchemeHost, SchemeDevice, Device, double, int>::runSu
	{
		if(u[0]*u[i] <= 0.0)
			tmp=true;
		int centreGID = (this->n*(subGridID / this->gridRows)+ (this->n >> 1))*(this->n*this->gridCols) + this->n*(subGridID % this->gridRows) + (this->n >> 1);
		if(this->unusedCell[centreGID] == 0 || boundaryCondition == 0)
		int centerGID = (this->n*(subGridID / this->gridRows)+ (this->n >> 1))*(this->n*this->gridCols) + this->n*(subGridID % this->gridRows) + (this->n >> 1);
		if(this->unusedCell[centerGID] == 0 || boundaryCondition == 0)
			tmp = true;
	}
	//if(this->currentStep + 3 < getSubgridValue(subGridID))
@@ -1129,8 +1129,8 @@ void tnlParallelEikonalSolver<2,SchemeHost, SchemeDevice, Device, double, int>::
	if(l == 0)
	{
		tmp = 0;
		int centreGID = (blockDim.y*blockIdx.y + (blockDim.y>>1))*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1);
		if(this->unusedCell_cuda[centreGID] == 0 || boundaryCondition == 0)
		int centerGID = (blockDim.y*blockIdx.y + (blockDim.y>>1))*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1);
		if(this->unusedCell_cuda[centerGID] == 0 || boundaryCondition == 0)
			tmp = 1;
	}
	__syncthreads();
+4 −4
Original line number Diff line number Diff line
@@ -860,9 +860,9 @@ tnlParallelEikonalSolver<3,SchemeHost, SchemeDevice, Device, double, int>::runSu
	idz = subGridID / (this->gridRows*this->gridCols);
	idy = (subGridID % (this->gridRows*this->gridCols)) / this->gridCols;
	idx = subGridID %  (this->gridCols);
	int centreGID = (this->n*idy + (this->n>>1) )*(this->n*this->gridCols) + this->n*idx + (this->n>>1)
	int centerGID = (this->n*idy + (this->n>>1) )*(this->n*this->gridCols) + this->n*idx + (this->n>>1)
			      + ((this->n>>1)+this->n*idz)*this->n*this->n*this->gridRows*this->gridCols;
	if(this->unusedCell[centreGID] == 0 || boundaryCondition == 0)
	if(this->unusedCell[centerGID] == 0 || boundaryCondition == 0)
		tmp = true;
	//if(this->currentStep + 3 < getSubgridValue(subGridID))
		//tmp = true;
@@ -1115,9 +1115,9 @@ void tnlParallelEikonalSolver<3,SchemeHost, SchemeDevice, Device, double, int>::
	if(l == 0)
	{
		tmp = 0;
		int centreGID = (blockDim.y*blockIdx.y + (blockDim.y>>1) )*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1)
		int centerGID = (blockDim.y*blockIdx.y + (blockDim.y>>1) )*(blockDim.x*gridDim.x) + blockDim.x*blockIdx.x + (blockDim.x>>1)
				      + ((blockDim.z>>1)+blockDim.z*blockIdx.z)*blockDim.x*blockDim.y*gridDim.x*gridDim.y;
		if(this->unusedCell_cuda[centreGID] == 0 || boundaryCondition == 0)
		if(this->unusedCell_cuda[centerGID] == 0 || boundaryCondition == 0)
			tmp = 1;
	}
	__syncthreads();
Loading