merge Mark's branch

This commit is contained in:
andy
2008-10-16 12:47:25 +01:00
82 changed files with 1113 additions and 657 deletions

View File

@ -2,7 +2,7 @@
# #
#+TITLE: *OpenFOAM release notes for version 1.5* #+TITLE: *OpenFOAM release notes for version 1.5*
#+AUTHOR: OpenCFD Ltd. #+AUTHOR: OpenCFD Ltd.
#+DATE: 26 August 2008 #+DATE: 07 October 2008
#+LINK: http://www.opencfd.co.uk #+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
@ -34,7 +34,7 @@
and $WM_COMPILER_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc and $WM_COMPILER_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc
(or cshrc) file. (or cshrc) file.
+ The location of the installation of the compiler is controlled by the + The location of the installation of the compiler is controlled by the
$WM_COMPILER_INST environment variable in the OpenFOAM-1.5/etc/settings.sh $compilerInstall environment variable in the OpenFOAM-1.5/etc/settings.sh
(or settings.csh) file. (or settings.csh) file.
* Developments to solvers (applications) * Developments to solvers (applications)

View File

@ -49,7 +49,7 @@ quires the installation of Qt 4.3.? for ParaView-3 to run.
$WM_COMPILER and $WM_COMPILER_ARCH environment variables in the $WM_COMPILER and $WM_COMPILER_ARCH environment variables in the
OpenFOAM-1.5/etc/bashrc (or cshrc) file. OpenFOAM-1.5/etc/bashrc (or cshrc) file.
* The location of the installation of the compiler is controlled by the * The location of the installation of the compiler is controlled by the
$WM_COMPILER_INST environment variable in the OpenFOAM-1.5/etc/settings.sh $compilerInstall environment variable in the OpenFOAM-1.5/etc/settings.sh
(or settings.csh) file. (or settings.csh) file.
4 Developments to solvers (applications) 4 Developments to solvers (applications)
@ -202,7 +202,7 @@ To aid common monitoring and post-processing activities.
* Non-blocking, non-buffered, parallel transfers with potential scaling * Non-blocking, non-buffered, parallel transfers with potential scaling
benefits for larger number of processors. benefits for larger number of processors.
Date: 26 August 2008 Date: 07 October 2008
HTML generated by org-mode 6.06b in emacs 23 HTML generated by org-mode 6.06b in emacs 23

View File

@ -1,224 +0,0 @@
.file "ListLoop.C"
.section .ctors,"aw",@progbits
.align 4
.long _GLOBAL__I__Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_
.text
.align 2
.p2align 4,,15
.type _Z41__static_initialization_and_destruction_0ii, @function
_Z41__static_initialization_and_destruction_0ii:
.LFB2550:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
pushl %ebx
.LCFI2:
call __i686.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
subl $20, %esp
.LCFI3:
decl %eax
je .L7
.L5:
addl $20, %esp
popl %ebx
leave
ret
.p2align 4,,7
.L7:
cmpl $65535, %edx
jne .L5
leal _ZSt8__ioinit@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call _ZNSt8ios_base4InitC1Ev@PLT
movl __dso_handle@GOT(%ebx), %eax
movl $0, 4(%esp)
movl %eax, 8(%esp)
leal __tcf_0@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call __cxa_atexit@PLT
addl $20, %esp
popl %ebx
leave
ret
.LFE2550:
.size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii
.globl __gxx_personality_v0
.align 2
.p2align 4,,15
.type _GLOBAL__I__Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_, @function
_GLOBAL__I__Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_:
.LFB2552:
pushl %ebp
.LCFI4:
movl $65535, %edx
movl $1, %eax
movl %esp, %ebp
.LCFI5:
leave
jmp _Z41__static_initialization_and_destruction_0ii
.LFE2552:
.size _GLOBAL__I__Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_, .-_GLOBAL__I__Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_
.align 2
.p2align 4,,15
.type __tcf_0, @function
__tcf_0:
.LFB2551:
pushl %ebp
.LCFI6:
movl %esp, %ebp
.LCFI7:
pushl %ebx
.LCFI8:
call __i686.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
subl $4, %esp
.LCFI9:
leal _ZSt8__ioinit@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call _ZNSt8ios_base4InitD1Ev@PLT
addl $4, %esp
popl %ebx
leave
ret
.LFE2551:
.size __tcf_0, .-__tcf_0
.align 2
.p2align 4,,15
.globl _Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_
.type _Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_, @function
_Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_:
.LFB2352:
pushl %ebp
.LCFI10:
movl %esp, %ebp
.LCFI11:
pushl %edi
.LCFI12:
pushl %esi
.LCFI13:
subl $12, %esp
.LCFI14:
movl 8(%ebp), %edx
movl (%edx), %eax
testl %eax, %eax
movl %eax, -20(%ebp)
jle .L16
movl 16(%ebp), %eax
movl 4(%edx), %edx
xorl %ecx, %ecx
movl 4(%eax), %eax
movl %edx, -12(%ebp)
movl %eax, -16(%ebp)
movl 20(%ebp), %eax
movl 4(%eax), %edi
movl 12(%ebp), %eax
movl 4(%eax), %esi
.p2align 4,,7
.L15:
movl -16(%ebp), %edx
movl (%edx,%ecx,4), %eax
movl -12(%ebp), %edx
leal (%edx,%eax,8), %eax
movl (%edi,%ecx,4), %edx
incl %ecx
cmpl %ecx, -20(%ebp)
fldl (%eax)
fsubl (%esi,%edx,8)
fstpl (%eax)
jne .L15
.L16:
addl $12, %esp
popl %esi
popl %edi
leave
ret
.LFE2352:
.size _Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_, .-_Z4funcRN4Foam4ListIdEERKS1_RKNS0_IiEES7_
.local _ZSt8__ioinit
.comm _ZSt8__ioinit,1,1
.section .eh_frame,"a",@progbits
.Lframe1:
.long .LECIE1-.LSCIE1
.LSCIE1:
.long 0x0
.byte 0x1
.string "zPR"
.uleb128 0x1
.sleb128 -4
.byte 0x8
.uleb128 0x6
.byte 0x9b
.long DW.ref.__gxx_personality_v0-.
.byte 0x1b
.byte 0xc
.uleb128 0x4
.uleb128 0x4
.byte 0x88
.uleb128 0x1
.align 4
.LECIE1:
.LSFDE1:
.long .LEFDE1-.LASFDE1
.LASFDE1:
.long .LASFDE1-.Lframe1
.long .LFB2550-.
.long .LFE2550-.LFB2550
.uleb128 0x0
.byte 0x4
.long .LCFI0-.LFB2550
.byte 0xe
.uleb128 0x8
.byte 0x85
.uleb128 0x2
.byte 0x4
.long .LCFI1-.LCFI0
.byte 0xd
.uleb128 0x5
.byte 0x4
.long .LCFI2-.LCFI1
.byte 0x83
.uleb128 0x3
.align 4
.LEFDE1:
.LSFDE5:
.long .LEFDE5-.LASFDE5
.LASFDE5:
.long .LASFDE5-.Lframe1
.long .LFB2551-.
.long .LFE2551-.LFB2551
.uleb128 0x0
.byte 0x4
.long .LCFI6-.LFB2551
.byte 0xe
.uleb128 0x8
.byte 0x85
.uleb128 0x2
.byte 0x4
.long .LCFI7-.LCFI6
.byte 0xd
.uleb128 0x5
.byte 0x4
.long .LCFI8-.LCFI7
.byte 0x83
.uleb128 0x3
.align 4
.LEFDE5:
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section .data.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
.align 4
.type DW.ref.__gxx_personality_v0, @object
.size DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.long __gxx_personality_v0
.ident "GCC: (GNU) 4.1.1"
.section .text.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat
.globl __i686.get_pc_thunk.bx
.hidden __i686.get_pc_thunk.bx
.type __i686.get_pc_thunk.bx, @function
__i686.get_pc_thunk.bx:
movl (%esp), %ebx
ret
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,4 @@
xferListTest.C
/* EXE = $(FOAM_USER_APPBIN)/xferListTest */
EXE = ./xferListTest

