mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into particleInteractions
Conflicts: src/parallel/decompose/decompositionMethods/Make/options
This commit is contained in:
27
README
27
README
@ -2,7 +2,7 @@
|
||||
#
|
||||
#+TITLE: OpenFOAM README for version 1.6
|
||||
#+AUTHOR: OpenCFD Ltd.
|
||||
#+DATE: November 2009
|
||||
#+DATE: March 2010
|
||||
#+LINK: http://www.opencfd.co.uk
|
||||
#+OPTIONS: author:nil ^:{}
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
section "Running OpenFOAM in 32-bit mode".
|
||||
|
||||
*** 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
|
||||
supported on Qt version 4.3.x. However, we have found in limited tests that
|
||||
ParaView works satisfactorily with newer versions of Qt than 4.3.x. To
|
||||
supported on Qt version 4.6.x. However, we have found in limited tests that
|
||||
ParaView works satisfactorily with Qt than 4.5.x. To
|
||||
check whether Qt4 is installed, and the version, type:
|
||||
+ qmake --version
|
||||
|
||||
@ -44,13 +44,14 @@
|
||||
+ openSUSE-10.3: Version 4.3.1
|
||||
+ openSUSE-11.0: Version 4.4.0
|
||||
+ 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
|
||||
downloaded in the "libqt4-dev" package on ubuntu.
|
||||
|
||||
If you don't have an appropriate version of Qt installed you can download
|
||||
the sources from TrollTech e.g.:
|
||||
ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2
|
||||
the sources e.g.:
|
||||
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
|
||||
conflict with the pre-installed version.
|
||||
|
||||
@ -108,7 +109,7 @@
|
||||
* Building from Sources (Optional)
|
||||
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
|
||||
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/.
|
||||
|
||||
Install the compiler in
|
||||
@ -157,16 +158,16 @@
|
||||
Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for
|
||||
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
|
||||
compile ParaView from sources. The compilation
|
||||
is a fairly simple process using the makeParaView script
|
||||
(found in ThirdParty directory), which has worked in our tests with other
|
||||
packages supplied in the ThirdParty directory, namely cmake-2.6.4 and
|
||||
gcc-4.3.3. Execute the following:
|
||||
packages supplied in the ThirdParty directory, namely cmake-2.8.0 and
|
||||
gcc-4.4.3. Execute the following:
|
||||
+ cd $WM_THIRD_PARTY_DIR
|
||||
+ rm -rf paraview-3.6.1/platforms
|
||||
+ rm -rf platforms/*/paraview-3.6.1
|
||||
+ rm -rf paraview-3.7.0/platforms
|
||||
+ rm -rf platforms/*/paraview-3.7.0
|
||||
+ ./makeParaView
|
||||
|
||||
The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled
|
||||
@ -178,7 +179,7 @@
|
||||
*** Compiling Paraview with a local version of Qt
|
||||
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
|
||||
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.
|
||||
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
|
||||
+ ./makeQt
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
rhoPorousMRFPimpleFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/rhoPorousMRFPimpleFoam
|
||||
|
||||
@ -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
|
||||
@ -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();
|
||||
}
|
||||
@ -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);
|
||||
123
applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H
Normal file
123
applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H
Normal 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);
|
||||
}
|
||||
*/
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -59,7 +59,17 @@
|
||||
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 rho2f = fvc::interpolate(rho2);
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
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 rho2f = fvc::interpolate(rho2);
|
||||
|
||||
@ -70,12 +70,12 @@
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
alpha1,
|
||||
phiAlpha1BD,
|
||||
phiAlpha1,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
zero(),
|
||||
zero(),
|
||||
1,
|
||||
0,
|
||||
3
|
||||
@ -107,12 +107,12 @@
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
alpha2,
|
||||
phiAlpha2BD,
|
||||
phiAlpha2,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
zero(),
|
||||
zero(),
|
||||
1,
|
||||
0,
|
||||
3
|
||||
|
||||
@ -51,8 +51,8 @@
|
||||
);
|
||||
|
||||
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
|
||||
//MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
//MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
|
||||
rhoPhi +=
|
||||
(runTime.deltaT()/totalDeltaT)
|
||||
|
||||
@ -11,6 +11,7 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lautoMesh
|
||||
|
||||
@ -347,7 +347,7 @@ int main(int argc, char *argv[])
|
||||
<< "You have selected decomposition method "
|
||||
<< decomposer.typeName
|
||||
<< " which is not parallel aware." << endl
|
||||
<< "Please select one that is (hierarchical, parMetis)"
|
||||
<< "Please select one that is (hierarchical, ptscotch)"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -28,20 +28,6 @@ License
|
||||
#include "Time.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 * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
|
||||
@ -71,12 +71,6 @@ class mirrorFvMesh
|
||||
public:
|
||||
|
||||
|
||||
// Static data
|
||||
|
||||
//- Cell renumnering table
|
||||
static const label cellRenumber[8][8];
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from IOobject
|
||||
|
||||
@ -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
|
||||
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||
{
|
||||
@ -211,29 +309,20 @@ int main(int argc, char *argv[])
|
||||
polyTopoChanger stitcher(mesh);
|
||||
stitcher.setSize(1);
|
||||
|
||||
DynamicList<pointZone*> pz;
|
||||
DynamicList<faceZone*> fz;
|
||||
DynamicList<cellZone*> cz;
|
||||
mesh.pointZones().clearAddressing();
|
||||
mesh.faceZones().clearAddressing();
|
||||
mesh.cellZones().clearAddressing();
|
||||
|
||||
if (perfectCover)
|
||||
{
|
||||
// Add empty zone for resulting internal faces
|
||||
fz.append
|
||||
(
|
||||
new faceZone
|
||||
(
|
||||
cutZoneName,
|
||||
isf,
|
||||
boolList(masterPatch.size(), false),
|
||||
0,
|
||||
mesh.faceZones()
|
||||
)
|
||||
);
|
||||
label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
|
||||
// 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());
|
||||
mesh.faceZones()[cutZoneID].resetAddressing
|
||||
(
|
||||
isf,
|
||||
boolList(masterPatch.size(), false)
|
||||
);
|
||||
|
||||
// Add the perfect interface mesh modifier
|
||||
stitcher.set
|
||||
@ -252,27 +341,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
pz.append
|
||||
(
|
||||
new pointZone
|
||||
(
|
||||
mergePatchName + "CutPointZone",
|
||||
labelList(0),
|
||||
0,
|
||||
mesh.pointZones()
|
||||
)
|
||||
);
|
||||
label pointZoneID = addPointZone(mesh, mergePatchName + "CutPointZone");
|
||||
mesh.pointZones()[pointZoneID] = labelList(0);
|
||||
|
||||
fz.append
|
||||
label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone");
|
||||
|
||||
mesh.faceZones()[masterZoneID].resetAddressing
|
||||
(
|
||||
new faceZone
|
||||
(
|
||||
mergePatchName + "MasterZone",
|
||||
isf,
|
||||
boolList(masterPatch.size(), false),
|
||||
0,
|
||||
mesh.faceZones()
|
||||
)
|
||||
isf,
|
||||
boolList(masterPatch.size(), false)
|
||||
);
|
||||
|
||||
// Slave patch
|
||||
@ -284,42 +361,27 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelList osf(slavePatch.size());
|
||||
|
||||
forAll(osf, i)
|
||||
forAll (osf, i)
|
||||
{
|
||||
osf[i] = slavePatch.start() + i;
|
||||
}
|
||||
|
||||
fz.append
|
||||
label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone");
|
||||
mesh.faceZones()[slaveZoneID].resetAddressing
|
||||
(
|
||||
new faceZone
|
||||
(
|
||||
mergePatchName + "SlaveZone",
|
||||
osf,
|
||||
boolList(slavePatch.size(), false),
|
||||
1,
|
||||
mesh.faceZones()
|
||||
)
|
||||
osf,
|
||||
boolList(slavePatch.size(), false)
|
||||
);
|
||||
|
||||
// Add empty zone for cut faces
|
||||
fz.append
|
||||
label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
mesh.faceZones()[cutZoneID].resetAddressing
|
||||
(
|
||||
new faceZone
|
||||
(
|
||||
cutZoneName,
|
||||
labelList(0),
|
||||
boolList(0, false),
|
||||
2,
|
||||
mesh.faceZones()
|
||||
)
|
||||
labelList(0),
|
||||
boolList(0, false)
|
||||
);
|
||||
|
||||
|
||||
// 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
|
||||
stitcher.set
|
||||
(
|
||||
|
||||
@ -7,6 +7,6 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods \
|
||||
-ldecompositionMethods -lmetisDecomp -lscotchDecomp \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -7,5 +7,6 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -356,8 +356,15 @@ class vtkPV3Foam
|
||||
//- Zone info
|
||||
void updateInfoZones(vtkDataArraySelection*);
|
||||
|
||||
//- Read zone names for zoneType from file
|
||||
wordList readZoneNames(const word& zoneType);
|
||||
//- Get non-empty zone names for zoneType from file
|
||||
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
|
||||
template<class Type>
|
||||
|
||||
@ -82,9 +82,31 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * 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
|
||||
IOobject ioObj
|
||||
@ -107,14 +129,14 @@ Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
|
||||
{
|
||||
zonesEntries zones(ioObj);
|
||||
|
||||
zoneNames.setSize(zones.size());
|
||||
names.setSize(zones.size());
|
||||
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_)
|
||||
{
|
||||
namesLst = meshPtr_->cellZones().names();
|
||||
namesLst = getZoneNames(meshPtr_->cellZones());
|
||||
}
|
||||
else
|
||||
{
|
||||
namesLst = readZoneNames("cellZones");
|
||||
namesLst = getZoneNames("cellZones");
|
||||
}
|
||||
|
||||
arrayRangeCellZones_.reset(arraySelection->GetNumberOfArrays());
|
||||
@ -335,11 +357,11 @@ void Foam::vtkPV3Foam::updateInfoZones
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
if (meshPtr_)
|
||||
{
|
||||
namesLst = meshPtr_->faceZones().names();
|
||||
namesLst = getZoneNames(meshPtr_->faceZones());
|
||||
}
|
||||
else
|
||||
{
|
||||
namesLst = readZoneNames("faceZones");
|
||||
namesLst = getZoneNames("faceZones");
|
||||
}
|
||||
|
||||
arrayRangeFaceZones_.reset(arraySelection->GetNumberOfArrays());
|
||||
@ -358,11 +380,11 @@ void Foam::vtkPV3Foam::updateInfoZones
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||
if (meshPtr_)
|
||||
{
|
||||
namesLst = meshPtr_->pointZones().names();
|
||||
namesLst = getZoneNames(meshPtr_->pointZones());
|
||||
}
|
||||
else
|
||||
{
|
||||
namesLst = readZoneNames("pointZones");
|
||||
namesLst = getZoneNames("pointZones");
|
||||
}
|
||||
|
||||
arrayRangePointZones_.reset(arraySelection->GetNumberOfArrays());
|
||||
|
||||
@ -43,7 +43,6 @@ usage() {
|
||||
cat <<USAGE 1>&2
|
||||
Usage: ${0##*/} [OPTION] path [wildcard1] .. [wildcardN]
|
||||
options:
|
||||
-space treat 'path' as space-delimited (eg, from C-Shell)
|
||||
-strip remove inaccessible directories
|
||||
-help print the usage
|
||||
|
||||
@ -57,7 +56,7 @@ USAGE
|
||||
}
|
||||
|
||||
|
||||
unset space strip
|
||||
unset strip
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
@ -65,10 +64,6 @@ do
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-space)
|
||||
space=true
|
||||
shift
|
||||
;;
|
||||
-strip)
|
||||
strip=true
|
||||
shift
|
||||
@ -82,12 +77,7 @@ done
|
||||
|
||||
[ "$#" -ge 1 ] || usage
|
||||
|
||||
if [ "$space" = true ]
|
||||
then
|
||||
dirList=$(echo "$1" | sed -e 's/ /:/g')
|
||||
else
|
||||
dirList="$1"
|
||||
fi
|
||||
dirList="$1"
|
||||
shift
|
||||
|
||||
##DEBUG echo "input>$dirList<" 1>&2
|
||||
@ -140,11 +130,8 @@ done
|
||||
IFS=' '
|
||||
set -- $dirList
|
||||
|
||||
# join on ':', unless -space option was specified
|
||||
if [ "$space" != true ]
|
||||
then
|
||||
IFS=':'
|
||||
fi
|
||||
# rejoin on ':'
|
||||
IFS=':'
|
||||
dirList="$*"
|
||||
|
||||
# restore IFS
|
||||
|
||||
106
bin/foamEndJob
106
bin/foamEndJob
@ -85,7 +85,8 @@ setRawEntry() {
|
||||
oldLine=`echo "$oldNumLine" | sed -e 's/^[^:]*://'`
|
||||
oldKey=`getKey "$oldLine"`
|
||||
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 "oldKey=$oldKey"
|
||||
echo "lineNo=$lineNo"
|
||||
@ -134,9 +135,12 @@ getBoolEntry()
|
||||
}
|
||||
|
||||
# newerFile file1 file2
|
||||
newerFile() {
|
||||
# ... could also use if [ $file1 -nt $file2 ] ...
|
||||
newerFile()
|
||||
{
|
||||
latest=`ls -1 -t $1 $2 2> /dev/null | head -1`
|
||||
if [ "$latest" = $1 ]; then
|
||||
if [ "$latest" = $1 ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -149,8 +153,8 @@ processExists() {
|
||||
ps -u $LOGNAME -o 'pid' | fgrep $1 >/dev/null
|
||||
}
|
||||
|
||||
printUsage() {
|
||||
cat << USAGELABEL
|
||||
usage() {
|
||||
cat << USAGE
|
||||
Usage: $PROGNAME [-n] <root> <case> <pid>
|
||||
or
|
||||
$PROGNAME -c <root> <case>
|
||||
@ -165,7 +169,8 @@ finish. Restores original controlDict if
|
||||
|
||||
The -c option clears any outstanding $PROGNAME for the case.
|
||||
|
||||
USAGELABEL
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
@ -174,7 +179,8 @@ restoreDict() {
|
||||
trap 2 3 15
|
||||
|
||||
echo "$PROGNAME : Restoring controlDict from controlDict_bak."
|
||||
if [ -r ${controlDict}_bak ]; then
|
||||
if [ -r ${controlDict}_bak ]
|
||||
then
|
||||
cp ${controlDict}_bak $controlDict
|
||||
fi
|
||||
|
||||
@ -208,61 +214,69 @@ esac
|
||||
#
|
||||
# Initial checks
|
||||
#
|
||||
if [ $# -lt 3 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
if [ $# -lt 3 ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
|
||||
STOPNOW=''
|
||||
if [ $1 = '-n' ]; then
|
||||
if [ $1 = '-n' ]
|
||||
then
|
||||
STOPNOW='yes'
|
||||
shift
|
||||
fi
|
||||
CLEAR=''
|
||||
if [ $1 = '-c' ]; then
|
||||
if [ $1 = '-c' ]
|
||||
then
|
||||
CLEAR='yes'
|
||||
shift
|
||||
if [ $# -ne 2 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
if [ $# -ne 2 ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
ROOT=$1
|
||||
CASE=$2
|
||||
else
|
||||
if [ $# -ne 3 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
if [ $# -ne 3 ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
ROOT=$1
|
||||
CASE=$2
|
||||
PID=$3
|
||||
fi
|
||||
CASE=`echo $CASE | sed -e 's!/.*!!'` #strip of processorXXX ending
|
||||
CASE=`echo $CASE | sed -e 's!/.*!!'` # strip of processorXXX ending
|
||||
|
||||
#- Pid actually running
|
||||
if [ ! "$CLEAR" ]; then
|
||||
if [ ! "$CLEAR" ]
|
||||
then
|
||||
processExists $PID
|
||||
if [ $? -ne 0 ] ;then
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "$PROGNAME : process $PID not running."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
#- case directory writeable
|
||||
if [ ! -w $ROOT/$CASE ]; then
|
||||
if [ ! -w $ROOT/$CASE ]
|
||||
then
|
||||
echo "$PROGNAME : $ROOT/$CASE is not writeable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#- Controldict writeable
|
||||
controlDict=$ROOT/$CASE/system/controlDict
|
||||
if [ ! -w $controlDict ]; then
|
||||
if [ ! -w $controlDict ]
|
||||
then
|
||||
echo "$PROGNAME : $controlDict is not writeable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#- runTimeModifiable
|
||||
getBoolEntry $controlDict 'runTimeModifiable'
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "$PROGNAME : runTimeModifiable not true in dictionary $controlDict."
|
||||
exit 1
|
||||
fi
|
||||
@ -270,12 +284,14 @@ fi
|
||||
#
|
||||
#- Check if another foamEndJob running
|
||||
#
|
||||
if [ "$CLEAR" ]; then
|
||||
if [ "$CLEAR" ]
|
||||
then
|
||||
pidFiles=`ls $ROOT/$CASE/.foamEndJob* 2>/dev/null`
|
||||
for pidFile in $pidFiles
|
||||
do
|
||||
pid=`cat $pidFile`
|
||||
if [ "$pid" ]; then
|
||||
if [ "$pid" ]
|
||||
then
|
||||
echo "$PROGNAME : found $PROGNAME (pid $pid) for Foam process"
|
||||
echo " root: $ROOT"
|
||||
echo " case: $CASE"
|
||||
@ -288,11 +304,14 @@ if [ "$CLEAR" ]; then
|
||||
fi
|
||||
|
||||
pidFile=$ROOT/$CASE/.foamEndJob${PID}
|
||||
if [ -f $pidFile ]; then
|
||||
if [ -f $pidFile ]
|
||||
then
|
||||
pid=`cat $pidFile`
|
||||
if [ "$pid" ]; then
|
||||
if [ "$pid" ]
|
||||
then
|
||||
processExists $pid
|
||||
if [ $? -eq 0 ] ;then
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "$PROGNAME : found running $PROGNAME (pid $pid) for Foam process"
|
||||
echo " root: $ROOT"
|
||||
echo " case: $CASE"
|
||||
@ -314,28 +333,32 @@ echo $$ > $pidFile
|
||||
|
||||
#- startTime
|
||||
startTime=`getEntry $controlDict 'startTime'`
|
||||
if [ ! "$startTime" ]; then
|
||||
if [ ! "$startTime" ]
|
||||
then
|
||||
echo "$PROGNAME : startTime not set in dictionary $controlDict."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#- Write interval
|
||||
writeInterval=`getEntry $controlDict 'writeInterval'`
|
||||
if [ ! "$writeInterval" ]; then
|
||||
if [ ! "$writeInterval" ]
|
||||
then
|
||||
echo "$PROGNAME : writeInterval not set in dictionary $controlDict."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#- stopAt
|
||||
stopAt=`getEntry $controlDict 'stopAt'`
|
||||
if [ ! "$stopAt" ]; then
|
||||
if [ ! "$stopAt" ]
|
||||
then
|
||||
echo "$PROGNAME : stopAt not set in dictionary $controlDict."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#- endTime
|
||||
endTime=`getEntry $controlDict 'endTime'`
|
||||
if [ ! "$endTime" ]; then
|
||||
if [ ! "$endTime" ]
|
||||
then
|
||||
echo "$PROGNAME : endTime not set in dictionary $controlDict."
|
||||
exit 1
|
||||
fi
|
||||
@ -353,7 +376,8 @@ cp $controlDict ${controlDict}_bak
|
||||
#- Set up handler to restore controlDict
|
||||
trap restoreDict 2 3 15
|
||||
|
||||
if [ "$STOPNOW" ]; then
|
||||
if [ "$STOPNOW" ]
|
||||
then
|
||||
setRawEntry $controlDict 'stopAt' 'nextWrite'
|
||||
setRawEntry $controlDict 'writeInterval' '1'
|
||||
|
||||
@ -385,7 +409,8 @@ if newerFile ${controlDict} ${controlDict}_bak; then
|
||||
iter=0
|
||||
while newerFile ${controlDict} ${controlDict}_bak
|
||||
do
|
||||
if [ $iter -ge 120 ]; then
|
||||
if [ $iter -ge 120 ]
|
||||
then
|
||||
#- 120*5 sec = 10 mins passed. Give up
|
||||
echo "$PROGNAME : File date not yet ok after 10 mins. Giving up."
|
||||
break
|
||||
@ -412,22 +437,25 @@ while true
|
||||
do
|
||||
sleep 5
|
||||
|
||||
if [ ! -r ${controlDict}_bak ]; then
|
||||
if [ ! -r ${controlDict}_bak ]
|
||||
then
|
||||
echo "$PROGNAME : ${controlDict}_bak dissappeared. Exiting without restore."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if newerFile ${controlDict} ${controlDict}_bak; then
|
||||
if newerFile ${controlDict} ${controlDict}_bak
|
||||
then
|
||||
echo "$PROGNAME : ${controlDict} modified externally. Exiting without restore."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
processExists $PID
|
||||
if [ $? -ne 0 ] ;then
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
#- Job finished
|
||||
break
|
||||
fi
|
||||
#echo "Foam job $PID still running ..."
|
||||
# echo "Foam job $PID still running ..."
|
||||
done
|
||||
|
||||
#- Dictionary restore
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -27,8 +27,17 @@
|
||||
# foamEtcFile
|
||||
#
|
||||
# Description
|
||||
# Locate user/site/shipped file with the semantics used in the
|
||||
# ~OpenFOAM/fileName expansion
|
||||
# Locate user/group/shipped file with semantics similar to the
|
||||
# ~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
|
||||
@ -41,24 +50,32 @@ usage() {
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] fileName
|
||||
${0##*/} -list
|
||||
|
||||
${0##*/} [OPTION] -list
|
||||
options:
|
||||
-l | -list list the directories to be searched
|
||||
-q | -quiet suppress all normal output
|
||||
-list list the directories to be searched
|
||||
-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
|
||||
~OpenFOAM/fileName expansion
|
||||
Locate user/group/shipped file with semantics similar to the
|
||||
~OpenFOAM/fileName expansion.
|
||||
|
||||
Exit status 0 when the file is found and output resolved path to stdout.
|
||||
Exit status 1 for miscellaneous errors.
|
||||
Exit status 2 when the file is not found.
|
||||
The options can also be specified as a single character
|
||||
(eg, '-q' instead of '-quiet'), but must not be grouped.
|
||||
|
||||
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
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# default mode is 'ugo'
|
||||
mode=ugo
|
||||
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
@ -70,6 +87,20 @@ do
|
||||
listOpt=true
|
||||
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)
|
||||
quietOpt=true
|
||||
shift
|
||||
@ -83,18 +114,32 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
# Save the essential bits of information:
|
||||
nArgs=$#
|
||||
fileName="$1"
|
||||
|
||||
# The various places to be searched:
|
||||
set -- \
|
||||
$HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION \
|
||||
$HOME/.${WM_PROJECT:-OpenFOAM} \
|
||||
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \
|
||||
$WM_PROJECT_INST_DIR/site \
|
||||
$WM_PROJECT_DIR/etc
|
||||
# Define the various places to be searched:
|
||||
files=""
|
||||
case "$mode" in
|
||||
*u*) # user
|
||||
files="$files $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
|
||||
files="$files $HOME/.${WM_PROJECT:-OpenFOAM}"
|
||||
;;
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
|
||||
265
bin/foamJob
265
bin/foamJob
@ -30,14 +30,14 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] <application> ...
|
||||
options:
|
||||
-case <dir> specify alternative case directory, default is the cwd
|
||||
-s also sends output to screen
|
||||
-p parallel run of processors
|
||||
-s also sends output to screen
|
||||
-v <ver> specify OpenFOAM version
|
||||
-help print the usage
|
||||
|
||||
@ -45,56 +45,46 @@ options:
|
||||
Redirects the output to 'log' in the case directory
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 1
|
||||
}
|
||||
|
||||
unset version
|
||||
|
||||
# replacement for possibly buggy 'which'
|
||||
findExec() {
|
||||
case "$1" in
|
||||
*/*)
|
||||
if [ -x "$1" ] ; then
|
||||
echo "$1"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
case "$1" in
|
||||
*/*)
|
||||
if [ -x "$1" ]
|
||||
then
|
||||
echo "$1"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
oldIFS=$IFS
|
||||
IFS=':'
|
||||
for d in $PATH
|
||||
do
|
||||
# echo "testing: $d/$1" 1>&2
|
||||
if [ -x "$d/$1" -a ! -d "$d/$1" ] ; then
|
||||
# echo "Found exec: $d/$1" 1>&2
|
||||
IFS=$oldIFS
|
||||
echo "$d/$1"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
IFS=$oldIFS
|
||||
echo ""
|
||||
return 1
|
||||
}
|
||||
|
||||
# grep for $1
|
||||
getPID() {
|
||||
ps -u $LOGNAME -o 'pid,args' | fgrep "$1 " | fgrep -v grep | head -1 | awk '{ print $1 }'
|
||||
oldIFS=$IFS
|
||||
IFS=':'
|
||||
for d in $PATH
|
||||
do
|
||||
# echo "testing: $d/$1" 1>&2
|
||||
if [ -x "$d/$1" -a ! -d "$d/$1" ]
|
||||
then
|
||||
# echo "Found exec: $d/$1" 1>&2
|
||||
IFS=$oldIFS
|
||||
echo "$d/$1"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
IFS=$oldIFS
|
||||
echo ""
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
consultGuide() {
|
||||
cat<<EOF
|
||||
|
||||
Please consult the User Guide for details of parallel running
|
||||
EOF
|
||||
}
|
||||
|
||||
# MAIN SCRIPT
|
||||
#~~~~~~~~~~~~
|
||||
SCREEN=no
|
||||
PARALLEL=no
|
||||
unset parallelOpt screenOpt
|
||||
|
||||
|
||||
# parse options
|
||||
@ -110,12 +100,12 @@ do
|
||||
shift 2
|
||||
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
||||
;;
|
||||
-s)
|
||||
SCREEN=yes
|
||||
-p)
|
||||
parallelOpt=true
|
||||
shift
|
||||
;;
|
||||
-p)
|
||||
PARALLEL=yes
|
||||
-s)
|
||||
screenOpt=true
|
||||
shift
|
||||
;;
|
||||
-v)
|
||||
@ -136,100 +126,119 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
usage "No application specified"
|
||||
if [ "$#" -lt 1 ]
|
||||
then
|
||||
usage "No application specified"
|
||||
fi
|
||||
|
||||
# use foamExec for a specified version and for remote (parallel) runs
|
||||
if [ -n "$version" -o "$PARALLEL" = yes ]; then
|
||||
APPLICATION=`findExec foamExec`
|
||||
if [ $? -ne 0 ]; then
|
||||
usage "'foamExec' not found"
|
||||
fi
|
||||
if [ -n "$version" ]; then
|
||||
APPLICATION="$APPLICATION -v $version"
|
||||
fi
|
||||
if [ -n "$version" -o "$parallelOpt" = true ]
|
||||
then
|
||||
APPLICATION=`findExec foamExec`
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
usage "'foamExec' not found"
|
||||
fi
|
||||
if [ -n "$version" ]
|
||||
then
|
||||
APPLICATION="$APPLICATION -v $version"
|
||||
fi
|
||||
else
|
||||
APPLICATION=`findExec $1`
|
||||
if [ $? -ne 0 ]; then
|
||||
usage "Application '$1' executable not found"
|
||||
fi
|
||||
echo "Application : $1"
|
||||
shift
|
||||
APPLICATION=`findExec $1`
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
usage "Application '$1' executable not found"
|
||||
fi
|
||||
echo "Application : $1"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$PARALLEL" = no ]; then
|
||||
#
|
||||
# RUN ON SINGLE PROCESSOR
|
||||
#
|
||||
if [ "$SCREEN" = no ]; then
|
||||
echo "Executing: $APPLICATION $@ > log 2>&1 &"
|
||||
$APPLICATION $@ > log 2>&1 &
|
||||
|
||||
if [ "$parallelOpt" = true ]
|
||||
then
|
||||
# parallel
|
||||
# ~~~~~~~~
|
||||
|
||||
#
|
||||
# is the case decomposed?
|
||||
#
|
||||
if [ -r "processor0" ]
|
||||
then
|
||||
NPROCS="`/bin/ls -1d processor* | wc -l`"
|
||||
else
|
||||
echo "Executing: $APPLICATION $@ | tee log &"
|
||||
$APPLICATION $@ | tee log &
|
||||
wait $!
|
||||
echo "Case is not currently decomposed"
|
||||
if [ -r system/decomposeParDict ]
|
||||
then
|
||||
echo "system/decomposeParDict exists"
|
||||
echo "Try decomposing with \"foamJob decomposePar\""
|
||||
exit 1
|
||||
else
|
||||
echo "Cannot find system/decomposeParDict file required to decompose the case for parallel running."
|
||||
echo "Please consult the User Guide for details of parallel running"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# locate mpirun
|
||||
#
|
||||
mpirun=`findExec mpirun`
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
usage "'mpirun' not found"
|
||||
fi
|
||||
mpiopts="-np $NPROCS"
|
||||
|
||||
#
|
||||
# is the machine ready to run parallel?
|
||||
#
|
||||
echo "Parallel processing using $WM_MPLIB with $NPROCS processors"
|
||||
case "$WM_MPLIB" in
|
||||
OPENMPI)
|
||||
# add hostfile info
|
||||
for hostfile in \
|
||||
hostfile \
|
||||
machines \
|
||||
system/hostfile \
|
||||
system/machines \
|
||||
;
|
||||
do
|
||||
if [ -r $hostfile ]
|
||||
then
|
||||
mpiopts="$mpiopts -hostfile $hostfile"
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# run (in parallel)
|
||||
#
|
||||
if [ "$screenOpt" = true ]
|
||||
then
|
||||
echo "Executing: 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
|
||||
|
||||
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
|
||||
|
||||
#
|
||||
# IS THE CASE DECOMPOSED?
|
||||
#
|
||||
if [ -r "processor0" ] ; then
|
||||
NPROCS="`/bin/ls -1d processor* | wc -l`"
|
||||
else
|
||||
echo "Case is not currently decomposed"
|
||||
if [ -r system/decomposeParDict ] ; then
|
||||
echo "system/decomposeParDict exists"
|
||||
echo "Try decomposing with \"foamJob decomposePar\""
|
||||
exit 1
|
||||
else
|
||||
echo "Cannot find system/decomposeParDict file required to decompose the case for parallel running."
|
||||
consultGuide
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# LOCATE MPIRUN
|
||||
#
|
||||
mpirun=`findExec mpirun`
|
||||
if [ $? -ne 0 ]; then
|
||||
usage "'mpirun' not found"
|
||||
fi
|
||||
mpiopts="-np $NPROCS"
|
||||
|
||||
#
|
||||
# IS THE MACHINE READY TO RUN PARALLEL?
|
||||
#
|
||||
echo "Parallel processing using $WM_MPLIB with $NPROCS processors"
|
||||
case "$WM_MPLIB" in
|
||||
OPENMPI)
|
||||
# add hostfile info
|
||||
for hostfile in \
|
||||
hostfile \
|
||||
machines \
|
||||
system/hostfile \
|
||||
system/machines \
|
||||
;
|
||||
do
|
||||
if [ -r $hostfile ]; then
|
||||
mpiopts="$mpiopts -hostfile $hostfile"
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# RUN IN PARALLEL
|
||||
#
|
||||
if [ "$SCREEN" = no ] ; then
|
||||
echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1"
|
||||
$mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1 &
|
||||
else
|
||||
echo "Executing: mpirun $mpiopts $APPLICATION $@ -parallel | tee log"
|
||||
$mpirun $mpiopts $APPLICATION $@ -parallel | tee log
|
||||
fi
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
151
bin/mpirunDebug
151
bin/mpirunDebug
@ -40,34 +40,39 @@ else
|
||||
fi
|
||||
|
||||
|
||||
printUsage() {
|
||||
echo ""
|
||||
echo "Usage: ${0##*/} -np <dd> <executable> <args>"
|
||||
echo ""
|
||||
echo "This will run like mpirun but with each process in an xterm"
|
||||
usage()
|
||||
{
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} -np <dd> <executable> <args>
|
||||
|
||||
* This will run like mpirun but with each process in an XTerm
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
nProcs=''
|
||||
exec=''
|
||||
args=''
|
||||
unset nProcs exec args
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
while [ "$1" != "" ]
|
||||
do
|
||||
echo "$1"
|
||||
case $1 in
|
||||
-np)
|
||||
-np)
|
||||
nProcs=$2
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
if [ ! "$exec" ]; then
|
||||
*)
|
||||
if [ ! "$exec" ]
|
||||
then
|
||||
exec=$1
|
||||
elif [ ! "$args" ]; then
|
||||
elif [ ! "$args" ]
|
||||
then
|
||||
args="\"$1\""
|
||||
else
|
||||
args="$args \"$1\""
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@ -76,27 +81,19 @@ echo "nProcs=$nProcs"
|
||||
echo "exec=$exec"
|
||||
echo "args=$args"
|
||||
|
||||
if [ ! "$nProcs" ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
if [ ! "$args" ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
if [ ! "$exec" ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
[ "$nProcs" ] || usage
|
||||
[ "$args" ] || usage
|
||||
[ "$exec" ] || usage
|
||||
|
||||
exec=`which $exec`
|
||||
if [ ! -x "$exec" ]; then
|
||||
if [ ! -x "$exec" ]
|
||||
then
|
||||
echo "Cannot find executable $exec or is not executable"
|
||||
printUsage
|
||||
exit 1
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ ! "$PWD" ]; then
|
||||
if [ ! "$PWD" ]
|
||||
then
|
||||
PWD=`pwd`
|
||||
fi
|
||||
|
||||
@ -106,43 +103,51 @@ 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"
|
||||
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
|
||||
printUsage
|
||||
exit 1
|
||||
fi
|
||||
case "$method" in
|
||||
0 | 1 | 2 | 3 | 4 | 5 )
|
||||
# okay
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
$ECHO "Run all processes local or distributed? 1)local 2)remote: \c"
|
||||
read spawn
|
||||
if [ "$spawn" -ne 1 -a "$spawn" -ne 2 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
if [ "$spawn" -ne 1 -a "$spawn" -ne 2 ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
|
||||
|
||||
# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
|
||||
# check ~/.$WM_PROJECT/
|
||||
# check <installedProject>/etc/
|
||||
if [ "$WM_PROJECT" ]; then
|
||||
if [ "$WM_PROJECT" ]
|
||||
then
|
||||
|
||||
for i in \
|
||||
$HOME/.WM_PROJECT/$WM_PROJECT_VERSION \
|
||||
$HOME/.WM_PROJECT \
|
||||
$WM_PROJECT_DIR/etc \
|
||||
;
|
||||
do
|
||||
if [ -f "$i/bashrc" ]; then
|
||||
sourceFoam="$i/bashrc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
for i in \
|
||||
$HOME/.WM_PROJECT/$WM_PROJECT_VERSION \
|
||||
$HOME/.WM_PROJECT \
|
||||
$WM_PROJECT_DIR/etc \
|
||||
;
|
||||
do
|
||||
if [ -f "$i/bashrc" ]
|
||||
then
|
||||
sourceFoam="$i/bashrc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Construct test string for remote execution.
|
||||
# Source OpenFOAM settings if OpenFOAM environment not set.
|
||||
# attempt to preserve the installation directory 'FOAM_INST_DIR'
|
||||
if [ "$FOAM_INST_DIR" ]; then
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
|
||||
if [ "$FOAM_INST_DIR" ]
|
||||
then
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
|
||||
else
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
|
||||
fi
|
||||
|
||||
echo "**sourceFoam:$sourceFoam"
|
||||
@ -160,36 +165,45 @@ do
|
||||
geom="-geometry 120x20+$xpos+$ypos"
|
||||
node=""
|
||||
|
||||
if [ .$WM_MPLIB = .OPENMPI ]; then
|
||||
if [ "$WM_MPLIB" = OPENMPI ]
|
||||
then
|
||||
node="-np 1 "
|
||||
fi
|
||||
|
||||
echo "#!/bin/sh" > $procCmdFile
|
||||
if [ "$method" -eq 0 ]; then
|
||||
case "$method" in
|
||||
0)
|
||||
echo "$sourceFoam; cd $PWD; $exec $args | tee $procLog" >> $procCmdFile
|
||||
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; $exec $args; read dummy" >> $procCmdFile
|
||||
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 "${node}$procCmdFile" >> $PWD/mpirun.schema
|
||||
elif [ "$method" -eq 3 ]; then
|
||||
;;
|
||||
3)
|
||||
echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
|
||||
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 "${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 "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
chmod +x $procCmdFile
|
||||
|
||||
let column=proc%6
|
||||
if [ $proc -ne 0 -a $column -eq 0 ]; then
|
||||
if [ $proc -ne 0 -a $column -eq 0 ]
|
||||
then
|
||||
((xpos+=600))
|
||||
((ypos=0))
|
||||
else
|
||||
@ -203,10 +217,13 @@ do
|
||||
echo " tail -f $procLog"
|
||||
done
|
||||
|
||||
cmd=""
|
||||
if [ .$WM_MPLIB = .OPENMPI ]; then
|
||||
unset cmd
|
||||
|
||||
case "$WM_MPLIB" in
|
||||
OPENMPI)
|
||||
cmd="mpirun -app $PWD/mpirun.schema </dev/null"
|
||||
elif [ .$WM_MPLIB = .MPICH ]; then
|
||||
;;
|
||||
MPICH)
|
||||
cmd="mpiexec"
|
||||
for ((proc=0; proc<$nProcs; proc++))
|
||||
do
|
||||
@ -216,12 +233,14 @@ elif [ .$WM_MPLIB = .MPICH ]; then
|
||||
echo "#!/bin/sh" > $procXtermCmdFile
|
||||
echo "$procCmd" >> $procXtermCmdFile
|
||||
chmod +x $procXtermCmdFile
|
||||
if [ $proc -ne 0 ]; then
|
||||
if [ $proc -ne 0 ]
|
||||
then
|
||||
cmd="${cmd} :"
|
||||
fi
|
||||
cmd="${cmd} -n 1 ${procXtermCmdFile}"
|
||||
done < $PWD/mpirun.schema
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Constructed $PWD/mpirun.schema file."
|
||||
echo ""
|
||||
|
||||
@ -40,11 +40,11 @@ if ( -r $CEI_HOME ) then
|
||||
|
||||
# special treatment for 32bit OpenFOAM and 64bit Ensight
|
||||
if ($WM_ARCH == linux && `uname -m` == x86_64) then
|
||||
setenv CEI_ARCH linux_2.6_32
|
||||
setenv CEI_ARCH linux_2.6_32
|
||||
endif
|
||||
|
||||
# add to path
|
||||
set path=($CEI_HOME/bin $path)
|
||||
setenv PATH ${CEI_HOME}/bin:${PATH}
|
||||
|
||||
setenv ENSIGHT9_INPUT dummy
|
||||
setenv ENSIGHT9_READER $FOAM_LIBBIN
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# 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-"`
|
||||
if ( $status == 0 ) set path=($cleaned)
|
||||
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 ) setenv PATH $cleaned
|
||||
|
||||
# determine the cmake to be used
|
||||
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
|
||||
if ( -r $cmake ) then
|
||||
setenv CMAKE_HOME $cmake
|
||||
set path=($CMAKE_HOME/bin $path)
|
||||
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
||||
break
|
||||
endif
|
||||
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
|
||||
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}
|
||||
|
||||
# add in python libraries if required
|
||||
|
||||
@ -272,4 +272,4 @@ fi
|
||||
unset cleaned foamClean foamInstall foamOldDirs
|
||||
unset _foamSource
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
19
etc/cshrc
19
etc/cshrc
@ -209,16 +209,19 @@ default:
|
||||
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
|
||||
|
||||
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
|
||||
if (! $?MANPATH) setenv MANPATH ''
|
||||
|
||||
#- Clean path/PATH
|
||||
set cleaned=`$foamClean -space "$path" "$foamOldDirs"`
|
||||
if ( $status == 0 ) set path=($cleaned)
|
||||
#- Clean PATH (path)
|
||||
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) then
|
||||
unset PATH
|
||||
setenv PATH $cleaned
|
||||
endif
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
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 path/PATH
|
||||
set cleaned=`$foamClean -space "$path"`
|
||||
if ( $status == 0 ) set path=($cleaned)
|
||||
#- Clean PATH (path)
|
||||
set cleaned=`$foamClean "$PATH"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
set cleaned=`$foamClean "$LD_LIBRARY_PATH"`
|
||||
@ -265,4 +268,4 @@ endif
|
||||
unset cleaned foamClean foamInstall foamOldDirs
|
||||
unalias _foamSource
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
# along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# Script
|
||||
# File
|
||||
# etc/prefs.csh
|
||||
#
|
||||
# Description
|
||||
@ -50,4 +50,4 @@
|
||||
setenv ParaView_VERSION git # eg, cvs/git version
|
||||
setenv ParaView_MAJOR 3.7
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
# along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# Script
|
||||
# File
|
||||
# etc/prefs.sh
|
||||
#
|
||||
# Description
|
||||
@ -49,4 +49,5 @@ export WM_MPLIB=SYSTEMOPENMPI
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export ParaView_VERSION=git # eg, cvs/git version
|
||||
export ParaView_MAJOR=3.7
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# prefix to PATH
|
||||
alias _foamAddPath 'set path=(\!* $path)'
|
||||
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
|
||||
# prefix to LD_LIBRARY_PATH
|
||||
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
|
||||
# prefix to MANPATH
|
||||
@ -68,14 +68,11 @@ setenv FOAM_SOLVERS $FOAM_APP/solvers
|
||||
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
|
||||
|
||||
# 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_SITE_APPBIN
|
||||
_foamAddPath $FOAM_USER_APPBIN
|
||||
_foamAddLib $FOAM_LIBBIN
|
||||
_foamAddLib $FOAM_SITE_LIBBIN
|
||||
_foamAddLib $FOAM_USER_LIBBIN
|
||||
_foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
|
||||
# Make sure to pick up dummy versions of external libraries last
|
||||
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
|
||||
|
||||
|
||||
# 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/gmp-4.2.4/lib
|
||||
breaksw
|
||||
case Gcc42:
|
||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.2.4
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
@ -117,8 +111,7 @@ case OpenFOAM:
|
||||
endif
|
||||
|
||||
_foamAddPath ${WM_COMPILER_DIR}/bin
|
||||
_foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
|
||||
_foamAddLib ${WM_COMPILER_DIR}/lib
|
||||
_foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}:${WM_COMPILER_DIR}/lib
|
||||
_foamAddMan ${WM_COMPILER_DIR}/man
|
||||
|
||||
breaksw
|
||||
@ -128,12 +121,11 @@ endsw
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
unset MPI_ARCH_PATH
|
||||
unsetenv MPI_ARCH_PATH MPI_HOME
|
||||
|
||||
switch ("$WM_MPLIB")
|
||||
case OPENMPI:
|
||||
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
|
||||
|
||||
# Tell OpenMPI where to find its install directory
|
||||
@ -163,7 +155,7 @@ case SYSTEMOPENMPI:
|
||||
echo " libmpi dir : $libDir"
|
||||
endif
|
||||
|
||||
_foamAddLib $libDir
|
||||
_foamAddLib $libDir
|
||||
|
||||
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
|
||||
unset mpi_version libDir
|
||||
@ -187,9 +179,9 @@ case MPICH-GM:
|
||||
setenv MPICH_PATH $MPI_ARCH_PATH
|
||||
setenv GM_LIB_PATH /opt/gm/lib64
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
|
||||
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
|
||||
breaksw
|
||||
@ -231,18 +223,18 @@ case MPI:
|
||||
case FJMPI:
|
||||
setenv MPI_ARCH_PATH /opt/FJSVmpi2
|
||||
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
breaksw
|
||||
|
||||
case QSMPI:
|
||||
setenv MPI_ARCH_PATH /usr/lib/mpi
|
||||
setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
breaksw
|
||||
|
||||
@ -256,7 +248,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
|
||||
|
||||
# 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 < $minBufferSize ) then
|
||||
@ -274,8 +266,8 @@ if ( $?CGAL_LIB_DIR ) then
|
||||
endif
|
||||
|
||||
|
||||
# Switch on the hoard memory allocator if available
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Enable the hoard memory allocator if available
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#if ( -f $FOAM_LIBBIN/libhoard.so ) then
|
||||
# setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
|
||||
#endif
|
||||
@ -283,9 +275,7 @@ endif
|
||||
|
||||
# cleanup environment:
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
unalias _foamAddPath
|
||||
unalias _foamAddLib
|
||||
unalias _foamAddMan
|
||||
unset minBufferSize
|
||||
unalias _foamAddPath _foamAddLib _foamAddMan
|
||||
unset compilerInstall minBufferSize
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -94,8 +94,9 @@ export FOAM_RUN=$WM_PROJECT_USER_DIR/run
|
||||
# add OpenFOAM scripts and wmake to the path
|
||||
export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
|
||||
|
||||
_foamAddPath $FOAM_APPBIN $FOAM_SITE_APPBIN $FOAM_USER_APPBIN
|
||||
_foamAddLib $FOAM_LIBBIN $FOAM_SITE_LIBBIN $FOAM_USER_LIBBIN
|
||||
_foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
|
||||
# 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
|
||||
@ -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/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
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
@ -164,12 +162,11 @@ unset compilerBin compilerLib compilerMan compilerInstall
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
unset MPI_ARCH_PATH
|
||||
unset MPI_ARCH_PATH MPI_HOME
|
||||
|
||||
case "$WM_MPLIB" in
|
||||
OPENMPI)
|
||||
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
|
||||
|
||||
# Tell OpenMPI where to find its install directory
|
||||
@ -200,7 +197,7 @@ SYSTEMOPENMPI)
|
||||
echo " libmpi dir : $libDir"
|
||||
fi
|
||||
|
||||
_foamAddLib $libDir
|
||||
_foamAddLib $libDir
|
||||
|
||||
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
|
||||
unset mpi_version libDir
|
||||
@ -224,9 +221,9 @@ MPICH-GM)
|
||||
export MPICH_PATH=$MPI_ARCH_PATH
|
||||
export GM_LIB_PATH=/opt/gm/lib64
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
|
||||
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm
|
||||
;;
|
||||
@ -270,18 +267,18 @@ FJMPI)
|
||||
export MPI_ARCH_PATH=/opt/FJSVmpi2
|
||||
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
;;
|
||||
|
||||
QSMPI)
|
||||
export MPI_ARCH_PATH=/usr/lib/mpi
|
||||
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/qsmpi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
;;
|
||||
|
||||
@ -295,7 +292,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
|
||||
|
||||
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
minBufferSize=20000000
|
||||
: ${minBufferSize:=20000000}
|
||||
|
||||
if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ]
|
||||
then
|
||||
@ -309,8 +306,8 @@ export MPI_BUFFER_SIZE
|
||||
[ -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 ]
|
||||
#then
|
||||
# export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
|
||||
@ -321,4 +318,4 @@ export MPI_BUFFER_SIZE
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
unset _foamAddPath _foamAddLib _foamAddMan minBufferSize
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- end-of-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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,6 +53,7 @@ class oneField
|
||||
:
|
||||
public one
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
@ -65,10 +66,6 @@ public:
|
||||
// Member Operators
|
||||
|
||||
inline scalar operator[](const label) const;
|
||||
|
||||
inline oneField field() const;
|
||||
|
||||
inline oneField oldTime() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,15 +33,5 @@ inline Foam::scalar Foam::oneField::operator[](const label) const
|
||||
return scalar(1);
|
||||
}
|
||||
|
||||
inline Foam::oneField Foam::oneField::field() const
|
||||
{
|
||||
return oneField();
|
||||
}
|
||||
|
||||
inline Foam::oneField Foam::oneField::oldTime() const
|
||||
{
|
||||
return oneField();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,10 +65,6 @@ public:
|
||||
// Member Operators
|
||||
|
||||
inline scalar operator[](const label) const;
|
||||
|
||||
inline zeroField field() const;
|
||||
|
||||
inline zeroField oldTime() const;
|
||||
};
|
||||
|
||||
|
||||
@ -78,7 +74,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "zeroFieldI.H"
|
||||
#include "zeroFieldI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -33,14 +33,4 @@ inline Foam::scalar Foam::zeroField::operator[](const label) const
|
||||
return scalar(0);
|
||||
}
|
||||
|
||||
inline Foam::zeroField Foam::zeroField::field() const
|
||||
{
|
||||
return zeroField();
|
||||
}
|
||||
|
||||
inline Foam::zeroField Foam::zeroField::oldTime() const
|
||||
{
|
||||
return zeroField();
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -24,52 +24,28 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "parMetisDecomp.H"
|
||||
#include "geometricZeroField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Insert at front of list
|
||||
template<class Type>
|
||||
void Foam::parMetisDecomp::prepend
|
||||
(
|
||||
const UList<Type>& extraLst,
|
||||
List<Type>& lst
|
||||
)
|
||||
inline Foam::scalar Foam::geometricZeroField::operator[](const label) const
|
||||
{
|
||||
label nExtra = extraLst.size();
|
||||
|
||||
// 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
|
||||
forAll(extraLst, i)
|
||||
{
|
||||
lst[i] = extraLst[i];
|
||||
}
|
||||
return scalar(0);
|
||||
}
|
||||
|
||||
// Insert at back of list
|
||||
template<class Type>
|
||||
void Foam::parMetisDecomp::append
|
||||
(
|
||||
const UList<Type>& extraLst,
|
||||
List<Type>& lst
|
||||
)
|
||||
inline Foam::zeroField Foam::geometricZeroField::field() const
|
||||
{
|
||||
label sz = lst.size();
|
||||
return zeroField();
|
||||
}
|
||||
|
||||
// Make space for initial elements
|
||||
lst.setSize(sz + extraLst.size());
|
||||
inline Foam::zeroField Foam::geometricZeroField::oldTime() const
|
||||
{
|
||||
return zeroField();
|
||||
}
|
||||
|
||||
// Insert at back
|
||||
forAll(extraLst, i)
|
||||
{
|
||||
lst[sz++] = extraLst[i];
|
||||
}
|
||||
inline Foam::zeroFieldField Foam::geometricZeroField::boundaryField() const
|
||||
{
|
||||
return zeroFieldField();
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
2
src/dummyThirdParty/Allwmake
vendored
2
src/dummyThirdParty/Allwmake
vendored
@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wmake libso scotchDecomp
|
||||
wmake libso ptscotchDecomp
|
||||
wmake libso metisDecomp
|
||||
wmake libso parMetisDecomp
|
||||
wmake libso MGridGen
|
||||
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
dummyParMetisDecomp.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/dummy/libparMetisDecomp
|
||||
3
src/dummyThirdParty/ptscotchDecomp/Make/files
vendored
Normal file
3
src/dummyThirdParty/ptscotchDecomp/Make/files
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
dummyPtscotchDecomp.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/dummy/libptscotchDecomp
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(FOAM_SRC)/parallel/decompose/parMetisDecomp/lnInclude
|
||||
-I$(FOAM_SRC)/parallel/decompose/ptscotchDecomp/lnInclude
|
||||
|
||||
LIB_LIBS =
|
||||
@ -24,64 +24,59 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "parMetisDecomp.H"
|
||||
#include "ptscotchDecomp.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "polyMesh.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
|
||||
{
|
||||
defineTypeNameAndDebug(parMetisDecomp, 0);
|
||||
defineTypeNameAndDebug(ptscotchDecomp, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
decompositionMethod,
|
||||
parMetisDecomp,
|
||||
ptscotchDecomp,
|
||||
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 * * * * * * * * * * * //
|
||||
|
||||
//- Does prevention of 0 cell domains and calls parmetis.
|
||||
Foam::label Foam::parMetisDecomp::decompose
|
||||
(
|
||||
Field<int>& xadj,
|
||||
Field<int>& adjncy,
|
||||
const pointField& cellCentres,
|
||||
Field<int>& cellWeights,
|
||||
Field<int>& faceWeights,
|
||||
const List<int>& options,
|
||||
void Foam::ptscotchDecomp::check(const int retVal, const char* str)
|
||||
{}
|
||||
|
||||
|
||||
Foam::label Foam::ptscotchDecomp::decompose
|
||||
(
|
||||
List<int>& adjncy,
|
||||
List<int>& xadj,
|
||||
const scalarField& cWeights,
|
||||
List<int>& finalDecomp
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"label parMetisDecomp::decompose"
|
||||
"label ptscotchDecomp::decompose"
|
||||
"("
|
||||
"Field<int>&, "
|
||||
"Field<int>&, "
|
||||
"const pointField&, "
|
||||
"Field<int>&, "
|
||||
"Field<int>&, "
|
||||
"const List<int>&, "
|
||||
"const List<int>&, "
|
||||
"const scalarField&, "
|
||||
"List<int>&"
|
||||
")"
|
||||
)<< notImplementedMessage << exit(FatalError);
|
||||
) << notImplementedMessage << exit(FatalError);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -89,7 +84,7 @@ Foam::label Foam::parMetisDecomp::decompose
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::parMetisDecomp::parMetisDecomp
|
||||
Foam::ptscotchDecomp::ptscotchDecomp
|
||||
(
|
||||
const dictionary& decompositionDict,
|
||||
const polyMesh& mesh
|
||||
@ -102,35 +97,35 @@ Foam::parMetisDecomp::parMetisDecomp
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::labelList Foam::parMetisDecomp::decompose
|
||||
Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
(
|
||||
const pointField& cc,
|
||||
const scalarField& cWeights
|
||||
const pointField& points,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"labelList parMetisDecomp::decompose"
|
||||
"labelList ptscotchDecomp::decompose"
|
||||
"("
|
||||
"const pointField&, "
|
||||
"const scalarField&"
|
||||
")"
|
||||
) << notImplementedMessage << exit(FatalError);
|
||||
|
||||
return labelList();
|
||||
return labelList::null();
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::parMetisDecomp::decompose
|
||||
Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
(
|
||||
const labelList& cellToRegion,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
const labelList& agglom,
|
||||
const pointField& agglomPoints,
|
||||
const scalarField& pointWeights
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"labelList parMetisDecomp::decompose"
|
||||
"labelList ptscotchDecomp::decompose"
|
||||
"("
|
||||
"const labelList&, "
|
||||
"const pointField&, "
|
||||
@ -138,11 +133,11 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||
")"
|
||||
) << notImplementedMessage << exit(FatalError);
|
||||
|
||||
return labelList();
|
||||
return labelList::null();
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::parMetisDecomp::decompose
|
||||
Foam::labelList Foam::ptscotchDecomp::decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cellCentres,
|
||||
@ -151,7 +146,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"labelList parMetisDecomp::decompose"
|
||||
"labelList ptscotchDecomp::decompose"
|
||||
"("
|
||||
"const labelListList&, "
|
||||
"const pointField&, "
|
||||
@ -159,26 +154,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||
")"
|
||||
) << notImplementedMessage << exit(FatalError);
|
||||
|
||||
return labelList();
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
return labelList::null();
|
||||
}
|
||||
|
||||
|
||||
119
src/dummyThirdParty/scotchDecomp/dummyScotchDecomp.C
vendored
119
src/dummyThirdParty/scotchDecomp/dummyScotchDecomp.C
vendored
@ -22,87 +22,6 @@ 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 "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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,6 +31,7 @@ License
|
||||
#include "fvMatrices.H"
|
||||
#include "syncTools.H"
|
||||
#include "faceSet.H"
|
||||
#include "geometricOneField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -377,85 +378,33 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
|
||||
|
||||
void Foam::MRFZone::relativeFlux(surfaceScalarField& phi) const
|
||||
{
|
||||
const surfaceVectorField& Cf = mesh_.Cf();
|
||||
const surfaceVectorField& Sf = mesh_.Sf();
|
||||
relativeRhoFlux(geometricOneField(), phi);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
void Foam::MRFZone::relativeFlux
|
||||
(
|
||||
const surfaceScalarField& rho,
|
||||
surfaceScalarField& phi
|
||||
) const
|
||||
{
|
||||
relativeRhoFlux(rho, phi);
|
||||
}
|
||||
|
||||
|
||||
void Foam::MRFZone::absoluteFlux(surfaceScalarField& phi) const
|
||||
{
|
||||
const surfaceVectorField& Cf = mesh_.Cf();
|
||||
const surfaceVectorField& Sf = mesh_.Sf();
|
||||
absoluteRhoFlux(geometricOneField(), phi);
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
void Foam::MRFZone::absoluteFlux
|
||||
(
|
||||
const surfaceScalarField& rho,
|
||||
surfaceScalarField& phi
|
||||
) const
|
||||
{
|
||||
absoluteRhoFlux(rho, phi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,6 +97,22 @@ class MRFZone
|
||||
//- Divide faces in frame according to patch
|
||||
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
|
||||
MRFZone(const MRFZone&);
|
||||
|
||||
@ -163,9 +179,23 @@ public:
|
||||
//- Make the given absolute flux relative within the MRF region
|
||||
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
|
||||
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
|
||||
void correctBoundaryVelocity(volVectorField& U) const;
|
||||
|
||||
@ -186,6 +216,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "MRFZoneTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
130
src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C
Normal file
130
src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C
Normal 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
forAll(*this, i)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,9 +85,23 @@ public:
|
||||
//- Make the given absolute flux relative within the MRF region
|
||||
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
|
||||
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
|
||||
void correctBoundaryVelocity(volVectorField& U) const;
|
||||
};
|
||||
|
||||
@ -87,7 +87,7 @@ template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type> >
|
||||
Foam::PorousZones<ZoneType>::ddt
|
||||
(
|
||||
const oneField&,
|
||||
const geometricOneField&,
|
||||
GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ SourceFiles
|
||||
#include "volFieldsFwd.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
#include "dimensionedScalarFwd.H"
|
||||
#include "oneField.H"
|
||||
#include "geometricOneField.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -105,7 +105,7 @@ public:
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > ddt
|
||||
(
|
||||
const oneField&,
|
||||
const geometricOneField&,
|
||||
GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "porousZone.H"
|
||||
#include "fvMesh.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "oneField.H"
|
||||
#include "geometricOneField.H"
|
||||
|
||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -236,7 +236,7 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
Udiag,
|
||||
cells,
|
||||
V,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
}
|
||||
@ -268,7 +268,7 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
Usource,
|
||||
cells,
|
||||
V,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
mesh_.lookupObject<volScalarField>("nu"),
|
||||
U
|
||||
);
|
||||
@ -316,7 +316,7 @@ void Foam::porousZone::addResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
}
|
||||
@ -344,7 +344,7 @@ void Foam::porousZone::addResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
mesh_.lookupObject<volScalarField>("nu"),
|
||||
U
|
||||
);
|
||||
|
||||
@ -60,7 +60,7 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
ddt
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ SourceFiles
|
||||
|
||||
#include "volFieldsFwd.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "oneField.H"
|
||||
#include "one.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,7 +60,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > ddt
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
@ -115,7 +115,7 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
@ -130,7 +130,7 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
@ -143,7 +143,7 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
|
||||
@ -39,7 +39,8 @@ SourceFiles
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "oneField.H"
|
||||
#include "zero.H"
|
||||
#include "one.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -69,7 +70,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > laplacian
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
const word&
|
||||
);
|
||||
@ -77,7 +78,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > laplacian
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
@ -85,7 +86,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > laplacian
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
const word&
|
||||
);
|
||||
@ -93,7 +94,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > laplacian
|
||||
(
|
||||
const oneField&,
|
||||
const one&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ template<class Type>
|
||||
Foam::zeroField
|
||||
Foam::fvm::Su
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
@ -174,7 +174,7 @@ template<class Type>
|
||||
Foam::zeroField
|
||||
Foam::fvm::Sp
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
)
|
||||
{
|
||||
@ -240,7 +240,7 @@ template<class Type>
|
||||
Foam::zeroField
|
||||
Foam::fvm::SuSp
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
|
||||
#include "volFieldsFwd.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "zeroField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -76,7 +77,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
zeroField Su
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
@ -116,7 +117,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
zeroField Sp
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
@ -147,7 +148,7 @@ namespace fvm
|
||||
template<class Type>
|
||||
zeroField SuSp
|
||||
(
|
||||
const zeroField&,
|
||||
const zero&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
}
|
||||
|
||||
@ -1088,7 +1088,7 @@ void Foam::fvMatrix<Type>::operator-=
|
||||
template<class Type>
|
||||
void Foam::fvMatrix<Type>::operator+=
|
||||
(
|
||||
const zeroField&
|
||||
const zero&
|
||||
)
|
||||
{}
|
||||
|
||||
@ -1096,7 +1096,7 @@ void Foam::fvMatrix<Type>::operator+=
|
||||
template<class Type>
|
||||
void Foam::fvMatrix<Type>::operator-=
|
||||
(
|
||||
const zeroField&
|
||||
const zero&
|
||||
)
|
||||
{}
|
||||
|
||||
@ -1507,7 +1507,7 @@ template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type> > Foam::operator==
|
||||
(
|
||||
const fvMatrix<Type>& A,
|
||||
const zeroField&
|
||||
const zero&
|
||||
)
|
||||
{
|
||||
return A;
|
||||
@ -1518,7 +1518,7 @@ template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type> > Foam::operator==
|
||||
(
|
||||
const tmp<fvMatrix<Type> >& tA,
|
||||
const zeroField&
|
||||
const zero&
|
||||
)
|
||||
{
|
||||
return tA;
|
||||
|
||||
@ -44,7 +44,7 @@ SourceFiles
|
||||
#include "tmp.H"
|
||||
#include "autoPtr.H"
|
||||
#include "dimensionedTypes.H"
|
||||
#include "zeroField.H"
|
||||
#include "zero.H"
|
||||
#include "className.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -435,8 +435,8 @@ public:
|
||||
void operator+=(const dimensioned<Type>&);
|
||||
void operator-=(const dimensioned<Type>&);
|
||||
|
||||
void operator+=(const zeroField&);
|
||||
void operator-=(const zeroField&);
|
||||
void operator+=(const zero&);
|
||||
void operator-=(const zero&);
|
||||
|
||||
void operator*=(const DimensionedField<scalar, volMesh>&);
|
||||
void operator*=(const tmp<DimensionedField<scalar, volMesh> >&);
|
||||
@ -647,14 +647,14 @@ template<class Type>
|
||||
tmp<fvMatrix<Type> > operator==
|
||||
(
|
||||
const fvMatrix<Type>&,
|
||||
const zeroField&
|
||||
const zero&
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> > operator==
|
||||
(
|
||||
const tmp<fvMatrix<Type> >&,
|
||||
const zeroField&
|
||||
const zero&
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,6 +34,7 @@ License
|
||||
#include "fvcSurfaceIntegrate.H"
|
||||
#include "slicedSurfaceFields.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
#include "fvm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -49,11 +50,11 @@ void Foam::MULES::explicitSolve
|
||||
{
|
||||
explicitSolve
|
||||
(
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
zeroField(), zeroField(),
|
||||
zero(), zero(),
|
||||
psiMax, psiMin
|
||||
);
|
||||
}
|
||||
@ -70,11 +71,11 @@ void Foam::MULES::implicitSolve
|
||||
{
|
||||
implicitSolve
|
||||
(
|
||||
oneField(),
|
||||
geometricOneField(),
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
zeroField(), zeroField(),
|
||||
zero(), zero(),
|
||||
psiMax, psiMin
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,8 +46,8 @@ SourceFiles
|
||||
#include "volFields.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "zeroField.H"
|
||||
#include "oneField.H"
|
||||
#include "zero.H"
|
||||
#include "geometricOneField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -88,8 +88,8 @@ void Foam::MULES::explicitSolve
|
||||
psi,
|
||||
phiBD,
|
||||
phiCorr,
|
||||
Sp.field(),
|
||||
Su.field(),
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
3
|
||||
@ -109,18 +109,18 @@ void Foam::MULES::explicitSolve
|
||||
psiIf =
|
||||
(
|
||||
mesh.Vsc0()*rho.oldTime()*psi0/(deltaT*mesh.Vsc())
|
||||
+ Su.field()
|
||||
+ Su
|
||||
- psiIf
|
||||
)/(rho/deltaT - Sp.field());
|
||||
)/(rho/deltaT - Sp);
|
||||
}
|
||||
else
|
||||
{
|
||||
psiIf =
|
||||
(
|
||||
rho.oldTime()*psi0/deltaT
|
||||
+ Su.field()
|
||||
+ Su
|
||||
- psiIf
|
||||
)/(rho/deltaT - Sp.field());
|
||||
)/(rho/deltaT - Sp);
|
||||
}
|
||||
|
||||
psi.correctBoundaryConditions();
|
||||
@ -244,8 +244,8 @@ void Foam::MULES::implicitSolve
|
||||
psi,
|
||||
phiBD,
|
||||
phiCorr,
|
||||
Sp.field(),
|
||||
Su.field(),
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
nLimiterIter
|
||||
|
||||
@ -431,7 +431,7 @@ Foam::autoHexMeshDriver::autoHexMeshDriver
|
||||
<< "You have selected decomposition method "
|
||||
<< decomposer.typeName
|
||||
<< " which is not parallel aware." << endl
|
||||
<< "Please select one that is (parMetis, hierarchical)"
|
||||
<< "Please select one that is (hierarchical, ptscotch)"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ wmake libso metisDecomp
|
||||
|
||||
if [ -d "$FOAM_MPI_LIBBIN" ]
|
||||
then
|
||||
( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB; wmake libso parMetisDecomp )
|
||||
( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB; wmake libso ptscotchDecomp )
|
||||
fi
|
||||
|
||||
wmake libso decompositionMethods
|
||||
|
||||
@ -4,7 +4,7 @@ set -x
|
||||
|
||||
wmakeLnInclude decompositionMethods
|
||||
wmakeLnInclude metisDecomp
|
||||
wmakeLnInclude parMetisDecomp
|
||||
wmakeLnInclude scotchDecomp
|
||||
wmakeLnInclude ptscotchDecomp
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
EXE_INC =
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(FOAM_LIBBIN)/dummy \
|
||||
-L$(FOAM_MPI_LIBBIN) \
|
||||
-lscotchDecomp \
|
||||
-lmetisDecomp \
|
||||
-lparMetisDecomp
|
||||
|
||||
LIB_LIBS =
|
||||
|
||||
|
||||
@ -28,6 +28,9 @@ InClass
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "decompositionMethod.H"
|
||||
#include "globalIndex.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * 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
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -201,15 +216,284 @@ void Foam::decompositionMethod::calcCellCells
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::decompositionMethod::decompose
|
||||
void Foam::decompositionMethod::calcCSR
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
const pointField& cc
|
||||
const polyMesh& mesh,
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -66,6 +66,31 @@ protected:
|
||||
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 Member Functions
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(WM_THIRD_PARTY_DIR)/metis-5.0pre2/include \
|
||||
-I../decompositionMethods/lnInclude \
|
||||
-I../scotchDecomp/lnInclude
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lmetis \
|
||||
|
||||
@ -28,7 +28,6 @@ License
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "floatScalar.H"
|
||||
#include "Time.H"
|
||||
#include "scotchDecomp.H"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@ -340,7 +339,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||
|
||||
List<int> adjncy;
|
||||
List<int> xadj;
|
||||
scotchDecomp::calcCSR(mesh_, adjncy, xadj);
|
||||
calcCSR(mesh_, adjncy, xadj);
|
||||
|
||||
// Decompose using default weights
|
||||
List<int> finalDecomp;
|
||||
@ -390,7 +389,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||
cellCells
|
||||
);
|
||||
|
||||
scotchDecomp::calcCSR(cellCells, adjncy, xadj);
|
||||
calcCSR(cellCells, adjncy, xadj);
|
||||
}
|
||||
|
||||
// Decompose using default weights
|
||||
@ -435,7 +434,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
||||
|
||||
List<int> adjncy;
|
||||
List<int> xadj;
|
||||
scotchDecomp::calcCSR(globalCellCells, adjncy, xadj);
|
||||
calcCSR(globalCellCells, adjncy, xadj);
|
||||
|
||||
|
||||
// Decompose using default weights
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
parMetisDecomp.C
|
||||
|
||||
LIB = $(FOAM_MPI_LIBBIN)/libparMetisDecomp
|
||||
@ -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
3
src/parallel/decompose/ptscotchDecomp/Make/files
Normal file
3
src/parallel/decompose/ptscotchDecomp/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
ptscotchDecomp.C
|
||||
|
||||
LIB = $(FOAM_MPI_LIBBIN)/libptscotchDecomp
|
||||
10
src/parallel/decompose/ptscotchDecomp/Make/options
Normal file
10
src/parallel/decompose/ptscotchDecomp/Make/options
Normal 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
|
||||
592
src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
Normal file
592
src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,17 +23,18 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::parMetisDecomp
|
||||
Foam::ptscotchDecomp
|
||||
|
||||
Description
|
||||
PTScotch domain decomposition
|
||||
|
||||
SourceFiles
|
||||
parMetisDecomp.C
|
||||
ptscotchDecomp.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef parMetisDecomp_H
|
||||
#define parMetisDecomp_H
|
||||
#ifndef ptscotchDecomp_H
|
||||
#define ptscotchDecomp_H
|
||||
|
||||
#include "decompositionMethod.H"
|
||||
|
||||
@ -41,10 +42,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class parMetisDecomp Declaration
|
||||
Class ptscotchDecomp Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class parMetisDecomp
|
||||
class ptscotchDecomp
|
||||
:
|
||||
public decompositionMethod
|
||||
{
|
||||
@ -55,41 +56,32 @@ class parMetisDecomp
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Insert list in front of list.
|
||||
template<class Type>
|
||||
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>&);
|
||||
//- Check and print error message
|
||||
static void check(const int, const char*);
|
||||
|
||||
label decompose
|
||||
(
|
||||
Field<int>& xadj,
|
||||
Field<int>& adjncy,
|
||||
const pointField& cellCentres,
|
||||
Field<int>& cellWeights,
|
||||
Field<int>& faceWeights,
|
||||
const List<int>& options,
|
||||
|
||||
List<int>& adjncy,
|
||||
List<int>& xadj,
|
||||
const scalarField& cWeights,
|
||||
List<int>& finalDecomp
|
||||
);
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const parMetisDecomp&);
|
||||
parMetisDecomp(const parMetisDecomp&);
|
||||
void operator=(const ptscotchDecomp&);
|
||||
ptscotchDecomp(const ptscotchDecomp&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("parMetis");
|
||||
TypeName("ptscotch");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given the decomposition dictionary and mesh
|
||||
parMetisDecomp
|
||||
ptscotchDecomp
|
||||
(
|
||||
const dictionary& decompositionDict,
|
||||
const polyMesh& mesh
|
||||
@ -98,23 +90,20 @@ public:
|
||||
|
||||
// Destructor
|
||||
|
||||
~parMetisDecomp()
|
||||
virtual ~ptscotchDecomp()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- parMetis handles Foam processor boundaries
|
||||
virtual bool parallelAware() const
|
||||
{
|
||||
// ptscotch does not know about proc boundaries
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return for every coordinate the wanted processor number. Use the
|
||||
// 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
|
||||
(
|
||||
const pointField& points,
|
||||
@ -125,10 +114,9 @@ public:
|
||||
// passed agglomeration map (from fine to coarse cells) and coarse cell
|
||||
// location. Can be overridden by decomposers that provide this
|
||||
// functionality natively.
|
||||
// See note on weights above.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelList& cellToRegion,
|
||||
const labelList& agglom,
|
||||
const pointField& regionPoints,
|
||||
const scalarField& regionWeights
|
||||
);
|
||||
@ -140,7 +128,6 @@ public:
|
||||
// from 0 at processor0 and then incrementing all through the
|
||||
// processors)
|
||||
// - the connections are across coupled patches
|
||||
// See note on weights above.
|
||||
virtual labelList decompose
|
||||
(
|
||||
const labelListList& globalCellCells,
|
||||
@ -148,13 +135,6 @@ public:
|
||||
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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -474,7 +474,7 @@ Foam::labelList Foam::scotchDecomp::decompose
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"parMetisDecomp::decompose(const labelList&, const pointField&)"
|
||||
"scotchDecomp::decompose(const labelList&, const pointField&)"
|
||||
) << "Size of cell-to-coarse map " << agglom.size()
|
||||
<< " differs from number of cells in mesh " << mesh_.nCells()
|
||||
<< 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -139,26 +139,6 @@ public:
|
||||
const pointField& cc,
|
||||
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
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
9
tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/Allrun
Executable file
9
tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/Allrun
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=`getApplication`
|
||||
|
||||
./makeMesh
|
||||
runApplication $application
|
||||
@ -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;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
Reference in New Issue
Block a user