Merge branch 'master' into particleInteractions

Conflicts:
	src/parallel/decompose/decompositionMethods/Make/options
This commit is contained in:
graham
2010-03-23 11:18:53 +00:00
115 changed files with 5324 additions and 2119 deletions

27
README
View File

@ -2,7 +2,7 @@
# #
#+TITLE: OpenFOAM README for version 1.6 #+TITLE: OpenFOAM README for version 1.6
#+AUTHOR: OpenCFD Ltd. #+AUTHOR: OpenCFD Ltd.
#+DATE: November 2009 #+DATE: March 2010
#+LINK: http://www.opencfd.co.uk #+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
@ -23,10 +23,10 @@
section "Running OpenFOAM in 32-bit mode". section "Running OpenFOAM in 32-bit mode".
*** Qt (from http://trolltech.com/products/qt) *** Qt (from http://trolltech.com/products/qt)
The ParaView 3.6.1 visualisation package requires Qt to be installed on the The ParaView 3.7.0 visualisation package requires Qt to be installed on the
system. ParaView's producers state that ParaView is only officially system. ParaView's producers state that ParaView is only officially
supported on Qt version 4.3.x. However, we have found in limited tests that supported on Qt version 4.6.x. However, we have found in limited tests that
ParaView works satisfactorily with newer versions of Qt than 4.3.x. To ParaView works satisfactorily with Qt than 4.5.x. To
check whether Qt4 is installed, and the version, type: check whether Qt4 is installed, and the version, type:
+ qmake --version + qmake --version
@ -44,13 +44,14 @@
+ openSUSE-10.3: Version 4.3.1 + openSUSE-10.3: Version 4.3.1
+ openSUSE-11.0: Version 4.4.0 + openSUSE-11.0: Version 4.4.0
+ openSUSE-11.1: Version 4.4.3 + openSUSE-11.1: Version 4.4.3
+ openSUSE-11.2: Version 4.5.3
Compilation and running of ParaView has been successful using the libraries Compilation and running of ParaView has been successful using the libraries
downloaded in the "libqt4-dev" package on ubuntu. downloaded in the "libqt4-dev" package on ubuntu.
If you don't have an appropriate version of Qt installed you can download If you don't have an appropriate version of Qt installed you can download
the sources from TrollTech e.g.: the sources e.g.:
ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2 http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz
and compile and install in /usr/local or some other location that does not and compile and install in /usr/local or some other location that does not
conflict with the pre-installed version. conflict with the pre-installed version.
@ -108,7 +109,7 @@
* Building from Sources (Optional) * Building from Sources (Optional)
If you cannot find an appropriate binary pack for your platform, you can build If you cannot find an appropriate binary pack for your platform, you can build
the complete OpenFOAM from the source-pack. You will first need to compile or the complete OpenFOAM from the source-pack. You will first need to compile or
obtain a recent version of gcc (we recomend gcc-4.3.?) for your platform, obtain a recent version of gcc (we recommend gcc-4.4.?) for your platform,
which may be obtained from http://gcc.gnu.org/. which may be obtained from http://gcc.gnu.org/.
Install the compiler in Install the compiler in
@ -157,16 +158,16 @@
Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for
more information. more information.
* Compiling Paraview 3.6.1 and the PV3FoamReader module * Compiling Paraview 3.7.0 and the PV3FoamReader module
If there are problems encountered with ParaView, then it may be necessary to If there are problems encountered with ParaView, then it may be necessary to
compile ParaView from sources. The compilation compile ParaView from sources. The compilation
is a fairly simple process using the makeParaView script is a fairly simple process using the makeParaView script
(found in ThirdParty directory), which has worked in our tests with other (found in ThirdParty directory), which has worked in our tests with other
packages supplied in the ThirdParty directory, namely cmake-2.6.4 and packages supplied in the ThirdParty directory, namely cmake-2.8.0 and
gcc-4.3.3. Execute the following: gcc-4.4.3. Execute the following:
+ cd $WM_THIRD_PARTY_DIR + cd $WM_THIRD_PARTY_DIR
+ rm -rf paraview-3.6.1/platforms + rm -rf paraview-3.7.0/platforms
+ rm -rf platforms/*/paraview-3.6.1 + rm -rf platforms/*/paraview-3.7.0
+ ./makeParaView + ./makeParaView
The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled
@ -178,7 +179,7 @@
*** Compiling Paraview with a local version of Qt *** Compiling Paraview with a local version of Qt
If the user still encounters problems with ParaView, it may relate to the If the user still encounters problems with ParaView, it may relate to the
version of Qt, in which case, it is recommended that the user first version of Qt, in which case, it is recommended that the user first
downloads a supported version of Qt /e.g./ 4.3.5 as described in the section downloads a supported version of Qt /e.g./ 4.5.3 as described in the section
on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR. on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR: Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
+ ./makeQt + ./makeQt

View File

@ -0,0 +1,4 @@
rhoPorousMRFPimpleFoam.C
EXE = $(FOAM_APPBIN)/rhoPorousMRFPimpleFoam

View File

@ -0,0 +1,15 @@
EXE_INC = \
-I../rhoPimpleFoam \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,39 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
pZones.ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
if (oCorr == nOuterCorr-1)
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn());
volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p));
}
}
else
{
U = rUA*(UEqn().H() - fvc::grad(p));
U.correctBoundaryConditions();
}

View File

@ -0,0 +1,70 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
dimensionedScalar pMin
(
mesh.solutionDict().subDict("PIMPLE").lookup("pMin")
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
//dimensionedScalar initialMass = fvc::domainIntegrate(rho);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
porousZones pZones(mesh);
Switch pressureImplicitPorosity(false);

View File

@ -0,0 +1,123 @@
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H();
if (nCorr <= 1)
{
UEqn.clear();
}
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
if
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
//+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
mrfZones.relativeFlux(fvc::interpolate(rho), phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
);
if
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
//if (oCorr != nOuterCorr-1)
{
// Explicitly relax pressure for momentum corrector
p.relax();
rho = thermo.rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
}
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
/*
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
*/

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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
rhoPorousMRFPimpleFoam
Description
Transient solver for laminar or turbulent flow of compressible fluids
with support for porous media and MRF for HVAC and similar applications.
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient simulations.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "bound.H"
#include "MRFZones.H"
#include "porousZones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
if (nOuterCorr != 1)
{
p.storePrevIter();
rho.storePrevIter();
}
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
#include "UEqn.H"
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
turbulence->correct();
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -59,7 +59,17 @@
alpharScheme alpharScheme
); );
MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
phiAlpha1,
Sp,
Su,
1,
0
);
surfaceScalarField rho1f = fvc::interpolate(rho1); surfaceScalarField rho1f = fvc::interpolate(rho1);
surfaceScalarField rho2f = fvc::interpolate(rho2); surfaceScalarField rho2f = fvc::interpolate(rho2);

View File

@ -59,7 +59,7 @@
alpharScheme alpharScheme
); );
MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0);
surfaceScalarField rho1f = fvc::interpolate(rho1); surfaceScalarField rho1f = fvc::interpolate(rho1);
surfaceScalarField rho2f = fvc::interpolate(rho2); surfaceScalarField rho2f = fvc::interpolate(rho2);

View File

@ -70,12 +70,12 @@
MULES::limiter MULES::limiter
( (
allLambda, allLambda,
oneField(), geometricOneField(),
alpha1, alpha1,
phiAlpha1BD, phiAlpha1BD,
phiAlpha1, phiAlpha1,
zeroField(), zero(),
zeroField(), zero(),
1, 1,
0, 0,
3 3
@ -107,12 +107,12 @@
MULES::limiter MULES::limiter
( (
allLambda, allLambda,
oneField(), geometricOneField(),
alpha2, alpha2,
phiAlpha2BD, phiAlpha2BD,
phiAlpha2, phiAlpha2,
zeroField(), zero(),
zeroField(), zero(),
1, 1,
0, 0,
3 3

View File

@ -51,8 +51,8 @@
); );
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); //MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
rhoPhi += rhoPhi +=
(runTime.deltaT()/totalDeltaT) (runTime.deltaT()/totalDeltaT)

View File

@ -11,6 +11,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
-lautoMesh -lautoMesh

View File

@ -347,7 +347,7 @@ int main(int argc, char *argv[])
<< "You have selected decomposition method " << "You have selected decomposition method "
<< decomposer.typeName << decomposer.typeName
<< " which is not parallel aware." << endl << " which is not parallel aware." << endl
<< "Please select one that is (hierarchical, parMetis)" << "Please select one that is (hierarchical, ptscotch)"
<< exit(FatalError); << exit(FatalError);
} }

View File

@ -28,20 +28,6 @@ License
#include "Time.H" #include "Time.H"
#include "plane.H" #include "plane.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::label Foam::mirrorFvMesh::cellRenumber[8][8] =
{
{-1, -1, -1, -1, -1, -1, -1, -1}, // unknown
{-1, -1, -1, -1, -1, -1, -1, -1}, //
{-1, -1, -1, -1, -1, -1, -1, -1}, //
{ 0, 3, 2, 1, 4, 7, 6, 5}, // hex
{ 2, 1, 0, 5, 4, 3, 6, -1}, // wedge
{ 0, 2, 1, 3, 5, 4, -1, -1}, // prism
{ 0, 3, 2, 1, 4, -1, -1, -1}, // pyramid
{ 2, 1, 0, 3, -1, -1, -1, -1}, // tet
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io) Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)

View File

@ -71,12 +71,6 @@ class mirrorFvMesh
public: public:
// Static data
//- Cell renumnering table
static const label cellRenumber[8][8];
// Constructors // Constructors
//- Construct from IOobject //- Construct from IOobject

View File

@ -68,6 +68,104 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
label addPointZone(const polyMesh& mesh, const word& name)
{
label zoneID = mesh.pointZones().findZoneID(name);
if (zoneID != -1)
{
Info<< "Reusing existing pointZone "
<< mesh.pointZones()[zoneID].name()
<< " at index " << zoneID << endl;
}
else
{
pointZoneMesh& pointZones = const_cast<polyMesh&>(mesh).pointZones();
zoneID = pointZones.size();
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
pointZones.setSize(zoneID+1);
pointZones.set
(
zoneID,
new pointZone
(
name,
labelList(0),
zoneID,
pointZones
)
);
}
return zoneID;
}
label addFaceZone(const polyMesh& mesh, const word& name)
{
label zoneID = mesh.faceZones().findZoneID(name);
if (zoneID != -1)
{
Info<< "Reusing existing faceZone " << mesh.faceZones()[zoneID].name()
<< " at index " << zoneID << endl;
}
else
{
faceZoneMesh& faceZones = const_cast<polyMesh&>(mesh).faceZones();
zoneID = faceZones.size();
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
faceZones.setSize(zoneID+1);
faceZones.set
(
zoneID,
new faceZone
(
name,
labelList(0),
boolList(),
zoneID,
faceZones
)
);
}
return zoneID;
}
label addCellZone(const polyMesh& mesh, const word& name)
{
label zoneID = mesh.cellZones().findZoneID(name);
if (zoneID != -1)
{
Info<< "Reusing existing cellZone " << mesh.cellZones()[zoneID].name()
<< " at index " << zoneID << endl;
}
else
{
cellZoneMesh& cellZones = const_cast<polyMesh&>(mesh).cellZones();
zoneID = cellZones.size();
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
cellZones.setSize(zoneID+1);
cellZones.set
(
zoneID,
new cellZone
(
name,
labelList(0),
zoneID,
cellZones
)
);
}
return zoneID;
}
// Checks whether patch present // Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name) void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{ {
@ -211,29 +309,20 @@ int main(int argc, char *argv[])
polyTopoChanger stitcher(mesh); polyTopoChanger stitcher(mesh);
stitcher.setSize(1); stitcher.setSize(1);
DynamicList<pointZone*> pz; mesh.pointZones().clearAddressing();
DynamicList<faceZone*> fz; mesh.faceZones().clearAddressing();
DynamicList<cellZone*> cz; mesh.cellZones().clearAddressing();
if (perfectCover) if (perfectCover)
{ {
// Add empty zone for resulting internal faces // Add empty zone for resulting internal faces
fz.append label cutZoneID = addFaceZone(mesh, cutZoneName);
(
new faceZone
(
cutZoneName,
isf,
boolList(masterPatch.size(), false),
0,
mesh.faceZones()
)
);
// Note: make sure to add the zones BEFORE constructing polyMeshModifier mesh.faceZones()[cutZoneID].resetAddressing
// (since looks up various zones at construction time) (
Info<< "Adding point and face zones" << endl; isf,
mesh.addZones(pz.shrink(), fz.shrink(), cz.shrink()); boolList(masterPatch.size(), false)
);
// Add the perfect interface mesh modifier // Add the perfect interface mesh modifier
stitcher.set stitcher.set
@ -252,27 +341,15 @@ int main(int argc, char *argv[])
} }
else else
{ {
pz.append label pointZoneID = addPointZone(mesh, mergePatchName + "CutPointZone");
( mesh.pointZones()[pointZoneID] = labelList(0);
new pointZone
(
mergePatchName + "CutPointZone",
labelList(0),
0,
mesh.pointZones()
)
);
fz.append label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone");
mesh.faceZones()[masterZoneID].resetAddressing
( (
new faceZone
(
mergePatchName + "MasterZone",
isf, isf,
boolList(masterPatch.size(), false), boolList(masterPatch.size(), false)
0,
mesh.faceZones()
)
); );
// Slave patch // Slave patch
@ -289,37 +366,22 @@ int main(int argc, char *argv[])
osf[i] = slavePatch.start() + i; osf[i] = slavePatch.start() + i;
} }
fz.append label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone");
mesh.faceZones()[slaveZoneID].resetAddressing
( (
new faceZone
(
mergePatchName + "SlaveZone",
osf, osf,
boolList(slavePatch.size(), false), boolList(slavePatch.size(), false)
1,
mesh.faceZones()
)
); );
// Add empty zone for cut faces // Add empty zone for cut faces
fz.append label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing
( (
new faceZone
(
cutZoneName,
labelList(0), labelList(0),
boolList(0, false), boolList(0, false)
2,
mesh.faceZones()
)
); );
// Note: make sure to add the zones BEFORE constructing polyMeshModifier
// (since looks up various zones at construction time)
Info<< "Adding point and face zones" << endl;
mesh.addZones(pz.shrink(), fz.shrink(), cz.shrink());
// Add the sliding interface mesh modifier // Add the sliding interface mesh modifier
stitcher.set stitcher.set
( (

View File

@ -7,6 +7,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-ldecompositionMethods \ -ldecompositionMethods -lmetisDecomp -lscotchDecomp \
-llagrangian \ -llagrangian \
-lmeshTools -lmeshTools

View File

@ -7,5 +7,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View File

@ -356,8 +356,15 @@ class vtkPV3Foam
//- Zone info //- Zone info
void updateInfoZones(vtkDataArraySelection*); void updateInfoZones(vtkDataArraySelection*);
//- Read zone names for zoneType from file //- Get non-empty zone names for zoneType from file
wordList readZoneNames(const word& zoneType); wordList getZoneNames(const word& zoneType) const;
//- Get non-empty zone names from mesh info
template<class ZoneType>
wordList getZoneNames
(
const ZoneMesh<ZoneType, polyMesh>&
) const;
//- Add objects of Type to paraview array selection //- Add objects of Type to paraview array selection
template<class Type> template<class Type>

View File

@ -82,9 +82,31 @@ public:
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType) template<class ZoneType>
Foam::wordList Foam::vtkPV3Foam::getZoneNames
(
const ZoneMesh<ZoneType, polyMesh>& zmesh
) const
{ {
wordList zoneNames; wordList names(zmesh.size());
label nZone = 0;
forAll(zmesh, zoneI)
{
if (zmesh[zoneI].size())
{
names[nZone++] = zmesh[zoneI].name();
}
}
names.setSize(nZone);
return names;
}
Foam::wordList Foam::vtkPV3Foam::getZoneNames(const word& zoneType) const
{
wordList names;
// mesh not loaded - read from file // mesh not loaded - read from file
IOobject ioObj IOobject ioObj
@ -107,14 +129,14 @@ Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
{ {
zonesEntries zones(ioObj); zonesEntries zones(ioObj);
zoneNames.setSize(zones.size()); names.setSize(zones.size());
forAll(zones, zoneI) forAll(zones, zoneI)
{ {
zoneNames[zoneI] = zones[zoneI].keyword(); names[zoneI] = zones[zoneI].keyword();
} }
} }
return zoneNames; return names;
} }
@ -312,11 +334,11 @@ void Foam::vtkPV3Foam::updateInfoZones
// ~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~
if (meshPtr_) if (meshPtr_)
{ {
namesLst = meshPtr_->cellZones().names(); namesLst = getZoneNames(meshPtr_->cellZones());
} }
else else
{ {
namesLst = readZoneNames("cellZones"); namesLst = getZoneNames("cellZones");
} }
arrayRangeCellZones_.reset(arraySelection->GetNumberOfArrays()); arrayRangeCellZones_.reset(arraySelection->GetNumberOfArrays());
@ -335,11 +357,11 @@ void Foam::vtkPV3Foam::updateInfoZones
// ~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~
if (meshPtr_) if (meshPtr_)
{ {
namesLst = meshPtr_->faceZones().names(); namesLst = getZoneNames(meshPtr_->faceZones());
} }
else else
{ {
namesLst = readZoneNames("faceZones"); namesLst = getZoneNames("faceZones");
} }
arrayRangeFaceZones_.reset(arraySelection->GetNumberOfArrays()); arrayRangeFaceZones_.reset(arraySelection->GetNumberOfArrays());
@ -358,11 +380,11 @@ void Foam::vtkPV3Foam::updateInfoZones
// ~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~
if (meshPtr_) if (meshPtr_)
{ {
namesLst = meshPtr_->pointZones().names(); namesLst = getZoneNames(meshPtr_->pointZones());
} }
else else
{ {
namesLst = readZoneNames("pointZones"); namesLst = getZoneNames("pointZones");
} }
arrayRangePointZones_.reset(arraySelection->GetNumberOfArrays()); arrayRangePointZones_.reset(arraySelection->GetNumberOfArrays());

View File

@ -43,7 +43,6 @@ usage() {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION] path [wildcard1] .. [wildcardN] Usage: ${0##*/} [OPTION] path [wildcard1] .. [wildcardN]
options: options:
-space treat 'path' as space-delimited (eg, from C-Shell)
-strip remove inaccessible directories -strip remove inaccessible directories
-help print the usage -help print the usage
@ -57,7 +56,7 @@ USAGE
} }
unset space strip unset strip
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -65,10 +64,6 @@ do
-h | -help) -h | -help)
usage usage
;; ;;
-space)
space=true
shift
;;
-strip) -strip)
strip=true strip=true
shift shift
@ -82,12 +77,7 @@ done
[ "$#" -ge 1 ] || usage [ "$#" -ge 1 ] || usage
if [ "$space" = true ]
then
dirList=$(echo "$1" | sed -e 's/ /:/g')
else
dirList="$1" dirList="$1"
fi
shift shift
##DEBUG echo "input>$dirList<" 1>&2 ##DEBUG echo "input>$dirList<" 1>&2
@ -140,11 +130,8 @@ done
IFS=' ' IFS=' '
set -- $dirList set -- $dirList
# join on ':', unless -space option was specified # rejoin on ':'
if [ "$space" != true ]
then
IFS=':' IFS=':'
fi
dirList="$*" dirList="$*"
# restore IFS # restore IFS