View File

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 "OSspecific.H"
#include "IOstreams.H"
#include "IStringStream.H"
#include "labelList.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
List<label> lstA(10);
List<label> lstC(IStringStream("(1 2 3 4)")());
forAll(lstA, i)
{
lstA[i] = i;
}
Info<< "lstA: " << lstA << endl;
Info<< "lstC: " << lstC << endl;
xfer<List<label> > xA(lstA, true);
xfer<List<label> > xB;
// List<label> lstB( xferTmp(List<label>, lstC) );
// List<label> lstB( xfer<List<label> >(lstC) );
List<label> lstB( xA );
Info<< "xA: " << *xA << endl;
Info<< "xB: " << *xB << endl;
Info<< "lstA: " << lstA << endl;
Info<< "lstB: " << lstB << endl;
Info<< "lstC: " << lstC << endl;
xA = lstB;
Info<< "xA: " << *xA << endl;
Info<< "xB: " << *xB << endl;
Info<< "lstA: " << lstA << endl;
Info<< "lstB: " << lstB << endl;
Info<< "lstC: " << lstC << endl;
xB = xA;
Info<< "xA: " << *xA << endl;
Info<< "xB: " << *xB << endl;
Info<< "lstA: " << lstA << endl;
Info<< "lstB: " << lstB << endl;
Info<< "lstC: " << lstC << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
EXE_INC = \ EXE_INC = \
-IextrudedMesh \ -IextrudedMesh \
-IextrudeModel/lnInclude \ -IextrudeModel/lnInclude \
-I$(FOAM_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(FOAM_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \

View File

@ -1,6 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(FOAM_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \

View File

@ -1,8 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(FOAM_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(FOAM_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \

View File

@ -39,6 +39,14 @@ Usage
@param -zeroTime \n @param -zeroTime \n
Include the often incomplete initial conditions. Include the often incomplete initial conditions.
@param -index \<start\>\n
Ignore the time index contained in the time file and use a
simple indexing when creating the @c Ensight/data/######## files.
@param -noMesh \n
Suppress writing the geometry. Can be useful for converting partial
results for a static geometry.
Note Note
- no parallel data. - no parallel data.
- writes to @a Ensight directory to avoid collisions with foamToEnsight. - writes to @a Ensight directory to avoid collisions with foamToEnsight.
@ -70,6 +78,8 @@ int main(int argc, char *argv[])
timeSelector::addOptions(true, false); timeSelector::addOptions(true, false);
argList::noParallel(); argList::noParallel();
argList::validOptions.insert("ascii", ""); argList::validOptions.insert("ascii", "");
argList::validOptions.insert("index", "start");
argList::validOptions.insert("noMesh", "");
const word volFieldTypes[] = const word volFieldTypes[] =
{ {
@ -104,6 +114,18 @@ int main(int argc, char *argv[])
format = IOstream::ASCII; format = IOstream::ASCII;
} }
// control for renumbering iterations
bool optIndex = false;
label indexingNumber = 0;
if (args.options().found("index"))
{
optIndex = true;
indexingNumber = readLabel(IStringStream(args.options()["index"])());
}
// always write the geometry, unless the -noMesh option is specified
bool optNoMesh = args.options().found("noMesh");
fileName ensightDir = args.rootPath()/args.globalCaseName()/"Ensight"; fileName ensightDir = args.rootPath()/args.globalCaseName()/"Ensight";
fileName dataDir = ensightDir/"data"; fileName dataDir = ensightDir/"data";
fileName caseFileName = "Ensight.case"; fileName caseFileName = "Ensight.case";
@ -146,6 +168,13 @@ int main(int argc, char *argv[])
# include "findFields.H" # include "findFields.H"
# include "validateFields.H" # include "validateFields.H"
if (hasMovingMesh && optNoMesh)
{
Info<< "mesh is moving: ignoring '-noMesh' option" << endl;
optNoMesh = false;
}
// map times used // map times used
Map<scalar> timeIndices; Map<scalar> timeIndices;
@ -192,6 +221,8 @@ int main(int argc, char *argv[])
partsList.recalculate(mesh); partsList.recalculate(mesh);
} }
if (!optNoMesh)
{
fileName geomDir; fileName geomDir;
if (hasMovingMesh) if (hasMovingMesh)
{ {
@ -202,6 +233,7 @@ int main(int argc, char *argv[])
partsList.writeGeometry(geoFile); partsList.writeGeometry(geoFile);
Info<< nl; Info<< nl;
} }
}
Info<< "write volume field (" << flush; Info<< "write volume field (" << flush;

View File

@ -1,9 +1,13 @@
// Read time index from */uniform/time, // Read time index from */uniform/time, but treat 0 and constant specially
// but treat 0 and constant specially // or simply increment from the '-index' option if it was supplied
label timeIndex = 0; label timeIndex = 0;
if if (optIndex)
{
timeIndex = indexingNumber++;
}
else if
( (
runTime.timeName() != "constant" runTime.timeName() != "constant"
&& runTime.timeName() != "0" && runTime.timeName() != "0"
@ -22,19 +26,8 @@
if (io.headerOk()) if (io.headerOk())
{ {
IOdictionary timeObject io.readOpt() = IOobject::MUST_READ;
( IOdictionary timeObject(io);
IOobject
(
"time",
runTime.timeName(),
"uniform",
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
timeObject.lookup("index") >> timeIndex; timeObject.lookup("index") >> timeIndex;
} }

View File

@ -1,5 +1,5 @@
{ {
IOobject ioPoints IOobject io
( (
"points", "points",
runTime.timeName(), runTime.timeName(),
@ -7,21 +7,11 @@
mesh mesh
); );
if (ioPoints.headerOk()) if (io.headerOk())
{ {
// Reading new points // Read new points
pointIOField newPoints io.readOpt() = IOobject::MUST_READ;
( pointIOField newPoints(io);
IOobject
(
"points",
mesh.time().timeName(),
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
mesh.movePoints(newPoints); mesh.movePoints(newPoints);
} }

View File

@ -5,7 +5,8 @@ forAllIter(HashTable<word>, volumeFields, fieldIter)
const word& fieldName = fieldIter.key(); const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter(); const word& fieldType = fieldIter();
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) != "_0") // ignore _0 fields
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
{ {
volumeFields.erase(fieldIter); volumeFields.erase(fieldIter);
} }

View File

@ -1,4 +1,3 @@
# create a plugin that adds a reader to the ParaView GUI # create a plugin that adds a reader to the ParaView GUI
# it is added in the file dialog when doing opens/saves. # it is added in the file dialog when doing opens/saves.
@ -16,8 +15,8 @@ LINK_DIRECTORIES(
) )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
$ENV{FOAM_SRC}/OpenFOAM/lnInclude $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{FOAM_SRC}/finiteVolume/lnInclude $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPV3Foam ${PROJECT_SOURCE_DIR}/../vtkPV3Foam
) )
@ -52,3 +51,4 @@ TARGET_LINK_LIBRARIES(
finiteVolume finiteVolume
vtkPV3Foam vtkPV3Foam
) )
#-----------------------------------------------------------------------------

View File

@ -16,8 +16,12 @@ SET(PVFoamReader_LIBS
vtkGraphics vtkGraphics
) )
INCLUDE_DIRECTORIES($ENV{FOAM_SRC}/OpenFOAM/lnInclude $ENV{FOAM_SRC}/finiteVolume/lnInclude) INCLUDE_DIRECTORIES(
INCLUDE_DIRECTORIES($ENV{ParaView_INST_DIR}/include ../vtkFoam/lnInclude) $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
$ENV{ParaView_INST_DIR}/include
../vtkFoam/lnInclude
)
ADD_DEFINITIONS(-D$ENV{WM_PRECISION_OPTION}) ADD_DEFINITIONS(-D$ENV{WM_PRECISION_OPTION})
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -72,3 +76,4 @@ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVFoamReader.pvsm.in
${PROJECT_BINARY_DIR}/../${PROJECT_NAME}.pvsm @ONLY IMMEDIATE) ${PROJECT_BINARY_DIR}/../${PROJECT_NAME}.pvsm @ONLY IMMEDIATE)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} OpenFOAM finiteVolume vtkFoam) TARGET_LINK_LIBRARIES(${PROJECT_NAME} OpenFOAM finiteVolume vtkFoam)
#-----------------------------------------------------------------------------

View File

