Commit 61f660d3 authored by Tomas Sobotik's avatar Tomas Sobotik
Browse files

Merging parallel solver

parent 1c9157d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ add_subdirectory( heat-equation )
add_subdirectory( navier-stokes )
#add_subdirectory( mean-curvature-flow )
#add_subdirectory( hamilton-jacobi )
#add_subdirectory( hamilton-jacobi-parallel )
add_subdirectory( hamilton-jacobi-parallel )
add_subdirectory( fast-sweeping )
+1 −1
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@ add_subdirectory( navier-stokes )
#add_subdirectory( mean-curvature-flow )
#add_subdirectory( hamilton-jacobi )
#add_subdirectory( hamilton-jacobi-parallel )
#add_subdirectory( fast-sweeping )
add_subdirectory( fast-sweeping )
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#ifndef MAINBUILDCONFIG_H_
#define MAINBUILDCONFIG_H_

#include <solvers/tnlConfigTags.h>
#include <solvers/tnlBuildConfigTags.h>

class MainBuildConfig
{
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#include "tnlParallelEikonalSolver.h"
#include "parallelEikonalConfig.h"
#include "MainBuildConfig.h"
#include <solvers/tnlConfigTags.h>
#include <solvers/tnlBuildConfigTags.h>
#include <operators/godunov-eikonal/parallelGodunovEikonal.h>
#include <mesh/tnlGrid.h>
#include <core/tnlDevice.h>
+36 −3
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@
#include <config/tnlParameterContainer.h>
#include <core/vectors/tnlVector.h>
#include <core/vectors/tnlStaticVector.h>
#include <functions/tnlMeshFunction.h>
#include <core/tnlHost.h>
#include <mesh/tnlGrid.h>
#include <mesh/grids/tnlGridEntity.h>
#include <limits.h>
#include <core/tnlDevice.h>

@@ -91,9 +93,13 @@ public:
	VectorType runSubgrid( int boundaryCondition, VectorType u, int subGridID);


	VectorType u0, work_u;
	tnlMeshFunction<MeshType> u0;
	VectorType work_u;
	IntVectorType subgridValues, boundaryConditions, unusedCell, calculationsCount;
	MeshType mesh, subMesh;

//	tnlGridEntity< MeshType, 2, tnlGridEntityNoStencilStorage > Entity;

	SchemeHost schemeHost;
	SchemeDevice schemeDevice;
	double delta, tau0, stopTime,cflCondition;
@@ -214,7 +220,8 @@ public:
		VectorType runSubgrid( int boundaryCondition, VectorType u, int subGridID);


		VectorType u0, work_u;
		tnlMeshFunction<MeshType> u0;
		VectorType work_u;
		IntVectorType subgridValues, boundaryConditions, unusedCell, calculationsCount;
		MeshType mesh, subMesh;
		SchemeHost schemeHost;
@@ -326,6 +333,32 @@ template <typename SchemeHost, typename SchemeDevice, typename Device>
__global__ void synchronize2CUDA3D(tnlParallelEikonalSolver<3, SchemeHost, SchemeDevice, Device, double, int >* cudaSolver);
#endif

#include "tnlParallelEikonalSolver2D_impl.h"

__device__
double fabsMin( double x, double y)
{
	double fx = abs(x);

	if(Min(fx,abs(y)) == fx)
		return x;
	else
		return y;
}

__device__
double atomicFabsMin(double* address, double val)
{
	unsigned long long int* address_as_ull =
						  (unsigned long long int*)address;
	unsigned long long int old = *address_as_ull, assumed;
	do {
		assumed = old;
			old = atomicCAS(address_as_ull, assumed,__double_as_longlong( fabsMin(__longlong_as_double(assumed),val) ));
	} while (assumed != old);
	return __longlong_as_double(old);
}


#include "tnlParallelEikonalSolver2D_impl.h"
#include "tnlParallelEikonalSolver3D_impl.h"
#endif /* TNLPARALLELEIKONALSOLVER_H_ */
Loading