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

Implementing the mesh initializer.

parent afa64d76
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class tnlStaticFor
{
   public:

   static void Exec()
   static void exec()
   {
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
@@ -125,7 +125,7 @@ class tnlStaticFor
   }

   template< typename T >
   static void Exec( T &p )
   static void exec( T &p )
   {
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
@@ -135,7 +135,7 @@ class tnlStaticFor

   template< typename T0,
             typename T1 >
   static void Exec( T0& p0, T1& p1 )
   static void exec( T0& p0, T1& p1 )
   {
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
@@ -146,7 +146,7 @@ class tnlStaticFor
   template< typename T0,
             typename T1,
             typename T2 >
   static void Exec( T0& p0, T1& p1, T2& p2 )
   static void exec( T0& p0, T1& p1, T2& p2 )
   {
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
@@ -158,7 +158,7 @@ class tnlStaticFor
             typename T1,
             typename T2,
             typename T3 >
   static void Exec( T0& p0, T1& p1, T2& p2, T3& p3 )
   static void exec( T0& p0, T1& p1, T2& p2, T3& p3 )
   {
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
+21 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ class tnlMeshStorageLayer< ConfigTag,
   using BaseType::getNumberOfEntities;
   using BaseType::setEntity;
   using BaseType::getEntity;
   using BaseType::getEntities;

   bool setNumberOfEntities( DimensionsTraits, const GlobalIndexType size )
   {
@@ -96,6 +97,16 @@ class tnlMeshStorageLayer< ConfigTag,
      return this->entities[ entityIndex ];
   }

   ContainerType& getEntities( DimensionsTraits )
   {
      return this->entities;
   }

   const ContainerType& getEntities( DimensionsTraits ) const
   {
      return this->entities;
   }

   bool save( tnlFile& file ) const
   {
      if( ! BaseType::save( file ) ||
@@ -216,6 +227,16 @@ class tnlMeshStorageLayer< ConfigTag,
      return this->vertices.getElement( entityIndex );
   }

   ContainerType& getEntities( DimensionsTraits )
   {
      return this->vertices;
   }

   const ContainerType& getEntities( DimensionsTraits ) const
   {
      return this->vertices;
   }

   bool save( tnlFile& file ) const
   {
      if( ! vertices.save( file ) )
+29 −7
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ class tnlMeshSubentityStorageLayer< ConfigTag,
    */
   using BaseType::getSubentityIndex;
   using BaseType::setSubentityIndex;
   using BaseType::getSubentitiesIndecis;

   /****
    * Define setter/getter for the current level of the subentities
@@ -113,8 +114,19 @@ class tnlMeshSubentityStorageLayer< ConfigTag,
      return this->subentitiesIndecis[ localIndex ];
   }

   ContainerType& getSubentitiesIndecis( DimensionsTraits )
   {
      return this->subentitiesIndecis;
   }

   const ContainerType& getSubentitiesIndecis( DimensionsTraits ) const
   {
      return this->subentitiesIndecis;
   }

   private:
   ContainerType subentitiesIndecis;

};


@@ -167,23 +179,33 @@ class tnlMeshSubentityStorageLayer< ConfigTag,

   void print( ostream& str ) const
   {
      str << "\t Subentities with " << DimensionsTraits::value << " dimensions are: " << this->subentityVertices << ".";
      str << "\t Subentities with " << DimensionsTraits::value << " dimensions are: " << this->verticesIndecis << ".";
   }

   GlobalIndexType getSubentityIndex( DimensionsTraits,
                                      const LocalIndexType localIndex ) const
   {
      return this->subentityVertices[ localIndex ];
      return this->verticesIndecis[ localIndex ];
   }
   void setSubentityIndex( DimensionsTraits,
                           const LocalIndexType localIndex,
                           const GlobalIndexType globalIndex )
   {
      this->subentityVertices[ localIndex ] = globalIndex;
      this->verticesIndecis[ localIndex ] = globalIndex;
   }

   ContainerType& getSubentitiesIndecis( DimensionsTraits )
   {
      return this->verticesIndecis;
   }

   const ContainerType& getSubentitiesIndecis( DimensionsTraits ) const
   {
      return this->verticesIndecis;
   }

   private:
   ContainerType subentityVertices;
   ContainerType verticesIndecis;
};

template< typename ConfigTag,
+23 −4
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ class tnlMeshSuperentityStorageLayer< ConfigTag,
    using BaseType::getNumberOfSuperentities;
    using BaseType::getSuperentityIndex;
    using BaseType::setSuperentityIndex;
    using BaseType::getSuperentitiesIndecis;


    /****
     * Define setter/getter for the current level of the superentities
@@ -122,6 +124,16 @@ class tnlMeshSuperentityStorageLayer< ConfigTag,
       return this->superentitiesIndices[ localIndex ];
    }

    ContainerType& getSuperentitiesIndecis()
    {
       return this->superentitiesIndecis;
    }

    const ContainerType& getSuperentitiesIndecis() const
    {
       return this->superentitiesIndecis;
    }

    private:
    ContainerType superentitiesIndices;
};
@@ -171,9 +183,12 @@ class tnlMeshSuperentityStorageLayer< ConfigTag,
   void setSuperentityIndex( DimensionsTraits,
                             const LocalIndexType localIndex,
                             const GlobalIndexType globalIndex ) {}
   void print( ostream& str ) const
   {};

   void print( ostream& str ) const{}

   ContainerType& getSuperentitiesIndecis(){}

   const ContainerType& getSuperentitiesIndecis() const{}
};

template< typename ConfigTag,
@@ -207,8 +222,12 @@ class tnlMeshSuperentityStorageLayer< ConfigTag,
                             const LocalIndexType localIndex,
                             const GlobalIndexType globalIndex ) {}

   void print( ostream& str ) const
   {};
   void print( ostream& str ) const{}

   ContainerType& getSuperentitiesIndecis(){}

   const ContainerType& getSuperentitiesIndecis() const{}


};

+12 −0
Original line number Diff line number Diff line
@@ -127,6 +127,18 @@ class tnlMesh : public tnlObject,
      BaseType::setEntity( tnlDimensionsTraits< Dimensions >(), entityIndex, entity );
   }

   template< int Dimensions >
   typename EntitiesTraits< Dimensions >::ContainerType& getEntities()
   {
      return BaseType::getEntities( tnlDimensionsTraits< Dimensions >() );
   }

   template< int Dimensions >
   const typename EntitiesTraits< Dimensions >::ContainerType& getEntities() const
   {
      return BaseType::getEntities( tnlDimensionsTraits< Dimensions >() );
   }

   typename EntitiesTraits< dimensions >::EntityType&
      getCell( const typename EntitiesTraits< dimensions >::GlobalIndexType entityIndex )
   {
Loading