@ -94,7 +94,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/browser/lnInclude \ -I$(LIB_SRC)/browser/lnInclude \
-I$(FOAM_SRC)/lagrangian/basic/lnInclude -I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \ EXE_LIBS = \
$(FV_LIBS) \ $(FV_LIBS) \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels/RAS \ -I$(LIB_SRC)/turbulenceModels/RAS \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/postProcessing/postCalc \ -I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -23,16 +23,17 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # Script
# bashrc # etc/bashrc
# #
# Description # Description
# Startup file for OpenFOAM # Startup file for OpenFOAM
# Sourced from ~/.profile or ~/.bashrc # Sourced from ~/.profile or ~/.bashrc
# Should be usable by any POSIX-compliant shell (eg, ksh)
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM export WM_PROJECT=OpenFOAM
#export WM_PROJECT_VERSION=1.5 #export WM_PROJECT_VERSION=1.5.x
: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION : ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
@ -53,7 +54,7 @@ foamInstall=$HOME/$WM_PROJECT
# Location of site/user files # Location of site/user files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$FOAM_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
@ -163,7 +164,7 @@ esac
cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath
# Remove anything under top-level foam directory # Remove anything under top-level foam directory
wildCards="$FOAM_INST_DIR $HOME/$WM_PROJECT/$USER" wildCards="$WM_PROJECT_INST_DIR $HOME/$WM_PROJECT/$USER"
#- Clean path/PATH #- Clean path/PATH
cleanPath=`$cleanProg "$PATH" "$wildCards"` && PATH="$cleanPath" cleanPath=`$cleanProg "$PATH" "$wildCards"` && PATH="$cleanPath"
@ -182,9 +183,7 @@ _foamSource()
{ {
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
if [ "$FOAM_VERBOSE" -a "$PS1" ]; then [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1"
echo "Sourcing: $1"
fi
. $1 . $1
shift shift
done done

View File

@ -23,7 +23,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # Script
# cshrc # etc/cshrc
# #
# Description # Description
# Startup file for OpenFOAM # Startup file for OpenFOAM
@ -32,7 +32,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM setenv WM_PROJECT OpenFOAM
#setenv WM_PROJECT_VERSION 1.5 #setenv WM_PROJECT_VERSION 1.5.x
if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
#!!User: #!!User:
@ -52,7 +52,7 @@ if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
# Location of site/user files # Location of site/user files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
setenv WM_PROJECT_DIR $FOAM_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
@ -167,7 +167,7 @@ if (! $?MANPATH) then
endif endif
# Remove anything under top-level foam directory # Remove anything under top-level foam directory
set wildCards="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME" set wildCards="$WM_PROJECT_INST_DIR $HOME/$WM_PROJECT/$LOGNAME"
#- Clean path/PATH #- Clean path/PATH
set colonPath=`echo "$path" | sed -e 's/ /:/g'` set colonPath=`echo "$path" | sed -e 's/ /:/g'`
@ -219,5 +219,8 @@ endif
# cleanup environment: # cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unset cleanProg
unset wildCards
unset colonPath
unalias _foamSource unalias _foamSource
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -23,7 +23,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # Script
# settings.csh # etc/settings.csh
# #
# Description # Description
# Startup file for OpenFOAM # Startup file for OpenFOAM
@ -31,60 +31,70 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
alias _foamAddPath 'set path=(\!* $path) ; if ( ! -d \!* ) mkdir -p \!*' # prefix to PATH
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH} ; set xx=`echo $LD_LIBRARY_PATH | sed -e "s/:.*//"`; if ( ! -d $xx ) mkdir -p $xx' alias _foamAddPath 'set path=(\!* $path)'
# prefix to LD_LIBRARY_PATH
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# make directory if it doesn't already exist
alias _foamMkDir 'if ( ! -d \!* ) mkdir -p \!*'
# location of the jobControl directory
setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
#- Add the system-specific executables path to the path # wmake configuration
set path=($WM_PROJECT_DIR/bin $FOAM_INST_DIR/$WM_ARCH/bin $path)
#- Location of the jobControl directory
setenv FOAM_JOB_DIR $FOAM_INST_DIR/jobControl
setenv WM_DIR $WM_PROJECT_DIR/wmake setenv WM_DIR $WM_PROJECT_DIR/wmake
setenv WM_LINK_LANGUAGE c++ setenv WM_LINK_LANGUAGE c++
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
set path=($WM_DIR $path)
# base configuration
setenv FOAM_SRC $WM_PROJECT_DIR/src setenv FOAM_SRC $WM_PROJECT_DIR/src
setenv FOAM_LIB $WM_PROJECT_DIR/lib setenv FOAM_LIB $WM_PROJECT_DIR/lib
setenv FOAM_LIBBIN $FOAM_LIB/$WM_OPTIONS setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
_foamAddLib $FOAM_LIBBIN
setenv FOAM_APP $WM_PROJECT_DIR/applications setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
_foamAddPath $FOAM_APPBIN
# user configuration
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
# convenience
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
setenv FOAM_UTILITIES $FOAM_APP/utilities setenv FOAM_UTILITIES $FOAM_APP/utilities
setenv FOAM_SOLVERS $FOAM_APP/solvers setenv FOAM_SOLVERS $FOAM_APP/solvers
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS # add OpenFOAM scripts and wmake to the path
set path=($WM_DIR $WM_PROJECT_DIR/bin $path)
_foamAddPath $FOAM_APPBIN
_foamAddPath $FOAM_USER_APPBIN
_foamAddLib $FOAM_LIBBIN
_foamAddLib $FOAM_USER_LIBBIN _foamAddLib $FOAM_USER_LIBBIN
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS # create these directories if necessary:
_foamAddPath $FOAM_USER_APPBIN _foamMkDir $FOAM_LIBBIN
_foamMkDir $FOAM_APPBIN
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run _foamMkDir $FOAM_USER_LIBBIN
_foamMkDir $FOAM_USER_APPBIN
# Compiler settings # Compiler settings
# ~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~
set WM_COMPILER_BIN= set compilerBin=
set WM_COMPILER_LIB= set compilerLib=
# Select compiler installation # Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_COMPILER_INST = OpenFOAM | System # compilerInstall = OpenFOAM | System
set WM_COMPILER_INST=OpenFOAM set compilerInstall=OpenFOAM
switch ("$WM_COMPILER_INST") switch ("$compilerInstall")
case OpenFOAM: case OpenFOAM:
switch ("$WM_COMPILER") switch ("$WM_COMPILER")
case Gcc: case Gcc:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
breaksw breaksw
case Gcc42: case Gcc42:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
@ -97,22 +107,22 @@ case OpenFOAM:
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " Cannot find $WM_COMPILER_DIR installation." echo " Cannot find $WM_COMPILER_DIR installation."
echo " Please install this compiler version or if you wish to use the system compiler," echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the WM_COMPILER_INST setting to 'System' in this file" echo " change the 'compilerInstall' setting to 'System' in this file"
echo echo
endif endif
set WM_COMPILER_BIN="$WM_COMPILER_DIR/bin" set compilerBin=$WM_COMPILER_DIR/bin
set WM_COMPILER_LIB=$WM_COMPILER_DIR/lib${WM_COMPILER_LIB_ARCH}:$WM_COMPILER_DIR/lib set compilerLib=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
breaksw breaksw
endsw endsw
if ($?WM_COMPILER_BIN) then if ($?compilerBin) then
_foamAddPath $WM_COMPILER_BIN _foamAddPath $compilerBin
_foamAddLib $WM_COMPILER_LIB _foamAddLib $compilerLib
endif endif
unset WM_COMPILER_BIN unset compilerBin
unset WM_COMPILER_LIB unset compilerLib
# Communications library # Communications library
@ -129,8 +139,8 @@ case OPENMPI:
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
setenv OPAL_PREFIX $MPI_ARCH_PATH setenv OPAL_PREFIX $MPI_ARCH_PATH
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -143,8 +153,8 @@ case LAM:
setenv LAMHOME $WM_THIRD_PARTY_DIR/$mpi_version setenv LAMHOME $WM_THIRD_PARTY_DIR/$mpi_version
# note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -156,8 +166,8 @@ case MPICH:
setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
setenv MPICH_ROOT $MPI_ARCH_PATH setenv MPICH_ROOT $MPI_ARCH_PATH
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -169,9 +179,9 @@ case MPICH-GM:
setenv MPICH_ROOT $MPI_ARCH_PATH setenv MPICH_ROOT $MPI_ARCH_PATH
setenv GM_LIB_PATH /opt/gm/lib64 setenv GM_LIB_PATH /opt/gm/lib64
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH _foamAddLib $GM_LIB_PATH
_foamAddPath $MPI_ARCH_PATH/bin
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
breaksw breaksw
@ -215,8 +225,8 @@ endif
# cleanup environment: # cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unalias _foamAddLib
unalias _foamAddPath unalias _foamAddPath
unalias _foamAddLib
unalias _foamMkDir
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -23,7 +23,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # Script
# settings.sh # etc/settings.sh
# #
# Description # Description
# Startup file for OpenFOAM # Startup file for OpenFOAM
@ -31,95 +31,89 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# prefix to PATH
_foamAddPath() _foamAddPath()
{ {
if [ $# -eq 1 ]
then
oldIFS="$IFS"
IFS=':' # split on ':'
set -- $1
IFS="$oldIFS"
unset oldIFS
fi
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
[ -d $1 ] || mkdir -p $1
export PATH=$1:$PATH export PATH=$1:$PATH
shift shift
done done
} }
# prefix to LD_LIBRARY_PATH
_foamAddLib() _foamAddLib()
{ {
if [ $# -eq 1 ]
then
oldIFS="$IFS"
IFS=':' # split on ':'
set -- $1
IFS="$oldIFS"
unset oldIFS
fi
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
[ -d $1 ] || mkdir -p $1
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
shift shift
done done
} }
#- Add the system-specific executables path to the path # make directories if they don't already exist
export PATH=$WM_PROJECT_DIR/bin:$FOAM_INST_DIR/$WM_ARCH/bin:$PATH _foamMkDir()
{
while [ $# -ge 1 ]
do
[ -d $1 ] || mkdir -p $1
shift
done
}
#- Location of the jobControl directory
export FOAM_JOB_DIR=$FOAM_INST_DIR/jobControl
# location of the jobControl directory
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
# wmake configuration
export WM_DIR=$WM_PROJECT_DIR/wmake export WM_DIR=$WM_PROJECT_DIR/wmake
export WM_LINK_LANGUAGE=c++ export WM_LINK_LANGUAGE=c++
export WM_OPTIONS=$WM_ARCH${WM_COMPILER}$WM_PRECISION_OPTION$WM_COMPILE_OPTION export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
export PATH=$WM_DIR:$PATH
# base configuration
export FOAM_SRC=$WM_PROJECT_DIR/src export FOAM_SRC=$WM_PROJECT_DIR/src
export FOAM_LIB=$WM_PROJECT_DIR/lib export FOAM_LIB=$WM_PROJECT_DIR/lib
export FOAM_LIBBIN=$FOAM_LIB/$WM_OPTIONS export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
_foamAddLib $FOAM_LIBBIN
export FOAM_APP=$WM_PROJECT_DIR/applications export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
_foamAddPath $FOAM_APPBIN
# user configuration
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
# convenience
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
export FOAM_UTILITIES=$FOAM_APP/utilities export FOAM_UTILITIES=$FOAM_APP/utilities
export FOAM_SOLVERS=$FOAM_APP/solvers export FOAM_SOLVERS=$FOAM_APP/solvers
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
_foamAddLib $FOAM_USER_LIBBIN
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
_foamAddPath $FOAM_USER_APPBIN
export FOAM_RUN=$WM_PROJECT_USER_DIR/run export FOAM_RUN=$WM_PROJECT_USER_DIR/run
# add OpenFOAM scripts and wmake to the path
export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
_foamAddPath $FOAM_APPBIN $FOAM_USER_APPBIN
_foamAddLib $FOAM_LIBBIN $FOAM_USER_LIBBIN
# create these directories if necessary:
_foamMkDir $FOAM_LIBBIN $FOAM_USER_LIBBIN $FOAM_APPBIN $FOAM_USER_APPBIN
# Compiler settings # Compiler settings
# ~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~
WM_COMPILER_BIN= unset compilerBin compilerLib
WM_COMPILER_LIB=
# Select compiler installation # Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_COMPILER_INST = OpenFOAM | System # compilerInstall = OpenFOAM | System
WM_COMPILER_INST=OpenFOAM compilerInstall=OpenFOAM
case "$WM_COMPILER_INST" in case "$compilerInstall" in
OpenFOAM) OpenFOAM)
case "$WM_COMPILER" in case "$WM_COMPILER" in
Gcc) Gcc)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
;; ;;
Gcc42) Gcc42)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
@ -133,21 +127,22 @@ OpenFOAM)
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Cannot find $WM_COMPILER_DIR installation." echo " Cannot find $WM_COMPILER_DIR installation."
echo " Please install this compiler version or if you wish to use the system compiler," echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the WM_COMPILER_INST setting to 'System' in this file" echo " change the 'compilerInstall' setting to 'System' in this file"
echo echo
fi fi
WM_COMPILER_BIN=$WM_COMPILER_DIR/bin compilerBin=$WM_COMPILER_DIR/bin
WM_COMPILER_LIB=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib compilerLib=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
;; ;;
esac esac
if [ -d "$WM_COMPILER_BIN" ]; then if [ -d "$compilerBin" ]
_foamAddPath $WM_COMPILER_BIN then
_foamAddLib $WM_COMPILER_LIB _foamAddPath $compilerBin
_foamAddLib $compilerLib
fi fi
unset WM_COMPILER_BIN WM_COMPILER_LIB unset compilerBin compilerLib compilerInstall
# Communications library # Communications library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
@ -163,8 +158,8 @@ OPENMPI)
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
export OPAL_PREFIX=$MPI_ARCH_PATH export OPAL_PREFIX=$MPI_ARCH_PATH
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -177,8 +172,8 @@ LAM)
export LAMHOME=$WM_THIRD_PARTY_DIR/$mpi_version export LAMHOME=$WM_THIRD_PARTY_DIR/$mpi_version
# note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -190,8 +185,8 @@ MPICH)
export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS
export MPICH_ROOT=$MPI_ARCH_PATH export MPICH_ROOT=$MPI_ARCH_PATH
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
unset mpi_version unset mpi_version
@ -203,9 +198,9 @@ MPICH-GM)
export MPICH_ROOT=$MPI_ARCH_PATH export MPICH_ROOT=$MPI_ARCH_PATH
export GM_LIB_PATH=/opt/gm/lib64 export GM_LIB_PATH=/opt/gm/lib64
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH _foamAddLib $GM_LIB_PATH
_foamAddPath $MPI_ARCH_PATH/bin
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm
;; ;;
@ -247,6 +242,6 @@ export MPI_BUFFER_SIZE=20000000
# cleanup environment: # cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unset _foamAddLib _foamAddPath unset _foamAddPath _foamAddLib _foamMkDir
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -83,6 +83,19 @@ HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
} }
} }
template<class T, class Key, class Hash>
HashTable<T, Key, Hash>::HashTable(const xfer<HashTable<T, Key, Hash> >& ht)
:
HashTableName(),
tableSize_(0),
table_(NULL),
nElmts_(0),
endIter_(*this, NULL, 0),
endConstIter_(*this, NULL, 0)
{
transfer(*ht);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -41,6 +41,7 @@ SourceFiles
#include "label.H" #include "label.H"
#include "word.H" #include "word.H"
#include "className.H" #include "className.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -155,6 +156,9 @@ public:
//- Construct as copy //- Construct as copy
HashTable(const HashTable<T, Key, Hash>&); HashTable(const HashTable<T, Key, Hash>&);
//- Construct by transferring the parameter contents
HashTable(const xfer<HashTable<T, Key, Hash> >&);
// Destructor // Destructor

View File

@ -76,6 +76,24 @@ StaticHashTable<T, Key, Hash>::StaticHashTable
{} {}
template<class T, class Key, class Hash>
StaticHashTable<T, Key, Hash>::StaticHashTable
(
const xfer<StaticHashTable<T, Key, Hash> >& ht
)
:
StaticHashTableName(),
keys_(0),
objects_(0),
nElmts_(0),
endIter_(*this, 0, 0),
endConstIter_(*this, 0, 0)
{
transfer(*ht);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class T, class Key, class Hash> template<class T, class Key, class Hash>

View File

@ -46,6 +46,7 @@ SourceFiles
#include "label.H" #include "label.H"
#include "word.H" #include "word.H"
#include "className.H" #include "className.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -146,6 +147,8 @@ public:
//- Construct as copy //- Construct as copy
StaticHashTable(const StaticHashTable<T, Key, Hash>&); StaticHashTable(const StaticHashTable<T, Key, Hash>&);
//- Construct as copy
StaticHashTable(const xfer<StaticHashTable<T, Key, Hash> >&);
// Destructor // Destructor

View File

@ -92,6 +92,12 @@ CompactListList<T>::CompactListList(const UList<label>& rowSizes, const T& t)
} }
template<class T>
CompactListList<T>::CompactListList(const xfer<CompactListList<T> >& lst)
{
transfer(*lst);
}
template<class T> template<class T>
CompactListList<T>::CompactListList(CompactListList<T>& cll, bool reUse) CompactListList<T>::CompactListList(CompactListList<T>& cll, bool reUse)
: :