View File

@ -85,7 +85,8 @@ setRawEntry() {
oldLine=`echo "$oldNumLine" | sed -e 's/^[^:]*://'` oldLine=`echo "$oldNumLine" | sed -e 's/^[^:]*://'`
oldKey=`getKey "$oldLine"` oldKey=`getKey "$oldLine"`
oldVal=`getRawEntry $1 "$2"` oldVal=`getRawEntry $1 "$2"`
if [ ! "$oldKey" -o ! "$oldVal" -o ! "$oldLine" ]; then if [ ! "$oldKey" -o ! "$oldVal" -o ! "$oldLine" ]
then
echo "setRawStringEntry: entry $2 not found in $1" echo "setRawStringEntry: entry $2 not found in $1"
echo "oldKey=$oldKey" echo "oldKey=$oldKey"
echo "lineNo=$lineNo" echo "lineNo=$lineNo"
@ -134,9 +135,12 @@ getBoolEntry()
} }
# newerFile file1 file2 # newerFile file1 file2
newerFile() { # ... could also use if [ $file1 -nt $file2 ] ...
newerFile()
{
latest=`ls -1 -t $1 $2 2> /dev/null | head -1` latest=`ls -1 -t $1 $2 2> /dev/null | head -1`
if [ "$latest" = $1 ]; then if [ "$latest" = $1 ]
then
return 0 return 0
else else
return 1 return 1
@ -149,8 +153,8 @@ processExists() {
ps -u $LOGNAME -o 'pid' | fgrep $1 >/dev/null ps -u $LOGNAME -o 'pid' | fgrep $1 >/dev/null
} }
printUsage() { usage() {
cat << USAGELABEL cat << USAGE
Usage: $PROGNAME [-n] <root> <case> <pid> Usage: $PROGNAME [-n] <root> <case> <pid>
or or
$PROGNAME -c <root> <case> $PROGNAME -c <root> <case>
@ -165,7 +169,8 @@ finish. Restores original controlDict if
The -c option clears any outstanding $PROGNAME for the case. The -c option clears any outstanding $PROGNAME for the case.
USAGELABEL USAGE
exit 1
} }
@ -174,7 +179,8 @@ restoreDict() {
trap 2 3 15 trap 2 3 15
echo "$PROGNAME : Restoring controlDict from controlDict_bak." echo "$PROGNAME : Restoring controlDict from controlDict_bak."
if [ -r ${controlDict}_bak ]; then if [ -r ${controlDict}_bak ]
then
cp ${controlDict}_bak $controlDict cp ${controlDict}_bak $controlDict
fi fi
@ -208,29 +214,32 @@ esac
# #
# Initial checks # Initial checks
# #
if [ $# -lt 3 ]; then if [ $# -lt 3 ]
printUsage then
exit 1 usage
fi fi
STOPNOW='' STOPNOW=''
if [ $1 = '-n' ]; then if [ $1 = '-n' ]
then
STOPNOW='yes' STOPNOW='yes'
shift shift
fi fi
CLEAR='' CLEAR=''
if [ $1 = '-c' ]; then if [ $1 = '-c' ]
then
CLEAR='yes' CLEAR='yes'
shift shift
if [ $# -ne 2 ]; then if [ $# -ne 2 ]
printUsage then
exit 1 usage
fi fi
ROOT=$1 ROOT=$1
CASE=$2 CASE=$2
else else
if [ $# -ne 3 ]; then if [ $# -ne 3 ]
printUsage then
exit 1 usage
fi fi
ROOT=$1 ROOT=$1
CASE=$2 CASE=$2
@ -239,30 +248,35 @@ fi
CASE=`echo $CASE | sed -e 's!/.*!!'` # strip of processorXXX ending CASE=`echo $CASE | sed -e 's!/.*!!'` # strip of processorXXX ending
#- Pid actually running #- Pid actually running
if [ ! "$CLEAR" ]; then if [ ! "$CLEAR" ]
then
processExists $PID processExists $PID
if [ $? -ne 0 ] ;then if [ $? -ne 0 ]
then
echo "$PROGNAME : process $PID not running." echo "$PROGNAME : process $PID not running."
exit 1 exit 1
fi fi
fi fi
#- case directory writeable #- case directory writeable
if [ ! -w $ROOT/$CASE ]; then if [ ! -w $ROOT/$CASE ]
then
echo "$PROGNAME : $ROOT/$CASE is not writeable." echo "$PROGNAME : $ROOT/$CASE is not writeable."
exit 1 exit 1
fi fi
#- Controldict writeable #- Controldict writeable
controlDict=$ROOT/$CASE/system/controlDict controlDict=$ROOT/$CASE/system/controlDict
if [ ! -w $controlDict ]; then if [ ! -w $controlDict ]
then
echo "$PROGNAME : $controlDict is not writeable." echo "$PROGNAME : $controlDict is not writeable."
exit 1 exit 1
fi fi
#- runTimeModifiable #- runTimeModifiable
getBoolEntry $controlDict 'runTimeModifiable' getBoolEntry $controlDict 'runTimeModifiable'
if [ $? -ne 0 ]; then if [ $? -ne 0 ]
then
echo "$PROGNAME : runTimeModifiable not true in dictionary $controlDict." echo "$PROGNAME : runTimeModifiable not true in dictionary $controlDict."
exit 1 exit 1
fi fi
@ -270,12 +284,14 @@ fi
# #
#- Check if another foamEndJob running #- Check if another foamEndJob running
# #
if [ "$CLEAR" ]; then if [ "$CLEAR" ]
then
pidFiles=`ls $ROOT/$CASE/.foamEndJob* 2>/dev/null` pidFiles=`ls $ROOT/$CASE/.foamEndJob* 2>/dev/null`
for pidFile in $pidFiles for pidFile in $pidFiles
do do
pid=`cat $pidFile` pid=`cat $pidFile`
if [ "$pid" ]; then if [ "$pid" ]
then
echo "$PROGNAME : found $PROGNAME (pid $pid) for Foam process" echo "$PROGNAME : found $PROGNAME (pid $pid) for Foam process"
echo " root: $ROOT" echo " root: $ROOT"
echo " case: $CASE" echo " case: $CASE"
@ -288,11 +304,14 @@ if [ "$CLEAR" ]; then
fi fi
pidFile=$ROOT/$CASE/.foamEndJob${PID} pidFile=$ROOT/$CASE/.foamEndJob${PID}
if [ -f $pidFile ]; then if [ -f $pidFile ]
then
pid=`cat $pidFile` pid=`cat $pidFile`
if [ "$pid" ]; then if [ "$pid" ]
then
processExists $pid processExists $pid
if [ $? -eq 0 ] ;then if [ $? -eq 0 ]
then
echo "$PROGNAME : found running $PROGNAME (pid $pid) for Foam process" echo "$PROGNAME : found running $PROGNAME (pid $pid) for Foam process"
echo " root: $ROOT" echo " root: $ROOT"
echo " case: $CASE" echo " case: $CASE"
@ -314,28 +333,32 @@ echo $$ > $pidFile
#- startTime #- startTime
startTime=`getEntry $controlDict 'startTime'` startTime=`getEntry $controlDict 'startTime'`
if [ ! "$startTime" ]; then if [ ! "$startTime" ]
then
echo "$PROGNAME : startTime not set in dictionary $controlDict." echo "$PROGNAME : startTime not set in dictionary $controlDict."
exit 1 exit 1
fi fi
#- Write interval #- Write interval
writeInterval=`getEntry $controlDict 'writeInterval'` writeInterval=`getEntry $controlDict 'writeInterval'`
if [ ! "$writeInterval" ]; then if [ ! "$writeInterval" ]
then
echo "$PROGNAME : writeInterval not set in dictionary $controlDict." echo "$PROGNAME : writeInterval not set in dictionary $controlDict."
exit 1 exit 1
fi fi
#- stopAt #- stopAt
stopAt=`getEntry $controlDict 'stopAt'` stopAt=`getEntry $controlDict 'stopAt'`
if [ ! "$stopAt" ]; then if [ ! "$stopAt" ]
then
echo "$PROGNAME : stopAt not set in dictionary $controlDict." echo "$PROGNAME : stopAt not set in dictionary $controlDict."
exit 1 exit 1
fi fi
#- endTime #- endTime
endTime=`getEntry $controlDict 'endTime'` endTime=`getEntry $controlDict 'endTime'`
if [ ! "$endTime" ]; then if [ ! "$endTime" ]
then
echo "$PROGNAME : endTime not set in dictionary $controlDict." echo "$PROGNAME : endTime not set in dictionary $controlDict."
exit 1 exit 1
fi fi
@ -353,7 +376,8 @@ cp $controlDict ${controlDict}_bak
#- Set up handler to restore controlDict #- Set up handler to restore controlDict
trap restoreDict 2 3 15 trap restoreDict 2 3 15
if [ "$STOPNOW" ]; then if [ "$STOPNOW" ]
then
setRawEntry $controlDict 'stopAt' 'nextWrite' setRawEntry $controlDict 'stopAt' 'nextWrite'
setRawEntry $controlDict 'writeInterval' '1' setRawEntry $controlDict 'writeInterval' '1'
@ -385,7 +409,8 @@ if newerFile ${controlDict} ${controlDict}_bak; then
iter=0 iter=0
while newerFile ${controlDict} ${controlDict}_bak while newerFile ${controlDict} ${controlDict}_bak
do do
if [ $iter -ge 120 ]; then if [ $iter -ge 120 ]
then
#- 120*5 sec = 10 mins passed. Give up #- 120*5 sec = 10 mins passed. Give up
echo "$PROGNAME : File date not yet ok after 10 mins. Giving up." echo "$PROGNAME : File date not yet ok after 10 mins. Giving up."
break break
@ -412,18 +437,21 @@ while true
do do
sleep 5 sleep 5
if [ ! -r ${controlDict}_bak ]; then if [ ! -r ${controlDict}_bak ]
then
echo "$PROGNAME : ${controlDict}_bak dissappeared. Exiting without restore." echo "$PROGNAME : ${controlDict}_bak dissappeared. Exiting without restore."
exit 1 exit 1
fi fi
if newerFile ${controlDict} ${controlDict}_bak; then if newerFile ${controlDict} ${controlDict}_bak
then
echo "$PROGNAME : ${controlDict} modified externally. Exiting without restore." echo "$PROGNAME : ${controlDict} modified externally. Exiting without restore."
exit 0 exit 0
fi fi
processExists $PID processExists $PID
if [ $? -ne 0 ] ;then if [ $? -ne 0 ]
then
#- Job finished #- Job finished
break break
fi fi

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -27,8 +27,17 @@
# foamEtcFile # foamEtcFile
# #
# Description # Description
# Locate user/site/shipped file with the semantics used in the # Locate user/group/shipped file with semantics similar to the
# ~OpenFOAM/fileName expansion # ~OpenFOAM/fileName expansion.
#
# The -mode option can be used to allow chaining from
# personal settings to site-wide settings.
#
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
# @verbatim
# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \
# && _foamSource $foamPrefs
# @endverbatim
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
unset listOpt quietOpt unset listOpt quietOpt
@ -41,24 +50,32 @@ usage() {
cat<<USAGE cat<<USAGE
Usage: ${0##*/} [OPTION] fileName Usage: ${0##*/} [OPTION] fileName
${0##*/} -list ${0##*/} [OPTION] -list
options: options:
-l | -list list the directories to be searched -list list the directories to be searched
-q | -quiet suppress all normal output -mode <mode> any combination of u(user), g(group), o(other)
-quiet suppress all normal output
-help print the usage
Locate user/site/shipped file with the semantics used in the Locate user/group/shipped file with semantics similar to the
~OpenFOAM/fileName expansion ~OpenFOAM/fileName expansion.
Exit status 0 when the file is found and output resolved path to stdout. The options can also be specified as a single character
Exit status 1 for miscellaneous errors. (eg, '-q' instead of '-quiet'), but must not be grouped.
Exit status 2 when the file is not found.
Exit status
0 when the file is found. Print resolved path to stdout.
1 for miscellaneous errors.
2 when the file is not found.
USAGE USAGE
exit 1 exit 1
} }
# default mode is 'ugo'
mode=ugo
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -70,6 +87,20 @@ do
listOpt=true listOpt=true
shift shift
;; ;;
-m | -mode)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
mode="$2"
# sanity check:
case "$mode" in
*u* | *g* | *o* )
;;
*)
usage "'$1' option with invalid mode '$mode'"
;;
esac
shift 2
;;
-q | -quiet) -q | -quiet)
quietOpt=true quietOpt=true
shift shift
@ -83,18 +114,32 @@ do
esac esac
done done
# Save the essential bits of information: # Save the essential bits of information:
nArgs=$# nArgs=$#
fileName="$1" fileName="$1"
# The various places to be searched: # Define the various places to be searched:
set -- \ files=""
$HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION \ case "$mode" in
$HOME/.${WM_PROJECT:-OpenFOAM} \ *u*) # user
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \ files="$files $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
$WM_PROJECT_INST_DIR/site \ files="$files $HOME/.${WM_PROJECT:-OpenFOAM}"
$WM_PROJECT_DIR/etc ;;
esac
case "$mode" in
*g*) # group
files="$files $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION"
files="$files $WM_PROJECT_INST_DIR/site"
;;
esac
case "$mode" in
*o*) # other
files="$files $WM_PROJECT_DIR/etc"
;;
esac
set -- $files
# #

View File

