mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
2
Allwmake
2
Allwmake
@ -6,7 +6,7 @@ set -x
|
|||||||
( cd wmake/src && make )
|
( cd wmake/src && make )
|
||||||
|
|
||||||
# build ThirdParty sources
|
# build ThirdParty sources
|
||||||
( cd $WM_THIRD_PARTY_DIR && ./Allwmake )
|
( cd $WM_THIRD_PARTY_DIR && AllwmakeThirdParty )
|
||||||
|
|
||||||
src/Allwmake
|
src/Allwmake
|
||||||
applications/Allwmake
|
applications/Allwmake
|
||||||
|
|||||||
@ -28,8 +28,11 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "argList.H"
|
||||||
#include "uLabel.H"
|
#include "uLabel.H"
|
||||||
|
#include "IOobject.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
|
#include "IFstream.H"
|
||||||
#include "PackedBoolList.H"
|
#include "PackedBoolList.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
@ -39,309 +42,54 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Info<< "PackedList max_bits() = " << PackedList<>::max_bits() << nl;
|
argList::noParallel();
|
||||||
|
argList::validArgs.insert("file .. fileN");
|
||||||
|
|
||||||
Info<< "\ntest allocation with value\n";
|
argList::validOptions.insert("count", "");
|
||||||
PackedList<3> list1(5,1);
|
argList::validOptions.insert("info", "");
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign uniform value\n";
|
argList args(argc, argv, false, true);
|
||||||
list1 = 3;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign uniform value (with overflow)\n";
|
if (args.additionalArgs().empty())
|
||||||
list1 = -1;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest zero\n";
|
|
||||||
list1 = 0;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest set() with default argument (max_value)\n";
|
|
||||||
list1.set(3);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign between references\n";
|
|
||||||
list1[2] = 3;
|
|
||||||
list1[4] = list1[2];
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign between references, with chaining\n";
|
|
||||||
list1[0] = list1[4] = 1;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign between references, with chaining and auto-vivify\n";
|
|
||||||
list1[1] = list1[8] = list1[10] = list1[14] = 2;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "\ntest operator== between references\n";
|
|
||||||
if (list1[1] == list1[8])
|
|
||||||
{
|
{
|
||||||
Info<< "[1] == [8] (expected)\n";
|
args.printUsage();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "[1] != [8] (unexpected)\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list1[0] != list1[1])
|
forAll(args.additionalArgs(), argI)
|
||||||
{
|
{
|
||||||
Info<< "[0] != [1] (expected)\n";
|
const string& srcFile = args.additionalArgs()[argI];
|
||||||
|
Info<< nl << "reading " << srcFile << nl;
|
||||||
|
|
||||||
|
IFstream ifs(srcFile);
|
||||||
|
List<label> rawLst(ifs);
|
||||||
|
PackedBoolList packLst(rawLst);
|
||||||
|
|
||||||
|
Info<< "size: " << packLst.size() << nl;
|
||||||
|
|
||||||
|
if (args.optionFound("count"))
|
||||||
|
{
|
||||||
|
unsigned int rawCount = 0;
|
||||||
|
forAll(rawLst, elemI)
|
||||||
|
{
|
||||||
|
if (rawLst[elemI])
|
||||||
|
{
|
||||||
|
rawCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Info<< "raw count: " << rawCount << nl
|
||||||
|
<< "packed count: " << packLst.count() << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.optionFound("info"))
|
||||||
|
{
|
||||||
|
packLst.print(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< nl;
|
||||||
|
IOobject::writeDivider(Info);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "[0] == [1] (unexpected)\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "\ntest operator== with iterator\n";
|
|
||||||
{
|
|
||||||
PackedList<3>::iterator iter = list1[1];
|
|
||||||
|
|
||||||
if (iter != list1[8])
|
|
||||||
{
|
|
||||||
Info<< "iter != [8] (expected)\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "iter == [8] (unexpected)\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*iter != list1[8])
|
|
||||||
{
|
|
||||||
Info<< "*iter != [8] (unexpected)\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "*iter == [8] (expected)\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
const PackedList<3>& constLst = list1;
|
|
||||||
Info<< "\ntest operator[] const with out-of-range index\n";
|
|
||||||
constLst.print(Info);
|
|
||||||
if (constLst[20])
|
|
||||||
{
|
|
||||||
Info<< "[20] is true (unexpected)\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
|
|
||||||
}
|
|
||||||
constLst.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest operator[] non-const with out-of-range index\n";
|
|
||||||
if (list1[20])
|
|
||||||
{
|
|
||||||
Info<< "[20] is true (unexpected)\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "[20] is false (expected) but list was resized?? (non-const)\n";
|
|
||||||
}
|
|
||||||
list1.print(Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "\ntest operator[] with out-of-range index\n";
|
|
||||||
if (!list1[20])
|
|
||||||
{
|
|
||||||
Info<< "[20] is false, as expected\n";
|
|
||||||
}
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest resize with value (without reallocation)\n";
|
|
||||||
list1.resize(8, list1.max_value());
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest flip() function\n";
|
|
||||||
list1.flip();
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\nre-flip()\n";
|
|
||||||
list1.flip();
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest set() function\n";
|
|
||||||
list1.set(1, 5);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign bool\n";
|
|
||||||
list1 = false;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest assign bool\n";
|
|
||||||
list1 = true;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest resize without value (with reallocation)\n";
|
|
||||||
list1.resize(12);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest resize with value (with reallocation)\n";
|
|
||||||
list1.resize(25, list1.max_value());
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest resize smaller (should not touch allocation)\n";
|
|
||||||
list1.resize(8);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest append() operation\n";
|
|
||||||
list1.append(2);
|
|
||||||
list1.append(3);
|
|
||||||
list1.append(4);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest reserve() operation\n";
|
|
||||||
list1.reserve(32);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest shrink() operation\n";
|
|
||||||
list1.shrink();
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest setCapacity() operation\n";
|
|
||||||
list1.setCapacity(15);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest setCapacity() operation\n";
|
|
||||||
list1.setCapacity(100);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest operator[] assignment\n";
|
|
||||||
list1[16] = 5;
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest operator[] assignment with auto-vivify\n";
|
|
||||||
list1[36] = list1.max_value();
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest setCapacity smaller\n";
|
|
||||||
list1.setCapacity(24);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest resize much smaller\n";
|
|
||||||
list1.resize(150);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest trim\n";
|
|
||||||
list1.trim();
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
// add in some misc values
|
|
||||||
list1[31] = 1;
|
|
||||||
list1[32] = 2;
|
|
||||||
list1[33] = 3;
|
|
||||||
|
|
||||||
Info<< "\ntest iterator\n";
|
|
||||||
PackedList<3>::iterator iter = list1.begin();
|
|
||||||
Info<< "begin():";
|
|
||||||
iter.print(Info) << "\n";
|
|
||||||
|
|
||||||
Info<< "iterator:" << iter() << "\n";
|
|
||||||
iter() = 5;
|
|
||||||
iter.print(Info);
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
iter = list1[31];
|
|
||||||
Info<< "iterator:" << iter() << "\n";
|
|
||||||
iter.print(Info);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "\ntest get() method\n";
|
|
||||||
Info<< "get(10):" << list1.get(10) << " and list[10]:" << list1[10] << "\n";
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest iterator indexing\n";
|
|
||||||
Info<< "cend() ";
|
|
||||||
list1.cend().print(Info) << "\n";
|
|
||||||
|
|
||||||
{
|
|
||||||
Info<< "\ntest assignment of iterator\n";
|
|
||||||
list1.print(Info);
|
|
||||||
Info<< "cend()\n";
|
|
||||||
list1.end().print(Info);
|
|
||||||
PackedList<3>::iterator cit = list1[100];
|
|
||||||
Info<< "out-of-range: ";
|
|
||||||
cit.print(Info);
|
|
||||||
cit = list1[15];
|
|
||||||
Info<< "in-range: ";
|
|
||||||
cit.print(Info);
|
|
||||||
Info<< "out-of-range: ";
|
|
||||||
cit = list1[1000];
|
|
||||||
cit.print(Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for
|
|
||||||
(
|
|
||||||
PackedList<3>::iterator cit = list1[30];
|
|
||||||
cit != list1.end();
|
|
||||||
++cit
|
|
||||||
)
|
|
||||||
{
|
|
||||||
cit.print(Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "\ntest operator[] auto-vivify\n";
|
|
||||||
Info<< "size:" << list1.size() << "\n";
|
|
||||||
|
|
||||||
const unsigned int val = list1[45];
|
|
||||||
|
|
||||||
Info<< "list[45]:" << val << "\n";
|
|
||||||
Info<< "size after read:" << list1.size() << "\n";
|
|
||||||
|
|
||||||
list1[45] = list1.max_value();
|
|
||||||
Info<< "size after write:" << list1.size() << "\n";
|
|
||||||
Info<< "list[45]:" << list1[45] << "\n";
|
|
||||||
list1[49] = list1[100];
|
|
||||||
list1.print(Info);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "\ntest copy constructor + append\n";
|
|
||||||
PackedList<3> list2(list1);
|
|
||||||
list2.append(4);
|
|
||||||
Info<< "source list:\n";
|
|
||||||
list1.print(Info);
|
|
||||||
Info<< "destination list:\n";
|
|
||||||
list2.print(Info);
|
|
||||||
|
|
||||||
Info<< "\ntest pattern that fills all bits\n";
|
|
||||||
PackedList<4> list3(8, 8);
|
|
||||||
|
|
||||||
label pos = list3.size() - 1;
|
|
||||||
|
|
||||||
list3[pos--] = list3.max_value();
|
|
||||||
list3[pos--] = 0;
|
|
||||||
list3[pos--] = list3.max_value();
|
|
||||||
list3.print(Info);
|
|
||||||
|
|
||||||
Info<< "removed final value: " << list3.remove() << endl;
|
|
||||||
list3.print(Info);
|
|
||||||
|
|
||||||
|
|
||||||
List<bool> list4(4, true);
|
|
||||||
{
|
|
||||||
const List<bool>& constLst = list4;
|
|
||||||
Info<< "\ntest operator[] const with out-of-range index\n";
|
|
||||||
Info<< constLst << endl;
|
|
||||||
if (constLst[20])
|
|
||||||
{
|
|
||||||
Info<< "[20] is true (unexpected)\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
|
|
||||||
}
|
|
||||||
Info<< constLst << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "\n\nDone.\n";
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
3
applications/test/PackedList1/Make/files
Normal file
3
applications/test/PackedList1/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PackedListTest1.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/PackedListTest1
|
||||||
0
applications/test/PackedList1/Make/options
Normal file
0
applications/test/PackedList1/Make/options
Normal file
347
applications/test/PackedList1/PackedListTest1.C
Normal file
347
applications/test/PackedList1/PackedListTest1.C
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
|
||||||
|
Application
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "uLabel.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
#include "PackedBoolList.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
Info<< "PackedList max_bits() = " << PackedList<>::max_bits() << nl;
|
||||||
|
|
||||||
|
Info<< "\ntest allocation with value\n";
|
||||||
|
PackedList<3> list1(5,1);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign uniform value\n";
|
||||||
|
list1 = 3;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign uniform value (with overflow)\n";
|
||||||
|
list1 = -1;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest zero\n";
|
||||||
|
list1 = 0;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest set() with default argument (max_value)\n";
|
||||||
|
list1.set(3);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign between references\n";
|
||||||
|
list1[2] = 3;
|
||||||
|
list1[4] = list1[2];
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign between references, with chaining\n";
|
||||||
|
list1[0] = list1[4] = 1;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign between references, with chaining and auto-vivify\n";
|
||||||
|
list1[1] = list1[8] = list1[10] = list1[14] = 2;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "\ntest operator== between references\n";
|
||||||
|
if (list1[1] == list1[8])
|
||||||
|
{
|
||||||
|
Info<< "[1] == [8] (expected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "[1] != [8] (unexpected)\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (list1[0] != list1[1])
|
||||||
|
{
|
||||||
|
Info<< "[0] != [1] (expected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "[0] == [1] (unexpected)\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "\ntest operator== with iterator\n";
|
||||||
|
{
|
||||||
|
PackedList<3>::iterator iter = list1[1];
|
||||||
|
|
||||||
|
if (iter != list1[8])
|
||||||
|
{
|
||||||
|
Info<< "iter != [8] (expected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "iter == [8] (unexpected)\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*iter != list1[8])
|
||||||
|
{
|
||||||
|
Info<< "*iter != [8] (unexpected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "*iter == [8] (expected)\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
const PackedList<3>& constLst = list1;
|
||||||
|
Info<< "\ntest operator[] const with out-of-range index\n";
|
||||||
|
constLst.print(Info);
|
||||||
|
if (constLst[20])
|
||||||
|
{
|
||||||
|
Info<< "[20] is true (unexpected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
|
||||||
|
}
|
||||||
|
constLst.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest operator[] non-const with out-of-range index\n";
|
||||||
|
if (list1[20])
|
||||||
|
{
|
||||||
|
Info<< "[20] is true (unexpected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "[20] is false (expected) but list was resized?? (non-const)\n";
|
||||||
|
}
|
||||||
|
list1.print(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "\ntest operator[] with out-of-range index\n";
|
||||||
|
if (!list1[20])
|
||||||
|
{
|
||||||
|
Info<< "[20] is false, as expected\n";
|
||||||
|
}
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest resize with value (without reallocation)\n";
|
||||||
|
list1.resize(8, list1.max_value());
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest flip() function\n";
|
||||||
|
list1.flip();
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\nre-flip()\n";
|
||||||
|
list1.flip();
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest set() function\n";
|
||||||
|
list1.set(1, 5);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign bool\n";
|
||||||
|
list1 = false;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest assign bool\n";
|
||||||
|
list1 = true;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest resize without value (with reallocation)\n";
|
||||||
|
list1.resize(12);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest resize with value (with reallocation)\n";
|
||||||
|
list1.resize(25, list1.max_value());
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest resize smaller (should not touch allocation)\n";
|
||||||
|
list1.resize(8);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest append() operation\n";
|
||||||
|
list1.append(2);
|
||||||
|
list1.append(3);
|
||||||
|
list1.append(4);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest reserve() operation\n";
|
||||||
|
list1.reserve(32);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest shrink() operation\n";
|
||||||
|
list1.shrink();
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest setCapacity() operation\n";
|
||||||
|
list1.setCapacity(15);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest setCapacity() operation\n";
|
||||||
|
list1.setCapacity(100);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest operator[] assignment\n";
|
||||||
|
list1[16] = 5;
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest operator[] assignment with auto-vivify\n";
|
||||||
|
list1[36] = list1.max_value();
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest setCapacity smaller\n";
|
||||||
|
list1.setCapacity(24);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest resize much smaller\n";
|
||||||
|
list1.resize(150);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest trim\n";
|
||||||
|
list1.trim();
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
// add in some misc values
|
||||||
|
list1[31] = 1;
|
||||||
|
list1[32] = 2;
|
||||||
|
list1[33] = 3;
|
||||||
|
|
||||||
|
Info<< "\ntest iterator\n";
|
||||||
|
PackedList<3>::iterator iter = list1.begin();
|
||||||
|
Info<< "begin():";
|
||||||
|
iter.print(Info) << "\n";
|
||||||
|
|
||||||
|
Info<< "iterator:" << iter() << "\n";
|
||||||
|
iter() = 5;
|
||||||
|
iter.print(Info);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
iter = list1[31];
|
||||||
|
Info<< "iterator:" << iter() << "\n";
|
||||||
|
iter.print(Info);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "\ntest get() method\n";
|
||||||
|
Info<< "get(10):" << list1.get(10) << " and list[10]:" << list1[10] << "\n";
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest iterator indexing\n";
|
||||||
|
Info<< "cend() ";
|
||||||
|
list1.cend().print(Info) << "\n";
|
||||||
|
|
||||||
|
{
|
||||||
|
Info<< "\ntest assignment of iterator\n";
|
||||||
|
list1.print(Info);
|
||||||
|
Info<< "cend()\n";
|
||||||
|
list1.end().print(Info);
|
||||||
|
PackedList<3>::iterator cit = list1[100];
|
||||||
|
Info<< "out-of-range: ";
|
||||||
|
cit.print(Info);
|
||||||
|
cit = list1[15];
|
||||||
|
Info<< "in-range: ";
|
||||||
|
cit.print(Info);
|
||||||
|
Info<< "out-of-range: ";
|
||||||
|
cit = list1[1000];
|
||||||
|
cit.print(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for
|
||||||
|
(
|
||||||
|
PackedList<3>::iterator cit = list1[30];
|
||||||
|
cit != list1.end();
|
||||||
|
++cit
|
||||||
|
)
|
||||||
|
{
|
||||||
|
cit.print(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "\ntest operator[] auto-vivify\n";
|
||||||
|
Info<< "size:" << list1.size() << "\n";
|
||||||
|
|
||||||
|
const unsigned int val = list1[45];
|
||||||
|
|
||||||
|
Info<< "list[45]:" << val << "\n";
|
||||||
|
Info<< "size after read:" << list1.size() << "\n";
|
||||||
|
|
||||||
|
list1[45] = list1.max_value();
|
||||||
|
Info<< "size after write:" << list1.size() << "\n";
|
||||||
|
Info<< "list[45]:" << list1[45] << "\n";
|
||||||
|
list1[49] = list1[100];
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "\ntest copy constructor + append\n";
|
||||||
|
PackedList<3> list2(list1);
|
||||||
|
list2.append(4);
|
||||||
|
Info<< "source list:\n";
|
||||||
|
list1.print(Info);
|
||||||
|
Info<< "destination list:\n";
|
||||||
|
list2.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest pattern that fills all bits\n";
|
||||||
|
PackedList<4> list3(8, 8);
|
||||||
|
|
||||||
|
label pos = list3.size() - 1;
|
||||||
|
|
||||||
|
list3[pos--] = list3.max_value();
|
||||||
|
list3[pos--] = 0;
|
||||||
|
list3[pos--] = list3.max_value();
|
||||||
|
list3.print(Info);
|
||||||
|
|
||||||
|
Info<< "removed final value: " << list3.remove() << endl;
|
||||||
|
list3.print(Info);
|
||||||
|
|
||||||
|
|
||||||
|
List<bool> list4(4, true);
|
||||||
|
{
|
||||||
|
const List<bool>& constLst = list4;
|
||||||
|
Info<< "\ntest operator[] const with out-of-range index\n";
|
||||||
|
Info<< constLst << endl;
|
||||||
|
if (constLst[20])
|
||||||
|
{
|
||||||
|
Info<< "[20] is true (unexpected)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
|
||||||
|
}
|
||||||
|
Info<< constLst << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "\n\nDone.\n";
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -26,8 +26,8 @@ Description
|
|||||||
Makes internal faces into boundary faces. Does not duplicate points, unlike
|
Makes internal faces into boundary faces. Does not duplicate points, unlike
|
||||||
mergeOrSplitBaffles.
|
mergeOrSplitBaffles.
|
||||||
|
|
||||||
Note: if any coupled patch face is selected for baffling automatically
|
Note: if any coupled patch face is selected for baffling the opposite
|
||||||
the opposite member is selected for baffling as well. Note that this
|
member has to be selected for baffling as well. Note that this
|
||||||
is the same as repatching. This was added only for convenience so
|
is the same as repatching. This was added only for convenience so
|
||||||
you don't have to filter coupled boundary out of your set.
|
you don't have to filter coupled boundary out of your set.
|
||||||
|
|
||||||
@ -128,6 +128,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::validArgs.append("faceZone");
|
argList::validArgs.append("faceZone");
|
||||||
argList::validArgs.append("patch");
|
argList::validArgs.append("patch");
|
||||||
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
|
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
|
||||||
|
argList::validOptions.insert("internalFacesOnly", "");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
bool overwrite = args.optionFound("overwrite");
|
bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
|
bool internalFacesOnly = args.optionFound("internalFacesOnly");
|
||||||
|
|
||||||
|
if (internalFacesOnly)
|
||||||
|
{
|
||||||
|
Info<< "Not converting faces on non-coupled patches." << nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Read objects in time directory
|
// Read objects in time directory
|
||||||
@ -234,7 +241,21 @@ int main(int argc, char *argv[])
|
|||||||
// guarantees that when e.g. creating a cyclic all faces from one
|
// guarantees that when e.g. creating a cyclic all faces from one
|
||||||
// side come first and faces from the other side next.
|
// side come first and faces from the other side next.
|
||||||
|
|
||||||
|
// Whether first use of face (modify) or consecutive (add)
|
||||||
PackedBoolList modifiedFace(mesh.nFaces());
|
PackedBoolList modifiedFace(mesh.nFaces());
|
||||||
|
// Never modify coupled faces
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
if (pp.coupled())
|
||||||
|
{
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
modifiedFace[pp.start()+i] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label nModified = 0;
|
||||||
|
|
||||||
forAll(newPatches, i)
|
forAll(newPatches, i)
|
||||||
{
|
{
|
||||||
@ -281,6 +302,8 @@ int main(int argc, char *argv[])
|
|||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nModified++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,16 +356,27 @@ int main(int argc, char *argv[])
|
|||||||
// Modify any boundary faces
|
// Modify any boundary faces
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Normal boundary:
|
||||||
|
// - move to new patch. Might already be back-to-back baffle
|
||||||
|
// you want to add cyclic to. Do warn though.
|
||||||
|
//
|
||||||
|
// Processor boundary:
|
||||||
|
// - do not move to cyclic
|
||||||
|
// - add normal patches though.
|
||||||
|
|
||||||
|
// For warning once per patch.
|
||||||
|
labelHashSet patchWarned;
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
if (patches[newPatchI].coupled() && pp.coupled())
|
if (pp.coupled() && patches[newPatchI].coupled())
|
||||||
{
|
{
|
||||||
// Do not allow coupled faces to be moved to different coupled
|
// Do not allow coupled faces to be moved to different coupled
|
||||||
// patches.
|
// patches.
|
||||||
}
|
}
|
||||||
else
|
else if (pp.coupled() || !internalFacesOnly)
|
||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
@ -352,6 +386,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (zoneFaceI != -1)
|
if (zoneFaceI != -1)
|
||||||
{
|
{
|
||||||
|
if (patchWarned.insert(patchI))
|
||||||
|
{
|
||||||
|
WarningIn(args.executable())
|
||||||
|
<< "Found boundary face (in patch " << pp.name()
|
||||||
|
<< ") in faceZone " << fZone.name()
|
||||||
|
<< " to convert to baffle patch "
|
||||||
|
<< patches[newPatchI].name()
|
||||||
|
<< endl
|
||||||
|
<< " Run with -internalFacesOnly option"
|
||||||
|
<< " if you don't wish to convert"
|
||||||
|
<< " boundary faces." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
@ -364,6 +411,7 @@ int main(int argc, char *argv[])
|
|||||||
fZone.flipMap()[zoneFaceI], // face flip in zone
|
fZone.flipMap()[zoneFaceI], // face flip in zone
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
|
nModified++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -371,7 +419,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< "Converted " << returnReduce(modifiedFace.count(), sumOp<label>())
|
Info<< "Converted " << returnReduce(nModified, sumOp<label>())
|
||||||
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
|
|||||||
41
bin/AllcleanThirdParty
Executable file
41
bin/AllcleanThirdParty
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#---------------------------------*- sh -*-------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / 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
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# AllwcleanThirdParty
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Distribution clean script for ThirdParty
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
set -x
|
||||||
|
|
||||||
|
(cd gmp-4.2.4 && rm -rf build)
|
||||||
|
(cd mpfr-2.4.1 && rm -rf build)
|
||||||
|
(cd gcc-4.3.3 && rm -rf build)
|
||||||
|
(cd metis-5.0pre2 && make distclean)
|
||||||
|
(cd openmpi-1.3.3 && make distclean)
|
||||||
|
(cd paraview-3.6.1 && make distclean)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
64
bin/AllwmakeLibccmio
Executable file
64
bin/AllwmakeLibccmio
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | Copyright (C) 1991-2007 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
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# AllwmakeLibccmio
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Get and build CD-adapco's ccmio library
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
set -x
|
||||||
|
|
||||||
|
packageDir=libccmio-2.6.1
|
||||||
|
|
||||||
|
if [ ! -d ${packageDir} ]
|
||||||
|
then
|
||||||
|
if [ ! -e ${packageDir}.tar.gz ]
|
||||||
|
then
|
||||||
|
wget --no-check-certificate \
|
||||||
|
https://wci.llnl.gov/codes/visit/3rd_party/${packageDir}.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e ${packageDir}.tar.gz ]
|
||||||
|
then
|
||||||
|
tar -xzf ${packageDir}.tar.gz
|
||||||
|
else
|
||||||
|
echo "no ${packageDir}.tar.gz to unpack"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d ${packageDir} -a ! -d ${packageDir}/Make ]
|
||||||
|
then
|
||||||
|
cp -r wmakeFiles/libccmio/Make ${packageDir}/Make
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d ${packageDir}/Make ]
|
||||||
|
then
|
||||||
|
wmake libso ${packageDir}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
184
bin/AllwmakeThirdParty
Executable file
184
bin/AllwmakeThirdParty
Executable file
@ -0,0 +1,184 @@
|
|||||||
|
#---------------------------------*- sh -*-------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / 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
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# AllwmakeThirdParty
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Build script for ThirdParty
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# export WM settings in a form that GNU configure recognizes
|
||||||
|
[ -n "$WM_CC" ] && export CC="$WM_CC"
|
||||||
|
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||||
|
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
|
||||||
|
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
|
||||||
|
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
|
||||||
|
|
||||||
|
# wmake libso zlib-1.2.3
|
||||||
|
|
||||||
|
( cd malloc && ./Allwmake )
|
||||||
|
|
||||||
|
#
|
||||||
|
# compile specific mpi libraries
|
||||||
|
#
|
||||||
|
case "$WM_MPLIB" in
|
||||||
|
OPENMPI)
|
||||||
|
if [ -r $MPI_ARCH_PATH/lib/libmpi.so ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB shared library"
|
||||||
|
elif [ -r $MPI_ARCH_PATH/lib/libmpi.a ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB static library"
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd $MPI_HOME
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
rm -rf $MPI_ARCH_PATH
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=$MPI_ARCH_PATH \
|
||||||
|
--disable-mpirun-prefix-by-default \
|
||||||
|
--disable-orterun-prefix-by-default \
|
||||||
|
--enable-shared --disable-static \
|
||||||
|
--disable-mpi-f77 --disable-mpi-f90 --disable-mpi-cxx \
|
||||||
|
--disable-mpi-profile
|
||||||
|
# These lines enable Infiniband support
|
||||||
|
# --with-openib=/usr/local/ofed \
|
||||||
|
# --with-openib-libdir=/usr/local/ofed/lib64
|
||||||
|
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
make distclean
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
LAM)
|
||||||
|
if [ -r $MPI_ARCH_PATH/lib/libmpi.so ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB shared library"
|
||||||
|
elif [ -r $MPI_ARCH_PATH/lib/libmpi.a ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB static library"
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd $MPI_HOME
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
rm -rf $MPI_ARCH_PATH
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=$MPI_ARCH_PATH \
|
||||||
|
--enable-shared \
|
||||||
|
--disable-static \
|
||||||
|
--without-romio \
|
||||||
|
--without-mpi2cpp \
|
||||||
|
--without-profiling \
|
||||||
|
--without-fc
|
||||||
|
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
make distclean
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
MPICH)
|
||||||
|
if [ -r $MPI_ARCH_PATH/lib/libmpich.so ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB shared library"
|
||||||
|
elif [ -r $MPI_ARCH_PATH/lib/libmpich.a ]
|
||||||
|
then
|
||||||
|
echo "have $WM_MPLIB static library"
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd $MPI_HOME
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
rm -rf $MPI_ARCH_PATH
|
||||||
|
rm util/machines/machines.*
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--without-mpe \
|
||||||
|
--disable-f77 \
|
||||||
|
--disable-f90 \
|
||||||
|
--disable-f90modules \
|
||||||
|
--disable-c++ \
|
||||||
|
--disable-mpedbg \
|
||||||
|
--disable-devdebug \
|
||||||
|
--disable-debug \
|
||||||
|
--enable-sharedlib=$MPI_ARCH_PATH/lib \
|
||||||
|
--with-device=ch_p4 \
|
||||||
|
-prefix=$MPI_ARCH_PATH
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
make distclean
|
||||||
|
|
||||||
|
if [ -r $MPI_ARCH_PATH ]
|
||||||
|
then
|
||||||
|
cd $MPI_ARCH_PATH/bin
|
||||||
|
for file in *
|
||||||
|
do
|
||||||
|
sed s%$MPI_ARCH_PATH%'$MPI_ARCH_PATH'%g $file > temp.$$
|
||||||
|
mv temp.$$ $file
|
||||||
|
chmod ugo+rx $file
|
||||||
|
done
|
||||||
|
|
||||||
|
cd $MPI_ARCH_PATH/lib
|
||||||
|
|
||||||
|
if [ -r libmpich.so.1.0 ]
|
||||||
|
then
|
||||||
|
rm *.so
|
||||||
|
ln -s libmpich.so.1.0 libmpich.so
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Build scotch
|
||||||
|
( cd scotch_5.1 && wmake libso src/libscotch )
|
||||||
|
|
||||||
|
# Build Metis
|
||||||
|
( cd metis-5.0pre2 && wmake libso GKlib && wmake libso libmetis )
|
||||||
|
|
||||||
|
# Build parMetis. Requires mpi!
|
||||||
|
if [ "$WM_MPLIB" = "MPI" -o -d $MPI_ARCH_PATH ]
|
||||||
|
then
|
||||||
|
( cd ParMetis-3.1 && WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB && wmake libso METISLib && wmake libso ParMETISLib )
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Build ParMGridGen
|
||||||
|
wmake libso ParMGridGen-1.0/MGridGen/IMlib
|
||||||
|
wmake libso ParMGridGen-1.0/MGridGen/Lib
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
132
bin/foamMakeGcc
Executable file
132
bin/foamMakeGcc
Executable file
@ -0,0 +1,132 @@
|
|||||||
|
#---------------------------------*- sh -*-------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / 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
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# foamMakeGcc
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Build script for gmp, mpfr and gcc-4.3.? and gcc-4.4.?
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
usage() {
|
||||||
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
usage: ${0##*/} <gcc-4.?.?> ...
|
||||||
|
|
||||||
|
* build gmp, mpfr and gcc-4.3.? and gcc-4.4.?
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]
|
||||||
|
then
|
||||||
|
usage "gcc version not provided"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set the number of cores to build on
|
||||||
|
#
|
||||||
|
WM_NCOMPPROCS=1
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]
|
||||||
|
then
|
||||||
|
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
|
||||||
|
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Building on " $WM_NCOMPPROCS " cores"
|
||||||
|
|
||||||
|
GMP_DIR=$WM_THIRD_PARTY_DIR/gmp-4.2.4
|
||||||
|
MPFR_DIR=$WM_THIRD_PARTY_DIR/mpfr-2.4.1
|
||||||
|
GCC_DIR=$WM_THIRD_PARTY_DIR/$1
|
||||||
|
|
||||||
|
GMPROOT=${GMP_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||||
|
MPFRROOT=${MPFR_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||||
|
GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bulid GMP
|
||||||
|
#
|
||||||
|
if [ ! -d $GMPROOT ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
make distclean \
|
||||||
|
&& mkdir $GMP_DIR/build \
|
||||||
|
&& cd $GMP_DIR/build \
|
||||||
|
&& ../configure ABI=$ABI --prefix=$GMPROOT \
|
||||||
|
&& make -j $WM_NCOMPPROCS \
|
||||||
|
&& make install
|
||||||
|
)
|
||||||
|
echo " Finished building gmp."
|
||||||
|
else
|
||||||
|
echo " gmp already built."
|
||||||
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="$GMPROOT/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build MPFR
|
||||||
|
#
|
||||||
|
if [ ! -d $MPFRROOT ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
make distclean \
|
||||||
|
&& mkdir $MPFR_DIR/build \
|
||||||
|
&& cd $MPFR_DIR/build \
|
||||||
|
&& ../configure ABI=$ABI --prefix=$MPFRROOT --with-gmp=$GMPROOT \
|
||||||
|
&& make -j $WM_NCOMPPROCS \
|
||||||
|
&& make install
|
||||||
|
)
|
||||||
|
echo " Finished building mpfr."
|
||||||
|
else
|
||||||
|
echo " mprf already built."
|
||||||
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="$MPFRROOT/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build GCC
|
||||||
|
#
|
||||||
|
if [ ! -d $GCCROOT ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
make distclean \
|
||||||
|
&& mkdir $GCC_DIR/build \
|
||||||
|
&& cd $GCC_DIR/build \
|
||||||
|
&& ../configure --enable-languages=c,c++ --with-pkgversion='OpenFOAM' \
|
||||||
|
--enable-__cxa_atexit --enable-libstdcxx-allocator=new \
|
||||||
|
--with-system-zlib --prefix=$GCCROOT \
|
||||||
|
--with-mpfr=$MPFRROOT --with-gmp=$GMPROOT \
|
||||||
|
&& make -j $WM_NCOMPPROCS \
|
||||||
|
&& make install
|
||||||
|
)
|
||||||
|
echo " Finished building gcc."
|
||||||
|
else
|
||||||
|
echo " gcc already built."
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
69
bin/foamMakeQt
Executable file
69
bin/foamMakeQt
Executable file
@ -0,0 +1,69 @@
|
|||||||
|
#---------------------------------*- sh -*-------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / 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
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# foamMakeQt
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Build script for Qt-4.3.5
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
QT_VERSION=4.3.5
|
||||||
|
QT_HOME=${WM_THIRD_PARTY_DIR}/qt-x11-opensource-src-${QT_VERSION}
|
||||||
|
QT_ARCH_PATH=${QT_HOME}/platforms/${WM_OPTIONS}
|
||||||
|
|
||||||
|
if [ ! -d $QT_ARCH_PATH ]
|
||||||
|
then
|
||||||
|
cd ${QT_HOME}
|
||||||
|
|
||||||
|
make distclean
|
||||||
|
|
||||||
|
rm -rf ${QT_ARCH_PATH}
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=${QT_ARCH_PATH} \
|
||||||
|
-nomake demos \
|
||||||
|
-nomake examples
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]
|
||||||
|
then
|
||||||
|
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
|
||||||
|
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
|
||||||
|
|
||||||
|
echo "Building on " $WM_NCOMPPROCS " cores"
|
||||||
|
|
||||||
|
time make -j $WM_NCOMPPROCS
|
||||||
|
else
|
||||||
|
time make
|
||||||
|
fi
|
||||||
|
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo " Finished building Qt-4.3.5."
|
||||||
|
else
|
||||||
|
echo " Qt-4.3.5 already built."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -1112,6 +1112,13 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pp.size()&1)
|
||||||
|
{
|
||||||
|
FatalErrorIn("cyclicPolyPatch::order(..)")
|
||||||
|
<< "Size of cyclic " << name() << " should be a multiple of 2"
|
||||||
|
<< ". It is " << pp.size() << abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
label halfSize = pp.size()/2;
|
label halfSize = pp.size()/2;
|
||||||
|
|
||||||
// Supplied primitivePatch already with new points.
|
// Supplied primitivePatch already with new points.
|
||||||
|
|||||||
@ -191,7 +191,10 @@ void Foam::polyTopoChange::countMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::labelHashSet Foam::polyTopoChange::getSetIndices(const PackedBoolList& lst)
|
Foam::labelHashSet Foam::polyTopoChange::getSetIndices
|
||||||
|
(
|
||||||
|
const PackedBoolList& lst
|
||||||
|
)
|
||||||
{
|
{
|
||||||
labelHashSet values(lst.count());
|
labelHashSet values(lst.count());
|
||||||
forAll(lst, i)
|
forAll(lst, i)
|
||||||
|
|||||||
Reference in New Issue
Block a user