View File

@ -103,6 +103,9 @@ public:
//- Construct given list of row-sizes //- Construct given list of row-sizes
CompactListList(const UList<label>& rowSizes, const T&); CompactListList(const UList<label>& rowSizes, const T&);
//- Construct by transferring the parameter contents
CompactListList(const xfer<CompactListList<T> >&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
CompactListList(CompactListList<T>&, bool reUse); CompactListList(CompactListList<T>&, bool reUse);

View File

@ -84,6 +84,10 @@ class DynamicList
//- Allocated size for underlying List. //- Allocated size for underlying List.
label allocSize_; label allocSize_;
// Private Member Functions
// Disabled, since the usefulness and semantics are not quite clear
void setSize(const label, const T&);
public: public:
@ -117,12 +121,14 @@ public:
// Edit // Edit
//- Reset size of List. //- Alter the list size.
// When the new size is greater than the addressed list size, the
// allocated list sizes is adjusted and the
// addressed size does not change.
// Otherwise the addressed list size is just reduced and the
// allocated size does not change.
inline void setSize(const label); inline void setSize(const label);
//- Reset size of List and value for new elements.
inline void setSize(const label, const T&);
//- Clear the list, i.e. set the size to zero. //- Clear the list, i.e. set the size to zero.
// Allocated size does not change // Allocated size does not change
inline void clear(); inline void clear();
@ -156,7 +162,7 @@ public:
// resizing the list if necessary // resizing the list if necessary
inline T& operator()(const label); inline T& operator()(const label);
//- Assignment of all entries to the given value //- Assignment of all addressed entries to the given value
inline void operator=(const T&); inline void operator=(const T&);
//- Assignment from List<T>. Also handles assignment from DynamicList. //- Assignment from List<T>. Also handles assignment from DynamicList.

View File

@ -33,7 +33,7 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList()
List<T>(SizeInc), List<T>(SizeInc),
allocSize_(SizeInc) allocSize_(SizeInc)
{ {
List<T>::size() = 0; List<T>::size(0);
} }
@ -47,7 +47,7 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
List<T>(s), List<T>(s),
allocSize_(s) allocSize_(s)
{ {
List<T>::size() = 0; List<T>::size(0);
} }
@ -79,18 +79,19 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
const label s const label s
) )
{ {
if (s <= List<T>::size()) label nextFree = List<T>::size();
if (s <= nextFree)
{ {
// shrink addressable size, leave allocated size untouched // adjust addressed size, leave allocated size untouched
List<T>::size() = s; nextFree = s;
} }
else else
{ {
label nextFree = List<T>::size(); // adjust allocated size, leave addressed size untouched
allocSize_ = s; allocSize_ = s;
List<T>::setSize(allocSize_); List<T>::setSize(allocSize_);
List<T>::size() = nextFree;
} }
List<T>::size(nextFree);
} }
@ -112,14 +113,17 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
allocSize_ = s; allocSize_ = s;
List<T>::setSize(allocSize_, t); List<T>::setSize(allocSize_, t);
List<T>::size() = nextFree; List<T>::size() = nextFree;
=======
>>>>>>> olesenm:src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
} }
List<T>::size(nextFree);
} }
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clear() inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clear()
{ {
List<T>::size() = 0; List<T>::size(0);
} }
@ -193,7 +197,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append(const T& e)
List<T>::setSize(allocSize_); List<T>::setSize(allocSize_);
} }
List<T>::size() = nextFree; List<T>::size(nextFree);
this->operator[](nextFree - 1) = e; this->operator[](nextFree - 1) = e;
} }
@ -214,7 +218,7 @@ inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()
const T& val = List<T>::operator[](nextFree); const T& val = List<T>::operator[](nextFree);
List<T>::size() = nextFree; List<T>::size(nextFree);
return val; return val;
} }
@ -242,7 +246,7 @@ inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()
List<T>::setSize(allocSize_); List<T>::setSize(allocSize_);
} }
List<T>::size() = nextFree; List<T>::size(nextFree);
return this->operator[](i); return this->operator[](i);
} }
@ -255,7 +259,6 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
) )
{ {
List<T>::operator=(t); List<T>::operator=(t);
allocSize_ = List<T>::size();
} }

