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

Refactoring the mesh.

parent a173ee63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
#include <mesh/initializer/tnlMeshEntitySeed.h>
#include <mesh/initializer/tnlMeshEntitySeedKey.h>

template< typename MeshConfig >
class tnlMesh;

template< typename MeshConfig,
          typename DimensionsTag,
          bool EntityStorage = 
+4 −4
Original line number Diff line number Diff line
@@ -23,15 +23,15 @@
#include <mesh/traits/tnlMeshEntityTraits.h>
#include <mesh/traits/tnlMeshTraits.h>

template< typename MeshConfig >
class tnlMesh;
//template< typename MeshConfig >
//class tnlMesh;

template< typename DimensionsTag,
/*template< typename DimensionsTag,
          typename Device,
          typename MeshConfig,
          typename EntityStorageTag = typename tnlMeshEntityTraits< MeshConfig,
                                                                      DimensionsTag::value >::EntityStorageTag >
class tnlMeshStorageTag;
class tnlMeshStorageTag;*/

template< typename MeshConfig,
          typename DimensionsTag,
+10 −22
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
                          tnlMesh.h  -  description
                             -------------------
    begin                : Feb 16, 2014
    copyright            : (C) 2014 by Tomas Oberhuber
    copyright            : (C) 2014 by Tomas Oberhuber et al.
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

@@ -25,7 +25,8 @@
#include <mesh/config/tnlMeshConfigValidator.h>
#include <mesh/initializer/tnlMeshInitializer.h>

template< typename MeshConfig >
template< typename MeshConfig > //,
          //typename Device = tnlHost >
class tnlMesh : public tnlObject,
                public tnlMeshStorageLayers< MeshConfig >
{
@@ -34,12 +35,9 @@ class tnlMesh : public tnlObject,
   typedef tnlMeshTraits< MeshConfig >                       MeshTraits;
   typedef typename tnlMeshTraits< MeshConfig >::PointType   PointType;
   static const int dimensions = MeshTraits::meshDimensions;
   template< typename Dimensions > using EntityTraits = typename MeshTraits::template EntityTraits< Dimensions::value >;
   template< int Dimensions > using EntityTraits = typename MeshTraits::template EntityTraits< Dimensions >;

   static tnlString getType()
   {
      return tnlString( "tnlMesh< ") + MeshConfig::getType() + " >";
   }
   static tnlString getType();
   
   virtual tnlString getTypeVirtual() const
   {
@@ -71,19 +69,7 @@ class tnlMesh : public tnlObject,
      return true;
   }

   /*template< int Dimensions >
   struct EntitiesTraits
   {
      typedef tnlDimensionsTag< Dimensions >                       DimensionsTag;
      typedef tnlMeshEntityTraits< MeshConfig, DimensionsTag >    MeshEntitiesTraits;
      typedef typename MeshEntitiesTraits::EntityType                       Type;
      typedef typename MeshEntitiesTraits::ContainerType              ContainerType;
      typedef typename MeshEntitiesTraits::SharedContainerType        SharedContainerType;
      typedef typename ContainerType::IndexType                       GlobalIndexType;
      typedef typename ContainerType::ElementType                     EntityType;
      static const bool available = MeshConfig::entityStorage( Dimensions );
   };
   typedef EntitiesTraits< dimensions > CellTraits;*/
   static const int getDimensions();
   
   template< int Dimensions >
   bool entitiesAvalable() const
@@ -183,4 +169,6 @@ class tnlMesh : public tnlObject,
};


#include <mesh/tnlMesh_impl.h>

#endif /* TNLMESH_H_ */
+2 −2
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ class tnlMeshWriterVTKLegacy
                          MeshType& mesh,
                          bool verbose )
   {
      typedef typename MeshType::MeshTraits::CellEntity CellEntityType;
      typedef typename MeshType::MeshTraits::CellType CellType;
      file << "# vtk DataFile Version 2.0" << endl;
      file << "TNL Mesh" << endl;
      file << "ASCII" << endl;
@@ -122,7 +122,7 @@ class tnlMeshWriterVTKLegacy
      file << "CELL_TYPES " <<  mesh.template getNumberOfCells() << endl;      
      for( int i = 0; i < mesh.template getNumberOfCells(); i++ )      
      {
         file << tnlMeshEntityVTKType< CellEntityType >::VTKType << endl;
         file << tnlMeshEntityVTKType< CellType >::VTKType << endl;
      }
      file << endl;
      return true;
+35 −0
Original line number Diff line number Diff line
/***************************************************************************
                          tnlMesh_impl.h  -  description
                             -------------------
    begin                : Sep 5, 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 TNLMESH_IMPL_H
#define	TNLMESH_IMPL_H

#include "tnlMesh.h"


template< typename MeshConfig >
tnlString
tnlMesh< MeshConfig >::
getType()
{
   return tnlString( "tnlMesh< ") + MeshConfig::getType() + " >";
}


#endif	/* TNLMESH_IMPL_H */
Loading