@ -36,8 +36,8 @@ usage() {
Usage: ${0##*/} [OPTION] <application> ... Usage: ${0##*/} [OPTION] <application> ...
options: options:
-case <dir> specify alternative case directory, default is the cwd -case <dir> specify alternative case directory, default is the cwd
-s also sends output to screen
-p parallel run of processors -p parallel run of processors
-s also sends output to screen
-v <ver> specify OpenFOAM version -v <ver> specify OpenFOAM version
-help print the usage -help print the usage
@ -54,7 +54,8 @@ unset version
findExec() { findExec() {
case "$1" in case "$1" in
*/*) */*)
if [ -x "$1" ] ; then if [ -x "$1" ]
then
echo "$1" echo "$1"
return 0 return 0
fi fi
@ -66,7 +67,8 @@ findExec() {
for d in $PATH for d in $PATH
do do
# echo "testing: $d/$1" 1>&2 # echo "testing: $d/$1" 1>&2
if [ -x "$d/$1" -a ! -d "$d/$1" ] ; then if [ -x "$d/$1" -a ! -d "$d/$1" ]
then
# echo "Found exec: $d/$1" 1>&2 # echo "Found exec: $d/$1" 1>&2
IFS=$oldIFS IFS=$oldIFS
echo "$d/$1" echo "$d/$1"
@ -78,23 +80,11 @@ findExec() {
return 1 return 1
} }
# grep for $1
getPID() {
ps -u $LOGNAME -o 'pid,args' | fgrep "$1 " | fgrep -v grep | head -1 | awk '{ print $1 }'
}
consultGuide() {
cat<<EOF
Please consult the User Guide for details of parallel running
EOF
}
# MAIN SCRIPT # MAIN SCRIPT
#~~~~~~~~~~~~ #~~~~~~~~~~~~
SCREEN=no unset parallelOpt screenOpt
PARALLEL=no
# parse options # parse options
@ -110,12 +100,12 @@ do
shift 2 shift 2
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'" cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
;; ;;
-s) -p)
SCREEN=yes parallelOpt=true
shift shift
;; ;;
-p) -s)
PARALLEL=yes screenOpt=true
shift shift
;; ;;
-v) -v)
@ -136,70 +126,71 @@ do
esac esac
done done
if [ "$#" -lt 1 ]; then if [ "$#" -lt 1 ]
then
usage "No application specified" usage "No application specified"
fi fi
# use foamExec for a specified version and for remote (parallel) runs # use foamExec for a specified version and for remote (parallel) runs
if [ -n "$version" -o "$PARALLEL" = yes ]; then if [ -n "$version" -o "$parallelOpt" = true ]
then
APPLICATION=`findExec foamExec` APPLICATION=`findExec foamExec`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]
then
usage "'foamExec' not found" usage "'foamExec' not found"
fi fi
if [ -n "$version" ]; then if [ -n "$version" ]
then
APPLICATION="$APPLICATION -v $version" APPLICATION="$APPLICATION -v $version"
fi fi
else else
APPLICATION=`findExec $1` APPLICATION=`findExec $1`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]
then
usage "Application '$1' executable not found" usage "Application '$1' executable not found"
fi fi
echo "Application : $1" echo "Application : $1"
shift shift
fi fi
if [ "$PARALLEL" = no ]; then
# if [ "$parallelOpt" = true ]
# RUN ON SINGLE PROCESSOR then
# # parallel
if [ "$SCREEN" = no ]; then # ~~~~~~~~
echo "Executing: $APPLICATION $@ > log 2>&1 &"
$APPLICATION $@ > log 2>&1 &
else
echo "Executing: $APPLICATION $@ | tee log &"
$APPLICATION $@ | tee log &
wait $!
fi
else
# #
# IS THE CASE DECOMPOSED? # is the case decomposed?
# #
if [ -r "processor0" ] ; then if [ -r "processor0" ]
then
NPROCS="`/bin/ls -1d processor* | wc -l`" NPROCS="`/bin/ls -1d processor* | wc -l`"
else else
echo "Case is not currently decomposed" echo "Case is not currently decomposed"
if [ -r system/decomposeParDict ] ; then if [ -r system/decomposeParDict ]
then
echo "system/decomposeParDict exists" echo "system/decomposeParDict exists"
echo "Try decomposing with \"foamJob decomposePar\"" echo "Try decomposing with \"foamJob decomposePar\""
exit 1 exit 1
else else
echo "Cannot find system/decomposeParDict file required to decompose the case for parallel running." echo "Cannot find system/decomposeParDict file required to decompose the case for parallel running."
consultGuide echo "Please consult the User Guide for details of parallel running"
exit 1 exit 1
fi fi
fi fi
# #
# LOCATE MPIRUN # locate mpirun
# #
mpirun=`findExec mpirun` mpirun=`findExec mpirun`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]
then
usage "'mpirun' not found" usage "'mpirun' not found"
fi fi
mpiopts="-np $NPROCS" mpiopts="-np $NPROCS"
# #
# IS THE MACHINE READY TO RUN PARALLEL? # is the machine ready to run parallel?
# #
echo "Parallel processing using $WM_MPLIB with $NPROCS processors" echo "Parallel processing using $WM_MPLIB with $NPROCS processors"
case "$WM_MPLIB" in case "$WM_MPLIB" in
@ -212,7 +203,8 @@ else
system/machines \ system/machines \
; ;
do do
if [ -r $hostfile ]; then if [ -r $hostfile ]
then
mpiopts="$mpiopts -hostfile $hostfile" mpiopts="$mpiopts -hostfile $hostfile"
break break
fi fi
@ -221,15 +213,32 @@ else
esac esac
# #
# RUN IN PARALLEL # run (in parallel)
# #
if [ "$SCREEN" = no ] ; then if [ "$screenOpt" = true ]
echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1" then
$mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1 &
else
echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel | tee log" echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel | tee log"
$mpirun $mpiopts $APPLICATION $@ -parallel | tee log $mpirun $mpiopts $APPLICATION $@ -parallel | tee log
else
echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1"
$mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1 &
fi fi
else
#
# run (on single processor)
#
if [ "$screenOpt" = true ]
then
echo "Executing: $APPLICATION $@ | tee log &"
$APPLICATION $@ | tee log &
wait $!
else
echo "Executing: $APPLICATION $@ > log 2>&1 &"
$APPLICATION $@ > log 2>&1 &
fi
else
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -40,18 +40,22 @@ else
fi fi
printUsage() { usage()
echo "" {
echo "Usage: ${0##*/} -np <dd> <executable> <args>" cat<<USAGE
echo ""
echo "This will run like mpirun but with each process in an xterm" Usage: ${0##*/} -np <dd> <executable> <args>
* This will run like mpirun but with each process in an XTerm
USAGE
exit 1
} }
nProcs='' unset nProcs exec args
exec=''
args=''
while [ "$1" != "" ]; do while [ "$1" != "" ]
do
echo "$1" echo "$1"
case $1 in case $1 in
-np) -np)
@ -59,15 +63,16 @@ while [ "$1" != "" ]; do
shift shift
;; ;;
*) *)
if [ ! "$exec" ]; then if [ ! "$exec" ]
then
exec=$1 exec=$1
elif [ ! "$args" ]; then elif [ ! "$args" ]
then
args="\"$1\"" args="\"$1\""
else else
args="$args \"$1\"" args="$args \"$1\""
fi fi
;; ;;
esac esac
shift shift
done done
@ -76,27 +81,19 @@ echo "nProcs=$nProcs"
echo "exec=$exec" echo "exec=$exec"
echo "args=$args" echo "args=$args"
if [ ! "$nProcs" ]; then [ "$nProcs" ] || usage
printUsage [ "$args" ] || usage
exit 1 [ "$exec" ] || usage
fi
if [ ! "$args" ]; then
printUsage
exit 1
fi
if [ ! "$exec" ]; then
printUsage
exit 1
fi
exec=`which $exec` exec=`which $exec`
if [ ! -x "$exec" ]; then if [ ! -x "$exec" ]
then
echo "Cannot find executable $exec or is not executable" echo "Cannot find executable $exec or is not executable"
printUsage usage
exit 1
fi fi
if [ ! "$PWD" ]; then if [ ! "$PWD" ]
then
PWD=`pwd` PWD=`pwd`
fi fi
@ -106,22 +103,28 @@ echo "Constructed gdb initialization file $PWD/gdbCommands"
$ECHO "Choose running method: 0)normal 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind: \c" $ECHO "Choose running method: 0)normal 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind: \c"
read method read method
if [ "$method" -ne 0 -a "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 -a "$method" -ne 5 ]; then case "$method" in
printUsage 0 | 1 | 2 | 3 | 4 | 5 )
exit 1 # okay
fi ;;
*)
usage
;;
esac
$ECHO "Run all processes local or distributed? 1)local 2)remote: \c" $ECHO "Run all processes local or distributed? 1)local 2)remote: \c"
read spawn read spawn
if [ "$spawn" -ne 1 -a "$spawn" -ne 2 ]; then if [ "$spawn" -ne 1 -a "$spawn" -ne 2 ]
printUsage then
exit 1 usage
fi fi
# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ # check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
# check ~/.$WM_PROJECT/ # check ~/.$WM_PROJECT/
# check <installedProject>/etc/ # check <installedProject>/etc/
if [ "$WM_PROJECT" ]; then if [ "$WM_PROJECT" ]
then
for i in \ for i in \
$HOME/.WM_PROJECT/$WM_PROJECT_VERSION \ $HOME/.WM_PROJECT/$WM_PROJECT_VERSION \
@ -129,7 +132,8 @@ if [ "$WM_PROJECT" ]; then
$WM_PROJECT_DIR/etc \ $WM_PROJECT_DIR/etc \
; ;
do do
if [ -f "$i/bashrc" ]; then if [ -f "$i/bashrc" ]
then
sourceFoam="$i/bashrc" sourceFoam="$i/bashrc"
break break
fi fi
@ -139,7 +143,8 @@ fi
# Construct test string for remote execution. # Construct test string for remote execution.
# Source OpenFOAM settings if OpenFOAM environment not set. # Source OpenFOAM settings if OpenFOAM environment not set.
# attempt to preserve the installation directory 'FOAM_INST_DIR' # attempt to preserve the installation directory 'FOAM_INST_DIR'
if [ "$FOAM_INST_DIR" ]; then if [ "$FOAM_INST_DIR" ]
then
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam" sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
else else
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam" sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
@ -160,36 +165,45 @@ do
geom="-geometry 120x20+$xpos+$ypos" geom="-geometry 120x20+$xpos+$ypos"
node="" node=""
if [ .$WM_MPLIB = .OPENMPI ]; then if [ "$WM_MPLIB" = OPENMPI ]
then
node="-np 1 " node="-np 1 "
fi fi
echo "#!/bin/sh" > $procCmdFile echo "#!/bin/sh" > $procCmdFile
if [ "$method" -eq 0 ]; then case "$method" in
0)
echo "$sourceFoam; cd $PWD; $exec $args | tee $procLog" >> $procCmdFile echo "$sourceFoam; cd $PWD; $exec $args | tee $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 1 ]; then ;;
1)
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands $exec 2>&1 | tee $procLog; read dummy" >> $procCmdFile echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands $exec 2>&1 | tee $procLog; read dummy" >> $procCmdFile
#echo "$sourceFoam; cd $PWD; $exec $args; read dummy" >> $procCmdFile #echo "$sourceFoam; cd $PWD; $exec $args; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 2 ]; then ;;
2)
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands >& $procLog" >> $procCmdFile echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 3 ]; then ;;
3)
echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema echo "${node}$procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 4 ]; then ;;
4)
echo "$sourceFoam; cd $PWD; $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile echo "$sourceFoam; cd $PWD; $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
elif [ "$method" -eq 5 ]; then ;;
5)
echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
fi ;;
esac
chmod +x $procCmdFile chmod +x $procCmdFile
let column=proc%6 let column=proc%6
if [ $proc -ne 0 -a $column -eq 0 ]; then if [ $proc -ne 0 -a $column -eq 0 ]
then
((xpos+=600)) ((xpos+=600))
((ypos=0)) ((ypos=0))
else else
@ -203,10 +217,13 @@ do
echo " tail -f $procLog" echo " tail -f $procLog"
done done
cmd="" unset cmd
if [ .$WM_MPLIB = .OPENMPI ]; then
case "$WM_MPLIB" in
OPENMPI)
cmd="mpirun -app $PWD/mpirun.schema </dev/null" cmd="mpirun -app $PWD/mpirun.schema </dev/null"
elif [ .$WM_MPLIB = .MPICH ]; then ;;
MPICH)
cmd="mpiexec" cmd="mpiexec"
for ((proc=0; proc<$nProcs; proc++)) for ((proc=0; proc<$nProcs; proc++))
do do
@ -216,12 +233,14 @@ elif [ .$WM_MPLIB = .MPICH ]; then
echo "#!/bin/sh" > $procXtermCmdFile echo "#!/bin/sh" > $procXtermCmdFile
echo "$procCmd" >> $procXtermCmdFile echo "$procCmd" >> $procXtermCmdFile
chmod +x $procXtermCmdFile chmod +x $procXtermCmdFile
if [ $proc -ne 0 ]; then if [ $proc -ne 0 ]
then
cmd="${cmd} :" cmd="${cmd} :"
fi fi
cmd="${cmd} -n 1 ${procXtermCmdFile}" cmd="${cmd} -n 1 ${procXtermCmdFile}"
done < $PWD/mpirun.schema done < $PWD/mpirun.schema
fi ;;
esac
echo "Constructed $PWD/mpirun.schema file." echo "Constructed $PWD/mpirun.schema file."
echo "" echo ""

View File

@ -44,7 +44,7 @@ if ( -r $CEI_HOME ) then
endif endif
# add to path # add to path
set path=($CEI_HOME/bin $path) setenv PATH ${CEI_HOME}/bin:${PATH}
setenv ENSIGHT9_INPUT dummy setenv ENSIGHT9_INPUT dummy
setenv ENSIGHT9_READER $FOAM_LIBBIN setenv ENSIGHT9_READER $FOAM_LIBBIN

View File

@ -35,8 +35,8 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# clean the PATH # clean the PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath -space "$path" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"` set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) set path=($cleaned) if ( $status == 0 ) setenv PATH $cleaned
# determine the cmake to be used # determine the cmake to be used
unsetenv CMAKE_HOME unsetenv CMAKE_HOME
@ -44,7 +44,7 @@ foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
if ( -r $cmake ) then if ( -r $cmake ) then
setenv CMAKE_HOME $cmake setenv CMAKE_HOME $cmake
set path=($CMAKE_HOME/bin $path) setenv PATH ${CMAKE_HOME}/bin:${PATH}
break break
endif endif
end end
@ -73,7 +73,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
# set paths if binaries or source are present # set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
set path=($ParaView_DIR/bin $path) setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR} setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
# add in python libraries if required # add in python libraries if required

View File

@ -272,4 +272,4 @@ fi
unset cleaned foamClean foamInstall foamOldDirs unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource unset _foamSource
# ----------------------------------------------------------------------------- # ----------------------------------------------------------------- end-of-file

View File