View File

@ -125,6 +125,14 @@ Foam::List<T>::List(const List<T>& a)
} }
// Construct by transferring the parameter contents
template<class T>
Foam::List<T>::List(const xfer<List<T> >& lst)
{
transfer(*lst);
}
// Construct as copy or re-use as specified. // Construct as copy or re-use as specified.
template<class T> template<class T>
Foam::List<T>::List(List<T>& a, bool reUse) Foam::List<T>::List(List<T>& a, bool reUse)

View File

@ -43,6 +43,7 @@ SourceFiles
#include "UList.H" #include "UList.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -77,6 +78,12 @@ class List
public UList<T> public UList<T>
{ {
protected:
//- Override size to be inconsistent with allocated storage.
// Use with care.
inline void size(const label);
public: public:
// Constructors // Constructors
@ -93,6 +100,9 @@ public:
//- Copy constructor. //- Copy constructor.
List(const List<T>&); List(const List<T>&);
//- Construct by transferring the parameter contents
List(const xfer<List<T> >&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
List(List<T>&, bool reUse); List(List<T>&, bool reUse);
@ -142,9 +152,6 @@ public:
//- Return the number of elements in the UList. //- Return the number of elements in the UList.
inline label size() const; inline label size() const;
//- Override size to be inconsistent with allocated storage.
// Use with care.
inline label& size();
// Edit // Edit

View File

@ -53,19 +53,18 @@ inline T& Foam::List<T>::newElmt(const label i)
template<class T> template<class T>
inline Foam::label Foam::List<T>::size() const inline void Foam::List<T>::size(const label n)
{ {
return UList<T>::size_; UList<T>::size_ = n;
} }
template<class T> template<class T>
inline Foam::label& Foam::List<T>::size() inline Foam::label Foam::List<T>::size() const
{ {
return UList<T>::size_; return UList<T>::size_;
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T> template<class T>

View File

@ -44,6 +44,7 @@ PackedList<nBits>::PackedList(const label size, const unsigned int val)
} }
//- Copy constructor. //- Copy constructor.
template<int nBits> template<int nBits>
PackedList<nBits>::PackedList(const PackedList<nBits>& PList) PackedList<nBits>::PackedList(const PackedList<nBits>& PList)
@ -53,6 +54,13 @@ PackedList<nBits>::PackedList(const PackedList<nBits>& PList)
{} {}
template<int nBits>
PackedList<nBits>::PackedList(const xfer<PackedList<nBits> >& lst)
{
transfer(*lst);
}
//- Construct from labelList //- Construct from labelList
template<int nBits> template<int nBits>
PackedList<nBits>::PackedList(const labelList& lst) PackedList<nBits>::PackedList(const labelList& lst)

View File

@ -134,6 +134,9 @@ public:
//- Copy constructor. //- Copy constructor.
PackedList(const PackedList<nBits>& PList); PackedList(const PackedList<nBits>& PList);
//- Construct by transferring the parameter contents
PackedList(const xfer<PackedList<nBits> >&);
//- Construct from labelList. //- Construct from labelList.
PackedList(const labelList&); PackedList(const labelList&);

View File

@ -71,6 +71,13 @@ Foam::PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg)
} }
template<class T>
Foam::PtrList<T>::PtrList(const xfer<PtrList<T> >& lst)
{
transfer(*lst);
}
template<class T> template<class T>
Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reUse) Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reUse)
: :

View File

@ -129,6 +129,9 @@ public:
template<class CloneArg> template<class CloneArg>
PtrList(const PtrList<T>&, const CloneArg&); PtrList(const PtrList<T>&, const CloneArg&);
//- Construct by transferring the parameter contents
PtrList(const xfer<PtrList<T> >&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
PtrList(PtrList<T>&, bool reUse); PtrList(PtrList<T>&, bool reUse);

View File

@ -40,6 +40,17 @@ Foam::SortableList<Type>::SortableList(const List<Type>& values)
sort(); sort();
} }
// Construct from List by transferring
template <class Type>
Foam::SortableList<Type>::SortableList(const xfer<List<Type> >& values)
:
List<Type>(),
indices_((*values).size())
{
List<Type>::transfer(*values);
sort();
}
// Construct given size. Sort later on. // Construct given size. Sort later on.
template <class Type> template <class Type>

View File

