Skip to content
Snippets Groups Projects
Commit 6222ba20 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding sparse Ellpack graph.

parent 8cf8b912
No related branches found
No related tags found
No related merge requests found
Showing with 1678 additions and 147 deletions
...@@ -3,6 +3,7 @@ ADD_SUBDIRECTORY( functors ) ...@@ -3,6 +3,7 @@ ADD_SUBDIRECTORY( functors )
ADD_SUBDIRECTORY( config ) ADD_SUBDIRECTORY( config )
ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( core )
ADD_SUBDIRECTORY( debug ) ADD_SUBDIRECTORY( debug )
ADD_SUBDIRECTORY( graphs )
ADD_SUBDIRECTORY( matrices ) ADD_SUBDIRECTORY( matrices )
ADD_SUBDIRECTORY( mesh ) ADD_SUBDIRECTORY( mesh )
ADD_SUBDIRECTORY( operators ) ADD_SUBDIRECTORY( operators )
......
SET( headers tnlEllpackGraph.h
tnlEllpackGraph_impl.h
tnlEllpackGraphLinksAccessor.h
tnlEllpackGraphLinksAccessor_impl.h )
SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/graphs )
set( common_SOURCES
)
IF( BUILD_CUDA )
set( tnl_graphs_CUDA__SOURCES
${common_SOURCES}
PARENT_SCOPE )
ENDIF()
set( tnl_graphs_SOURCES
${common_SOURCES}
PARENT_SCOPE )
INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/graphs )
\ No newline at end of file
/***************************************************************************
tnlEllpackGraph.h - description
-------------------
begin : Sep 9, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLELLPACKGRAPH_H
#define TNLELLPACKGRAPH_H
#include <graphs/sparse/tnlEllpackGraphLinksAccessor.h>
template< typename Device = tnlHost,
typename Index = int >
class tnlEllpackGraphConstLinksAccessor;
template< typename Device = tnlHost,
typename Index = int >
class tnlEllpackGraph
{
public:
typedef Device DeviceType;
typedef Index IndexType;
typedef tnlEllpackGraphLinksAccessor< DeviceType, IndexType > LinksAccessorType;
typedef tnlEllpackGraphConstLinksAccessor< DeviceType, IndexType > ConstLinksAccessorType;
typedef tnlVector< IndexType, DeviceType, IndexType > LinksPerNodesVectorType;
tnlEllpackGraph();
void setNumberOfNodes( const IndexType nodes );
void setNumberOfLinksPerNode( const LinksPerNodesVectorType& linksPerNode );
LinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex );
ConstLinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex ) const;
protected:
tnlVector< IndexType, DeviceType, IndexType > links;
IndexType maxLinksPerNode, numberOfNodes;
};
#endif /* TNLELLPACKGRAPH_H */
/***************************************************************************
tnlEllpackGraph.h - description
-------------------
begin : Sep 10, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLELLPACKGRAPHLINKSACCESSOR_H
#define TNLELLPACKGRAPHLINKSACCESSOR_H
template< typename Device,
typename Index >
class tnlEllpackGraphLinksAccessor
{
public:
typedef Device DeviceType;
typedef Index IndexType;
typedef tnlEllpackGraph< DeviceType, IndexType > GraphType;
void setLink( const IndexType linkIndex,
const IndexType targetNode );
IndexType getLinkTarget( const IndexType linkIndex ) const;
IndexType& operator[]( const IndexType linkIndex );
const IndexType& operator[]( const IndexType linkIndex ) const;
protected:
tnlEllpackGraphLinksAccessor( IndexType* graphLinks,
const IndexType node,
const maxLinksPerNode );
IndexType* links;
IndexType step, maxLinksPerNode;
friend tnlEllpackGraph< IndexType, DeviceType >;
};
#include <graphs/sparse/tnlEllpackGraphLinksAccessor_impl.h>
#endif /* TNLELLPACKGRAPHLINKSACCESSOR_H */
/***************************************************************************
tnlEllpackGraph_impl.h - description
-------------------
begin : Sep 10, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H
#define TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H
template< typename Device,
typename Index >
tnlEllpackGraphLinksAccessor< Device, Index >::
tnlEllpackGraphLinksAccessor( IndexType* graphLinks,
const IndexType node,
const IndexType maxLinksPerNode )
{
this->links = &graphLinks[ node * maxLinksPerNode ];
this->maxLinksPerNode = maxLinksPerNode;
}
template< typename Device,
typename Index >
void
tnlEllpackGraphLinksAccessor< Device, Index >::
setLink( const IndexType linkIndex,
const IndexType targetNode )
{
links[ linkIndex ] = targetNode;
}
template< typename Device,
typename Index >
Index
tnlEllpackGraphLinksAccessor< Device, Index >::
getLinkTarget( const IndexType linkIndex ) const
{
return links[ linkIndex ];
}
template< typename Device,
typename Index >
Index&
tnlEllpackGraphLinksAccessor< Device, Index >::
operator[]( const IndexType linkIndex )
{
return links[ linkIndex ];
}
template< typename Device,
typename Index >
const Index&
tnlEllpackGraphLinksAccessor< Device, Index >::
operator[]( const IndexType linkIndex ) const
{
return links[ linkIndex ];
}
#endif /* TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H */
/***************************************************************************
tnlEllpackGraph_impl.h - description
-------------------
begin : Sep 9, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLELLPACKGRAPH_IMPL_H
#define TNLELLPACKGRAPH_IMPL_H
#include "tnlEllpackGraph.h"
template< typename Device,
typename Index >
tnlEllpackGraph< Device, Index >::
tnlEllpackGraph()
: maxLinksPerNode( 0 ), numberOfNodes( 0 )
{
}
template< typename Device,
typename Index >
void
tnlEllpackGraph< Device, Index >::
setNumberOfNodes( const IndexType nodes )
{
this->numberOfNodes = nodes;
}
template< typename Device,
typename Index >
void
tnlEllpackGraph< Device, Index >::
setNumberOfLinksPerNode( const LinksPerNodesVectorType& linksPerNode )
{
tnlAssert( linksPerNode.getSize() == this->numberOfNodes,
cerr << "linksPerNode.getSize() = " << linksPerNode.getSize()
<< "this->numberOfNodes = " << this->numberOfNodes );
this->maxLinksPerNode = linksPerNode.max();
tnlAssert( this->maxLinksPerNode >= 0,
cerr << "this->maxLinksPerNode = " << this->maxLinksPerNode );
}
template< typename Device,
typename Index >
typename tnlEllpackGraph< Device, Index >::LinksAccessorType
tnlEllpackGraph< Device, Index >::
getNodeLinksAccessor( const IndexType& nodeIndex )
{
return LinksAccessorType( this->links.getData(), nodeIndex, this->maxLinksPerNode );
}
template< typename Device,
typename Index >
typename tnlEllpackGraph< Device, Index >::ConstLinksAccessorType
tnlEllpackGraph< Device, Index >::
getNodeLinksAccessor( const IndexType& nodeIndex ) const
{
return ConstLinksAccessorType( this->links.getData(), nodeIndex, this->maxLinksPerNode );
}
#endif /* TNLELLPACKGRAPH_IMPL_H */
...@@ -51,105 +51,107 @@ class tnlMeshInitializer ...@@ -51,105 +51,107 @@ class tnlMeshInitializer
: public tnlMeshInitializerLayer< MeshConfig, : public tnlMeshInitializerLayer< MeshConfig,
typename tnlMeshTraits< MeshConfig >::DimensionsTag > typename tnlMeshTraits< MeshConfig >::DimensionsTag >
{ {
typedef tnlMesh< MeshConfig > MeshType; public:
typedef tnlMeshInitializerLayer< MeshConfig,
typename tnlMeshTraits< MeshConfig >::DimensionsTag > BaseType; typedef tnlMesh< MeshConfig > MeshType;
typedef tnlMeshTraits< MeshConfig > MeshTraits;
static const int Dimensions = MeshTraits::meshDimensions;
typedef tnlDimensionsTag< Dimensions > DimensionsTag;
typedef tnlMeshInitializerLayer< MeshConfig, DimensionsTag > BaseType;
typedef typename MeshTraits::PointArrayType PointArrayType;
typedef typename MeshTraits::CellSeedArrayType CellSeedArrayType;
typedef typename MeshTraits::GlobalIndexType GlobalIndexType;
public: tnlMeshInitializer()
: verbose( false ), mesh( 0 )
{}
tnlMeshInitializer() void setVerbose( bool verbose )
: verbose( false ), mesh( 0 ) {
{} this->verbose = verbose;
}
void setVerbose( bool verbose ) bool createMesh( const PointArrayType& points,
{ const CellSeedArrayType& cellSeeds,
this->verbose = verbose; MeshType& mesh )
} {
cout << "======= Starting mesh initiation ========" << endl;
this->mesh = &mesh;
cout << "========= Creating entity seeds =============" << endl;
BaseType::createEntitySeedsFromCellSeeds( cellSeeds );
cout << "========= Creating entity reference orientations =============" << endl;
BaseType::createEntityReferenceOrientations();
cout << "====== Initiating entities ==============" << endl;
BaseType::initEntities( *this, points, cellSeeds );
return true;
}
template<typename SubDimensionsTag, typename EntityType >
static typename MeshTraits::template SubentityTraits< typename EntityType::EntityTopology, SubDimensionsTag::value >::IdArrayType&
subentityIdsArray( EntityType& entity )
{
return entity.template subentityIdsArray< SubDimensionsTag::value >();
}
template< typename SuperDimensionsTag, typename MeshEntity>
static typename MeshTraits::IdArrayAccessorType&
superentityIdsArray( MeshEntity& entity )
{
return entity.template superentityIdsArray< SuperDimensionsTag::value >();
}
template<typename SubDimensionsTag, typename MeshEntity >
static typename MeshTraits::template SubentityTraits< typename MeshEntity::EntityTopology, SubDimensionsTag::value >::OrientationArrayType&
subentityOrientationsArray( MeshEntity &entity )
{
return entity.template subentityOrientationsArray< SubDimensionsTag::value >();
}
template< typename DimensionsTag >
typename MeshTraits::template EntityTraits< DimensionsTag::value >::StorageArrayType&
meshEntitiesArray()
{
return mesh->template entitiesArray< DimensionsTag >();
}
template< typename DimensionsTag, typename SuperDimensionsTag >
typename MeshTraits::GlobalIdArrayType&
meshSuperentityIdsArray()
{
return mesh->template superentityIdsArray< DimensionsTag, SuperDimensionsTag >();
}
static void
setVertexPoint( typename MeshType::VertexType& vertex, const typename MeshType::PointType& point )
{
vertex.setPoint( point );
}
template< typename DimensionsTag >
tnlMeshSuperentityStorageInitializer< MeshConfig, typename MeshTraits::template EntityTraits< DimensionsTag::value >::EntityTopology >&
getSuperentityInitializer()
{
return BaseType::getSuperentityInitializer( DimensionsTag() );
}
typedef typename tnlMeshTraits< MeshConfig >::PointArrayType PointArrayType;
typedef typename tnlMeshTraits< MeshConfig >::CellSeedArrayType CellSeedArrayType;
bool createMesh( const PointArrayType& points,
const CellSeedArrayType& cellSeeds,
MeshType& mesh )
{
cout << "======= Starting mesh initiation ========" << endl;
this->mesh = &mesh;
cout << "========= Creating entity seeds =============" << endl;
BaseType::createEntitySeedsFromCellSeeds( cellSeeds );
cout << "========= Creating entity reference orientations =============" << endl;
BaseType::createEntityReferenceOrientations();
cout << "====== Initiating entities ==============" << endl;
BaseType::initEntities( *this, points, cellSeeds );
return true; template< typename DimensionsTag >
} const tnlMeshEntityReferenceOrientation< MeshConfig, typename MeshTraits::template EntityTraits< DimensionsTag::value >::EntityTopology >&
getReferenceOrientation( GlobalIndexType index) const
template<typename SubDimensionsTag, typename EntityType > {
static typename tnlMeshTraits< MeshConfig >::template SubentityTraits< typename EntityType::EntityTopology, SubDimensionsTag::value >::IdArrayType& return BaseType::getReferenceOrientation( DimensionsTag(), index);
subentityIdsArray( EntityType& entity ) }
{
return entity.template subentityIdsArray< SubDimensionsTag::value >();
}
template< typename SuperDimensionsTag, typename MeshEntity>
static typename tnlMeshTraits< MeshConfig >::IdArrayAccessorType&
superentityIdsArray( MeshEntity& entity )
{
return entity.template superentityIdsArray< SuperDimensionsTag::value >();
}
template<typename SubDimensionsTag, typename MeshEntity >
static typename tnlMeshTraits< MeshConfig >::template SubentityTraits< typename MeshEntity::EntityTopology, SubDimensionsTag::value >::OrientationArrayType&
subentityOrientationsArray( MeshEntity &entity )
{
return entity.template subentityOrientationsArray< SubDimensionsTag::value >();
}
template< typename DimensionsTag >
typename tnlMeshTraits< MeshConfig >::template EntityTraits< DimensionsTag::value >::StorageArrayType&
meshEntitiesArray()
{
return mesh->template entitiesArray< DimensionsTag >();
}
template< typename DimensionsTag, typename SuperDimensionsTag >
typename tnlMeshTraits< MeshConfig >::GlobalIdArrayType&
meshSuperentityIdsArray()
{
return mesh->template superentityIdsArray< DimensionsTag, SuperDimensionsTag >();
}
static void
setVertexPoint( typename MeshType::VertexType& vertex, const typename MeshType::PointType& point )
{
vertex.setPoint( point );
}
template< typename DimensionsTag >
tnlMeshSuperentityStorageInitializer< MeshConfig, typename tnlMeshTraits< MeshConfig >::template EntityTraits< DimensionsTag::value >::EntityTopology >&
getSuperentityInitializer()
{
return BaseType::getSuperentityInitializer( DimensionsTag() );
}
typedef typename tnlMeshTraits< MeshConfig >::GlobalIndexType GlobalIndexType;
template< typename DimensionsTag >
const tnlMeshEntityReferenceOrientation< MeshConfig, typename tnlMeshTraits< MeshConfig >::template EntityTraits< DimensionsTag::value >::EntityTopology >&
getReferenceOrientation( GlobalIndexType index) const
{
return BaseType::getReferenceOrientation( DimensionsTag(), index);
}
protected: protected:
bool verbose; bool verbose;
MeshType* mesh; MeshType* mesh;
}; };
/**** /****
...@@ -165,36 +167,29 @@ class tnlMeshInitializerLayer< MeshConfig, ...@@ -165,36 +167,29 @@ class tnlMeshInitializerLayer< MeshConfig,
: public tnlMeshInitializerLayer< MeshConfig, : public tnlMeshInitializerLayer< MeshConfig,
typename tnlMeshTraits< MeshConfig >::DimensionsTag::Decrement > typename tnlMeshTraits< MeshConfig >::DimensionsTag::Decrement >
{ {
typedef typename tnlMeshTraits< MeshConfig >::DimensionsTag DimensionsTag; typedef tnlMeshTraits< MeshConfig > MeshTraits;
static const int Dimensions = MeshTraits::meshDimensions;
typedef tnlMeshInitializerLayer< MeshConfig, typedef tnlDimensionsTag< Dimensions > DimensionsTag;
typename DimensionsTag::Decrement > BaseType; typedef tnlMeshInitializerLayer< MeshConfig, typename DimensionsTag::Decrement > BaseType;
typedef tnlMesh< MeshConfig > MeshType; typedef tnlMesh< MeshConfig > MeshType;
typedef typename MeshType::MeshTraits MeshTraits; typedef typename MeshTraits::template EntityTraits< Dimensions > EntityTraits;
typedef typename MeshType::template EntityTraits< DimensionsTag::value > EntityTraits; typedef typename EntityTraits::EntityTopology EntityTopology;
typedef typename EntityTraits::EntityTopology EntityTopology; typedef typename MeshTraits::GlobalIndexType GlobalIndexType;
typedef typename EntityTraits::StorageArrayType ContainerType; typedef typename MeshTraits::CellTopology CellTopology;
typedef typename ContainerType::IndexType GlobalIndexType; typedef typename EntityTraits::StorageArrayType StorageArrayType;
typedef typename MeshTraits::CellTopology CellTopology;
typedef typename EntityTraits::StorageArrayType EntityArrayType; typedef tnlMeshInitializer< MeshConfig > InitializerType;
typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > EntityInitializerType;
typedef tnlMeshInitializer< MeshConfig > InitializerType; typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > CellInitializerType;
typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > EntityInitializerType; typedef tnlArray< CellInitializerType, tnlHost, GlobalIndexType > CellInitializerContainerType;
typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > CellInitializerType; typedef typename MeshTraits::CellSeedArrayType CellSeedArrayType;
typedef tnlArray< CellInitializerType, tnlHost, GlobalIndexType > CellInitializerContainerType; typedef typename MeshTraits::LocalIndexType LocalIndexType;
typedef typename MeshTraits::CellSeedArrayType CellSeedArrayType; typedef typename MeshTraits::PointArrayType PointArrayType;
typedef typename MeshTraits::LocalIndexType LocalIndexType; typedef tnlMeshEntitySeed< MeshConfig, CellTopology > SeedType;
typedef typename MeshTraits::PointArrayType PointArrayType; typedef tnlMeshSuperentityStorageInitializer< MeshConfig, EntityTopology > SuperentityInitializerType;
typedef tnlMeshEntitySeed< MeshConfig, CellTopology > SeedType;
typedef tnlMeshSuperentityStorageInitializer< MeshConfig, EntityTopology > SuperentityInitializerType;
public: public:
using BaseType::getEntityInitializer;
CellInitializerType& getEntityInitializer( DimensionsTag, GlobalIndexType index )
{
//return cellInitializerContainer[ index ];
}
void createEntitySeedsFromCellSeeds( const CellSeedArrayType& cellSeeds ) void createEntitySeedsFromCellSeeds( const CellSeedArrayType& cellSeeds )
{ {
...@@ -203,7 +198,7 @@ class tnlMeshInitializerLayer< MeshConfig, ...@@ -203,7 +198,7 @@ class tnlMeshInitializerLayer< MeshConfig,
void initEntities( InitializerType &initializer, const PointArrayType &points, const CellSeedArrayType &cellSeeds) void initEntities( InitializerType &initializer, const PointArrayType &points, const CellSeedArrayType &cellSeeds)
{ {
EntityArrayType &entityArray = initializer.template meshEntitiesArray< DimensionsTag >(); StorageArrayType &entityArray = initializer.template meshEntitiesArray< DimensionsTag >();
//cout << " Initiating entities with " << DimensionsTag::value << " dimensions ... " << endl; //cout << " Initiating entities with " << DimensionsTag::value << " dimensions ... " << endl;
entityArray.setSize( cellSeeds.getSize() ); entityArray.setSize( cellSeeds.getSize() );
for( GlobalIndexType i = 0; i < entityArray.getSize(); i++ ) for( GlobalIndexType i = 0; i < entityArray.getSize(); i++ )
...@@ -279,34 +274,33 @@ class tnlMeshInitializerLayer< MeshConfig, ...@@ -279,34 +274,33 @@ class tnlMeshInitializerLayer< MeshConfig,
: public tnlMeshInitializerLayer< MeshConfig, : public tnlMeshInitializerLayer< MeshConfig,
typename DimensionsTag::Decrement > typename DimensionsTag::Decrement >
{ {
typedef tnlMeshInitializerLayer< MeshConfig, typedef tnlMeshTraits< MeshConfig > MeshTraits;
typename DimensionsTag::Decrement > BaseType; static const int Dimensions = DimensionsTag::value;
typedef tnlMeshInitializerLayer< MeshConfig, typename DimensionsTag::Decrement > BaseType;
typedef tnlMesh< MeshConfig > MeshType;
typedef typename MeshType::MeshTraits MeshTraits; typedef tnlMesh< MeshConfig > MeshType;
typedef typename MeshType::template EntityTraits< DimensionsTag::value > EntityTraits; typedef typename MeshTraits::template EntityTraits< Dimensions > EntityTraits;
typedef typename EntityTraits::EntityTopology EntityTopology; typedef typename EntityTraits::EntityTopology EntityTopology;
typedef typename EntityTraits::StorageArrayType ContainerType; typedef typename MeshTraits::GlobalIndexType GlobalIndexType;
typedef typename ContainerType::IndexType GlobalIndexType; typedef typename MeshTraits::CellTopology CellTopology;
typedef typename MeshTraits::CellTopology CellTopology; typedef typename EntityTraits::StorageArrayType StorageArrayType;
typedef typename EntityTraits::StorageArrayType EntityArrayType;
typedef tnlMeshInitializer< MeshConfig > InitializerType;
typedef tnlMeshInitializer< MeshConfig > InitializerType; typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > EntityInitializerType;
typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > EntityInitializerType; typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > CellInitializerType;
typedef tnlMeshEntityInitializer< MeshConfig, EntityTopology > CellInitializerType; typedef tnlArray< CellInitializerType, tnlHost, GlobalIndexType > CellInitializerContainerType;
typedef tnlArray< CellInitializerType, tnlHost, GlobalIndexType > CellInitializerContainerType; typedef typename EntityTraits::SeedArrayType EntitySeedArrayType;
typedef typename EntityTraits::SeedArrayType EntitySeedArrayType; typedef typename MeshTraits::CellSeedArrayType CellSeedArrayType;
typedef typename MeshTraits::CellSeedArrayType CellSeedArrayType; typedef typename MeshTraits::LocalIndexType LocalIndexType;
typedef typename MeshTraits::LocalIndexType LocalIndexType; typedef typename MeshTraits::PointArrayType PointArrayType;
typedef typename MeshTraits::PointArrayType PointArrayType; typedef tnlMeshEntitySeed< MeshConfig, EntityTopology > SeedType;
typedef tnlMeshEntitySeed< MeshConfig, EntityTopology > SeedType; typedef tnlMeshSuperentityStorageInitializer< MeshConfig, EntityTopology > SuperentityInitializerType;
typedef tnlMeshSuperentityStorageInitializer< MeshConfig, EntityTopology > SuperentityInitializerType;
typedef typename typedef typename
tnlMeshSubentityTraits< MeshConfig, tnlMeshSubentityTraits< MeshConfig,
typename MeshConfig::CellTopology, typename MeshConfig::CellTopology,
DimensionsTag::value >::SubentityContainerType SubentitiesContainerType; DimensionsTag::value >::SubentityContainerType SubentitiesContainerType;
public: public:
using BaseType::getEntityInitializer; using BaseType::getEntityInitializer;
...@@ -350,7 +344,7 @@ class tnlMeshInitializerLayer< MeshConfig, ...@@ -350,7 +344,7 @@ class tnlMeshInitializerLayer< MeshConfig,
void initEntities( InitializerType& initializer, const PointArrayType& points ) void initEntities( InitializerType& initializer, const PointArrayType& points )
{ {
EntityArrayType &entityArray = initializer.template meshEntitiesArray< DimensionsTag >(); StorageArrayType &entityArray = initializer.template meshEntitiesArray< DimensionsTag >();
//cout << " Initiating entities with " << DimensionsTag::value << " dimensions ... " << endl; //cout << " Initiating entities with " << DimensionsTag::value << " dimensions ... " << endl;
entityArray.setSize( this->seedsIndexedSet.getSize() ); entityArray.setSize( this->seedsIndexedSet.getSize() );
EntitySeedArrayType seedsArray; EntitySeedArrayType seedsArray;
......
...@@ -186,7 +186,6 @@ class tnlMeshEntity< MeshConfig, tnlMeshVertexTopology > ...@@ -186,7 +186,6 @@ class tnlMeshEntity< MeshConfig, tnlMeshVertexTopology >
constexpr int getEntityDimensions() const; constexpr int getEntityDimensions() const;
template< int Superdimensions > LocalIndexType getNumberOfSuperentities() const; template< int Superdimensions > LocalIndexType getNumberOfSuperentities() const;
template< int Superdimensions > template< int Superdimensions >
......
...@@ -38,9 +38,7 @@ class tnlMeshTraits ...@@ -38,9 +38,7 @@ class tnlMeshTraits
public: public:
static const int meshDimensions = MeshConfig::CellTopology::dimensions; static const int meshDimensions = MeshConfig::CellTopology::dimensions;
static const int worldDimensions = MeshConfig::worldDimensions; static const int worldDimensions = MeshConfig::worldDimensions;
typedef tnlDimensionsTag< meshDimensions > DimensionsTag;
typedef Device DeviceType; typedef Device DeviceType;
typedef typename MeshConfig::GlobalIndexType GlobalIndexType; typedef typename MeshConfig::GlobalIndexType GlobalIndexType;
...@@ -66,6 +64,8 @@ class tnlMeshTraits ...@@ -66,6 +64,8 @@ class tnlMeshTraits
template< typename EntityTopology, int SuperDimensions > using SuperentityTraits = template< typename EntityTopology, int SuperDimensions > using SuperentityTraits =
tnlMeshSuperentityTraits< MeshConfig, EntityTopology, SuperDimensions >; tnlMeshSuperentityTraits< MeshConfig, EntityTopology, SuperDimensions >;
typedef tnlDimensionsTag< meshDimensions > DimensionsTag;
}; };
......
ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( core )
ADD_SUBDIRECTORY( graphs )
ADD_SUBDIRECTORY( matrices ) ADD_SUBDIRECTORY( matrices )
ADD_SUBDIRECTORY( mesh ) ADD_SUBDIRECTORY( mesh )
ADD_SUBDIRECTORY( operators ) ADD_SUBDIRECTORY( operators )
......
ADD_SUBDIRECTORY( sparse )
\ No newline at end of file
/***************************************************************************
tnlEllpackGraphTest.cpp - description
-------------------
begin : Sep 10, 2015
copyright : (C) 2015 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <tnlConfig.h>
#include <core/tnlHost.h>
#include <cstdlib>
#include "graphs/tnlEllpackGraph.h"
#include "../tnlUnitTestStarter.h"
int main( int argc, char* argv[] )
{
#ifdef HAVE_CPPUNIT
if( ! tnlUnitTestStarter :: run< tnlSparseMatrixTester< tnlEllpackMatrix< float, tnlHost, int > > >() ||
! tnlUnitTestStarter :: run< tnlSparseMatrixTester< tnlEllpackMatrix< double, tnlHost, int > > >() ||
! tnlUnitTestStarter :: run< tnlSparseMatrixTester< tnlEllpackMatrix< float, tnlHost, long int > > >() ||
! tnlUnitTestStarter :: run< tnlSparseMatrixTester< tnlEllpackMatrix< double, tnlHost, long int > > >()
)
return EXIT_FAILURE;
return EXIT_SUCCESS;
#else
return EXIT_FAILURE;
#endif
}
/***************************************************************************
tnlEllpackGraphTester.h - description
-------------------
begin : Sep 10, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLELLPACKGRAPHTESTER_H
#define TNLELLPACKGRAPHTESTER_H
#endif /* TNLELLPACKGRAPHTESTER_H */
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment