Newer
Older
/***************************************************************************
tnlTraversal_Grid2D_impl.h - description
-------------------
begin : Jul 29, 2014
copyright : (C) 2014 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. *
* *
***************************************************************************/
#ifndef TNLTRAVERSAL_GRID2D_IMPL_H_
#define TNLTRAVERSAL_GRID2D_IMPL_H_
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlHost, Index >, 2 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitiesProcessor ) const
{
/****
* Traversing cells
*/
CoordinatesType coordinates;
const IndexType& xSize = grid.getDimensions().x();
const IndexType& ySize = grid.getDimensions().y();
#ifdef HAVE_OPENMP
//#pragma omp parallel for
#endif
for( coordinates.y() = 0; coordinates.y() < ySize; coordinates.y() ++ )
for( coordinates.x() = 0; coordinates.x() < xSize; coordinates.x() ++ )
{
const IndexType index = grid.getCellIndex( coordinates );
if( grid.isBoundaryCell( coordinates ) )
boundaryEntitiesProcessor.template processCell( grid, userData, index, coordinates );
interiorEntitiesProcessor.template processCell( grid, userData, index, coordinates );
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
}
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlHost, Index >, 1 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitesProcessor ) const
{
/****
* Traversing faces
*/
}
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlHost, Index >, 0 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitesProcessor ) const
{
/****
* Traversing vertices
*/
}
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlCuda, Index >, 2 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitesProcessor ) const
{
/****
* Traversing cells
*/
}
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlCuda, Index >, 1 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitesProcessor ) const
{
/****
* Traversing faces
*/
}
template< typename Real,
typename Index >
template< typename UserData,
typename BoundaryEntitiesProcessor,
typename InteriorEntitiesProcessor >
void
tnlTraversal< tnlGrid< 2, Real, tnlCuda, Index >, 0 >::
processEntities( const GridType& grid,
UserData& userData,
BoundaryEntitiesProcessor& boundaryEntitiesProcessor,
InteriorEntitiesProcessor& interiorEntitesProcessor ) const
{
/****
*/
}
#endif /* TNLTRAVERSAL_GRID2D_IMPL_H_ */