@ -29,6 +29,8 @@ Description
A list that is sorted upon construction or when explicitly requested A list that is sorted upon construction or when explicitly requested
with the sort() method. with the sort() method.
Uses the Foam::stableSort() algorithm.
SourceFiles SourceFiles
SortableList.C SortableList.C
@ -84,10 +86,14 @@ public:
// Constructors // Constructors
//- Construct from List, sorting the elements. Starts with indices set //- Construct from List, sorting the elements.
// to index in argument // Starts with indices set to index in argument
explicit SortableList(const List<Type>&); explicit SortableList(const List<Type>&);
//- Construct from tranferred List, sorting the elements.
// Starts with indices set to index in argument
explicit SortableList(const xfer<List<Type> >&);
//- Construct given size. Sort later on. //- Construct given size. Sort later on.
explicit SortableList(const label size); explicit SortableList(const label size);

View File

@ -50,6 +50,13 @@ UPtrList<T>::UPtrList(const label s)
{} {}
template<class T>
UPtrList<T>::UPtrList(const xfer<UPtrList<T> >& lst)
{
transfer(*lst);
}
template<class T> template<class T>
UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse) UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse)
: :

View File

@ -110,6 +110,9 @@ public:
//- Construct with length specified. //- Construct with length specified.
explicit UPtrList(const label); explicit UPtrList(const label);
//- Construct by transferring the parameter contents
UPtrList(const xfer<UPtrList<T> >&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
UPtrList(UPtrList<T>&, bool reUse); UPtrList(UPtrList<T>&, bool reUse);

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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
Class
Foam::xfer
Description
A simple container that can be used to copy or transfer the contents
of objects of type \<T\>.
Since it is decided upon construction of the xfer object whether the
parameter is to be copied or transferred, the contents of resulting
object can be transferred unconditionally.
This greatly simplifies defining the constructors for other classes
with mixed transfer/copy semantics.
The wrapped object of type \<T\> must implement a transfer() method and
an operator=() copy method.
Note
The macros xferCopy(T,arg) and xferMove(T,arg) can be used as
workarounds for passing temporaries to copy-constructors.
SourceFiles
xferI.H
\*---------------------------------------------------------------------------*/
#ifndef xfer_H
#define xfer_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class xfer Declaration
\*---------------------------------------------------------------------------*/
template<class T>
class xfer
{
// Private data
//- Pointer to temporary object
mutable T* ptr_;
public:
// Constructors
//- Store object pointer and manage its deletion
// Can also be used later to transfer by assignment
inline explicit xfer(T* = 0);
//- Construct by copying or by transferring the parameter contents
inline xfer(T&, bool allowTransfer=false);
//- Construct by copying the parameter contents
inline xfer(const T&);
//- Construct by transferring the contents
inline xfer(const xfer<T>&);
// Destructor
inline ~xfer();
// Member Operators
//- Transfer the contents into the object
inline void operator=(T&);
//- Transfer the contents into the object
inline void operator=(const xfer<T>&);
//- Return a non-const reference to const object
// @sa xferCopy, xferMove macros alternatives for copy-constructors
inline const xfer<T>& operator()() const;
//- Reference to the underlying datatype
inline T& operator*() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
/**
* @def xferCopy(T,arg)
* Construct by copying the contents of the @a arg
* and return a const reference to an xfer of type \<T\>
*
* Useful for constructors where the argument is temporary.
* This is a workaround for a template resolution issue.
*
* @sa xferMove and Foam::xfer
*/
#define xferCopy(T,arg) \
(static_cast<const Foam::xfer< T >&>(Foam::xfer< T >(arg)()))
/**
* @def xferMove(T,arg)
* Construct by transferring the contents of the @a arg
* and return a const reference to an xfer of type \<T\>
*
* Useful for constructors where the argument is temporary.
* This is a workaround for a template resolution issue.
*
* @par Example Use
* @code
* List<label> a;
* ...
* List<label> b(xferMove(List<label>, a));
* @endcode
*
* @sa xferCopy and Foam::xfer
*/
#define xferMove(T,arg) \
(static_cast<const Foam::xfer< T >&>(Foam::xfer< T >(arg, true)()))
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "xferI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,113 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T>
inline Foam::xfer<T>::xfer(T* p)
:
ptr_(p ? p : new T)
{}
template<class T>
inline Foam::xfer<T>::xfer(T& t, bool allowTransfer)
:
ptr_(new T)
{
if (allowTransfer)
{
ptr_->transfer(t);
}
else
{
ptr_->operator=(t);
}
}
template<class T>
inline Foam::xfer<T>::xfer(const T& t)
:
ptr_(new T)
{
ptr_->operator=(t);
}
template<class T>
inline Foam::xfer<T>::xfer(const xfer<T>& t)
:
ptr_(new T)
{
ptr_->transfer(*(t.ptr_));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class T>
inline Foam::xfer<T>::~xfer()
{
delete ptr_;
ptr_ = 0;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
inline void Foam::xfer<T>::operator=(T& t)
{
ptr_->transfer(t);
}
template<class T>
inline void Foam::xfer<T>::operator=(const xfer<T>& t)
{
// silently ignore copy to self
if (this != &t)
{
ptr_->transfer(*(t.ptr_));
}
}
template<class T>
inline const Foam::xfer<T>& Foam::xfer<T>::operator()() const
{
return *this;
}
template<class T>
inline T& Foam::xfer<T>::operator*() const
{
return *ptr_;
}
// ************************************************************************* //

View File

@ -155,7 +155,7 @@ protected:
// Protected member functions // Protected member functions
//- Construct and return an IFstream for the object. //- Construct and return an IFstream for the object.
// The results is NULL if the stream constuction failed // The results is NULL if the stream construction failed
Istream* objectStream(); Istream* objectStream();
//- Set the object state to bad //- Set the object state to bad

View File

@ -29,41 +29,15 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::IOField<Type>::IOField Foam::IOField<Type>::IOField(const IOobject& io)
(
const IOobject& io
)
: :
regIOobject(io), regIOobject(io)
Field<Type>(readStream(typeName))
{ {
close(); if
}
template<class Type>
Foam::IOField<Type>::IOField
( (
const IOobject& io, io.readOpt() == IOobject::MUST_READ
const label size || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
) )
:
regIOobject(io),
Field<Type>(size)
{}
template<class Type>
Foam::IOField<Type>::IOField
(
const IOobject& io,
const Field<Type>& f
)
:
regIOobject(io),
Field<Type>(f)
{
if (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
{ {
readStream(typeName) >> *this; readStream(typeName) >> *this;
close(); close();
@ -71,11 +45,77 @@ Foam::IOField<Type>::IOField
} }
template<class Type>
Foam::IOField<Type>::IOField(const IOobject& io, const label size)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
else
{
Field<Type>::setSize(size);
}
}
template<class Type>
Foam::IOField<Type>::IOField(const IOobject& io, const Field<Type>& f)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
else
{
Field<Type>::operator=(f);
}
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
template<class T> template<class Type>
Foam::IOField<T>::~IOField() Foam::IOField<Type>::~IOField()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
bool Foam::IOField<Type>::writeData(Ostream& os) const
{
return (os << static_cast<const Field<Type>&>(*this)).good();
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type>
void Foam::IOField<Type>::operator=(const IOField<Type>& rhs)
{
Field<Type>::operator=(rhs);
}
template<class Type>
void Foam::IOField<Type>::operator=(const Field<Type>& rhs)
{
Field<Type>::operator=(rhs);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -63,24 +63,13 @@ public:
// Constructors // Constructors
//- Construct from IOobject //- Construct from IOobject
IOField IOField(const IOobject&);
(
const IOobject&
);
//- Construct from components //- Construct from components
IOField IOField(const IOobject&, const Field<Type>&);
(
const IOobject&,
const Field<Type>&
);
//- Construct from IOobject and size (does not set values) //- Construct from IOobject and size (does not set values)
IOField IOField(const IOobject&, const label size);
(
const IOobject&,
const label size
);
// Destructor // Destructor
@ -90,23 +79,14 @@ public:
// Member functions // Member functions
bool writeData(Ostream& os) const bool writeData(Ostream&) const;
{
return (os << static_cast<const Field<Type>&>(*this)).good();
}
// Member operators // Member operators
void operator=(const IOField<Type>& iof) void operator=(const IOField<Type>&);
{
Field<Type>::operator=(iof);
}
void operator=(const Field<Type>& f) void operator=(const Field<Type>&);
{
Field<Type>::operator=(f);
}
}; };

View File

@ -84,7 +84,6 @@ Foam::IOList<T>::IOList(const IOobject& io, const List<T>& list)
{ {
List<T>::operator=(list); List<T>::operator=(list);
} }
} }
@ -95,6 +94,16 @@ Foam::IOList<T>::~IOList()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
bool Foam::IOList<T>::writeData(Ostream& os) const
{
return (os << *this).good();
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T> template<class T>
@ -111,11 +120,4 @@ void Foam::IOList<T>::operator=(const List<T>& rhs)
} }
template<class T>
bool Foam::IOList<T>::writeData(Ostream& os) const
{
return (os << *this).good();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -31,8 +31,7 @@ License
template<class T> template<class T>
Foam::IOMap<T>::IOMap(const IOobject& io) Foam::IOMap<T>::IOMap(const IOobject& io)
: :
regIOobject(io), regIOobject(io)
Map<T>()
{ {
if if
( (

View File

@ -91,14 +91,7 @@ Foam::IOPtrList<T>::~IOPtrList()
{} {}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
void Foam::IOPtrList<T>::operator=(const IOPtrList<T>& rhs)
{
PtrList<T>::operator=(rhs);
}
template<class T> template<class T>
bool Foam::IOPtrList<T>::writeData(Ostream& os) const bool Foam::IOPtrList<T>::writeData(Ostream& os) const
@ -107,4 +100,12 @@ bool Foam::IOPtrList<T>::writeData(Ostream& os) const
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
void Foam::IOPtrList<T>::operator=(const IOPtrList<T>& rhs)
{
PtrList<T>::operator=(rhs);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -42,15 +42,10 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::IOdictionary::IOdictionary Foam::IOdictionary::IOdictionary(const IOobject& io)
(
const IOobject& io
)
: :
regIOobject(io) regIOobject(io)
{ {
dictionary::name() = IOobject::objectPath();
if if
( (
io.readOpt() == IOobject::MUST_READ io.readOpt() == IOobject::MUST_READ
@ -60,18 +55,29 @@ Foam::IOdictionary::IOdictionary
readStream(typeName) >> *this; readStream(typeName) >> *this;
close(); close();
} }
dictionary::name() = IOobject::objectPath();
} }
Foam::IOdictionary::IOdictionary Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
(
const IOobject& io,
const dictionary& dict
)
: :
regIOobject(io), regIOobject(io)
dictionary(dict)
{ {
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
else
{
dictionary::operator=(dict);
}
dictionary::name() = IOobject::objectPath(); dictionary::name() = IOobject::objectPath();
} }
@ -92,9 +98,9 @@ const Foam::word& Foam::IOdictionary::name() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::IOdictionary::operator=(const IOdictionary& d) void Foam::IOdictionary::operator=(const IOdictionary& rhs)
{ {
dictionary::operator=(d); dictionary::operator=(rhs);
} }

View File

@ -34,27 +34,17 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam bool Foam::IOdictionary::readData(Istream& is)
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool IOdictionary::readData(Istream& is)
{ {
is >> *this; is >> *this;
return !is.bad(); return !is.bad();
} }
bool IOdictionary::writeData(Ostream& os) const bool Foam::IOdictionary::writeData(Ostream& os) const
{ {
dictionary::write(os, false); dictionary::write(os, false);
return os.good(); return os.good();
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -63,7 +63,7 @@ class functionObjectList
//- Dictionary containing the list of function object specifications //- Dictionary containing the list of function object specifications
const dictionary& foDict_; const dictionary& foDict_;
//- Switch for the execultion of the functionObjects //- Switch for the execution of the functionObjects
bool execution_; bool execution_;
@ -84,7 +84,7 @@ public:
// The functionObject specifications are read from the controlDict // The functionObject specifications are read from the controlDict
functionObjectList functionObjectList
( (
const Time& t, const Time&,
const bool execution = true const bool execution = true
); );
@ -93,7 +93,7 @@ public:
// setting // setting
functionObjectList functionObjectList
( (
const Time& t, const Time&,
const dictionary& foDict, const dictionary& foDict,
const bool execution = true const bool execution = true
); );

View File

@ -101,7 +101,7 @@ public:
//- Construct as copy //- Construct as copy
regIOobject(const regIOobject&); regIOobject(const regIOobject&);
//- Construct as copy, and transfering registry registration to copy //- Construct as copy, and transferring registry registration to copy
// if registerCopy is true // if registerCopy is true
regIOobject(const regIOobject&, bool registerCopy); regIOobject(const regIOobject&, bool registerCopy);

View File

@ -105,18 +105,15 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent()
( (
"GeometricField<Type, PatchField, GeoMesh>::readIfPresent()" "GeometricField<Type, PatchField, GeoMesh>::readIfPresent()"
) << "read option IOobject::MUST_READ " ) << "read option IOobject::MUST_READ "
<< "suggests that a read constuctor for field " << this->name() << "suggests that a read constructor for field " << this->name()
<< " would be more appropriate." << endl; << " would be more appropriate." << endl;
} }
else if (this->readOpt() == IOobject::READ_IF_PRESENT) else if (this->readOpt() == IOobject::READ_IF_PRESENT && this->headerOk())
{
if (this->headerOk())
{ {
boundaryField_.transfer(readField(this->readStream(typeName))()); boundaryField_.transfer(readField(this->readStream(typeName))());
this->close(); this->close();
// Check compatibility between field and mesh // Check compatibility between field and mesh
if (this->size() != GeoMesh::size(this->mesh())) if (this->size() != GeoMesh::size(this->mesh()))
{ {
FatalIOErrorIn FatalIOErrorIn
@ -134,7 +131,6 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent()
return true; return true;
} }
}
return false; return false;
} }
@ -149,7 +145,7 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readOldTimeIfPresent()
this->name() + "_0", this->name() + "_0",
this->time().timeName(), this->time().timeName(),
this->db(), this->db(),
IOobject::MUST_READ, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
); );

View File

@ -214,7 +214,7 @@ public:
//- Construct from IOobject //- Construct from IOobject
explicit polyMesh(const IOobject& io); explicit polyMesh(const IOobject& io);
//- Construct from components without boundary. //- Construct without boundary from components.
// Boundary is added using addPatches() member function // Boundary is added using addPatches() member function
polyMesh polyMesh
( (
@ -226,8 +226,7 @@ public:
const bool syncPar = true const bool syncPar = true
); );
//- Construct from components with cells rather than owner //- Construct without boundary with cells rather than owner/neighbour.
// and neighbourwithout boundary.
// Boundary is added using addPatches() member function // Boundary is added using addPatches() member function
polyMesh polyMesh
( (
@ -263,8 +262,7 @@ public:
// Database // Database
//- Over-ride the objectRegistry dbDir //- Override the objectRegistry dbDir for a single-region case
// if this is single-region case
virtual const fileName& dbDir() const; virtual const fileName& dbDir() const;
//- Return the local mesh directory (dbDir()/meshSubDir) //- Return the local mesh directory (dbDir()/meshSubDir)
@ -311,17 +309,17 @@ public:
return bounds_; return bounds_;
} }
//- Return the vector of valid directions in mesh //- Return the vector of valid directions in mesh.
// defined according to the presence of empty patches. // Defined according to the presence of empty patches.
// 1 indicates valid direction and -1 an invalid direction. // 1 indicates valid direction and -1 an invalid direction.
const Vector<label>& directions() const; const Vector<label>& directions() const;
//- Return the number of valid geoemtric dimensions in the mesh //- Return the number of valid geometric dimensions in the mesh
label nGeometricD() const; label nGeometricD() const;
//- Return the number of valid solution dimensions in the mesh //- Return the number of valid solution dimensions in the mesh.
// For wedge cases this includes the circumferential direction // For wedge cases this includes the circumferential direction
// in case of swirl // in case of swirl.
label nSolutionD() const; label nSolutionD() const;
//- Return point zone mesh //- Return point zone mesh

View File

@ -114,6 +114,22 @@ Foam::cellZone::cellZone
{} {}
Foam::cellZone::cellZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
{}
// Construct from dictionary // Construct from dictionary
Foam::cellZone::cellZone Foam::cellZone::cellZone
( (
@ -148,6 +164,21 @@ Foam::cellZone::cellZone
cellLookupMapPtr_(NULL) cellLookupMapPtr_(NULL)
{} {}
Foam::cellZone::cellZone
(
const cellZone& cz,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)
:
labelList(addr),
name_(cz.name()),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -128,26 +128,45 @@ public:
const word& name, const word& name,
const labelList& addr, const labelList& addr,
const label index, const label index,
const cellZoneMesh& zm const cellZoneMesh&
);
//- Construct from components, transferring contents
cellZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh&
); );
//- Construct from dictionary //- Construct from dictionary
cellZone cellZone
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const cellZoneMesh& zm const cellZoneMesh&
); );
//- Construct given the original zone and resetting the //- Construct given the original zone and resetting the
// cell list and zone mesh information // cell list and zone mesh information
cellZone cellZone
( (
const cellZone& cz, const cellZone&,
const labelList& addr, const labelList& addr,
const label index, const label index,
const cellZoneMesh& zm const cellZoneMesh&
);
//- Construct given the original zone, resetting the
// cell list and zone mesh information
cellZone
(
const cellZone&,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh&
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -182,7 +201,7 @@ public:
static autoPtr<cellZone> New static autoPtr<cellZone> New
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh&
); );

View File

@ -242,6 +242,30 @@ Foam::faceZone::faceZone
} }
Foam::faceZone::faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)
:
labelList(addr),
name_(name),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
{
checkAddressing();
}
// Construct from dictionary // Construct from dictionary
Foam::faceZone::faceZone Foam::faceZone::faceZone
( (
@ -292,6 +316,30 @@ Foam::faceZone::faceZone
} }
Foam::faceZone::faceZone
(
const faceZone& fz,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)
:
labelList(addr),
name_(fz.name()),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
{
checkAddressing();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceZone::~faceZone() Foam::faceZone::~faceZone()

View File

@ -163,24 +163,45 @@ public:
const faceZoneMesh& zm const faceZoneMesh& zm
); );
//- Construct from components, transferring contents
faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh&
);
//- Construct from dictionary //- Construct from dictionary
faceZone faceZone
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const faceZoneMesh& zm const faceZoneMesh&
); );
//- Construct given the original zone and resetting the //- Construct given the original zone and resetting the
// face list and zone mesh information // face list and zone mesh information
faceZone faceZone
( (
const faceZone& fz, const faceZone&,
const labelList& addr, const labelList& addr,
const boolList& fm, const boolList& fm,
const label index, const label index,
const faceZoneMesh& zm const faceZoneMesh&
);
//- Construct given the original zone, resetting the
// face list and zone mesh information
faceZone
(
const faceZone&,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh&
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -216,9 +237,9 @@ public:
static autoPtr<faceZone> New static autoPtr<faceZone> New
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const faceZoneMesh& zm const faceZoneMesh&
); );

