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

Refactoring the grids.

parent ffb39863
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
TODO:
 - zavest namespaces

TODO: CUDA unified memory
 - pretizit operator new s cudaMallocManaged, pak by bylo mozne vytvaret CUDA objekty pristupne pro host a device
 - v TNL solveru by pak vlastne jen stacilo vytvaret objekty pomoci new
 - zrejme bude nutne pretizit i delete
 - pokud jde o MeshDependentData, stacilo by, aby uzivatel pretizil operator new a delete. Pokud by to neudelal, mohlo by 
se s nimi pracovat postaru
 - bylo by dobre to obalit unique poinetry, aby se nemusela delat dealokace rucne

TODO: shared pointery
 - mohli bysme pomoci nich odstranit Shared objekty
 - asi by bylo lepsi datcounter z shared pointeru primo do array a tento counter by se alokoval az po porvnim sdileni dat
 - diky tomu by se array mohlo vytvaret i na gpu bez nutnosti dynamicke alokace, jen by nebylo mozne delat bind (nebo nejaky zjednoduseny)

TODO: Mesh
 * vsechny traits zkusit presunout do jednotneho MeshTraits, tj. temer MeshConfigTraits ale pojmenovat jako MeshTraits
 * omezit tnlDimesnionsTag - asi to ale nepujde
+4 −4
Original line number Diff line number Diff line
@@ -57,16 +57,16 @@ class heatEquationSetter
   typedef Device DeviceType;
   typedef Index IndexType;

   typedef tnlStaticVector< MeshType::Dimensions, Real > Vertex;
   typedef tnlStaticVector< MeshType::meshDimensions, Real > Vertex;

   static bool run( const tnlParameterContainer& parameters )
   {
      enum { Dimensions = MeshType::Dimensions };
      enum { Dimensions = MeshType::meshDimensions };
      typedef tnlLinearDiffusion< MeshType, Real, Index > ApproximateOperator;
      typedef tnlExactLinearDiffusion< Dimensions > ExactOperator;
      typedef tnlTestFunction< MeshType::Dimensions, Real, Device > TestFunction;
      typedef tnlTestFunction< MeshType::meshDimensions, Real, Device > TestFunction;
      typedef tnlHeatEquationEocRhs< ExactOperator, TestFunction > RightHandSide;
      typedef tnlStaticVector < MeshType::Dimensions, Real > Vertex;
      typedef tnlStaticVector < MeshType::meshDimensions, Real > Vertex;
      typedef tnlAnalyticDirichletBoundaryConditions< MeshType, TestFunction, Real, Index > BoundaryConditions;
      typedef tnlHeatEquationEocProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Solver;
      SolverStarter solverStarter;
+3 −3
Original line number Diff line number Diff line
@@ -64,14 +64,14 @@ class heatEquationSetter
   typedef Device DeviceType;
   typedef Index IndexType;

   typedef tnlStaticVector< MeshType::Dimensions, Real > Vertex;
   typedef tnlStaticVector< MeshType::meshDimensions, Real > Vertex;

   static bool run( const tnlParameterContainer& parameters )
   {
      enum { Dimensions = MeshType::Dimensions };
      enum { Dimensions = MeshType::meshDimensions };
      typedef tnlLinearDiffusion< MeshType, Real, Index > ApproximateOperator;
      typedef tnlConstantFunction< Dimensions, Real > RightHandSide;
      typedef tnlStaticVector < MeshType::Dimensions, Real > Vertex;
      typedef tnlStaticVector < MeshType::meshDimensions, Real > Vertex;

      tnlString boundaryConditionsType = parameters.getParameter< tnlString >( "boundary-conditions-type" );
      if( parameters.checkParameter( "boundary-conditions-constant" ) )
+4 −4
Original line number Diff line number Diff line
@@ -61,13 +61,13 @@ class tnlArray : public virtual tnlObject

   __cuda_callable__ Index getSize() const;

   void setElement( const Index i, const Element& x );
   void setElement( const Index& i, const Element& x );

   Element getElement( Index i ) const;
   Element getElement( const Index& i ) const;

   __cuda_callable__ inline Element& operator[] ( Index i );
   __cuda_callable__ inline Element& operator[] ( const Index& i );

   __cuda_callable__ inline const Element& operator[] ( Index i ) const;
   __cuda_callable__ inline const Element& operator[] ( const Index& i ) const;

   tnlArray< Element, Device, Index >& operator = ( const tnlArray< Element, Device, Index >& array );

+4 −4
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ Index tnlArray< Element, Device, Index > :: getSize() const
template< typename Element,
           typename Device,
           typename Index >
void tnlArray< Element, Device, Index > :: setElement( const Index i, const Element& x )
void tnlArray< Element, Device, Index > :: setElement( const Index& i, const Element& x )
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for setElement method in tnlArray "
@@ -153,7 +153,7 @@ void tnlArray< Element, Device, Index > :: setElement( const Index i, const Elem
template< typename Element,
           typename Device,
           typename Index >
Element tnlArray< Element, Device, Index > :: getElement( Index i ) const
Element tnlArray< Element, Device, Index > :: getElement( const Index& i ) const
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for getElement method in tnlArray "
@@ -166,7 +166,7 @@ template< typename Element,
          typename Device,
          typename Index >
__cuda_callable__
inline Element& tnlArray< Element, Device, Index > :: operator[] ( Index i )
inline Element& tnlArray< Element, Device, Index > :: operator[] ( const Index& i )
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for operator[] in tnlArray "
@@ -179,7 +179,7 @@ template< typename Element,
           typename Device,
           typename Index >
__cuda_callable__
inline const Element& tnlArray< Element, Device, Index > :: operator[] ( Index i ) const
inline const Element& tnlArray< Element, Device, Index > :: operator[] ( const Index& i ) const
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for operator[] in tnlArray "
Loading