Corrected handling of loop macros and removed those for PtrList.

This commit is contained in:
henry 2009-06-23 20:43:51 +01:00
parent 03dc15545c
commit 0bb012d0c2
7 changed files with 12 additions and 112 deletions

View File

@ -31,8 +31,6 @@ Description
#ifndef ListLoop_H
#define ListLoop_H
#include "undefListLoopM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef vectorMachine
@ -48,8 +46,11 @@ Description
#define List_ELEM(f, fp, i) (fp[i])
#define List_ACCESS(type, f, fp) type* __restrict__ fp = (f).begin()
#define List_CONST_ACCESS(type, f, fp) const type* __restrict__ fp = (f).begin()
#define List_ACCESS(type, f, fp) \
type* const __restrict__ fp = (f).begin()
#define List_CONST_ACCESS(type, f, fp) \
const type* const __restrict__ fp = (f).begin()
#else
@ -64,8 +65,11 @@ Description
#define List_ELEM(f, fp, i) (*fp++)
#define List_ACCESS(type, f, fp) register type* __restrict__ fp = (f).begin()
#define List_CONST_ACCESS(type, f, fp) register const type* __restrict__ fp = (f).begin()
#define List_ACCESS(type, f, fp) \
register type* __restrict__ fp = (f).begin()
#define List_CONST_ACCESS(type, f, fp) \
register const type* __restrict__ fp = (f).begin()
#endif

View File

@ -1,46 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
A List\<Type\> is a 1D array of objects of type 'Type',
where the size of the array is known and used for subscript
bounds checking, etc.
\*---------------------------------------------------------------------------*/
#ifdef List_FOR_ALL
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef List_FOR_ALL
#undef List_END_FOR_ALL
#undef List_ELEM
#undef List_ACCESS
#undef List_CONST_ACCESS
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,7 +27,6 @@ License
#include "error.H"
#include "PtrList.H"
#include "PtrListLoopM.H"
#include "SLPtrList.H"
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //

View File

@ -1,56 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
simple generic PtrList MACROS for looping
\*---------------------------------------------------------------------------*/
#ifndef PtrListLoop_H
#define PtrListLoop_H
#include "undefListLoopM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Element access looping using [] for vector and parallel machines
#define List_FOR_ALL(f, i) \
forAll(f, i) \
{ \
#define List_END_FOR_ALL }
#define List_ELEM(f, fp, i) ((f)[i])
#define List_ACCESS(type, f, fp)
#define List_CONST_ACCESS(type, f, fp)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,7 +27,6 @@ License
#include "error.H"
#include "UPtrList.H"
#include "PtrListLoopM.H"
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //

View File

@ -50,7 +50,7 @@ void transform
{
TFOR_ALL_F_OP_FUNC_F_F
(
Type, rtf, =, transform, tensor, trf, Type, tf
Type, rtf, =, transform, symmTensor, trf, Type, tf
)
}
}

View File

@ -1,4 +1,4 @@
c++DBUG =
c++DBUG =
c++OPT = -O3
#c++OPT = -march=nocona -O3
# -ftree-vectorize -ftree-vectorizer-verbose=3