View File

@ -112,6 +112,22 @@ Foam::pointZone::pointZone
{} {}
Foam::pointZone::pointZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
{}
// Construct from dictionary // Construct from dictionary
Foam::pointZone::pointZone Foam::pointZone::pointZone
( (
@ -147,6 +163,22 @@ Foam::pointZone::pointZone
{} {}
Foam::pointZone::pointZone
(
const pointZone& pz,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)
:
labelList(addr),
name_(pz.name()),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pointZone::~pointZone() Foam::pointZone::~pointZone()

View File

@ -130,26 +130,45 @@ public:
const word& name, const word& name,
const labelList& addr, const labelList& addr,
const label index, const label index,
const pointZoneMesh& zm const pointZoneMesh&
);
//- Construct from components, transferring contents
pointZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh&
); );
//- Construct from dictionary //- Construct from dictionary
pointZone pointZone
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const pointZoneMesh& zm const pointZoneMesh&
); );
//- Construct given the original zone and resetting the //- Construct given the original zone and resetting the
// point list and zone mesh information // point list and zone mesh information
pointZone pointZone
( (
const pointZone& pz, const pointZone&,
const labelList& addr, const labelList& addr,
const label index, const label index,
const pointZoneMesh& zm const pointZoneMesh&
);
//- Construct given the original zone, resetting the
// face list and zone mesh information
pointZone
(
const pointZone&,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh&
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -184,7 +203,7 @@ public:
static autoPtr<pointZone> New static autoPtr<pointZone> New
( (
const word& name, const word& name,
const dictionary& dict, const dictionary&,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh&
); );

View File

@ -167,7 +167,7 @@ const labelList& primitiveMesh::pointCells
} }
} }
storage.size() = n; storage.setSize(n);
return storage; return storage;
} }

