Types.h 1.79 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//======================================================================================================================
//
//  This file is part of waLBerla. waLBerla 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 3 of 
//  the License, or (at your option) any later version.
//  
//  waLBerla is distributed in the hope that it will be useful, but WITHOUT 
//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
//  for more details.
//  
//  You should have received a copy of the GNU General Public License along
//  with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
Jean-Noël Grad's avatar
Jean-Noël Grad committed
16
//! \file Types.h
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! \ingroup blockforest
//! \author Florian Schornbaum <florian.schornbaum@fau.de>
//
//======================================================================================================================

#pragma once

#include "core/DataTypes.h"

#include <limits>


namespace walberla {
namespace blockforest {



// data structure specific types

36
37
using workload_t = real_t;
using memory_t = real_t;
38

39
40
WALBERLA_STATIC_ASSERT( sizeof( workload_t ) == 4 || sizeof( workload_t ) == 8 );
WALBERLA_STATIC_ASSERT( sizeof( memory_t   ) == 4 || sizeof( memory_t   ) == 8 );
41
42
43
44
45
46
47
48
49
50
51
52
53
54

template< typename T > inline workload_t workload_c( T t ) { return numeric_cast< workload_t >(t); } ///< cast to type workload_t using "workload_c(x)"
template< typename T > inline memory_t   memory_c  ( T t ) { return numeric_cast< memory_t >(t); }   ///< cast to type memory_t   using "memory_c(x)"



} // namespace blockforest

using blockforest::workload_t;
using blockforest::memory_t;

} // namespace walberla