@ -209,16 +209,19 @@ default:
endsw endsw
# Clean standard environment variables (path/PATH, LD_LIBRARY_PATH, MANPATH) # Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH '' if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
if (! $?MANPATH) setenv MANPATH '' if (! $?MANPATH) setenv MANPATH ''
#- Clean path/PATH #- Clean PATH (path)
set cleaned=`$foamClean -space "$path" "$foamOldDirs"` set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
if ( $status == 0 ) set path=($cleaned) if ( $status == 0 ) then
unset PATH
setenv PATH $cleaned
endif
#- Clean LD_LIBRARY_PATH #- Clean LD_LIBRARY_PATH
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`
@ -242,9 +245,9 @@ _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc
# Clean environment paths again. Only remove duplicates # Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean path/PATH #- Clean PATH (path)
set cleaned=`$foamClean -space "$path"` set cleaned=`$foamClean "$PATH"`
if ( $status == 0 ) set path=($cleaned) if ( $status == 0 ) setenv PATH $cleaned
#- Clean LD_LIBRARY_PATH #- Clean LD_LIBRARY_PATH
set cleaned=`$foamClean "$LD_LIBRARY_PATH"` set cleaned=`$foamClean "$LD_LIBRARY_PATH"`
@ -265,4 +268,4 @@ endif
unset cleaned foamClean foamInstall foamOldDirs unset cleaned foamClean foamInstall foamOldDirs
unalias _foamSource unalias _foamSource
# ----------------------------------------------------------------------------- # ----------------------------------------------------------------- end-of-file

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# etc/prefs.csh # etc/prefs.csh
# #
# Description # Description
@ -50,4 +50,4 @@
setenv ParaView_VERSION git # eg, cvs/git version setenv ParaView_VERSION git # eg, cvs/git version
setenv ParaView_MAJOR 3.7 setenv ParaView_MAJOR 3.7
# ----------------------------------------------------------------------------- # ----------------------------------------------------------------- end-of-file

View File

@ -22,7 +22,7 @@
# along with OpenFOAM; if not, write to the Free Software Foundation, # along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
# Script # File
# etc/prefs.sh # etc/prefs.sh
# #
# Description # Description
@ -49,4 +49,5 @@ export WM_MPLIB=SYSTEMOPENMPI
# ~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
export ParaView_VERSION=git # eg, cvs/git version export ParaView_VERSION=git # eg, cvs/git version
export ParaView_MAJOR=3.7 export ParaView_MAJOR=3.7
# -----------------------------------------------------------------------------
# ----------------------------------------------------------------- end-of-file

View File

@ -32,7 +32,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# prefix to PATH # prefix to PATH
alias _foamAddPath 'set path=(\!* $path)' alias _foamAddPath 'setenv PATH \!*\:${PATH}'
# prefix to LD_LIBRARY_PATH # prefix to LD_LIBRARY_PATH
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}' alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# prefix to MANPATH # prefix to MANPATH
@ -68,14 +68,11 @@ setenv FOAM_SOLVERS $FOAM_APP/solvers
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
# add OpenFOAM scripts and wmake to the path # add OpenFOAM scripts and wmake to the path
set path=($WM_DIR $WM_PROJECT_DIR/bin $path) setenv PATH ${WM_DIR}:${WM_PROJECT_DIR}/bin:${PATH}
_foamAddPath $FOAM_APPBIN _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
_foamAddPath $FOAM_SITE_APPBIN # Make sure to pick up dummy versions of external libraries last
_foamAddPath $FOAM_USER_APPBIN _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
_foamAddLib $FOAM_LIBBIN
_foamAddLib $FOAM_SITE_LIBBIN
_foamAddLib $FOAM_USER_LIBBIN
# Select compiler installation # Select compiler installation
@ -101,9 +98,6 @@ case OpenFOAM:
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
breaksw breaksw
case Gcc42:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.2.4
breaksw
endsw endsw
# Check that the compiler directory can be found # Check that the compiler directory can be found
@ -117,8 +111,7 @@ case OpenFOAM:
endif endif
_foamAddPath ${WM_COMPILER_DIR}/bin _foamAddPath ${WM_COMPILER_DIR}/bin
_foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH} _foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}:${WM_COMPILER_DIR}/lib
_foamAddLib ${WM_COMPILER_DIR}/lib
_foamAddMan ${WM_COMPILER_DIR}/man _foamAddMan ${WM_COMPILER_DIR}/man
breaksw breaksw
@ -128,12 +121,11 @@ endsw
# Communications library # Communications library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
unset MPI_ARCH_PATH unsetenv MPI_ARCH_PATH MPI_HOME
switch ("$WM_MPLIB") switch ("$WM_MPLIB")
case OPENMPI: case OPENMPI:
set mpi_version=openmpi-1.4.1 set mpi_version=openmpi-1.4.1
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
@ -256,7 +248,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
# Set the minimum MPI buffer size (used by all platforms except SGI MPI) # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set minBufferSize=20000000 if ( ! $?minBufferSize ) set minBufferSize=20000000
if ( $?MPI_BUFFER_SIZE ) then if ( $?MPI_BUFFER_SIZE ) then
if ( $MPI_BUFFER_SIZE < $minBufferSize ) then if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
@ -274,8 +266,8 @@ if ( $?CGAL_LIB_DIR ) then
endif endif
# Switch on the hoard memory allocator if available # Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if ( -f $FOAM_LIBBIN/libhoard.so ) then #if ( -f $FOAM_LIBBIN/libhoard.so ) then
# setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD} # setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
#endif #endif
@ -283,9 +275,7 @@ endif
# cleanup environment: # cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unalias _foamAddPath unalias _foamAddPath _foamAddLib _foamAddMan
unalias _foamAddLib unset compilerInstall minBufferSize
unalias _foamAddMan
unset minBufferSize
# ----------------------------------------------------------------------------- # ----------------------------------------------------------------- end-of-file

View File

@ -94,8 +94,9 @@ export FOAM_RUN=$WM_PROJECT_USER_DIR/run
# add OpenFOAM scripts and wmake to the path # add OpenFOAM scripts and wmake to the path
export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
_foamAddPath $FOAM_APPBIN $FOAM_SITE_APPBIN $FOAM_USER_APPBIN _foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
_foamAddLib $FOAM_LIBBIN $FOAM_SITE_LIBBIN $FOAM_USER_LIBBIN # Make sure to pick up dummy versions of external libraries last
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy
# Compiler settings # Compiler settings
@ -130,9 +131,6 @@ OpenFOAM)
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
;; ;;
Gcc42)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.2.4
;;
esac esac
# Check that the compiler directory can be found # Check that the compiler directory can be found
@ -164,12 +162,11 @@ unset compilerBin compilerLib compilerMan compilerInstall
# Communications library # Communications library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
unset MPI_ARCH_PATH unset MPI_ARCH_PATH MPI_HOME
case "$WM_MPLIB" in case "$WM_MPLIB" in
OPENMPI) OPENMPI)
mpi_version=openmpi-1.4.1 mpi_version=openmpi-1.4.1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
@ -295,7 +292,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
# Set the minimum MPI buffer size (used by all platforms except SGI MPI) # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
minBufferSize=20000000 : ${minBufferSize:=20000000}
if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ] if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ]
then then
@ -309,8 +306,8 @@ export MPI_BUFFER_SIZE
[ -d "$CGAL_LIB_DIR" ] && _foamAddLib $CGAL_LIB_DIR [ -d "$CGAL_LIB_DIR" ] && _foamAddLib $CGAL_LIB_DIR
# Switch on the hoard memory allocator if available # Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if [ -f $FOAM_LIBBIN/libhoard.so ] #if [ -f $FOAM_LIBBIN/libhoard.so ]
#then #then
# export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD # export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
@ -321,4 +318,4 @@ export MPI_BUFFER_SIZE
# ~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~
unset _foamAddPath _foamAddLib _foamAddMan minBufferSize unset _foamAddPath _foamAddLib _foamAddMan minBufferSize
# ----------------------------------------------------------------------------- # ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::oneFieldField
Description
A class representing the concept of a field of oneFields used to
avoid unnecessary manipulations for objects which are known to be one at
compile-time.
Used for example as the density argument to a function written for
compressible to be used for incompressible flow.
\*---------------------------------------------------------------------------*/
#ifndef oneFieldField_H
#define oneFieldField_H
#include "oneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class oneField Declaration
\*---------------------------------------------------------------------------*/
class oneFieldField
:
public one
{
public:
// Constructors
//- Construct null
oneFieldField()
{}
// Member Operators
inline oneField operator[](const label) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "oneFieldFieldI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "oneFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline Foam::oneField Foam::oneFieldField::operator[](const label) const
{
return oneField();
}
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::zeroFieldField
Description
A class representing the concept of a field of zeroFields used to
avoid unnecessary manipulations for objects which are known to be zero at
compile-time.
Used for example as the density argument to a function written for
compressible to be used for incompressible flow.
\*---------------------------------------------------------------------------*/
#ifndef zeroFieldField_H
#define zeroFieldField_H
#include "zeroField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class zeroField Declaration
\*---------------------------------------------------------------------------*/
class zeroFieldField
:
public zero
{
public:
// Constructors
//- Construct null
zeroFieldField()
{}
// Member Operators
inline zeroField operator[](const label) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "zeroFieldFieldI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "zeroFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline Foam::zeroField Foam::zeroFieldField::operator[](const label) const
{
return zeroField();
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,6 +53,7 @@ class oneField
: :
public one public one
{ {
public: public:
// Constructors // Constructors
@ -65,10 +66,6 @@ public:
// Member Operators // Member Operators
inline scalar operator[](const label) const; inline scalar operator[](const label) const;
inline oneField field() const;
inline oneField oldTime() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,15 +33,5 @@ inline Foam::scalar Foam::oneField::operator[](const label) const
return scalar(1); return scalar(1);
} }
inline Foam::oneField Foam::oneField::field() const
{
return oneField();
}
inline Foam::oneField Foam::oneField::oldTime() const
{
return oneField();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,10 +65,6 @@ public:
// Member Operators // Member Operators
inline scalar operator[](const label) const; inline scalar operator[](const label) const;
inline zeroField field() const;
inline zeroField oldTime() const;
}; };

View File

@ -33,14 +33,4 @@ inline Foam::scalar Foam::zeroField::operator[](const label) const
return scalar(0); return scalar(0);
} }
inline Foam::zeroField Foam::zeroField::field() const
{
return zeroField();
}
inline Foam::zeroField Foam::zeroField::oldTime() const
{
return zeroField();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::GeometricField
Description
A class representing the concept of a GeometricField of 1 used to avoid
unnecessary manipulations for objects which are known to be one at
compile-time.
Used for example as the density argument to a function written for
compressible to be used for incompressible flow.
\*---------------------------------------------------------------------------*/
#ifndef geometricOneField_H
#define geometricOneField_H
#include "oneFieldField.H"
#include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class geometricOneField Declaration
\*---------------------------------------------------------------------------*/
class geometricOneField
:
public one
{
public:
// Constructors
//- Construct null
geometricOneField()
{}
// Member Operators
inline scalar operator[](const label) const;
inline oneField field() const;
inline oneField oldTime() const;
inline oneFieldField boundaryField() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "geometricOneFieldI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "geometricOneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline Foam::scalar Foam::geometricOneField::operator[](const label) const
{
return scalar(1);
}
inline Foam::oneField Foam::geometricOneField::field() const
{
return oneField();
}
inline Foam::oneField Foam::geometricOneField::oldTime() const
{
return oneField();
}
inline Foam::oneFieldField Foam::geometricOneField::boundaryField() const
{
return oneFieldField();
}
// ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Class
Foam::GeometricField
Description
A class representing the concept of a GeometricField of 1 used to avoid
unnecessary manipulations for objects which are known to be zero at
compile-time.
Used for example as the density argument to a function written for
compressible to be used for incompressible flow.
\*---------------------------------------------------------------------------*/
#ifndef geometricZeroField_H
#define geometricZeroField_H
#include "zeroFieldField.H"
#include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class geometricZeroField Declaration
\*---------------------------------------------------------------------------*/
class geometricZeroField
:
public zero
{
public:
// Constructors
//- Construct null
geometricZeroField()
{}
// Member Operators
inline scalar operator[](const label) const;
inline zeroField field() const;
inline zeroField oldTime() const;
inline zeroFieldField boundaryField() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "geometricZeroFieldI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -24,52 +24,28 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "parMetisDecomp.H" #include "geometricZeroField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Insert at front of list inline Foam::scalar Foam::geometricZeroField::operator[](const label) const
template<class Type>
void Foam::parMetisDecomp::prepend
(
const UList<Type>& extraLst,
List<Type>& lst
)
{ {
label nExtra = extraLst.size(); return scalar(0);
// Make space for initial elements
lst.setSize(lst.size() + nExtra);
for (label i = lst.size()-1; i >= nExtra; i--)
{
lst[i] = lst[i-nExtra];
} }
// Insert at front inline Foam::zeroField Foam::geometricZeroField::field() const
forAll(extraLst, i)
{ {
lst[i] = extraLst[i]; return zeroField();
}
} }
// Insert at back of list inline Foam::zeroField Foam::geometricZeroField::oldTime() const
template<class Type>
void Foam::parMetisDecomp::append
(
const UList<Type>& extraLst,
List<Type>& lst
)
{ {
label sz = lst.size(); return zeroField();
// Make space for initial elements
lst.setSize(sz + extraLst.size());
// Insert at back
forAll(extraLst, i)
{
lst[sz++] = extraLst[i];
} }
inline Foam::zeroFieldField Foam::geometricZeroField::boundaryField() const
{
return zeroFieldField();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,6 +52,13 @@ inline Type operator/(const one&, const Type& t)
} }
template<class Type>
inline const Type& operator/(const Type& t, const one&)
{
return t;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake libso scotchDecomp wmake libso scotchDecomp
wmake libso ptscotchDecomp
wmake libso metisDecomp wmake libso metisDecomp
wmake libso parMetisDecomp
wmake libso MGridGen wmake libso MGridGen

View File

@ -1,3 +0,0 @@
dummyParMetisDecomp.C
LIB = $(FOAM_LIBBIN)/dummy/libparMetisDecomp

View File

@ -0,0 +1,3 @@
dummyPtscotchDecomp.C
LIB = $(FOAM_LIBBIN)/dummy/libptscotchDecomp

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(FOAM_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(FOAM_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(FOAM_SRC)/parallel/decompose/parMetisDecomp/lnInclude -I$(FOAM_SRC)/parallel/decompose/ptscotchDecomp/lnInclude
LIB_LIBS = LIB_LIBS =

View File

@ -24,61 +24,56 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "parMetisDecomp.H" #include "ptscotchDecomp.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "polyMesh.H"
#include "Time.H" #include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // static const char* notImplementedMessage =
"You are trying to use ptscotch but do not have the "
"ptscotchDecomp library loaded."
"\nThis message is from the dummy ptscotchDecomp stub library instead.\n"
"\n"
"Please install ptscotch and make sure that libptscotch.so is in your "
"LD_LIBRARY_PATH.\n"
"The ptscotchDecomp library can then be built in "
"$FOAM_SRC/parallel/decompose/ptscotchDecomp\n";
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(parMetisDecomp, 0); defineTypeNameAndDebug(ptscotchDecomp, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
decompositionMethod, decompositionMethod,
parMetisDecomp, ptscotchDecomp,
dictionaryMesh dictionaryMesh
); );
} }
static const char* notImplementedMessage =
"You are trying to use parMetis but do not have the parMetisDecomp library "
"loaded.\n"
"This message is from the dummy parMetisDecomp stub library instead.\n"
"\n"
"Please install parMetis and make sure that libparMetis.so is in your "
"LD_LIBRARY_PATH.\n"
"The parMetisDecomp library can then be built in "
"$FOAM_SRC/parallel/decompose/decompositionMethods/parMetisDecomp\n";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- Does prevention of 0 cell domains and calls parmetis. void Foam::ptscotchDecomp::check(const int retVal, const char* str)
Foam::label Foam::parMetisDecomp::decompose {}
(
Field<int>& xadj,
Field<int>& adjncy,
const pointField& cellCentres,
Field<int>& cellWeights,
Field<int>& faceWeights,
const List<int>& options,
Foam::label Foam::ptscotchDecomp::decompose
(
List<int>& adjncy,
List<int>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp List<int>& finalDecomp
) )
{ {
FatalErrorIn FatalErrorIn
( (
"label parMetisDecomp::decompose" "label ptscotchDecomp::decompose"
"(" "("
"Field<int>&, "
"Field<int>&, "
"const pointField&, "
"Field<int>&, "
"Field<int>&, "
"const List<int>&, " "const List<int>&, "
"const List<int>&, "
"const scalarField&, "
"List<int>&" "List<int>&"
")" ")"
) << notImplementedMessage << exit(FatalError); ) << notImplementedMessage << exit(FatalError);
@ -89,7 +84,7 @@ Foam::label Foam::parMetisDecomp::decompose
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::parMetisDecomp::parMetisDecomp Foam::ptscotchDecomp::ptscotchDecomp
( (
const dictionary& decompositionDict, const dictionary& decompositionDict,
const polyMesh& mesh const polyMesh& mesh
@ -102,35 +97,35 @@ Foam::parMetisDecomp::parMetisDecomp
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::parMetisDecomp::decompose Foam::labelList Foam::ptscotchDecomp::decompose
( (
const pointField& cc, const pointField& points,
const scalarField& cWeights const scalarField& pointWeights
) )
{ {
FatalErrorIn FatalErrorIn
( (
"labelList parMetisDecomp::decompose" "labelList ptscotchDecomp::decompose"
"(" "("
"const pointField&, " "const pointField&, "
"const scalarField&" "const scalarField&"
")" ")"
) << notImplementedMessage << exit(FatalError); ) << notImplementedMessage << exit(FatalError);
return labelList(); return labelList::null();
} }
Foam::labelList Foam::parMetisDecomp::decompose Foam::labelList Foam::ptscotchDecomp::decompose
( (
const labelList& cellToRegion, const labelList& agglom,
const pointField& regionPoints, const pointField& agglomPoints,
const scalarField& regionWeights const scalarField& pointWeights
) )
{ {
FatalErrorIn FatalErrorIn
( (
"labelList parMetisDecomp::decompose" "labelList ptscotchDecomp::decompose"
"(" "("
"const labelList&, " "const labelList&, "
"const pointField&, " "const pointField&, "
@ -138,11 +133,11 @@ Foam::labelList Foam::parMetisDecomp::decompose
")" ")"
) << notImplementedMessage << exit(FatalError); ) << notImplementedMessage << exit(FatalError);
return labelList(); return labelList::null();
} }
Foam::labelList Foam::parMetisDecomp::decompose Foam::labelList Foam::ptscotchDecomp::decompose
( (
const labelListList& globalCellCells, const labelListList& globalCellCells,
const pointField& cellCentres, const pointField& cellCentres,
@ -151,7 +146,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
{ {
FatalErrorIn FatalErrorIn
( (
"labelList parMetisDecomp::decompose" "labelList ptscotchDecomp::decompose"
"(" "("
"const labelListList&, " "const labelListList&, "
"const pointField&, " "const pointField&, "
@ -159,26 +154,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
")" ")"
) << notImplementedMessage << exit(FatalError); ) << notImplementedMessage << exit(FatalError);
return labelList(); return labelList::null();
}
void Foam::parMetisDecomp::calcMetisDistributedCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
)
{
FatalErrorIn
(
"void parMetisDecomp::calcMetisDistributedCSR"
"("
"const polyMesh&, "
"List<int>&, "
"List<int>&"
")"
) << notImplementedMessage << exit(FatalError);
} }

View File

@ -22,87 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
From scotch forum:
By: Francois PELLEGRINI RE: Graph mapping 'strategy' string [ reply ]
2008-08-22 10:09 Strategy handling in Scotch is a bit tricky. In order
not to be confused, you must have a clear view of how they are built.
Here are some rules:
1- Strategies are made up of "methods" which are combined by means of
"operators".
2- A method is of the form "m{param=value,param=value,...}", where "m"
is a single character (this is your first error: "f" is a method name,
not a parameter name).
3- There exist different sort of strategies : bipartitioning strategies,
mapping strategies, ordering strategies, which cannot be mixed. For
instance, you cannot build a bipartitioning strategy and feed it to a
mapping method (this is your second error).
To use the "mapCompute" routine, you must create a mapping strategy, not
a bipartitioning one, and so use stratGraphMap() and not
stratGraphBipart(). Your mapping strategy should however be based on the
"recursive bipartitioning" method ("b"). For instance, a simple (and
hence not very efficient) mapping strategy can be :
"b{sep=f}"
which computes mappings with the recursive bipartitioning method "b",
this latter using the Fiduccia-Mattheyses method "f" to compute its
separators.
If you want an exact partition (see your previous post), try
"b{sep=fx}".
However, these strategies are not the most efficient, as they do not
make use of the multi-level framework.
To use the multi-level framework, try for instance:
"b{sep=m{vert=100,low=h,asc=f}x}"
The current default mapping strategy in Scotch can be seen by using the
"-vs" option of program gmap. It is, to date:
b
{
job=t,
map=t,
poli=S,
sep=
(
m
{
asc=b
{
bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},
org=f{move=80,pass=-1,bal=0.005},
width=3
},
low=h{pass=10}f{move=80,pass=-1,bal=0.0005},
type=h,
vert=80,
rat=0.8
}
| m
{
asc=b
{
bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},
org=f{move=80,pass=-1,bal=0.005},
width=3
},
low=h{pass=10}f{move=80,pass=-1,bal=0.0005},
type=h,
vert=80,
rat=0.8
}
)
}
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "scotchDecomp.H" #include "scotchDecomp.H"
@ -239,42 +158,4 @@ Foam::labelList Foam::scotchDecomp::decompose
} }
void Foam::scotchDecomp::calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
)
{
FatalErrorIn
(
"labelList scotchDecomp::decompose"
"("
"const polyMesh&, "
"const List<int>&, "
"const List<int>&"
")"
) << notImplementedMessage << exit(FatalError);
}
void Foam::scotchDecomp::calcCSR
(
const labelListList& cellCells,
List<int>& adjncy,
List<int>& xadj
)
{
FatalErrorIn
(
"labelList scotchDecomp::decompose"
"("
"const labelListList&, "
"const List<int>&, "
"const List<int>&"
")"
) << notImplementedMessage << exit(FatalError);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,6 +31,7 @@ License
#include "fvMatrices.H" #include "fvMatrices.H"
#include "syncTools.H" #include "syncTools.H"
#include "faceSet.H" #include "faceSet.H"
#include "geometricOneField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -377,85 +378,33 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
void Foam::MRFZone::relativeFlux(surfaceScalarField& phi) const void Foam::MRFZone::relativeFlux(surfaceScalarField& phi) const
{ {
const surfaceVectorField& Cf = mesh_.Cf(); relativeRhoFlux(geometricOneField(), phi);
const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_.value();
const vector& Omega = Omega_.value();
// Internal faces
forAll(internalFaces_, i)
{
label facei = internalFaces_[i];
phi[facei] -= (Omega ^ (Cf[facei] - origin)) & Sf[facei];
} }
// Included patches
forAll(includedFaces_, patchi)
{
forAll(includedFaces_[patchi], i)
{
label patchFacei = includedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] = 0.0; void Foam::MRFZone::relativeFlux
} (
} const surfaceScalarField& rho,
surfaceScalarField& phi
// Excluded patches ) const
forAll(excludedFaces_, patchi)
{ {
forAll(excludedFaces_[patchi], i) relativeRhoFlux(rho, phi);
{
label patchFacei = excludedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] -=
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
& Sf.boundaryField()[patchi][patchFacei];
}
}
} }
void Foam::MRFZone::absoluteFlux(surfaceScalarField& phi) const void Foam::MRFZone::absoluteFlux(surfaceScalarField& phi) const
{ {
const surfaceVectorField& Cf = mesh_.Cf(); absoluteRhoFlux(geometricOneField(), phi);
const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_.value();
const vector& Omega = Omega_.value();
// Internal faces
forAll(internalFaces_, i)
{
label facei = internalFaces_[i];
phi[facei] += (Omega ^ (Cf[facei] - origin)) & Sf[facei];
} }
// Included patches
forAll(includedFaces_, patchi)
{
forAll(includedFaces_[patchi], i)
{
label patchFacei = includedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] += void Foam::MRFZone::absoluteFlux
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) (
& Sf.boundaryField()[patchi][patchFacei]; const surfaceScalarField& rho,
} surfaceScalarField& phi
} ) const
// Excluded patches
forAll(excludedFaces_, patchi)
{ {
forAll(excludedFaces_[patchi], i) absoluteRhoFlux(rho, phi);
{
label patchFacei = excludedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] +=
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
& Sf.boundaryField()[patchi][patchFacei];
}
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -97,6 +97,22 @@ class MRFZone
//- Divide faces in frame according to patch //- Divide faces in frame according to patch
void setMRFFaces(); void setMRFFaces();
//- Make the given absolute mass/vol flux relative within the MRF region
template<class RhoFieldType>
void relativeRhoFlux
(
const RhoFieldType& rho,
surfaceScalarField& phi
) const;
//- Make the given relative mass/vol flux absolute within the MRF region
template<class RhoFieldType>
void absoluteRhoFlux
(
const RhoFieldType& rho,
surfaceScalarField& phi
) const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
MRFZone(const MRFZone&); MRFZone(const MRFZone&);
@ -163,9 +179,23 @@ public:
//- Make the given absolute flux relative within the MRF region //- Make the given absolute flux relative within the MRF region
void relativeFlux(surfaceScalarField& phi) const; void relativeFlux(surfaceScalarField& phi) const;
//- Make the given absolute mass-flux relative within the MRF region
void relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const;
//- Make the given relative flux absolute within the MRF region //- Make the given relative flux absolute within the MRF region
void absoluteFlux(surfaceScalarField& phi) const; void absoluteFlux(surfaceScalarField& phi) const;
//- Make the given relative mass-flux absolute within the MRF region
void absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const;
//- Correct the boundary velocity for the roation of the MRF region //- Correct the boundary velocity for the roation of the MRF region
void correctBoundaryVelocity(volVectorField& U) const; void correctBoundaryVelocity(volVectorField& U) const;
@ -186,6 +216,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "MRFZoneTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "MRFZone.H"
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "geometricOneField.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class RhoFieldType>
void Foam::MRFZone::relativeRhoFlux
(
const RhoFieldType& rho,
surfaceScalarField& phi
) const
{
const surfaceVectorField& Cf = mesh_.Cf();
const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_.value();
const vector& Omega = Omega_.value();
// Internal faces
forAll(internalFaces_, i)
{
label facei = internalFaces_[i];
phi[facei] -= rho[facei]*(Omega ^ (Cf[facei] - origin)) & Sf[facei];
}
// Included patches
forAll(includedFaces_, patchi)
{
forAll(includedFaces_[patchi], i)
{
label patchFacei = includedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] = 0.0;
}
}
// Excluded patches
forAll(excludedFaces_, patchi)
{
forAll(excludedFaces_[patchi], i)
{
label patchFacei = excludedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] -=
rho.boundaryField()[patchi][patchFacei]
*(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
& Sf.boundaryField()[patchi][patchFacei];
}
}
}
template<class RhoFieldType>
void Foam::MRFZone::absoluteRhoFlux
(
const RhoFieldType& rho,
surfaceScalarField& phi
) const
{
const surfaceVectorField& Cf = mesh_.Cf();
const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_.value();
const vector& Omega = Omega_.value();
// Internal faces
forAll(internalFaces_, i)
{
label facei = internalFaces_[i];
phi[facei] += (Omega ^ (Cf[facei] - origin)) & Sf[facei];
}
// Included patches
forAll(includedFaces_, patchi)
{
forAll(includedFaces_[patchi], i)
{
label patchFacei = includedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] +=
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
& Sf.boundaryField()[patchi][patchFacei];
}
}
// Excluded patches
forAll(excludedFaces_, patchi)
{
forAll(excludedFaces_[patchi], i)
{
label patchFacei = excludedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] +=
(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
& Sf.boundaryField()[patchi][patchFacei];
}
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,6 +96,19 @@ void Foam::MRFZones::relativeFlux(surfaceScalarField& phi) const
} }
void Foam::MRFZones::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).relativeFlux(rho, phi);
}
}
void Foam::MRFZones::absoluteFlux(surfaceScalarField& phi) const void Foam::MRFZones::absoluteFlux(surfaceScalarField& phi) const
{ {
forAll(*this, i) forAll(*this, i)
@ -105,6 +118,19 @@ void Foam::MRFZones::absoluteFlux(surfaceScalarField& phi) const
} }
void Foam::MRFZones::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).absoluteFlux(rho, phi);
}
}
void Foam::MRFZones::correctBoundaryVelocity(volVectorField& U) const void Foam::MRFZones::correctBoundaryVelocity(volVectorField& U) const
{ {
forAll(*this, i) forAll(*this, i)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,9 +85,23 @@ public:
//- Make the given absolute flux relative within the MRF region //- Make the given absolute flux relative within the MRF region
void relativeFlux(surfaceScalarField& phi) const; void relativeFlux(surfaceScalarField& phi) const;
//- Make the given absolute mass-flux relative within the MRF region
void relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const;
//- Make the given relative flux absolute within the MRF region //- Make the given relative flux absolute within the MRF region
void absoluteFlux(surfaceScalarField& phi) const; void absoluteFlux(surfaceScalarField& phi) const;
//- Make the given relative mass-flux absolute within the MRF region
void absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const;
//- Correct the boundary velocity for the roation of the MRF region //- Correct the boundary velocity for the roation of the MRF region
void correctBoundaryVelocity(volVectorField& U) const; void correctBoundaryVelocity(volVectorField& U) const;
}; };

View File

@ -87,7 +87,7 @@ template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::tmp<Foam::fvMatrix<Type> >
Foam::PorousZones<ZoneType>::ddt Foam::PorousZones<ZoneType>::ddt
( (
const oneField&, const geometricOneField&,
GeometricField<Type, fvPatchField, volMesh>& vf GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {

View File

@ -44,7 +44,7 @@ SourceFiles
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "fvMatricesFwd.H" #include "fvMatricesFwd.H"
#include "dimensionedScalarFwd.H" #include "dimensionedScalarFwd.H"
#include "oneField.H" #include "geometricOneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -105,7 +105,7 @@ public:
template<class Type> template<class Type>
tmp<fvMatrix<Type> > ddt tmp<fvMatrix<Type> > ddt
( (
const oneField&, const geometricOneField&,
GeometricField<Type, fvPatchField, volMesh>& GeometricField<Type, fvPatchField, volMesh>&
); );

View File

@ -27,7 +27,7 @@ License
#include "porousZone.H" #include "porousZone.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "fvMatrices.H" #include "fvMatrices.H"
#include "oneField.H" #include "geometricOneField.H"
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
@ -236,7 +236,7 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
Udiag, Udiag,
cells, cells,
V, V,
oneField(), geometricOneField(),
U U
); );
} }
@ -268,7 +268,7 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
Usource, Usource,
cells, cells,
V, V,
oneField(), geometricOneField(),
mesh_.lookupObject<volScalarField>("nu"), mesh_.lookupObject<volScalarField>("nu"),
U U
); );
@ -316,7 +316,7 @@ void Foam::porousZone::addResistance
( (
AU, AU,
cells, cells,
oneField(), geometricOneField(),
U U
); );
} }
@ -344,7 +344,7 @@ void Foam::porousZone::addResistance
( (
AU, AU,
cells, cells,
oneField(), geometricOneField(),
mesh_.lookupObject<volScalarField>("nu"), mesh_.lookupObject<volScalarField>("nu"),
U U
); );

View File

@ -60,7 +60,7 @@ template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
ddt ddt
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {

View File

@ -38,7 +38,7 @@ SourceFiles
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "fvMatrix.H" #include "fvMatrix.H"
#include "oneField.H" #include "one.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,7 +60,7 @@ namespace fvm
template<class Type> template<class Type>
tmp<fvMatrix<Type> > ddt tmp<fvMatrix<Type> > ddt
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );

View File

@ -99,7 +99,7 @@ template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
laplacian laplacian
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
const word& name const word& name
) )
@ -115,7 +115,7 @@ template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
laplacian laplacian
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {
@ -130,7 +130,7 @@ template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
laplacian laplacian
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
const word& name const word& name
) )
@ -143,7 +143,7 @@ template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
laplacian laplacian
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {

View File

@ -39,7 +39,8 @@ SourceFiles
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H" #include "surfaceFieldsFwd.H"
#include "fvMatrix.H" #include "fvMatrix.H"
#include "oneField.H" #include "zero.H"
#include "one.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,7 +70,7 @@ namespace fvm
template<class Type> template<class Type>
tmp<fvMatrix<Type> > laplacian tmp<fvMatrix<Type> > laplacian
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
const word& const word&
); );
@ -77,7 +78,7 @@ namespace fvm
template<class Type> template<class Type>
tmp<fvMatrix<Type> > laplacian tmp<fvMatrix<Type> > laplacian
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );
@ -85,7 +86,7 @@ namespace fvm
template<class Type> template<class Type>
tmp<fvMatrix<Type> > laplacian tmp<fvMatrix<Type> > laplacian
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
const word& const word&
); );
@ -93,7 +94,7 @@ namespace fvm
template<class Type> template<class Type>
tmp<fvMatrix<Type> > laplacian tmp<fvMatrix<Type> > laplacian
( (
const oneField&, const one&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );

View File

@ -85,7 +85,7 @@ template<class Type>
Foam::zeroField Foam::zeroField
Foam::fvm::Su Foam::fvm::Su
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {
@ -174,7 +174,7 @@ template<class Type>
Foam::zeroField Foam::zeroField
Foam::fvm::Sp Foam::fvm::Sp
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
) )
{ {
@ -240,7 +240,7 @@ template<class Type>
Foam::zeroField Foam::zeroField
Foam::fvm::SuSp Foam::fvm::SuSp
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {

View File

@ -38,6 +38,7 @@ SourceFiles
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "fvMatrix.H" #include "fvMatrix.H"
#include "zeroField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,7 +77,7 @@ namespace fvm
template<class Type> template<class Type>
zeroField Su zeroField Su
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );
@ -116,7 +117,7 @@ namespace fvm
template<class Type> template<class Type>
zeroField Sp zeroField Sp
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );
@ -147,7 +148,7 @@ namespace fvm
template<class Type> template<class Type>
zeroField SuSp zeroField SuSp
( (
const zeroField&, const zero&,
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
); );
} }

View File

@ -1088,7 +1088,7 @@ void Foam::fvMatrix<Type>::operator-=
template<class Type> template<class Type>
void Foam::fvMatrix<Type>::operator+= void Foam::fvMatrix<Type>::operator+=
( (
const zeroField& const zero&
) )
{} {}
@ -1096,7 +1096,7 @@ void Foam::fvMatrix<Type>::operator+=
template<class Type> template<class Type>
void Foam::fvMatrix<Type>::operator-= void Foam::fvMatrix<Type>::operator-=
( (
const zeroField& const zero&
) )
{} {}
@ -1507,7 +1507,7 @@ template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::operator== Foam::tmp<Foam::fvMatrix<Type> > Foam::operator==
( (
const fvMatrix<Type>& A, const fvMatrix<Type>& A,
const zeroField& const zero&
) )
{ {
return A; return A;
@ -1518,7 +1518,7 @@ template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::operator== Foam::tmp<Foam::fvMatrix<Type> > Foam::operator==
( (
const tmp<fvMatrix<Type> >& tA, const tmp<fvMatrix<Type> >& tA,
const zeroField& const zero&
) )
{ {
return tA; return tA;

View File

@ -44,7 +44,7 @@ SourceFiles
#include "tmp.H" #include "tmp.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "dimensionedTypes.H" #include "dimensionedTypes.H"
#include "zeroField.H" #include "zero.H"
#include "className.H" #include "className.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -435,8 +435,8 @@ public:
void operator+=(const dimensioned<Type>&); void operator+=(const dimensioned<Type>&);
void operator-=(const dimensioned<Type>&); void operator-=(const dimensioned<Type>&);
void operator+=(const zeroField&); void operator+=(const zero&);
void operator-=(const zeroField&); void operator-=(const zero&);
void operator*=(const DimensionedField<scalar, volMesh>&); void operator*=(const DimensionedField<scalar, volMesh>&);
void operator*=(const tmp<DimensionedField<scalar, volMesh> >&); void operator*=(const tmp<DimensionedField<scalar, volMesh> >&);
@ -647,14 +647,14 @@ template<class Type>
tmp<fvMatrix<Type> > operator== tmp<fvMatrix<Type> > operator==
( (
const fvMatrix<Type>&, const fvMatrix<Type>&,
const zeroField& const zero&
); );
template<class Type> template<class Type>
tmp<fvMatrix<Type> > operator== tmp<fvMatrix<Type> > operator==
( (
const tmp<fvMatrix<Type> >&, const tmp<fvMatrix<Type> >&,
const zeroField& const zero&
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,6 +34,7 @@ License
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "slicedSurfaceFields.H" #include "slicedSurfaceFields.H"
#include "syncTools.H" #include "syncTools.H"
#include "fvm.H" #include "fvm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,11 +50,11 @@ void Foam::MULES::explicitSolve
{ {
explicitSolve explicitSolve
( (
oneField(), geometricOneField(),
psi, psi,
phi, phi,
phiPsi, phiPsi,
zeroField(), zeroField(), zero(), zero(),
psiMax, psiMin psiMax, psiMin
); );
} }
@ -70,11 +71,11 @@ void Foam::MULES::implicitSolve
{ {
implicitSolve implicitSolve
( (
oneField(), geometricOneField(),
psi, psi,
phi, phi,
phiPsi, phiPsi,
zeroField(), zeroField(), zero(), zero(),
psiMax, psiMin psiMax, psiMin
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,8 +46,8 @@ SourceFiles
#include "volFields.H" #include "volFields.H"
#include "surfaceFieldsFwd.H" #include "surfaceFieldsFwd.H"
#include "primitiveFieldsFwd.H" #include "primitiveFieldsFwd.H"
#include "zeroField.H" #include "zero.H"
#include "oneField.H" #include "geometricOneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -88,8 +88,8 @@ void Foam::MULES::explicitSolve
psi, psi,
phiBD, phiBD,
phiCorr, phiCorr,
Sp.field(), Sp,
Su.field(), Su,
psiMax, psiMax,
psiMin, psiMin,
3 3
@ -109,18 +109,18 @@ void Foam::MULES::explicitSolve
psiIf = psiIf =
( (
mesh.Vsc0()*rho.oldTime()*psi0/(deltaT*mesh.Vsc()) mesh.Vsc0()*rho.oldTime()*psi0/(deltaT*mesh.Vsc())
+ Su.field() + Su
- psiIf - psiIf
)/(rho/deltaT - Sp.field()); )/(rho/deltaT - Sp);
} }
else else
{ {
psiIf = psiIf =
( (
rho.oldTime()*psi0/deltaT rho.oldTime()*psi0/deltaT
+ Su.field() + Su
- psiIf - psiIf
)/(rho/deltaT - Sp.field()); )/(rho/deltaT - Sp);
} }
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
@ -244,8 +244,8 @@ void Foam::MULES::implicitSolve
psi, psi,
phiBD, phiBD,
phiCorr, phiCorr,
Sp.field(), Sp,
Su.field(), Su,
psiMax, psiMax,
psiMin, psiMin,
nLimiterIter nLimiterIter

View File

@ -431,7 +431,7 @@ Foam::autoHexMeshDriver::autoHexMeshDriver
<< "You have selected decomposition method " << "You have selected decomposition method "
<< decomposer.typeName << decomposer.typeName
<< " which is not parallel aware." << endl << " which is not parallel aware." << endl
<< "Please select one that is (parMetis, hierarchical)" << "Please select one that is (hierarchical, ptscotch)"
<< exit(FatalError); << exit(FatalError);
} }

View File

@ -9,7 +9,7 @@ wmake libso metisDecomp
if [ -d "$FOAM_MPI_LIBBIN" ] if [ -d "$FOAM_MPI_LIBBIN" ]
then then
( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB; wmake libso parMetisDecomp ) ( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB; wmake libso ptscotchDecomp )
fi fi
wmake libso decompositionMethods wmake libso decompositionMethods

View File

@ -4,7 +4,7 @@ set -x
wmakeLnInclude decompositionMethods wmakeLnInclude decompositionMethods
wmakeLnInclude metisDecomp wmakeLnInclude metisDecomp
wmakeLnInclude parMetisDecomp
wmakeLnInclude scotchDecomp wmakeLnInclude scotchDecomp
wmakeLnInclude ptscotchDecomp
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,10 +1,4 @@
EXE_INC = EXE_INC =
LIB_LIBS = \ LIB_LIBS =
-L$(FOAM_LIBBIN)/dummy \
-L$(FOAM_MPI_LIBBIN) \
-lscotchDecomp \
-lmetisDecomp \
-lparMetisDecomp

View File

@ -28,6 +28,9 @@ InClass
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "decompositionMethod.H" #include "decompositionMethod.H"
#include "globalIndex.H"
#include "cyclicPolyPatch.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -156,6 +159,18 @@ Foam::labelList Foam::decompositionMethod::decompose
} }
Foam::labelList Foam::decompositionMethod::decompose
(
const labelListList& globalCellCells,
const pointField& cc
)
{
scalarField cWeights(0);
return decompose(globalCellCells, cc, cWeights);
}
void Foam::decompositionMethod::calcCellCells void Foam::decompositionMethod::calcCellCells
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -201,15 +216,284 @@ void Foam::decompositionMethod::calcCellCells
} }
Foam::labelList Foam::decompositionMethod::decompose void Foam::decompositionMethod::calcCSR
( (
const labelListList& globalCellCells, const polyMesh& mesh,
const pointField& cc List<int>& adjncy,
List<int>& xadj
) )
{ {
scalarField cWeights(0); // Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
return decompose(globalCellCells, cc, cWeights); xadj.setSize(mesh.nCells()+1);
// Initialise the number of internal faces of the cells to twice the
// number of internal faces
label nInternalFaces = 2*mesh.nInternalFaces();
// Check the boundary for coupled patches and add to the number of
// internal faces
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
forAll(pbm, patchi)
{
if (isA<cyclicPolyPatch>(pbm[patchi]))
{
nInternalFaces += pbm[patchi].size();
}
}
// Create the adjncy array the size of the total number of internal and
// coupled faces
adjncy.setSize(nInternalFaces);
// Fill in xadj
// ~~~~~~~~~~~~
label freeAdj = 0;
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{
xadj[cellI] = freeAdj;
const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
if
(
mesh.isInternalFace(faceI)
|| isA<cyclicPolyPatch>(pbm[pbm.whichPatch(faceI)])
)
{
freeAdj++;
}
}
}
xadj[mesh.nCells()] = freeAdj;
// Fill in adjncy
// ~~~~~~~~~~~~~~
labelList nFacesPerCell(mesh.nCells(), 0);
// Internal faces
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
label own = mesh.faceOwner()[faceI];
label nei = mesh.faceNeighbour()[faceI];
adjncy[xadj[own] + nFacesPerCell[own]++] = nei;
adjncy[xadj[nei] + nFacesPerCell[nei]++] = own;
}
// Coupled faces. Only cyclics done.
forAll(pbm, patchi)
{
if (isA<cyclicPolyPatch>(pbm[patchi]))
{
const unallocLabelList& faceCells = pbm[patchi].faceCells();
label sizeby2 = faceCells.size()/2;
for (label facei=0; facei<sizeby2; facei++)
{
label own = faceCells[facei];
label nei = faceCells[facei + sizeby2];
adjncy[xadj[own] + nFacesPerCell[own]++] = nei;
adjncy[xadj[nei] + nFacesPerCell[nei]++] = own;
}
}
}
}
// From cell-cell connections to Metis format (like CompactListList)
void Foam::decompositionMethod::calcCSR
(
const labelListList& cellCells,
List<int>& adjncy,
List<int>& xadj
)
{
// Count number of internal faces
label nConnections = 0;
forAll(cellCells, coarseI)
{
nConnections += cellCells[coarseI].size();
}
// Create the adjncy array as twice the size of the total number of
// internal faces
adjncy.setSize(nConnections);
xadj.setSize(cellCells.size()+1);
// Fill in xadj
// ~~~~~~~~~~~~
label freeAdj = 0;
forAll(cellCells, coarseI)
{
xadj[coarseI] = freeAdj;
const labelList& cCells = cellCells[coarseI];
forAll(cCells, i)
{
adjncy[freeAdj++] = cCells[i];
}
}
xadj[cellCells.size()] = freeAdj;
}
void Foam::decompositionMethod::calcDistributedCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
)
{
// Create global cell numbers
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
globalIndex globalCells(mesh.nCells());
//
// Make Metis Distributed CSR (Compressed Storage Format) storage
// adjncy : contains cellCells (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
//
const labelList& faceOwner = mesh.faceOwner();
const labelList& faceNeighbour = mesh.faceNeighbour();
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Get renumbered owner on other side of coupled faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<int> globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
label faceI = pp.start();
label bFaceI = pp.start() - mesh.nInternalFaces();
forAll(pp, i)
{
globalNeighbour[bFaceI++] = globalCells.toGlobal
(
faceOwner[faceI++]
);
}
}
}
// Get the cell on the other side of coupled patches
syncTools::swapBoundaryFaceList(mesh, globalNeighbour, false);
// Count number of faces (internal + coupled)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Number of faces per cell
List<int> nFacesPerCell(mesh.nCells(), 0);
// Number of coupled faces
label nCoupledFaces = 0;
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
nFacesPerCell[faceOwner[faceI]]++;
nFacesPerCell[faceNeighbour[faceI]]++;
}
// Handle coupled faces
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
label faceI = pp.start();
forAll(pp, i)
{
nCoupledFaces++;
nFacesPerCell[faceOwner[faceI++]]++;
}
}
}
// Fill in xadj
// ~~~~~~~~~~~~
xadj.setSize(mesh.nCells()+1);
int freeAdj = 0;
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{
xadj[cellI] = freeAdj;
freeAdj += nFacesPerCell[cellI];
}
xadj[mesh.nCells()] = freeAdj;
// Fill in adjncy
// ~~~~~~~~~~~~~~
adjncy.setSize(2*mesh.nInternalFaces() + nCoupledFaces);
nFacesPerCell = 0;
// For internal faces is just offsetted owner and neighbour
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
adjncy[xadj[own] + nFacesPerCell[own]++] = globalCells.toGlobal(nei);
adjncy[xadj[nei] + nFacesPerCell[nei]++] = globalCells.toGlobal(own);
}
// For boundary faces is offsetted coupled neighbour
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
label faceI = pp.start();
label bFaceI = pp.start()-mesh.nInternalFaces();
forAll(pp, i)
{
label own = faceOwner[faceI];
adjncy[xadj[own] + nFacesPerCell[own]++] =
globalNeighbour[bFaceI];
faceI++;
bFaceI++;
}
}
}
} }

View File

@ -66,6 +66,31 @@ protected:
labelListList& cellCells labelListList& cellCells
); );
// From mesh to compact row storage format
// (like CompactListList)
static void calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
);
// From cell-cell connections to compact row storage format
// (like CompactListList)
static void calcCSR
(
const labelListList& cellCells,
List<int>& adjncy,
List<int>& xadj
);
static void calcDistributedCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
);
private: private:
// Private Member Functions // Private Member Functions

View File

@ -1,7 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(WM_THIRD_PARTY_DIR)/metis-5.0pre2/include \ -I$(WM_THIRD_PARTY_DIR)/metis-5.0pre2/include \
-I../decompositionMethods/lnInclude \ -I../decompositionMethods/lnInclude
-I../scotchDecomp/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lmetis \ -lmetis \

View File

@ -28,7 +28,6 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "floatScalar.H" #include "floatScalar.H"
#include "Time.H" #include "Time.H"
#include "scotchDecomp.H"
extern "C" extern "C"
{ {
@ -340,7 +339,7 @@ Foam::labelList Foam::metisDecomp::decompose
List<int> adjncy; List<int> adjncy;
List<int> xadj; List<int> xadj;
scotchDecomp::calcCSR(mesh_, adjncy, xadj); calcCSR(mesh_, adjncy, xadj);
// Decompose using default weights // Decompose using default weights
List<int> finalDecomp; List<int> finalDecomp;
@ -390,7 +389,7 @@ Foam::labelList Foam::metisDecomp::decompose
cellCells cellCells
); );
scotchDecomp::calcCSR(cellCells, adjncy, xadj); calcCSR(cellCells, adjncy, xadj);
} }
// Decompose using default weights // Decompose using default weights
@ -435,7 +434,7 @@ Foam::labelList Foam::metisDecomp::decompose
List<int> adjncy; List<int> adjncy;
List<int> xadj; List<int> xadj;
scotchDecomp::calcCSR(globalCellCells, adjncy, xadj); calcCSR(globalCellCells, adjncy, xadj);
// Decompose using default weights // Decompose using default weights

View File

@ -1,3 +0,0 @@
parMetisDecomp.C
LIB = $(FOAM_MPI_LIBBIN)/libparMetisDecomp

View File

@ -1,14 +0,0 @@
include $(RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \
-I$(WM_THIRD_PARTY_DIR)/ParMetis-3.1/ParMETISLib \
-I$(WM_THIRD_PARTY_DIR)/ParMetis-3.1 \
-I../decompositionMethods/lnInclude \
-I../metisDecomp/lnInclude \
-I../scotchDecomp/lnInclude
LIB_LIBS = \
-L$(FOAM_MPI_LIBBIN) \
-lmetis-parmetis \
-lparmetis

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
ptscotchDecomp.C
LIB = $(FOAM_MPI_LIBBIN)/libptscotchDecomp

View File

@ -0,0 +1,10 @@
include $(RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/include \
-I/usr/include/scotch \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(FOAM_MPI_LIBBIN) -lptscotch -lptscotcherrexit

View File

@ -0,0 +1,592 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
From scotch forum:
By: Francois PELLEGRINI RE: Graph mapping 'strategy' string [ reply ]
2008-08-22 10:09 Strategy handling in Scotch is a bit tricky. In order
not to be confused, you must have a clear view of how they are built.
Here are some rules:
1- Strategies are made up of "methods" which are combined by means of
"operators".
2- A method is of the form "m{param=value,param=value,...}", where "m"
is a single character (this is your first error: "f" is a method name,
not a parameter name).
3- There exist different sort of strategies : bipartitioning strategies,
mapping strategies, ordering strategies, which cannot be mixed. For
instance, you cannot build a bipartitioning strategy and feed it to a
mapping method (this is your second error).
To use the "mapCompute" routine, you must create a mapping strategy, not
a bipartitioning one, and so use stratGraphMap() and not
stratGraphBipart(). Your mapping strategy should however be based on the
"recursive bipartitioning" method ("b"). For instance, a simple (and
hence not very efficient) mapping strategy can be :
"b{sep=f}"
which computes mappings with the recursive bipartitioning method "b",
this latter using the Fiduccia-Mattheyses method "f" to compute its
separators.
If you want an exact partition (see your previous post), try
"b{sep=fx}".
However, these strategies are not the most efficient, as they do not
make use of the multi-level framework.
To use the multi-level framework, try for instance:
"b{sep=m{vert=100,low=h,asc=f}x}"
The current default mapping strategy in Scotch can be seen by using the
"-vs" option of program gmap. It is, to date:
b
{
job=t,
map=t,
poli=S,
sep=
(
m
{
asc=b
{
bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},
org=f{move=80,pass=-1,bal=0.005},
width=3
},
low=h{pass=10}f{move=80,pass=-1,bal=0.0005},
type=h,
vert=80,
rat=0.8
}
| m
{
asc=b
{
bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},
org=f{move=80,pass=-1,bal=0.005},
width=3
},
low=h{pass=10}f{move=80,pass=-1,bal=0.0005},
type=h,
vert=80,
rat=0.8
}
)
}
\*---------------------------------------------------------------------------*/
#include "ptscotchDecomp.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
#include "OFstream.H"
extern "C"
{
#include <stdio.h>
#include "mpi.h"
#include "ptscotch.h"
}
// Hack: scotch generates floating point errors so need to switch of error
// trapping!
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
# define LINUX
#endif
#if defined(LINUX) && defined(__GNUC__)
# define LINUX_GNUC
#endif
#ifdef LINUX_GNUC
# ifndef __USE_GNU
# define __USE_GNU
# endif
# include <fenv.h>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(ptscotchDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
ptscotchDecomp,
dictionaryMesh
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ptscotchDecomp::check(const int retVal, const char* str)
{
if (retVal)
{
FatalErrorIn("ptscotchDecomp::decompose(..)")
<< "Call to scotch routine " << str << " failed."
<< exit(FatalError);
}
}
// Call scotch with options from dictionary.
Foam::label Foam::ptscotchDecomp::decompose
(
List<int>& adjncy,
List<int>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
)
{
// // Dump graph
// if (decompositionDict_.found("ptscotchCoeffs"))
// {
// const dictionary& scotchCoeffs =
// decompositionDict_.subDict("ptscotchCoeffs");
//
// if (scotchCoeffs.found("writeGraph"))
// {
// Switch writeGraph(scotchCoeffs.lookup("writeGraph"));
//
// if (writeGraph)
// {
// OFstream str(mesh_.time().path() / mesh_.name() + ".grf");
//
// Info<< "Dumping Scotch graph file to " << str.name() << endl
// << "Use this in combination with gpart." << endl;
//
// label version = 0;
// str << version << nl;
// // Numer of vertices
// str << xadj.size()-1 << ' ' << adjncy.size() << nl;
// // Numbering starts from 0
// label baseval = 0;
// // Has weights?
// label hasEdgeWeights = 0;
// label hasVertexWeights = 0;
// label numericflag = 10*hasEdgeWeights+hasVertexWeights;
// str << baseval << ' ' << numericflag << nl;
// for (label cellI = 0; cellI < xadj.size()-1; cellI++)
// {
// label start = xadj[cellI];
// label end = xadj[cellI+1];
// str << end-start;
//
// for (label i = start; i < end; i++)
// {
// str << ' ' << adjncy[i];
// }
// str << nl;
// }
// }
// }
// }
// Strategy
// ~~~~~~~~
// Default.
SCOTCH_Strat stradat;
check(SCOTCH_stratInit(&stradat), "SCOTCH_stratInit");
if (decompositionDict_.found("scotchCoeffs"))
{
const dictionary& scotchCoeffs =
decompositionDict_.subDict("scotchCoeffs");
string strategy;
if (scotchCoeffs.readIfPresent("strategy", strategy))
{
if (debug)
{
Info<< "ptscotchDecomp : Using strategy " << strategy << endl;
}
SCOTCH_stratDgraphMap(&stradat, strategy.c_str());
//fprintf(stdout, "S\tStrat=");
//SCOTCH_stratSave(&stradat, stdout);
//fprintf(stdout, "\n");
}
}
// Graph
// ~~~~~
List<int> velotab;
// Check for externally provided cellweights and if so initialise weights
scalar minWeights = gMin(cWeights);
if (cWeights.size() > 0)
{
if (minWeights <= 0)
{
WarningIn
(
"ptscotchDecomp::decompose"
"(const pointField&, const scalarField&)"
) << "Illegal minimum weight " << minWeights
<< endl;
}
if (cWeights.size() != xadj.size()-1)
{
FatalErrorIn
(
"ptscotchDecomp::decompose"
"(const pointField&, const scalarField&)"
) << "Number of cell weights " << cWeights.size()
<< " does not equal number of cells " << xadj.size()-1
<< exit(FatalError);
}
// Convert to integers.
velotab.setSize(cWeights.size());
forAll(velotab, i)
{
velotab[i] = int(cWeights[i]/minWeights);
}
}
SCOTCH_Dgraph grafdat;
check(SCOTCH_dgraphInit(&grafdat, MPI_COMM_WORLD), "SCOTCH_dgraphInit");
check
(
SCOTCH_dgraphBuild
(
&grafdat, // grafdat
0, // baseval, c-style numbering
xadj.size()-1, // vertlocnbr, nCells
xadj.size()-1, // vertlocmax
const_cast<SCOTCH_Num*>(xadj.begin()), // vertloctab, start index per cell into
// adjncy
&xadj[1], // vendloctab, end index ,,
velotab.begin(), // veloloctab, vertex weights
NULL, // vlblloctab
adjncy.size(), // edgelocnbr, number of arcs
adjncy.size(), // edgelocsiz
adjncy.begin(), // edgeloctab
NULL, // edgegsttab
NULL // edlotab, edge weights
),
"SCOTCH_dgraphBuild"
);
check(SCOTCH_dgraphCheck(&grafdat), "SCOTCH_dgraphCheck");
// Architecture
// ~~~~~~~~~~~~
// (fully connected network topology since using switch)
SCOTCH_Arch archdat;
check(SCOTCH_archInit(&archdat), "SCOTCH_archInit");
List<label> processorWeights;
if (decompositionDict_.found("scotchCoeffs"))
{
const dictionary& scotchCoeffs =
decompositionDict_.subDict("scotchCoeffs");
scotchCoeffs.readIfPresent("processorWeights", processorWeights);
}
if (processorWeights.size())
{
if (debug)
{
Info<< "ptscotchDecomp : Using procesor weights " << processorWeights
<< endl;
}
check
(
SCOTCH_archCmpltw(&archdat, nProcessors_, processorWeights.begin()),
"SCOTCH_archCmpltw"
);
}
else
{
check
(
SCOTCH_archCmplt(&archdat, nProcessors_),
"SCOTCH_archCmplt"
);
}
//SCOTCH_Mapping mapdat;
//SCOTCH_dgraphMapInit(&grafdat, &mapdat, &archdat, NULL);
//SCOTCH_dgraphMapCompute(&grafdat, &mapdat, &stradat); /*Perform mapping*/
//SCOTCHdgraphMapExit(&grafdat, &mapdat);
// Hack:switch off fpu error trapping
# ifdef LINUX_GNUC
int oldExcepts = fedisableexcept
(
FE_DIVBYZERO
| FE_INVALID
| FE_OVERFLOW
);
# endif
finalDecomp.setSize(xadj.size()-1);
finalDecomp = 0;
check
(
SCOTCH_dgraphMap
(
&grafdat,
&archdat,
&stradat, // const SCOTCH_Strat *
finalDecomp.begin() // parttab
),
"SCOTCH_graphMap"
);
# ifdef LINUX_GNUC
feenableexcept(oldExcepts);
# endif
//finalDecomp.setSize(xadj.size()-1);
//check
//(
// SCOTCH_dgraphPart
// (
// &grafdat,
// nProcessors_, // partnbr
// &stradat, // const SCOTCH_Strat *
// finalDecomp.begin() // parttab
// ),
// "SCOTCH_graphPart"
//);
// Release storage for graph
SCOTCH_dgraphExit(&grafdat);
// Release storage for strategy
SCOTCH_stratExit(&stradat);
// Release storage for network topology
SCOTCH_archExit(&archdat);
return 0;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ptscotchDecomp::ptscotchDecomp
(
const dictionary& decompositionDict,
const polyMesh& mesh
)
:
decompositionMethod(decompositionDict),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::ptscotchDecomp::decompose
(
const pointField& points,
const scalarField& pointWeights
)
{
if (points.size() != mesh_.nCells())
{
FatalErrorIn
(
"ptscotchDecomp::decompose(const pointField&, const scalarField&)"
)
<< "Can use this decomposition method only for the whole mesh"
<< endl
<< "and supply one coordinate (cellCentre) for every cell." << endl
<< "The number of coordinates " << points.size() << endl
<< "The number of cells in the mesh " << mesh_.nCells()
<< exit(FatalError);
}
// // For running sequential ...
// if (Pstream::nProcs() <= 1)
// {
// return scotchDecomp(decompositionDict_, mesh_)
// .decompose(points, pointWeights);
// }
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
// Connections
Field<int> adjncy;
// Offsets into adjncy
Field<int> xadj;
calcDistributedCSR
(
mesh_,
adjncy,
xadj
);
// Decompose using default weights
List<int> finalDecomp;
decompose(adjncy, xadj, pointWeights, finalDecomp);
// Copy back to labelList
labelList decomp(finalDecomp.size());
forAll(decomp, i)
{
decomp[i] = finalDecomp[i];
}
return decomp;
}
Foam::labelList Foam::ptscotchDecomp::decompose
(
const labelList& agglom,
const pointField& agglomPoints,
const scalarField& pointWeights
)
{
if (agglom.size() != mesh_.nCells())
{
FatalErrorIn
(
"ptscotchDecomp::decompose(const labelList&, const pointField&)"
) << "Size of cell-to-coarse map " << agglom.size()
<< " differs from number of cells in mesh " << mesh_.nCells()
<< exit(FatalError);
}
// // For running sequential ...
// if (Pstream::nProcs() <= 1)
// {
// return scotchDecomp(decompositionDict_, mesh_)
// .decompose(agglom, agglomPoints, pointWeights);
// }
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
{
// Get cellCells on coarse mesh.
labelListList cellCells;
calcCellCells
(
mesh_,
agglom,
agglomPoints.size(),
cellCells
);
calcCSR(cellCells, adjncy, xadj);
}
// Decompose using weights
List<int> finalDecomp;
decompose(adjncy, xadj, pointWeights, finalDecomp);
// Rework back into decomposition for original mesh_
labelList fineDistribution(agglom.size());
forAll(fineDistribution, i)
{
fineDistribution[i] = finalDecomp[agglom[i]];
}
return fineDistribution;
}
Foam::labelList Foam::ptscotchDecomp::decompose
(
const labelListList& globalCellCells,
const pointField& cellCentres,
const scalarField& cWeights
)
{
if (cellCentres.size() != globalCellCells.size())
{
FatalErrorIn
(
"ptscotchDecomp::decompose(const pointField&, const labelListList&)"
) << "Inconsistent number of cells (" << globalCellCells.size()
<< ") and number of cell centres (" << cellCentres.size()
<< ")." << exit(FatalError);
}
// // For running sequential ...
// if (Pstream::nProcs() <= 1)
// {
// return scotchDecomp(decompositionDict_, mesh_)
// .decompose(globalCellCells, cellCentres, cWeights);
// }
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
calcCSR(globalCellCells, adjncy, xadj);
// Decompose using weights
List<int> finalDecomp;
decompose(adjncy, xadj, cWeights, finalDecomp);
// Copy back to labelList
labelList decomp(finalDecomp.size());
forAll(decomp, i)
{
decomp[i] = finalDecomp[i];
}
return decomp;
}
// ************************************************************************* //

View File

@ -23,17 +23,18 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class Class
Foam::parMetisDecomp Foam::ptscotchDecomp
Description Description
PTScotch domain decomposition
SourceFiles SourceFiles
parMetisDecomp.C ptscotchDecomp.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef parMetisDecomp_H #ifndef ptscotchDecomp_H
#define parMetisDecomp_H #define ptscotchDecomp_H
#include "decompositionMethod.H" #include "decompositionMethod.H"
@ -41,10 +42,10 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class parMetisDecomp Declaration Class ptscotchDecomp Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class parMetisDecomp class ptscotchDecomp
: :
public decompositionMethod public decompositionMethod
{ {
@ -55,41 +56,32 @@ class parMetisDecomp
// Private Member Functions // Private Member Functions
//- Insert list in front of list. //- Check and print error message
template<class Type> static void check(const int, const char*);
static void prepend(const UList<Type>&, List<Type>&);
//- Insert list at end of list.
template<class Type>
static void append(const UList<Type>&, List<Type>&);
label decompose label decompose
( (
Field<int>& xadj, List<int>& adjncy,
Field<int>& adjncy, List<int>& xadj,
const pointField& cellCentres, const scalarField& cWeights,
Field<int>& cellWeights,
Field<int>& faceWeights,
const List<int>& options,
List<int>& finalDecomp List<int>& finalDecomp
); );
//- Disallow default bitwise copy construct and assignment //- Disallow default bitwise copy construct and assignment
void operator=(const parMetisDecomp&); void operator=(const ptscotchDecomp&);
parMetisDecomp(const parMetisDecomp&); ptscotchDecomp(const ptscotchDecomp&);
public: public:
//- Runtime type information //- Runtime type information
TypeName("parMetis"); TypeName("ptscotch");
// Constructors // Constructors
//- Construct given the decomposition dictionary and mesh //- Construct given the decomposition dictionary and mesh
parMetisDecomp ptscotchDecomp
( (
const dictionary& decompositionDict, const dictionary& decompositionDict,
const polyMesh& mesh const polyMesh& mesh
@ -98,23 +90,20 @@ public:
// Destructor // Destructor
~parMetisDecomp() virtual ~ptscotchDecomp()
{} {}
// Member Functions // Member Functions
//- parMetis handles Foam processor boundaries
virtual bool parallelAware() const virtual bool parallelAware() const
{ {
// ptscotch does not know about proc boundaries
return true; return true;
} }
//- Return for every coordinate the wanted processor number. Use the //- Return for every coordinate the wanted processor number. Use the
// mesh connectivity (if needed) // mesh connectivity (if needed)
// Weights get normalised so the minimum value is 1 before truncation
// to an integer so the weights should be multiples of the minimum
// value. The overall sum of weights might otherwise overflow.
virtual labelList decompose virtual labelList decompose
( (
const pointField& points, const pointField& points,
@ -125,10 +114,9 @@ public:
// passed agglomeration map (from fine to coarse cells) and coarse cell // passed agglomeration map (from fine to coarse cells) and coarse cell
// location. Can be overridden by decomposers that provide this // location. Can be overridden by decomposers that provide this
// functionality natively. // functionality natively.
// See note on weights above.
virtual labelList decompose virtual labelList decompose
( (
const labelList& cellToRegion, const labelList& agglom,
const pointField& regionPoints, const pointField& regionPoints,
const scalarField& regionWeights const scalarField& regionWeights
); );
@ -140,7 +128,6 @@ public:
// from 0 at processor0 and then incrementing all through the // from 0 at processor0 and then incrementing all through the
// processors) // processors)
// - the connections are across coupled patches // - the connections are across coupled patches
// See note on weights above.
virtual labelList decompose virtual labelList decompose
( (
const labelListList& globalCellCells, const labelListList& globalCellCells,
@ -148,13 +135,6 @@ public:
const scalarField& cWeights const scalarField& cWeights
); );
//- Helper to convert mesh connectivity into distributed CSR
static void calcMetisDistributedCSR
(
const polyMesh&,
List<int>& adjncy,
List<int>& xadj
);
}; };
@ -164,12 +144,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "parMetisDecompTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -474,7 +474,7 @@ Foam::labelList Foam::scotchDecomp::decompose
{ {
FatalErrorIn FatalErrorIn
( (
"parMetisDecomp::decompose(const labelList&, const pointField&)" "scotchDecomp::decompose(const labelList&, const pointField&)"
) << "Size of cell-to-coarse map " << agglom.size() ) << "Size of cell-to-coarse map " << agglom.size()
<< " differs from number of cells in mesh " << mesh_.nCells() << " differs from number of cells in mesh " << mesh_.nCells()
<< exit(FatalError); << exit(FatalError);
@ -556,144 +556,4 @@ Foam::labelList Foam::scotchDecomp::decompose
} }
void Foam::scotchDecomp::calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
)
{
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
xadj.setSize(mesh.nCells()+1);
// Initialise the number of internal faces of the cells to twice the
// number of internal faces
label nInternalFaces = 2*mesh.nInternalFaces();
// Check the boundary for coupled patches and add to the number of
// internal faces
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
forAll(pbm, patchi)
{
if (isA<cyclicPolyPatch>(pbm[patchi]))
{
nInternalFaces += pbm[patchi].size();
}
}
// Create the adjncy array the size of the total number of internal and
// coupled faces
adjncy.setSize(nInternalFaces);
// Fill in xadj
// ~~~~~~~~~~~~
label freeAdj = 0;
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{
xadj[cellI] = freeAdj;
const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
if
(
mesh.isInternalFace(faceI)
|| isA<cyclicPolyPatch>(pbm[pbm.whichPatch(faceI)])
)
{
freeAdj++;
}
}
}
xadj[mesh.nCells()] = freeAdj;
// Fill in adjncy
// ~~~~~~~~~~~~~~
labelList nFacesPerCell(mesh.nCells(), 0);
// Internal faces
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
label own = mesh.faceOwner()[faceI];
label nei = mesh.faceNeighbour()[faceI];
adjncy[xadj[own] + nFacesPerCell[own]++] = nei;
adjncy[xadj[nei] + nFacesPerCell[nei]++] = own;
}
// Coupled faces. Only cyclics done.
forAll(pbm, patchi)
{
if (isA<cyclicPolyPatch>(pbm[patchi]))
{
const unallocLabelList& faceCells = pbm[patchi].faceCells();
label sizeby2 = faceCells.size()/2;
for (label facei=0; facei<sizeby2; facei++)
{
label own = faceCells[facei];
label nei = faceCells[facei + sizeby2];
adjncy[xadj[own] + nFacesPerCell[own]++] = nei;
adjncy[xadj[nei] + nFacesPerCell[nei]++] = own;
}
}
}
}
// From cell-cell connections to Metis format (like CompactListList)
void Foam::scotchDecomp::calcCSR
(
const labelListList& cellCells,
List<int>& adjncy,
List<int>& xadj
)
{
// Count number of internal faces
label nConnections = 0;
forAll(cellCells, coarseI)
{
nConnections += cellCells[coarseI].size();
}
// Create the adjncy array as twice the size of the total number of
// internal faces
adjncy.setSize(nConnections);
xadj.setSize(cellCells.size()+1);
// Fill in xadj
// ~~~~~~~~~~~~
label freeAdj = 0;
forAll(cellCells, coarseI)
{
xadj[coarseI] = freeAdj;
const labelList& cCells = cellCells[coarseI];
forAll(cCells, i)
{
adjncy[freeAdj++] = cCells[i];
}
}
xadj[cellCells.size()] = freeAdj;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -139,26 +139,6 @@ public:
const pointField& cc, const pointField& cc,
const scalarField& cWeights const scalarField& cWeights
); );
//- Helper to convert local connectivity (supplied as owner,neighbour)
// into CSR (Metis,scotch) storage. Does cyclics but not processor
// patches
static void calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
);
//- Helper to convert connectivity (supplied as cellcells) into
// CSR (Metis,scotch) storage
static void calcCSR
(
const labelListList& globalCellCells,
List<int>& adjncy,
List<int>& xadj
);
}; };

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 293;
boundaryField
{
rotor
{
type zeroGradient;
}
stator
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
rotor
{
type fixedValue;
value uniform (0 0 0);
}
stator
{
type fixedValue;
value uniform (0 0 0);
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
rotor
{
type alphatWallFunction;
Prt 0.85;
value uniform 0;
}
stator
{
type alphatWallFunction;
Prt 0.85;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 20;
boundaryField
{
rotor
{
type compressible::epsilonWallFunction;
value uniform 20;
}
stator
{
type compressible::epsilonWallFunction;
value uniform 20;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 1;
boundaryField
{
rotor
{
type compressible::kqRWallFunction;
value uniform 0;
}
stator
{
type compressible::kqRWallFunction;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
rotor
{
type mutkWallFunction;
value uniform 0;
}
stator
{
type mutkWallFunction;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
rotor
{
type zeroGradient;
}
stator
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,9 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication`
./makeMesh
runApplication $application

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object MRFZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
rotor
{
// Fixed patches (by default they 'move' with the MRF zone)
nonRotatingPatches ();
origin origin [0 1 0 0 0 0 0] (0 0 0);
axis axis [0 0 0 0 0 0 0] (0 0 1);
omega omega [0 0 -1 0 0 0 0] 1047.2;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMeshLib "libtopoChangerFvMesh.so";
dynamicFvMesh mixerFvMesh;
mixerFvMeshCoeffs
{
coordinateSystem
{
type cylindrical;
origin ( 0 0 0 );
axis ( 0 0 1 );
direction ( 1 0 0 );
}
rpm 10;
slider
{
inside insideSlider;
outside outsideSlider;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,834 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// General macros to create 2D/extruded-2D meshes
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.1;
// Hub radius
// Impeller-tip radius
// Baffle-tip radius
// Tank radius
// MRF region radius
// Thickness of 2D slab
// Base z
// Top z
// Number of cells radially between hub and impeller tip
// Number of cells radially in each of the two regions between
// impeller and baffle tips
// Number of cells radially between baffle tip and tank
// Number of cells azimuthally in each of the 8 blocks
// Number of cells in the thickness of the slab
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vertices
(
(0.2 0 0) // Vertex r0b = 0
(0.2 0 0) // Vertex r0sb = 1
(0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2
(3.58979347393082e-10 -0.2 0) // Vertex r2b = 3
(3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4
(-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5
(-0.2 7.17958694786164e-10 0) // Vertex r4b = 6
(-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7
(-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8
(3.58979347393082e-10 0.2 0) // Vertex r6b = 9
(3.58979347393082e-10 0.2 0) // Vertex r6sb = 10
(0.141421356364228 0.141421356110391 0) // Vertex r7b = 11
(0.5 0 0) // Vertex rb0b = 12
(0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13
(8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14
(-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15
(-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16
(-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17
(8.97448368482705e-10 0.5 0) // Vertex rb6b = 18
(0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19
(0.6 0 0) // Vertex ri0b = 20
(0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21
(1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22
(-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23
(-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24
(-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25
(1.07693804217925e-09 0.6 0) // Vertex ri6b = 26
(0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27
(0.7 0 0) // Vertex Rb0b = 28
(0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29
(1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30
(-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31
(-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32
(-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33
(1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34
(0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35
(1 0 0) // Vertex R0b = 36
(0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37
(0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38
(1.79489673696541e-09 -1 0) // Vertex R2b = 39
(-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40
(-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41
(-1 3.58979347393082e-09 0) // Vertex R4b = 42
(-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43
(-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44
(1.79489673696541e-09 1 0) // Vertex R6b = 45
(0.707106781821139 0.707106780551956 0) // Vertex R7b = 46
(0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47
(0.2 0 0.1) // Vertex r0t = 48
(0.2 0 0.1) // Vertex r0st = 49
(0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50
(3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51
(3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52
(-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53
(-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54
(-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55
(-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56
(3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57
(3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58
(0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59
(0.5 0 0.1) // Vertex rb0t = 60
(0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61
(8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62
(-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63
(-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64
(-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65
(8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66
(0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67
(0.6 0 0.1) // Vertex ri0t = 68
(0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69
(1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70
(-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71
(-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72
(-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73
(1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74
(0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75
(0.7 0 0.1) // Vertex Rb0t = 76
(0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77
(1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78
(-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79
(-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80
(-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81
(1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82
(0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83
(1 0 0.1) // Vertex R0t = 84
(0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85
(0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86
(1.79489673696541e-09 -1 0.1) // Vertex R2t = 87
(-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88
(-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89
(-1 3.58979347393082e-09 0.1) // Vertex R4t = 90
(-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91
(-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92
(1.79489673696541e-09 1 0.1) // Vertex R6t = 93
(0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94
(0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95
);
blocks
(
// block0
hex (0 2 13 12 48 50 61 60)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block1
hex (2 4 14 13 50 52 62 61)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block2
hex (3 5 15 14 51 53 63 62)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block3
hex (5 7 16 15 53 55 64 63)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block4
hex (6 8 17 16 54 56 65 64)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block5
hex (8 10 18 17 56 58 66 65)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block6
hex (9 11 19 18 57 59 67 66)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block7
hex (11 1 12 19 59 49 60 67)
rotor
(12 12 1)
simpleGrading (1 1 1)
// block0
hex (12 13 21 20 60 61 69 68)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block1
hex (13 14 22 21 61 62 70 69)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block2
hex (14 15 23 22 62 63 71 70)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block3
hex (15 16 24 23 63 64 72 71)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block4
hex (16 17 25 24 64 65 73 72)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block5
hex (17 18 26 25 65 66 74 73)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block6
hex (18 19 27 26 66 67 75 74)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block7
hex (19 12 20 27 67 60 68 75)
rotor
(12 4 1)
simpleGrading (1 1 1)
// block0
hex (20 21 29 28 68 69 77 76)
stator
(12 4 1)
simpleGrading (1 1 1)
// block1
hex (21 22 30 29 69 70 78 77)
stator
(12 4 1)
simpleGrading (1 1 1)
// block2
hex (22 23 31 30 70 71 79 78)
stator
(12 4 1)
simpleGrading (1 1 1)
// block3
hex (23 24 32 31 71 72 80 79)
stator
(12 4 1)
simpleGrading (1 1 1)
// block4
hex (24 25 33 32 72 73 81 80)
stator
(12 4 1)
simpleGrading (1 1 1)
// block5
hex (25 26 34 33 73 74 82 81)
stator
(12 4 1)
simpleGrading (1 1 1)
// block6
hex (26 27 35 34 74 75 83 82)
stator
(12 4 1)
simpleGrading (1 1 1)
// block7
hex (27 20 28 35 75 68 76 83)
stator
(12 4 1)
simpleGrading (1 1 1)
// block0
hex (28 29 38 36 76 77 86 84)
stator
(12 12 1)
simpleGrading (1 1 1)
// block1
hex (29 30 39 37 77 78 87 85)
stator
(12 12 1)
simpleGrading (1 1 1)
// block2
hex (30 31 41 39 78 79 89 87)
stator
(12 12 1)
simpleGrading (1 1 1)
// block3
hex (31 32 42 40 79 80 90 88)
stator
(12 12 1)
simpleGrading (1 1 1)
// block4
hex (32 33 44 42 80 81 92 90)
stator
(12 12 1)
simpleGrading (1 1 1)
// block5
hex (33 34 45 43 81 82 93 91)
stator
(12 12 1)
simpleGrading (1 1 1)
// block6
hex (34 35 47 45 82 83 95 93)
stator
(12 12 1)
simpleGrading (1 1 1)
// block7
hex (35 28 36 46 83 76 84 94)
stator
(12 12 1)
simpleGrading (1 1 1)
);
edges
(
arc 0 2 (0.184775906536601 -0.0765366863901046 0)
arc 2 4 (0.0765366867217582 -0.184775906399226 0)
arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
arc 6 8 (-0.18477590626185 0.0765366870534118 0)
arc 8 10 (-0.0765366860584508 0.184775906673977 0)
arc 9 11 (0.0765366867217582 0.184775906399226 0)
arc 11 1 (0.184775906536601 0.0765366863901046 0)
arc 12 13 (0.461939766341503 -0.191341715975262 0)
arc 13 14 (0.191341716804395 -0.461939765998065 0)
arc 14 15 (-0.191341715146127 -0.461939766684942 0)
arc 15 16 (-0.461939765654626 -0.19134171763353 0)
arc 16 17 (-0.461939765654626 0.19134171763353 0)
arc 17 18 (-0.191341715146127 0.461939766684942 0)
arc 18 19 (0.191341716804395 0.461939765998065 0)
arc 19 12 (0.461939766341503 0.191341715975262 0)
arc 20 21 (0.554327719609804 -0.229610059170314 0)
arc 21 22 (0.229610060165275 -0.554327719197677 0)
arc 22 23 (-0.229610058175352 -0.55432772002193 0)
arc 23 24 (-0.554327718785551 -0.229610061160235 0)
arc 24 25 (-0.554327718785551 0.229610061160235 0)
arc 25 26 (-0.229610058175352 0.55432772002193 0)
arc 26 27 (0.229610060165275 0.554327719197677 0)
arc 27 20 (0.554327719609804 0.229610059170314 0)
arc 28 29 (0.646715672878104 -0.267878402365366 0)
arc 29 30 (0.267878403526154 -0.64671567239729 0)
arc 30 31 (-0.267878401204578 -0.646715673358918 0)
arc 31 32 (-0.646715671916476 -0.267878404686941 0)
arc 32 33 (-0.646715671916476 0.267878404686941 0)
arc 33 34 (-0.267878401204578 0.646715673358918 0)
arc 34 35 (0.267878403526154 0.64671567239729 0)
arc 35 28 (0.646715672878104 0.267878402365366 0)
arc 36 38 (0.923879532683006 -0.382683431950523 0)
arc 37 39 (0.382683433608791 -0.923879531996129 0)
arc 39 41 (-0.382683430292254 -0.923879533369883 0)
arc 40 42 (-0.923879531309252 -0.382683435267059 0)
arc 42 44 (-0.923879531309252 0.382683435267059 0)
arc 43 45 (-0.382683430292254 0.923879533369883 0)
arc 45 47 (0.382683433608791 0.923879531996129 0)
arc 46 36 (0.923879532683006 0.382683431950523 0)
arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
arc 66 67 (0.191341716804395 0.461939765998065 0.1)
arc 67 60 (0.461939766341503 0.191341715975262 0.1)
arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
arc 74 75 (0.229610060165275 0.554327719197677 0.1)
arc 75 68 (0.554327719609804 0.229610059170314 0.1)
arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
arc 82 83 (0.267878403526154 0.64671567239729 0.1)
arc 83 76 (0.646715672878104 0.267878402365366 0.1)
arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
arc 93 95 (0.382683433608791 0.923879531996129 0.1)
arc 94 84 (0.923879532683006 0.382683431950523 0.1)
);
patches
(
wall rotor
(
(0 2 50 48)
(2 4 52 50)
(3 5 53 51)
(5 7 55 53)
(6 8 56 54)
(8 10 58 56)
(9 11 59 57)
(11 1 49 59)
(0 12 60 48)
(1 12 60 49)
(3 14 62 51)
(4 14 62 52)
(6 16 64 54)
(7 16 64 55)
(9 18 66 57)
(10 18 66 58)
)
wall stator
(
(36 38 86 84)
(37 39 87 85)
(39 41 89 87)
(40 42 90 88)
(42 44 92 90)
(43 45 93 91)
(45 47 95 93)
(46 36 84 94)
(37 29 77 85)
(38 29 77 86)
(40 31 79 88)
(41 31 79 89)
(43 33 81 91)
(44 33 81 92)
(46 35 83 94)
(47 35 83 95)
)
empty front
(
(48 50 61 60)
(50 52 62 61)
(51 53 63 62)
(53 55 64 63)
(54 56 65 64)
(56 58 66 65)
(57 59 67 66)
(59 49 60 67)
(60 61 69 68)
(61 62 70 69)
(62 63 71 70)
(63 64 72 71)
(64 65 73 72)
(65 66 74 73)
(66 67 75 74)
(67 60 68 75)
(68 69 77 76)
(69 70 78 77)
(70 71 79 78)
(71 72 80 79)
(72 73 81 80)
(73 74 82 81)
(74 75 83 82)
(75 68 76 83)
(76 77 86 84)
(77 78 87 85)
(78 79 89 87)
(79 80 90 88)
(80 81 92 90)
(81 82 93 91)
(82 83 95 93)
(83 76 84 94)
)
empty back
(
(0 12 13 2)
(2 13 14 4)
(3 14 15 5)
(5 15 16 7)
(6 16 17 8)
(8 17 18 10)
(9 18 19 11)
(11 19 12 1)
(12 20 21 13)
(13 21 22 14)
(14 22 23 15)
(15 23 24 16)
(16 24 25 17)
(17 25 26 18)
(18 26 27 19)
(19 27 20 12)
(20 28 29 21)
(21 29 30 22)
(22 30 31 23)
(23 31 32 24)
(24 32 33 25)
(25 33 34 26)
(26 34 35 27)
(27 35 28 20)
(28 36 38 29)
(29 37 39 30)
(30 39 41 31)
(31 40 42 32)
(32 42 44 33)
(33 43 45 34)
(34 45 47 35)
(35 46 36 28)
)
);
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More