View File

@ -60,8 +60,7 @@ protected:
// Private data // Private data
//- Name of this set of forces, //- Name of this set of system calls
// Also used as the name of the probes directory.
word name_; word name_;
const objectRegistry& obr_; const objectRegistry& obr_;

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
setControlDict () { setControlDict () {
controlDict="system/controlDict" controlDict="system/controlDict"

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
cavityCases="cavity cavityFine cavityGrade cavityHighRe cavityClipped" cavityCases="cavity cavityFine cavityGrade cavityHighRe cavityClipped"

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
setDamBreakFine () setDamBreakFine ()
{ {

View File

@ -5,9 +5,10 @@
# Get application directory # Get application directory
application="laplacianFoam" application="laplacianFoam"
runIdeasToFoam () runAnsysToFoam()
{ {
if [ -f log.ideasToFoam ] ; then if [ -f log.ansysToFoam ]
then
echo "ansysToFoam already run on $PWD: remove log file to run" echo "ansysToFoam already run on $PWD: remove log file to run"
else else
echo "ansysToFoam: converting mesh $1" echo "ansysToFoam: converting mesh $1"
@ -15,7 +16,7 @@ runIdeasToFoam ()
fi fi
} }
runIdeasToFoam flange.ans 0.001 runAnsysToFoam flange.ans 0.001
runApplication $application runApplication $application
runApplication foamToFieldview9 runApplication foamToFieldview9
runApplication foamToEnsight runApplication foamToEnsight

View File

@ -7,21 +7,21 @@ application="lesCavitatingFoam"
refineMeshByCellSet() refineMeshByCellSet()
{ {
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1" echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict cp system/cellSetDict.$1 system/cellSetDict
cellSet >& log.cellSet.$1 cellSet > log.cellSet.$1 2>&1
echo "refining primary zone - $1" echo "refining primary zone - $1"
refineMesh -dict -overwrite >& log.refineMesh.$1 refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
} }
cd throttle cd throttle
runApplication blockMesh runApplication blockMesh
refineMeshByCellSet 1 2 3
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
runApplication $application runApplication $application
cd .. cd ..
@ -29,10 +29,7 @@ cd throttle3D
cp -r 0.org 0 cp -r 0.org 0
runApplication blockMesh runApplication blockMesh
refineMeshByCellSet 1 2 3
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
echo "mapping fields from 2D throttle case" echo "mapping fields from 2D throttle case"
mapFields ../throttle -sourceTime latestTime >& log.mapFields mapFields ../throttle -sourceTime latestTime >& log.mapFields

View File

@ -7,20 +7,19 @@ application="rasCavitatingFoam"
refineMeshByCellSet() refineMeshByCellSet()
{ {
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1" echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict cp system/cellSetDict.$1 system/cellSetDict
cellSet >& log.cellSet.$1 cellSet > log.cellSet.$1 2>&1
echo "refining primary zone - $1" echo "refining primary zone - $1"
refineMesh -dict -overwrite >& log.refineMesh.$1 refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
} }
runApplication blockMesh runApplication blockMesh
refineMeshByCellSet 1 2 3
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
runApplication $application runApplication $application

View File

@ -1,10 +1,9 @@
#!/bin/sh #!/bin/sh
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
cases=" \ cases=" \
shockTube \ shockTube \
@ -15,9 +14,10 @@ LadenburgJet60psi \
biconic25-55Run35 \ biconic25-55Run35 \
" "
moveTimeMeshToConstant () { moveTimeMeshToConstant ()
{
DT=`foamInfoExec -times | tail -1` DT=`foamInfoExec -times | tail -1`
if [ $DT != 0 ] ; then if [ "$DT" != 0 ] ; then
mv ${DT}/polyMesh/* constant/polyMesh mv ${DT}/polyMesh/* constant/polyMesh
rm -rf ${DT} rm -rf ${DT}
fi fi

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
setDecompressionTankFine () setDecompressionTankFine ()
{ {

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name from directory
application=`basename $PWD` application=${PWD##*/}
runStarToFoam () runStarToFoam ()
{ {

View File

@ -55,7 +55,7 @@ functions
// patches (WALL10); // patches (WALL10);
// // Name of fields // // Name of fields
// pName p; // pName p;
// Uname U; // UName U;
// // Dump to file // // Dump to file
// log true; // log true;
// // Density // // Density
@ -73,7 +73,7 @@ functions
patches (WALL10); patches (WALL10);
// Name of fields // Name of fields
pName p; pName p;
Uname U; UName U;
// Dump to file // Dump to file
log true; log true;
// Density // Density
@ -95,9 +95,6 @@ functions
Aref 1.0; Aref 1.0;
} }
); );
// ************************************************************************* // // ************************************************************************* //