Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
sergio
2011-02-04 15:31:23 +00:00
678 changed files with 12776 additions and 9696 deletions

View File

@ -1,6 +1,6 @@
GNU GENERAL PUBLIC LICENSE
OpenFOAM(R) is Copyright (C) 1991-2010 OpenCFD Ltd.
OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd.
Contact: OpenCFD (enquiries@OpenCFD.co.uk)
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms

View File

@ -5,7 +5,7 @@
#+DATE: TBA
#+LINK: http://www.openfoam.com
#+OPTIONS: author:nil ^:{}
# Copyright (c) 2010 OpenCFD Ltd.
# Copyright (c) 2011 OpenCFD Ltd.
* Overview
OpenFOAM-dev is the latest major release of OpenFOAM including many new
@ -117,7 +117,7 @@
*** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary.
*** *Updated* runTimeModifiable
+ user selectable model to use for checking run-time modifiable
dictionaries:
dictionaries (see also doc/changes/inotify.txt):
+ timeStamp : use time stamp as before
+ inotify : use inotify instead of time stamp
+ timeStampMaster : only master checks and reads file. Slaves get file

View File

@ -23,7 +23,7 @@ fvMesh mesh
fvMesh::defaultRegion,
runTime.timeName(),
runTime,
IOobject::NO_READ
IOobject::MUST_READ
),
xferMove<Field<vector> >(points),
faces.xfer(),

View File

@ -4,8 +4,8 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
@ -27,12 +27,12 @@ EXE_LIBS = \
-llagrangian \
-lmeshTools \
-ldieselSpray \
-lliquids \
-lliquidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lthermophysicalFunctions \
-lspecie \
-lbasicThermophysicalModels \
-llaminarFlameSpeedModels \
-lchemistryModel \
-lODE \
-lpdf
-ldistributionModels

View File

@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
@ -24,13 +24,13 @@ EXE_LIBS = \
-llagrangian \
-lmeshTools \
-ldieselSpray \
-lliquids \
-lliquidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lthermophysicalFunctions \
-lspecie \
-lbasicThermophysicalModels \
-llaminarFlameSpeedModels \
-lchemistryModel \
-lODE \
-lpdf \
-ldistributionModels \
-lfiniteVolume

View File

@ -5,7 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \
@ -17,4 +17,4 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleLESModels \
-lcompressibleRASModels \
-lradiation
-lradiationModels

View File

@ -1,7 +1,7 @@
EXE_INC = \
-I../buoyantSimpleFoam \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/RAS \
@ -11,7 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lradiationModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
@ -31,14 +31,14 @@ EXE_LIBS = \
-lcoalCombustion\
-lspecie \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lpointSolids \
-lpointSolidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiation \
-lradiationModels \
-lsurfaceFilmModels \
-lODE

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
@ -21,7 +21,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lradiationModels \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
@ -18,7 +18,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lradiationModels \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -30,14 +30,14 @@ EXE_LIBS = \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lpointSolids \
-lpointSolidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiation \
-lradiationModels \
-lODE \
-lsurfaceFilmModels

View File

@ -2,18 +2,18 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -26,13 +26,13 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lpointSolids \
-lpointSolidMixture \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiation \
-lradiationModels \
-lsurfaceFilmModels \
-llagrangianIntermediate \
-lODE

View File

@ -4,18 +4,18 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -29,14 +29,14 @@ EXE_LIBS = \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lpointSolids \
-lpointSolidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiation \
-lradiationModels \
-lODE \
-lsurfaceFilmModels

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -30,14 +30,14 @@ EXE_LIBS = \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lpointSolids \
-lpointSolidMixture \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiation \
-lradiationModels \
-lODE \
-lsurfaceFilmModels

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -16,7 +16,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lradiationModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \

View File

@ -1,6 +1,6 @@
label nAlphaCorr(readLabel(piso.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles"))));
label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{

View File

@ -0,0 +1,3 @@
Test-Distribution.C
EXE = $(FOAM_USER_APPBIN)/Test-DistributionTest

View File

@ -0,0 +1,2 @@
/* EXE_INC = */
/* EXE_LIBS = */

View File

@ -0,0 +1,292 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2011 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 3 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, see <http://www.gnu.org/licenses/>.
Application
Test-Distribution
Description
Test the Distribution class
Plot normal distribution test in gnuplot using:
@verbatim
normalDistribution(mean, sigma, x) = \
sqrt(1.0/(2.0*pi*sigma**2))*exp(-(x - mean)**2.0/(2.0*sigma**2))
plot normalDistribution(8.5, 2.5, x), "Distribution_scalar_test_x" w p
@endverbatim
\*---------------------------------------------------------------------------*/
#include "vector.H"
#include "labelVector.H"
#include "tensor.H"
#include "Distribution.H"
#include "Random.H"
#include "dimensionedTypes.H"
#include "argList.H"
#include "PstreamReduceOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using namespace Foam;
int main(int argc, char *argv[])
{
# include "setRootCase.H"
Random R(918273);
{
// scalar
label randomDistributionTestSize = 50000000;
Distribution<scalar> dS(scalar(5e-2));
Info<< nl << "Distribution<scalar>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from GaussNormal distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dS.add(2.5*R.GaussNormal() + 8.5);
}
Info<< "Mean " << dS.mean() << nl
<< "Median " << dS.median()
<< endl;
dS.write("Distribution_scalar_test_1");
Distribution<scalar> dS2(scalar(1e-2));
Info<< nl << "Distribution<scalar>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from GaussNormal distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dS2.add(1.5*R.GaussNormal() -6.0);
}
Info<< "Mean " << dS2.mean() << nl
<< "Median " << dS2.median()
<< endl;
dS2.write("Distribution_scalar_test_2");
Info<< nl << "Adding previous two Distribution<scalar>" << endl;
dS = dS + dS2;
dS.write("Distribution_scalar_test_1+2");
}
if (Pstream::parRun())
{
// scalar in parallel
label randomDistributionTestSize = 100000000;
Distribution<scalar> dS(scalar(1e-1));
Pout<< "Distribution<scalar>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from uniform distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dS.add(R.scalar01() + 10*Pstream::myProcNo());
}
Pout<< "Mean " << dS.mean() << nl
<< "Median " << dS.median()
<< endl;
reduce(dS, sumOp< Distribution<scalar> >());
if (Pstream::master())
{
Info<< "Reducing parallel Distribution<scalar>" << nl
<< "Mean " << dS.mean() << nl
<< "Median " << dS.median()
<< endl;
dS.write("Distribution_scalar_test_parallel_reduced");
}
}
{
// vector
Distribution<vector> dV(vector(0.1, 0.05, 0.15));
label randomDistributionTestSize = 1000000;
Info<< nl << "Distribution<vector>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from uniform and GaussNormal distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dV.add(R.vector01());
// Adding separate GaussNormal components with component
// weights
dV.add
(
vector
(
R.GaussNormal()*3.0 + 1.5,
R.GaussNormal()*0.25 + 4.0,
R.GaussNormal()*3.0 - 1.5
),
vector(1.0, 2.0, 5.0)
);
}
Info<< "Mean " << dV.mean() << nl
<< "Median " << dV.median()
<< endl;
dV.write("Distribution_vector_test");
}
// {
// // labelVector
// Distribution<labelVector> dLV(labelVector::one*10);
// label randomDistributionTestSize = 2000000;
// Info<< nl << "Distribution<labelVector>" << nl
// << "Sampling "
// << randomDistributionTestSize
// << " times from uniform distribution."
// << endl;
// for (label i = 0; i < randomDistributionTestSize; i++)
// {
// dLV.add
// (
// labelVector
// (
// R.integer(-1000, 1000),
// R.integer(-5000, 5000),
// R.integer(-2000, 7000)
// )
// );
// }
// Info<< "Mean " << dLV.mean() << nl
// << "Median " << dLV.median()
// << endl;
// dLV.write("Distribution_labelVector_test");
// }
{
// tensor
Distribution<tensor> dT(tensor::one*1e-2);
label randomDistributionTestSize = 2000000;
Info<< nl << "Distribution<tensor>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from uniform distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dT.add(R.tensor01());
}
Info<< "Mean " << dT.mean() << nl
<< "Median " << dT.median()
<< endl;
dT.write("Distribution_tensor_test");
}
{
// symmTensor
Distribution<symmTensor> dSyT(symmTensor::one*1e-2);
label randomDistributionTestSize = 2000000;
Info<< nl << "Distribution<symmTensor>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from uniform distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dSyT.add(R.symmTensor01());
}
Info<< "Mean " << dSyT.mean() << nl
<< "Median " << dSyT.median()
<< endl;
dSyT.write("Distribution_symmTensor_test");
}
{
// sphericalTensor
Distribution<sphericalTensor> dSpT(sphericalTensor::one*1e-2);
label randomDistributionTestSize = 50000000;
Info<< nl << "Distribution<sphericalTensor>" << nl
<< "Sampling "
<< randomDistributionTestSize
<< " times from uniform distribution."
<< endl;
for (label i = 0; i < randomDistributionTestSize; i++)
{
dSpT.add(R.sphericalTensor01());
}
Info<< "Mean " << dSpT.mean() << nl
<< "Median " << dSpT.median()
<< endl;
dSpT.write("Distribution_sphericalTensor_test");
}
Info<< nl << "End" << nl << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,3 +1,3 @@
hashTableTest2.C
Test-HashTable2.C
EXE = $(FOAM_USER_APPBIN)/hashTableTest2
EXE = $(FOAM_USER_APPBIN)/Test-HashTable2

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,6 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Miscellaneous tests for HashTable
\*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
hashTableTest3.C
Test-HashTable3.C
EXE = $(FOAM_USER_APPBIN)/hashTableTest3
EXE = $(FOAM_USER_APPBIN)/Test-HashTable3

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,6 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test speeds for some HashTable operations
\*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
Test-namedEnum.C
EXE = $(FOAM_USER_APPBIN)/NamedEnum
EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum

View File

@ -1,11 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-llagrangianIntermediate \
-lradiation \
-lradiationModels \
-lthermophysicalFunctions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Application
testDataEntry
Description
Tests lagrangian/intermediate/submodels/IO/DataEntry
Tests DataEntry
\*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
Test-dimensionedType.C
EXE = $(FOAM_USER_APPBIN)/dimensionedType
EXE = $(FOAM_USER_APPBIN)/Test-dimensionedType

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,133 +50,71 @@ int main(int argc, char *argv[])
const globalMeshData& globalData = mesh.globalData();
const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch();
const globalIndexAndTransform& transforms = globalData.globalTransforms();
// Test:print (collocated) shared points
// Test:print shared points
{
const labelListList& globalPointSlaves =
globalData.globalPointSlaves();
const mapDistribute& globalPointSlavesMap =
globalData.globalPointSlavesMap();
const labelListList& slaves =
globalData.globalPointSlaves();
const labelListList& transformedSlaves =
globalData.globalPointTransformedSlaves();
// Create field with my local data
pointField coords(globalPointSlavesMap.constructSize());
SubList<point>(coords, coupledPatch.nPoints()).assign
(
coupledPatch.localPoints()
);
// Exchange data
globalPointSlavesMap.distribute(coords);
// Exchange data. Apply positional transforms.
globalPointSlavesMap.distribute(transforms, coords, true);
// Print
forAll(globalPointSlaves, pointI)
forAll(slaves, pointI)
{
const labelList& slavePoints = globalPointSlaves[pointI];
const labelList& slavePoints = slaves[pointI];
if (slavePoints.size() > 0)
{
Pout<< "Master point:" << pointI
<< " coord:" << coords[pointI]
<< " connected to slave points:" << endl;
<< " connected to untransformed slave points:" << endl;
forAll(slavePoints, i)
{
Pout<< " " << coords[slavePoints[i]] << endl;
}
}
}
}
const labelList& transformedSlavePoints = transformedSlaves[pointI];
// Test: (collocated) point to faces addressing
{
const labelListList& globalPointBoundaryFaces =
globalData.globalPointBoundaryFaces();
const mapDistribute& globalPointBoundaryFacesMap =
globalData.globalPointBoundaryFacesMap();
label nBnd = mesh.nFaces()-mesh.nInternalFaces();
pointField fc(globalPointBoundaryFacesMap.constructSize());
SubList<point>(fc, nBnd).assign
(
primitivePatch
(
SubList<face>
(
mesh.faces(),
nBnd,
mesh.nInternalFaces()
),
mesh.points()
).faceCentres()
);
// Exchange data
globalPointBoundaryFacesMap.distribute(fc);
// Print
forAll(globalPointBoundaryFaces, pointI)
{
const labelList& bFaces = globalPointBoundaryFaces[pointI];
Pout<< "Point:" << pointI
<< " at:" << coupledPatch.localPoints()[pointI]
<< " connected to faces:" << endl;
forAll(bFaces, i)
if (transformedSlavePoints.size() > 0)
{
Pout<< " " << fc[bFaces[i]] << endl;
Pout<< "Master point:" << pointI
<< " coord:" << coords[pointI]
<< " connected to transformed slave points:" << endl;
forAll(transformedSlavePoints, i)
{
Pout<< " " << coords[transformedSlavePoints[i]]
<< endl;
}
}
}
}
// Test:(collocated) point to cells addressing
// Test:print shared edges
{
const labelList& boundaryCells = globalData.boundaryCells();
const labelListList& globalPointBoundaryCells =
globalData.globalPointBoundaryCells();
const mapDistribute& globalPointBoundaryCellsMap =
globalData.globalPointBoundaryCellsMap();
pointField cc(globalPointBoundaryCellsMap.constructSize());
forAll(boundaryCells, i)
{
cc[i] = mesh.cellCentres()[boundaryCells[i]];
}
// Exchange data
globalPointBoundaryCellsMap.distribute(cc);
// Print
forAll(globalPointBoundaryCells, pointI)
{
const labelList& bCells = globalPointBoundaryCells[pointI];
Pout<< "Point:" << pointI
<< " at:" << coupledPatch.localPoints()[pointI]
<< " connected to cells:" << endl;
forAll(bCells, i)
{
Pout<< " " << cc[bCells[i]] << endl;
}
}
}
// Test:print (collocated) shared edges
{
const labelListList& globalEdgeSlaves =
globalData.globalEdgeSlaves();
const mapDistribute& globalEdgeSlavesMap =
globalData.globalEdgeSlavesMap();
const labelListList& slaves =
globalData.globalEdgeSlaves();
const labelListList& transformedSlaves =
globalData.globalEdgeTransformedSlaves();
// Test: distribute edge centres
pointField ec(globalEdgeSlavesMap.constructSize());
@ -188,13 +126,13 @@ int main(int argc, char *argv[])
);
}
// Exchange data
globalEdgeSlavesMap.distribute(ec);
// Exchange data Apply positional transforms.
globalEdgeSlavesMap.distribute(transforms, ec, true);
// Print
forAll(globalEdgeSlaves, edgeI)
forAll(slaves, edgeI)
{
const labelList& slaveEdges = globalEdgeSlaves[edgeI];
const labelList& slaveEdges = slaves[edgeI];
if (slaveEdges.size() > 0)
{
@ -207,10 +145,102 @@ int main(int argc, char *argv[])
Pout<< " " << ec[slaveEdges[i]] << endl;
}
}
const labelList& transformedSlaveEdges = transformedSlaves[edgeI];
if (transformedSlaveEdges.size() > 0)
{
Pout<< "Master edge:" << edgeI
<< " centre:" << ec[edgeI]
<< " connected to transformed slave edges:" << endl;
forAll(transformedSlaveEdges, i)
{
Pout<< " " << ec[transformedSlaveEdges[i]]
<< endl;
}
}
}
}
//// Test: (collocated) point to faces addressing
//{
// const labelListList& globalPointBoundaryFaces =
// globalData.globalPointBoundaryFaces();
// const mapDistribute& globalPointBoundaryFacesMap =
// globalData.globalPointBoundaryFacesMap();
//
// label nBnd = mesh.nFaces()-mesh.nInternalFaces();
//
// pointField fc(globalPointBoundaryFacesMap.constructSize());
// SubList<point>(fc, nBnd).assign
// (
// primitivePatch
// (
// SubList<face>
// (
// mesh.faces(),
// nBnd,
// mesh.nInternalFaces()
// ),
// mesh.points()
// ).faceCentres()
// );
//
// // Exchange data
// globalPointBoundaryFacesMap.distribute(fc);
//
// // Print
// forAll(globalPointBoundaryFaces, pointI)
// {
// const labelList& bFaces = globalPointBoundaryFaces[pointI];
//
// Pout<< "Point:" << pointI
// << " at:" << coupledPatch.localPoints()[pointI]
// << " connected to faces:" << endl;
//
// forAll(bFaces, i)
// {
// Pout<< " " << fc[bFaces[i]] << endl;
// }
// }
//}
//
//
//// Test:(collocated) point to cells addressing
//{
// const labelList& boundaryCells = globalData.boundaryCells();
// const labelListList& globalPointBoundaryCells =
// globalData.globalPointBoundaryCells();
// const mapDistribute& globalPointBoundaryCellsMap =
// globalData.globalPointBoundaryCellsMap();
//
// pointField cc(globalPointBoundaryCellsMap.constructSize());
// forAll(boundaryCells, i)
// {
// cc[i] = mesh.cellCentres()[boundaryCells[i]];
// }
//
// // Exchange data
// globalPointBoundaryCellsMap.distribute(cc);
//
// // Print
// forAll(globalPointBoundaryCells, pointI)
// {
// const labelList& bCells = globalPointBoundaryCells[pointI];
//
// Pout<< "Point:" << pointI
// << " at:" << coupledPatch.localPoints()[pointI]
// << " connected to cells:" << endl;
//
// forAll(bCells, i)
// {
// Pout<< " " << cc[bCells[i]] << endl;
// }
// }
//}
Info<< "End\n" << endl;
return 0;

View File

@ -1,3 +0,0 @@
Test-lduMatrix3.C
EXE = $(FOAM_USER_APPBIN)/Test-lduMatrix

View File

@ -1,4 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = -lfiniteVolume

View File

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "fvMesh.H"
#include "volFields.H"
#include "LduMatrix.H"
#include "diagTensorField.H"
#include "TPCG.H"
#include "TPBiCG.H"
#include "NoPreconditioner.H"
using namespace Foam;
typedef Foam::LduMatrix<vector, diagTensor, scalar>
lduVectorMatrix;
defineNamedTemplateTypeNameAndDebug(lduVectorMatrix, 0);
typedef Foam::DiagonalSolver<vector, diagTensor, scalar>
lduVectorDiagonalSolver;
defineNamedTemplateTypeNameAndDebug(lduVectorDiagonalSolver, 0);
template<>
const vector lduVectorMatrix::great_(1e15, 1e15, 1e15);
template<>
const vector lduVectorMatrix::small_(1e-15, 1e-15, 1e-15);
namespace Foam
{
typedef LduMatrix<vector, diagTensor, scalar>::preconditioner
lduVectorPreconditioner;
defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, asymMatrix);
typedef LduMatrix<vector, diagTensor, scalar>::smoother
lduVectorSmoother;
defineTemplateRunTimeSelectionTable(lduVectorSmoother, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorSmoother, asymMatrix);
typedef LduMatrix<vector, diagTensor, scalar>::solver
lduVectorSolver;
defineTemplateRunTimeSelectionTable(lduVectorSolver, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorSolver, asymMatrix);
typedef TPCG<vector, diagTensor, scalar> TPCGVector;
defineNamedTemplateTypeNameAndDebug(TPCGVector, 0);
LduMatrix<vector, diagTensor, scalar>::solver::
addsymMatrixConstructorToTable<TPCGVector>
addTPCGSymMatrixConstructorToTable_;
typedef TPBiCG<vector, diagTensor, scalar> TPBiCGVector;
defineNamedTemplateTypeNameAndDebug(TPBiCGVector, 0);
LduMatrix<vector, diagTensor, scalar>::solver::
addasymMatrixConstructorToTable<TPBiCGVector>
addTPBiCGSymMatrixConstructorToTable_;
typedef NoPreconditioner<vector, diagTensor, scalar> NoPreconditionerVector;
defineNamedTemplateTypeNameAndDebug(NoPreconditionerVector, 0);
LduMatrix<vector, diagTensor, scalar>::preconditioner::
addsymMatrixConstructorToTable<NoPreconditionerVector>
addNoPreconditionerSymMatrixConstructorToTable_;
LduMatrix<vector, diagTensor, scalar>::preconditioner::
addasymMatrixConstructorToTable<NoPreconditionerVector>
addNoPreconditionerAsymMatrixConstructorToTable_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
volVectorField psi
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
lduVectorMatrix testMatrix(mesh);
testMatrix.diag() = 2*pTraits<diagTensor>::one;
testMatrix.source() = pTraits<vector>::one;
testMatrix.upper() = 0.1;
testMatrix.lower() = -0.1;
Info<< testMatrix << endl;
FieldField<Field, scalar> boundaryCoeffs(0);
FieldField<Field, scalar> internalCoeffs(0);
autoPtr<lduVectorMatrix::solver> testMatrixSolver =
lduVectorMatrix::solver::New
(
psi.name(),
testMatrix,
boundaryCoeffs,
internalCoeffs,
psi.boundaryField().interfaces(),
IStringStream
(
"PBiCG"
"{"
" preconditioner none;"
" tolerance (1e-05 1e-05 1e-05);"
" relTol (0 0 0);"
"}"
)()
);
lduVectorMatrix::solverPerformance solverPerf =
testMatrixSolver->solve(psi);
solverPerf.print();
Info<< psi << endl;
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "fvMesh.H"
#include "volFields.H"
#include "LduMatrix.H"
#include "tensorField.H"
#include "TPCG.H"
#include "TPBiCG.H"
#include "NoPreconditioner.H"
using namespace Foam;
typedef Foam::LduMatrix<vector, tensor, scalar>
lduVectorMatrix;
defineNamedTemplateTypeNameAndDebug(lduVectorMatrix, 0);
typedef Foam::DiagonalSolver<vector, tensor, scalar>
lduVectorDiagonalSolver;
defineNamedTemplateTypeNameAndDebug(lduVectorDiagonalSolver, 0);
template<>
const vector lduVectorMatrix::great_(1e15, 1e15, 1e15);
template<>
const vector lduVectorMatrix::small_(1e-15, 1e-15, 1e-15);
namespace Foam
{
typedef LduMatrix<vector, tensor, scalar>::preconditioner
lduVectorPreconditioner;
defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, asymMatrix);
typedef LduMatrix<vector, tensor, scalar>::smoother
lduVectorSmoother;
defineTemplateRunTimeSelectionTable(lduVectorSmoother, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorSmoother, asymMatrix);
typedef LduMatrix<vector, tensor, scalar>::solver
lduVectorSolver;
defineTemplateRunTimeSelectionTable(lduVectorSolver, symMatrix);
defineTemplateRunTimeSelectionTable(lduVectorSolver, asymMatrix);
typedef TPCG<vector, tensor, scalar> TPCGVector;
defineNamedTemplateTypeNameAndDebug(TPCGVector, 0);
LduMatrix<vector, tensor, scalar>::solver::
addsymMatrixConstructorToTable<TPCGVector>
addTPCGSymMatrixConstructorToTable_;
typedef TPBiCG<vector, tensor, scalar> TPBiCGVector;
defineNamedTemplateTypeNameAndDebug(TPBiCGVector, 0);
LduMatrix<vector, tensor, scalar>::solver::
addasymMatrixConstructorToTable<TPBiCGVector>
addTPBiCGSymMatrixConstructorToTable_;
typedef NoPreconditioner<vector, tensor, scalar> NoPreconditionerVector;
defineNamedTemplateTypeNameAndDebug(NoPreconditionerVector, 0);
LduMatrix<vector, tensor, scalar>::preconditioner::
addsymMatrixConstructorToTable<NoPreconditionerVector>
addNoPreconditionerSymMatrixConstructorToTable_;
LduMatrix<vector, tensor, scalar>::preconditioner::
addasymMatrixConstructorToTable<NoPreconditionerVector>
addNoPreconditionerAsymMatrixConstructorToTable_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
volVectorField psi
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
lduVectorMatrix testMatrix(mesh);
testMatrix.diag() = 2*I;
testMatrix.source() = pTraits<vector>::one;
testMatrix.upper() = 0.1;
testMatrix.lower() = -0.1;
Info<< testMatrix << endl;
FieldField<Field, scalar> boundaryCoeffs(0);
FieldField<Field, scalar> internalCoeffs(0);
autoPtr<lduVectorMatrix::solver> testMatrixSolver =
lduVectorMatrix::solver::New
(
psi.name(),
testMatrix,
//boundaryCoeffs,
//internalCoeffs,
//psi.boundaryField().interfaces(),
IStringStream
(
"PBiCG"
"{"
" preconditioner none;"
" tolerance (1e-05 1e-05 1e-05);"
" relTol (0 0 0);"
"}"
)()
);
lduVectorMatrix::solverPerformance solverPerf =
testMatrixSolver->solve(psi);
solverPerf.print();
Info<< psi << endl;
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,148 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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 3 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, see <http://www.gnu.org/licenses/>.
Application
icoFoam
Description
Transient solver for incompressible, laminar flow of Newtonian fluids.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "LduMatrix.H"
#include "diagTensorField.H"
typedef LduMatrix<vector, scalar, scalar> lduVectorMatrix;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
# include "CourantNo.H"
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);
fvVectorMatrix UEqnp(UEqn == -fvc::grad(p));
lduVectorMatrix U3Eqnp(mesh);
U3Eqnp.diag() = UEqnp.diag();
U3Eqnp.upper() = UEqnp.upper();
U3Eqnp.lower() = UEqnp.lower();
U3Eqnp.source() = UEqnp.source();
UEqnp.addBoundaryDiag(U3Eqnp.diag(), 0);
UEqnp.addBoundarySource(U3Eqnp.source(), false);
autoPtr<lduVectorMatrix::solver> U3EqnpSolver =
lduVectorMatrix::solver::New
(
U.name(),
U3Eqnp,
dictionary
(
IStringStream
(
"{"
" solver PBiCG;"
" preconditioner DILU;"
" tolerance (1e-13 1e-13 1e-13);"
" relTol (0 0 0);"
"}"
)()
)
);
U3EqnpSolver->solve(U).print(Info);
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
# include "continuityErrs.H"
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,56 +0,0 @@
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar nu
(
transportProperties.lookup("nu")
);
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);

View File

@ -1 +1 @@
EXE_LIBS = $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o
EXE_LIBS = $(FOAM_EXT_LIBBIN)/libfbsdmalloc.o

View File

@ -1,2 +1,2 @@
Test-pTraits.C
EXE = $(FOAM_USER_APPBIN)/pTraits
EXE = $(FOAM_USER_APPBIN)/Test-pTraits

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
mapDistribute map(constructSize, sendMap.xfer(), recvMap.xfer());
// Distribute complexData
mapDistribute::distribute(complexData);
map.distribute(complexData);
Pout<< "complexData:" << complexData << endl;
}

View File

@ -1,3 +1,3 @@
Test-simpleMatrix.C
EXE = $(FOAM_USER_APPBIN)/simpleMatrix
EXE = $(FOAM_USER_APPBIN)/Test-simpleMatrix

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -130,6 +130,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
{
FatalErrorIn("testPackedList()")
<< "point:" << i
<< " at:" << mesh.points()[i]
<< " minlabel:" << pointValues[i]
<< " minbits:" << bits.get(i)
<< " maxLabel:" << maxPointValues[i]
@ -186,6 +187,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{
Info<< nl << "Testing Map synchronisation." << endl;
WarningIn("testSparseData()")
<< "Position test of sparse data only correct for cases without cyclics"
<< " with shared points." << endl;
primitivePatch allBoundary
(
SubList<face>
@ -204,7 +209,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{
// Create some data. Use slightly perturbed positions.
Map<vector> sparseData;
Map<point> sparseData;
pointField fullData(mesh.nPoints(), point::max);
forAll(localPoints, i)
@ -223,14 +228,14 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
(
mesh,
sparseData,
minEqOp<vector>()
minMagSqrEqOp<point>()
// true // apply separation
);
syncTools::syncPointList
(
mesh,
fullData,
minEqOp<vector>(),
minMagSqrEqOp<point>(),
point::max
// true // apply separation
);
@ -257,7 +262,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
}
// 2. Does sparseData contain more?
forAllConstIter(Map<vector>, sparseData, iter)
forAllConstIter(Map<point>, sparseData, iter)
{
const point& sparsePt = iter();
label meshPointI = iter.key();
@ -374,16 +379,12 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
// Test position.
{
WarningIn("testPointSync()")
<< "Position test only correct for cases without cyclics"
<< " with shared points." << endl;
pointField syncedPoints(mesh.points());
syncTools::syncPointList
syncTools::syncPointPositions
(
mesh,
syncedPoints,
minEqOp<point>(),
minMagSqrEqOp<point>(),
point::max
);
@ -450,20 +451,16 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
// Test position.
{
WarningIn("testEdgeSync()")
<< "Position test only correct for cases without cyclics"
<< " with shared edges." << endl;
pointField syncedMids(edges.size());
forAll(syncedMids, edgeI)
{
syncedMids[edgeI] = edges[edgeI].centre(mesh.points());
}
syncTools::syncEdgeList
syncTools::syncEdgePositions
(
mesh,
syncedMids,
minEqOp<point>(),
minMagSqrEqOp<point>(),
point::max
);
@ -509,10 +506,11 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
{
if (nMasters[edgeI] != 1)
{
const edge& e = edges[edgeI];
//FatalErrorIn("testEdgeSync()")
WarningIn("testEdgeSync()")
<< "Edge " << edgeI
<< " midpoint " << edges[edgeI].centre(mesh.points())
<< " at:" << mesh.points()[e[0]] << mesh.points()[e[1]]
<< " has " << nMasters[edgeI]
<< " masters."
//<< exit(FatalError);
@ -532,11 +530,11 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
{
pointField syncedFc(mesh.faceCentres());
syncTools::syncFaceList
syncTools::syncFacePositions
(
mesh,
syncedFc,
maxEqOp<point>()
maxMagSqrEqOp<point>()
);
forAll(syncedFc, faceI)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -522,7 +522,7 @@ int main(int argc, char *argv[])
);
const boundBox& bb = mesh.globalData().bb();
const boundBox& bb = mesh.bounds();
const vector span = bb.span();
const scalar mergeDim = 1E-4 * bb.minDim();

View File

@ -34,22 +34,22 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \
-lLESdeltas \
-lLESfilters \
-lliquidMixture \
-lliquids \
-lliquidMixtureProperties \
-lliquidProperties \
-lmeshTools \
-lmolecularMeasurements \
-lmolecule \
-lODE \
-lOpenFOAM \
-lpdf \
-ldistributionModels \
-lpotential \
-lradiation \
-lradiationModels \
-lrandomProcesses \
-lreactionThermophysicalModels \
-lsampling \
-lpointSolidMixture \
-lsolidMixtureProperties \
-lsolidParticle \
-lpointSolids \
-lsolidProperties \
-lspecie \
-lsurfMesh \
-lsystemCall \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,8 @@ inline bool writeMeshObject
(
const word& name,
const fileName& meshDir,
Time& runTime
Time& runTime,
bool disableHeaderChecking = false
)
{
IOobject io
@ -67,14 +68,21 @@ inline bool writeMeshObject
// Switch off type checking (for reading e.g. faceZones as
// generic list of dictionaries).
const word oldTypeName = T::typeName;
const_cast<word&>(T::typeName) = word::null;
word oldTypeName;
if (disableHeaderChecking)
{
oldTypeName = T::typeName;
const_cast<word&>(T::typeName) = word::null;
}
T meshObject(io);
const_cast<word&>(T::typeName) = oldTypeName;
// Fake type back to what was in field
const_cast<word&>(meshObject.type()) = io.headerClassName();
if (disableHeaderChecking)
{
const_cast<word&>(T::typeName) = oldTypeName;
// Fake type back to what was in field
const_cast<word&>(meshObject.type()) = io.headerClassName();
}
Info<< " Writing " << name << endl;
writeOk = meshObject.regIOobject::write();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -910,7 +910,7 @@ int main(int argc, char *argv[])
(
args,
runTime,
mesh.globalData().bb()
mesh.bounds()
);
// Mesh distribution engine

View File

@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C
vtkPV3FoamUpdateInfo.C
vtkPV3FoamUtils.C
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam
LIB = $(FOAM_LIBBIN)/libvtkPV3Foam

View File

@ -19,5 +19,5 @@ LIB_LIBS = \
-lfiniteVolume \
-lgenericPatchFields \
-llagrangian \
-L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
-L$(FOAM_LIBBIN) -lvtkPV3Readers \
$(GLIBS)

View File

@ -2,4 +2,4 @@ vtkPV3blockMesh.C
vtkPV3blockMeshConvert.C
vtkPV3blockMeshUtils.C
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh
LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh

View File

@ -10,5 +10,5 @@ EXE_INC = \
LIB_LIBS = \
-lmeshTools \
-lblockMesh \
-L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
-L$(FOAM_LIBBIN) -lvtkPV3Readers \
$(GLIBS)

View File

@ -1,3 +1,3 @@
vtkPV3Readers.C
LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers
LIB = $(FOAM_LIBBIN)/libvtkPV3Readers

View File

@ -1,8 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lpdf \
-ldistributionModels \
-lsampling

View File

@ -22,7 +22,14 @@
cachedRandom rndGen(label(0), -1);
autoPtr<pdfs::pdf> p(pdfs::pdf::New(pdfDictionary, rndGen));
autoPtr<distributionModels::distributionModel> p
(
distributionModels::distributionModel::New
(
pdfDictionary,
rndGen
)
);
const scalar xMin = p->minValue();
const scalar xMax = p->maxValue();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "pdf.H"
#include "distributionModel.H"
#include "makeGraph.H"
#include "OFstream.H"

View File

@ -38,6 +38,16 @@ setFormat raw;
// but without any values!
surfaceFormat vtk;
// optionally define extra controls for the output formats
formatOptions
{
ensight
{
format ascii;
}
}
// interpolationScheme. choice of
// cell : use cell-centre value only; constant over cells (default)
// cellPoint : use cell-centre and vertex values
@ -231,6 +241,7 @@ surfaces
// Sampling on triSurface
type sampledTriSurfaceMesh;
surface integrationPlane.stl;
source boundaryFaces; // sample cells or boundaryFaces
interpolate true;
}
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -300,19 +300,24 @@ void rewriteField
Info<< "Looking for entry for patch " << patchName << endl;
if (boundaryField.found(patchName) && !boundaryField.found(newName))
// Find old patch name either direct or through wildcards
// Find new patch name direct only
if
(
boundaryField.found(patchName)
&& !boundaryField.found(newName, false, false)
)
{
Info<< " Changing entry " << patchName << " to " << newName
<< endl;
dictionary patchDict(boundaryField.subDict(patchName));
dictionary& patchDict = boundaryField.subDict(patchName);
if (patchDict.found("value"))
{
IOWarningIn("rewriteField(..)", patchDict)
<< "Cyclic patch " << patchName
<< " has value entry. Please remove this and rerun."
<< endl;
// Remove any value field since wrong size.
patchDict.remove("value");
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -208,7 +208,7 @@ int main(int argc, char *argv[])
const scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
// Get search box. Anything not within this box will not be considered.
const boundBox& meshBb = mesh.globalData().bb();
const boundBox& meshBb = mesh.bounds();
const vector searchSpan = searchTol * meshBb.span();
Info<< "All boundary faces further away than " << searchTol

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -59,10 +59,10 @@ USAGE
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
# foamEtcFile is found in the same directory
# foamEtcFile must be found in the same directory as this script
#-------------------------------------------------------------------------------
unset etcOpts
unset etcOpts version
# parse options
while [ "$#" -gt 0 ]
do
@ -72,7 +72,13 @@ do
;;
-v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
etcOpts="-version $2"
version="$2"
etcOpts="$etcOpts $1 $2" # pass-thru to foamEtcFile
shift
;;
-m | -mode | -p | -prefix)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
etcOpts="$etcOpts $1 $2" # pass-thru to foamEtcFile
shift
;;
--)
@ -89,19 +95,28 @@ do
shift
done
[ "$#" -ge 1 ] || usage "no application specified"
# find OpenFOAM settings (bashrc)
foamDotFile="$(${0%/*}/foamEtcFile $etcOpts bashrc)" || {
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
exit 1
#
# Find and source OpenFOAM settings (bashrc)
# placed in function to preserve command-line arguments
#
sourceRc()
{
# default is the current version
: ${version:=${WM_PROJECT_VERSION:-unknown}}
foamDotFile="$(${0%/*}/foamEtcFile $etcOpts bashrc)" || {
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
exit 1
}
. $foamDotFile
}
# preserve arguments (can otherwise get lost when sourcing the foamDotFile)
args="$*"
. $foamDotFile
# execute
exec $args
[ "$#" -ge 1 ] || usage "no application specified"
sourceRc
exec "$@"
#------------------------------------------------------------------------------

View File

@ -73,13 +73,10 @@ do
done
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#------------------------------------------------------------------------------

View File

@ -57,10 +57,29 @@ esac
}
# obtain archOptions types from lib/
for archOptions in $packDir/lib/*
do
$binDir/$packBin $@ ${archOptions##*/}
done
if [ -d $packDir/lib ]
then
# obtain archOptions types from lib/<archOptions>
for archOptions in $packDir/lib/*
do
$binDir/$packBin $@ ${archOptions##*/}
done
elif [ -d $packDir/platforms ]
# obtain archOptions types from platforms/<archOptions>/lib
for archOptions in $packDir/platforms/*/lib
do
archOptions=${archOptions%%/lib}
$binDir/$packBin $@ ${archOptions##*/}
done
else
echo "Error: directory $packDir does not appear packable" 1>&2
exit 1
fi
#------------------------------------------------------------------------------

View File

@ -72,13 +72,10 @@ do
done
# check for essential directories
for dir in $packDir
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -145,12 +145,12 @@ fi
# use FOAM_SETTINGS to pass command-line settings
if [ "$FOAM_INST_DIR" ]
then
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
sourceFoam="FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
else
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS"
sourceFoam=". $sourceFoam $FOAM_SETTINGS"
fi
echo "**sourceFoam:$sourceFoam $FOAM_SETTINGS"
echo "**sourceFoam:$sourceFoam"
rm -f $PWD/mpirun.schema
touch $PWD/mpirun.schema

View File

@ -67,19 +67,35 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1
}
done
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
# check new/old places for executables - same as $FOAM_APPBIN
[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || {
#
# check places for libraries - same as $FOAM_LIBBIN
# this has moved around a bit in the recent past
#
[ -d $packDir/lib/$archOptions ] || \
[ -d $packDir/platforms/$archOptions/lib ] || {
cat <<LIB_CHECK 1>&2
Error: no directory for libraries exists:
$packDir/lib/$archOptions
$packDir/platforms/$archOptions/lib
LIB_CHECK
exit 1
}
#
# check places for executables - same as $FOAM_APPBIN
# this has moved around a bit in the recent past
#
[ -d $packDir/applications/bin/$archOptions ] || \
[ -d $packDir/platforms/$archOptions/bin ] || {
cat <<BIN_CHECK 1>&2
Error: no directory for executables exists:
$packDir/bin/$archOptions
$packDir/platforms/$archOptions/bin
$packDir/applications/bin/$archOptions
BIN_CHECK
exit 1
@ -90,14 +106,15 @@ BIN_CHECK
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/lib/$archOptions \
$packDir/applications/bin/$archOptions \
$packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \
$packDir/wmake/bin/$archCompiler \
$packDir/wmake/bin/$archOS \
$packDir/wmake/rules/General \
$packDir/wmake/rules/$archCompiler \
$packDir/wmake/rules/$archOS \
$packDir/applications/bin/$archOptions \
$packDir/lib/$archOptions \
;
do
[ -d $dir ] && echo $dir

View File

@ -66,7 +66,7 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------
# check for essential directories
for dir in $packDir $packDir/lib/$archOptions
for dir in $packDir $packDir/platforms/$archOptions/lib
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
@ -78,12 +78,6 @@ done
# list of directories
dirList=$(
for dir in \
$packDir/bin/$archOptions \
$packDir/bin/$archCompiler \
$packDir/bin/$archOS \
$packDir/lib/$archOptions \
$packDir/lib/$archCompiler \
$packDir/lib/$archOS \
$packDir/platforms/$archOptions \
$packDir/platforms/$archCompiler \
$packDir/platforms/$archOS \

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -53,7 +53,7 @@ hookName="pre-commit"
die()
{
echo "$hookName hook failure" 1>&2
echo '-----------------------' 1>&2
echo '-----------------------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
echo '' 1>&2
@ -105,8 +105,8 @@ dieOnBadFiles()
{
if [ -n "$badFiles" ]
then
echo '$hookName hook failure' 1>&2
echo '-----------------------' 1>&2
echo "$hookName hook failure" 1>&2
echo '-----------------------------------' 1>&2
echo "$@" 1>&2
echo '' 1>&2
echo "File(s):" 1>&2

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -47,7 +47,7 @@ hookName="pre-receive"
die()
{
echo "$hookName hook failure" 1>&2
echo '-----------------------' 1>&2
echo '-----------------------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
echo '' 1>&2
@ -68,8 +68,8 @@ dieOnBadFiles()
{
if [ -n "$badFiles" ]
then
echo '$hookName hook failure' 1>&2
echo '-----------------------' 1>&2
echo "$hookName hook failure" 1>&2
echo '-----------------------------------' 1>&2
echo "$@" 1>&2
echo '' 1>&2
echo "File(s):" 1>&2

View File

@ -1,4 +1,6 @@
2010-05-28
http://www.openfoam.com
Copyright (c) 2011 OpenCFD Ltd.
Cleanup of automatic regIOobject rereading.
- all files (usually only IOdictionary) that need to be monitored

View File

@ -0,0 +1,41 @@
http://www.openfoam.com
Copyright (c) 2011 OpenCFD Ltd.
Some background on the new structure to synchronise point and edge data. The
building blocks:
- globalIndex : globally consecutive numbering of (untransformed) data. It
consists of a single label which starts at 0 on processor 0 and is numbered
consecutively on consecutive processors. The globalIndex class contains
functions to convert to/from processor and local index.
- globalIndexAndTransform : all the transformations in a mesh. Because the
transformations (cyclics, processorCyclics) need to fill space there can
be only three independent transforms. This class contains functions to encode
local index,processor and transformation into a labelPair.
- mapDistribute : contains constructors from local and remote data and
works out a compact storage scheme and returns corresponding indices into
the local storage and calculates a scheduling to get the local and remote
data into the local storage. The wanted data is
- untransformed: labelList(List) in globalIndex numbering
- transformed: labelPairList(List) in globalIndexAndTransform
See also mapDistribute.H
- globalMeshData : works out and stores a mapDistribute to get hold
of coupled point or edge data:
- globalPointSlavesMap() : the map to get all coupled point data
into a compact form
- globalPointSlaves : per point (on the patch of coupled faces) the
indices into the compact data corresponding to untransformed connected
points
- globalPointTransformedSlaves : same but for transformed connected
points
See e.g. syncPointData which applies a reduction operator to data on
coupled points. Note that it needs to know whether the data is a position
(since might need separation() vector).
These structures get used in e.g.
- syncTools : general synchronisation on points,edges, faces. The point and
edge synchronisation are thin wrappers around the globalMeshData functionality.
- volPointInterpolation : uses a mix of globalMeshData (for synchronising
collocated points) and patch-wise (for separated points).

View File

@ -1,3 +1,6 @@
http://www.openfoam.com
Copyright (c) 2011 OpenCFD Ltd.
Short overview of the changes to have cyclics split into two halves.
Cyclics

View File

@ -0,0 +1,35 @@
http://www.openfoam.com
Copyright (c) 2011 OpenCFD Ltd.
Static linkage:
- compile libraries as static objects:
src; ./Allwmake libo
- in the desired application (e.g. interFoam) adapt Make/options
to link all indirect and direct dependencies as .o files:
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_LIBS = \
-lz $(PLIBS) \
$(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream.o \
$(FOAM_LIBBIN)/libOSspecific.o \
$(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties.o \
$(FOAM_LIBBIN)/libinterfaceProperties.o \
$(FOAM_LIBBIN)/libincompressibleTransportModels.o \
$(FOAM_LIBBIN)/libincompressibleTurbulenceModel.o \
$(FOAM_LIBBIN)/libincompressibleRASModels.o \
$(FOAM_LIBBIN)/libincompressibleLESModels.o \
$(FOAM_LIBBIN)/libLESdeltas.o \
$(FOAM_LIBBIN)/libLESfilters.o \
$(FOAM_LIBBIN)/libfiniteVolume.o \
$(FOAM_LIBBIN)/libmeshTools.o \
$(FOAM_LIBBIN)/libtriSurface.o \
$(FOAM_LIBBIN)/libfileFormats.o \
$(FOAM_LIBBIN)/libOpenFOAM.o \
- in Make/files add
SEXE = $(FOAM_USER_APPBIN)/interFoam-static
- wmake exe
- check with ldd

View File

@ -1,5 +1,13 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
[ -d "$WM_PROJECT_DIR" ] || {
echo "Error: WM_PROJECT_DIR directory does not exist"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
exit 1
}
set -x
rm -rf latex man

View File

@ -760,7 +760,7 @@ ALPHABETICAL_INDEX = YES
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 4
COLS_IN_ALPHA_INDEX = 1
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.

View File

@ -2,7 +2,7 @@
</div> <!-- main -->
<div class="footer">
<p>
Copyright&nbsp;&copy;&nbsp;2000-2010&nbsp;
Copyright&nbsp;&copy;&nbsp;2004-2011&nbsp;
<a href="http://www.openfoam.com/about">OpenCFD Limited</a>
| OPENFOAM&reg; and OpenCFD&reg; are registered trademarks of OpenCFD Ltd.
</p>

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -44,15 +44,15 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF 'unsetenv WM_SCHEDULER'
# Change paraview version
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias foamPV 'setenv ParaView_VERSION \!*; source $WM_PROJECT_DIR/etc/apps/paraview3/cshrc; echo paraview-$ParaView_VERSION'
alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
# Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias src 'cd $FOAM_SRC'
alias lib 'cd $FOAM_LIB'
alias lib 'cd $FOAM_LIBBIN'
alias run 'cd $FOAM_RUN'
alias foam 'cd $WM_PROJECT_DIR'
alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT'

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -44,23 +44,20 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF='unset WM_SCHEDULER'
# Change paraview version
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
unset foamPV
foamPV()
{
export ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc ParaView_VERSION=$1
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)"
echo "dir: $ParaView_DIR"
[ -d "$ParaView_DIR" ] || echo "WARNING: directory does not exist"
}
# Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias src='cd $FOAM_SRC'
alias lib='cd $FOAM_LIB'
alias lib='cd $FOAM_LIBBIN'
alias run='cd $FOAM_RUN'
alias foam='cd $WM_PROJECT_DIR'
alias foamsrc='cd $FOAM_SRC/$WM_PROJECT'

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -50,17 +50,25 @@ do
done
# set VERSION and MAJOR (version) variables
if [ -z "$ParaView_VERSION" ]
then
ParaView_VERSION=3.8.0
ParaView_MAJOR=unknown
echo "Warning in app/paraview3/bashrc:" 1>&2
echo " ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2
fi
[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown
#- ParaView version, automatically determine major version
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=detect
# if needed, set MAJOR version to correspond to VERSION
# Evaluate command-line parameters for ParaView
while [ $# -gt 0 ]
do
case "$1" in
ParaView*=*)
# name=value -> export name=value
eval "export $1"
;;
esac
shift
done
# set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
case "$ParaView_VERSION" in
"$ParaView_MAJOR".* )
@ -82,7 +90,7 @@ if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
then
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_EXT_LIBBIN/paraview-$ParaView_MAJOR
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -48,17 +48,24 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
endif
end
# set VERSION and MAJOR (version) variables
if ( ! $?ParaView_VERSION )
then
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
echo "Warning in app/paraview3/cshrc:"
echo " ParaView_VERSION not set, using '$ParaView_VERSION'"
fi
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
#- ParaView version, automatically determine major version:
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR detect
# if needed, set MAJOR version to correspond to VERSION
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
switch ($argv[1])
case ParaView*=*:
# name=value -> setenv name value
eval "setenv $argv[1]:s/=/ /"
breaksw
endsw
shift
end
# set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
case "$ParaView_MAJOR".*:
@ -80,7 +87,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}"
setenv PV_PLUGIN_PATH $FOAM_EXT_LIBBIN/paraview-${ParaView_MAJOR}
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
# add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping

View File

@ -36,10 +36,5 @@
export SCOTCH_VERSION=scotch_5.1.11
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION
# mpi-qualified include directory
export SCOTCH_MPI_INCLUDE=$SCOTCH_ARCH_PATH/include/${FOAM_MPI_LIBBIN##*/}
# mpi-qualified lib directory
export SCOTCH_MPI_LIBBIN=$SCOTCH_ARCH_PATH/lib/${FOAM_MPI_LIBBIN##*/}
# -----------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -57,10 +57,6 @@ foamInstall=$HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
#- ParaView version, automatically determine major version:
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system
@ -134,6 +130,36 @@ _foamSource()
done
}
# Evaluate command-line parameters
_foamEval()
{
while [ $# -gt 0 ]
do
case "$1" in
*=)
# name= -> unset name
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}"
eval "unset ${1%=}"
;;
*=*)
# name=value -> export name=value
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1"
eval "export $1"
;;
*)
# filename: source it
if [ -f "$1" ]
then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"`
fi
;;
esac
shift
done
}
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
@ -141,29 +167,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify prefs files
export FOAM_SETTINGS="$@"
while [ $# -gt 0 ]
do
case "$1" in
*=)
# name= -> unset name
eval "unset ${1%=}"
;;
*=*)
# name=value -> export name=value
eval "export $1"
;;
*)
# filename: source it
if [ -f "$1" ]
then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"`
fi
;;
esac
shift
done
_foamEval $@
# Detect system type and set environment variables appropriately
@ -311,6 +315,6 @@ fi
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource
unset _foamSource _foamEval
# ----------------------------------------------------------------- end-of-file

View File

@ -149,7 +149,7 @@ pyr
(0 1)
(1 2)
(2 3)
(3 4)
(0 3)
(0 4)
(1 4)
(2 4)

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -56,10 +56,6 @@ set foamInstall = $HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts)
if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
#- ParaView version, automatically determine major version:
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
set foamCompiler=system
@ -256,9 +252,7 @@ if (! $?MANPATH) setenv MANPATH ''
#- Clean PATH (path)
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
if ( $status == 0 ) then
setenv PATH $cleaned
endif
if ( $status == 0 ) setenv PATH $cleaned
#- Clean LD_LIBRARY_PATH
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -44,9 +44,5 @@
## ~~~~~~~~~~~~~~~~~~~~~~
#setenv WM_MPLIB SYSTEMOPENMPI
# Specify ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~~
setenv ParaView_VERSION git # eg, cvs/git version
setenv ParaView_MAJOR 3.7
# ----------------------------------------------------------------- end-of-file

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -44,9 +44,5 @@ foamCompiler=system
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_MPLIB=SYSTEMOPENMPI
# Specify ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~~
export ParaView_VERSION=git # eg, cvs/git version
export ParaView_MAJOR=3.7
# ----------------------------------------------------------------- end-of-file

View File

@ -48,24 +48,24 @@ setenv WM_LINK_LANGUAGE c++
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base executables/libraries
setenv FOAM_APPBIN $WM_PROJECT_DIR/bin/$WM_OPTIONS
setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
setenv FOAM_APPBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
# external (ThirdParty) libraries
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
# user executables/libraries
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience
setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_LIB $WM_PROJECT_DIR/lib
#setenv FOAM_LIB $WM_PROJECT_DIR/lib
setenv FOAM_SRC $WM_PROJECT_DIR/src
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
setenv FOAM_UTILITIES $FOAM_APP/utilities
@ -90,8 +90,7 @@ unsetenv MPFR_ARCH_PATH
# Location of compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?foamCompiler ) then
then
foamCompiler=system
set foamCompiler=system
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " foamCompiler not set, using '$foamCompiler'"
endif
@ -253,13 +252,13 @@ unset boost_version cgal_version
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
unsetenv MPI_ARCH_PATH MPI_HOME
unsetenv MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
switch ("$WM_MPLIB")
case OPENMPI:
#set mpi_version=openmpi-1.4.1
set mpi_version=openmpi-1.5.1
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
#setenv FOAM_MPI openmpi-1.4.1
setenv FOAM_MPI openmpi-1.5.1
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
# Tell OpenMPI where to find its install directory
setenv OPAL_PREFIX $MPI_ARCH_PATH
@ -267,14 +266,11 @@ case OPENMPI:
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/man
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
breaksw
case SYSTEMOPENMPI:
# Use the system installed openmpi, get library directory via mpicc
set mpi_version=openmpi-system
setenv FOAM_MPI openmpi-system
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
setenv PINC "`mpicc --showme:compile`"
@ -289,25 +285,21 @@ case SYSTEMOPENMPI:
endif
_foamAddLib $libDir
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version libDir
unset libDir
breaksw
case MPICH:
set mpi_version=mpich2-1.1.1p1
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
setenv FOAM_MPI mpich2-1.1.1p1
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$FOAM_MPI
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/share/man
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
breaksw
case MPICH-GM:
setenv FOAM_MPI mpich-gm
setenv MPI_ARCH_PATH /opt/mpi
setenv MPICH_PATH $MPI_ARCH_PATH
setenv GM_LIB_PATH /opt/gm/lib64
@ -315,11 +307,10 @@ case MPICH-GM:
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpich-gm
breaksw
case HPMPI:
setenv FOAM_MPI hpmpi
setenv MPI_HOME /opt/hpmpi
setenv MPI_ARCH_PATH $MPI_HOME
@ -339,23 +330,22 @@ case HPMPI:
echo Unknown processor type `uname -m` for Linux
breaksw
endsw
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/hpmpi
breaksw
case GAMMA:
setenv FOAM_MPI gamma
setenv MPI_ARCH_PATH /usr
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/gamma
breaksw
case MPI:
setenv FOAM_MPI mpi
setenv MPI_ARCH_PATH /opt/mpi
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
breaksw
case FJMPI:
setenv FOAM_MPI fjmpi
setenv MPI_ARCH_PATH /opt/FJSVmpi2
setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
_foamAddLib /opt/FSUNf90/lib/sparcv9
@ -363,20 +353,25 @@ case FJMPI:
breaksw
case QSMPI:
setenv FOAM_MPI 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
breaksw
default:
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
setenv FOAM_MPI dummy
breaksw
endsw
_foamAddLib $FOAM_MPI_LIBBIN
# add (non-dummy) MPI implementation
# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
if ( "$FOAM_MPI" != dummy ) then
_foamAddLib ${FOAM_LIBBIN}/${FOAM_MPI}:${FOAM_EXT_LIBBIN}/${FOAM_MPI}
endif
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
@ -392,13 +387,6 @@ else
endif
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if ( -f $FOAM_EXT_LIBBIN/libhoard.so ) then
# setenv LD_PRELOAD $FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
#endif
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unalias _foamAddPath _foamAddLib _foamAddMan

View File

@ -71,24 +71,24 @@ export WM_LINK_LANGUAGE=c++
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
# base executables/libraries
export FOAM_APPBIN=$WM_PROJECT_DIR/bin/$WM_OPTIONS
export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
export FOAM_APPBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
# external (ThirdParty) libraries
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
# user executables/libraries
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience
export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_LIB=$WM_PROJECT_DIR/lib
#export FOAM_LIB=$WM_PROJECT_DIR/lib
export FOAM_SRC=$WM_PROJECT_DIR/src
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
export FOAM_UTILITIES=$FOAM_APP/utilities
@ -273,13 +273,13 @@ unset boost_version cgal_version
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
unset MPI_ARCH_PATH MPI_HOME
unset MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
case "$WM_MPLIB" in
OPENMPI)
#mpi_version=openmpi-1.4.1
mpi_version=openmpi-1.5.1
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
#export FOAM_MPI=openmpi-1.4.1
export FOAM_MPI=openmpi-1.5.1
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
# Tell OpenMPI where to find its install directory
export OPAL_PREFIX=$MPI_ARCH_PATH
@ -287,14 +287,11 @@ OPENMPI)
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/man
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
;;
SYSTEMOPENMPI)
# Use the system installed openmpi, get library directory via mpicc
mpi_version=openmpi-system
export FOAM_MPI=openmpi-system
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
export PINC="`mpicc --showme:compile`"
@ -310,25 +307,21 @@ SYSTEMOPENMPI)
fi
_foamAddLib $libDir
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version libDir
unset libDir
;;
MPICH)
mpi_version=mpich2-1.1.1p1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
export FOAM_MPI=mpich2-1.1.1p1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddMan $MPI_ARCH_PATH/share/man
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
unset mpi_version
;;
MPICH-GM)
export FOAM_MPI=mpich-gm
export MPI_ARCH_PATH=/opt/mpi
export MPICH_PATH=$MPI_ARCH_PATH
export GM_LIB_PATH=/opt/gm/lib64
@ -336,11 +329,10 @@ MPICH-GM)
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
_foamAddLib $GM_LIB_PATH
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpich-gm
;;
HPMPI)
export FOAM_MPI=hpmpi
export MPI_HOME=/opt/hpmpi
export MPI_ARCH_PATH=$MPI_HOME
@ -361,23 +353,21 @@ HPMPI)
echo Unknown processor type `uname -m` for Linux
;;
esac
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/hpmpi
;;
GAMMA)
export FOAM_MPI=gamma
export MPI_ARCH_PATH=/usr
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/gamma
;;
MPI)
export FOAM_MPI=mpi
export MPI_ARCH_PATH=/opt/mpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
;;
FJMPI)
export FOAM_MPI=fjmpi
export MPI_ARCH_PATH=/opt/FJSVmpi2
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
@ -386,20 +376,25 @@ FJMPI)
;;
QSMPI)
export FOAM_MPI=qsmpi
export MPI_ARCH_PATH=/usr/lib/mpi
export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/qsmpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
;;
*)
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/dummy
export FOAM_MPI=dummy
;;
esac
_foamAddLib $FOAM_MPI_LIBBIN
# add (non-dummy) MPI implementation
# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
if [ "$FOAM_MPI" != dummy ]
then
_foamAddLib $FOAM_LIBBIN/$FOAM_MPI:$FOAM_EXT_LIBBIN/$FOAM_MPI
fi
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
@ -413,14 +408,6 @@ fi
export MPI_BUFFER_SIZE
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if [ -f $FOAM_EXT_LIBBIN/libhoard.so ]
#then
# export LD_PRELOAD=$FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
#fi
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset _foamAddPath _foamAddLib _foamAddMan foamCompiler minBufferSize

View File

@ -1,5 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
echo "Error: Current directory is not \$WM_PROJECT_DIR/src"
@ -17,57 +18,57 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
set -x
# update OpenFOAM version strings if required
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/*/global.? 2>/dev/null
wmakeLnInclude OpenFOAM
wmakeLnInclude OSspecific/$WM_OSTYPE
Pstream/Allwmake
wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
Pstream/Allwmake $*
OSspecific/$WM_OSTYPE/Allwmake
wmake libso OpenFOAM
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake
wmake $makeOption OpenFOAM
wmake libso fileFormats
wmake libso triSurface
wmake libso meshTools
wmake libso edgeMesh
wmake libso surfMesh
wmake $makeOption fileFormats
wmake $makeOption triSurface
wmake $makeOption meshTools
wmake $makeOption edgeMesh
wmake $makeOption surfMesh
# Decomposition methods needed by dummyThirdParty
parallel/decompose/AllwmakeLnInclude
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
dummyThirdParty/Allwmake
dummyThirdParty/Allwmake $*
wmake libso lagrangian/basic
wmake libso finiteVolume
wmake libso genericPatchFields
wmake $makeOption lagrangian/basic
wmake $makeOption finiteVolume
wmake $makeOption genericPatchFields
# Build the proper scotchDecomp, metisDecomp etc.
parallel/Allwmake
parallel/Allwmake $*
wmake libso conversion
wmake $makeOption conversion
wmake libso sampling
wmake $makeOption sampling
wmake libso dynamicMesh
wmake libso dynamicFvMesh
wmake libso topoChangerFvMesh
wmake $makeOption dynamicMesh
wmake $makeOption dynamicFvMesh
wmake $makeOption topoChangerFvMesh
wmake libso ODE
wmake libso randomProcesses
wmake $makeOption ODE
wmake $makeOption randomProcesses
thermophysicalModels/Allwmake
transportModels/Allwmake
turbulenceModels/Allwmake
wmake libso surfaceFilmModels
lagrangian/Allwmake
postProcessing/Allwmake
mesh/Allwmake
thermophysicalModels/Allwmake $*
transportModels/Allwmake $*
turbulenceModels/Allwmake $*
wmake $makeOption surfaceFilmModels
lagrangian/Allwmake $*
postProcessing/Allwmake $*
mesh/Allwmake $*
wmake libso errorEstimation
wmake $makeOption errorEstimation
fvAgglomerationMethods/Allwmake
fvAgglomerationMethods/Allwmake $*
wmake libso fvMotionSolver
wmake libso engine
wmake $makeOption fvMotionSolver
wmake $makeOption engine
# ----------------------------------------------------------------- end-of-file

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,9 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "sigFpe.H"
#include "error.H"
#include "JobInfo.H"
#include "OSspecific.H"
#include "IOstreams.H"
@ -52,51 +51,42 @@ License
struct sigaction Foam::sigFpe::oldAction_;
#if defined(LINUX)
#ifdef LINUX
void *(*Foam::sigFpe::old_malloc_hook)(size_t, const void *) = NULL;
void *(*Foam::sigFpe::oldMallocHook_)(size_t, const void *) = NULL;
void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller)
void* Foam::sigFpe::nanMallocHook_(size_t size, const void *caller)
{
void *result;
// Restore all old hooks
__malloc_hook = old_malloc_hook;
__malloc_hook = oldMallocHook_;
// Call recursively
result = malloc (size);
result = malloc(size);
// initialize to signalling nan
// initialize to signalling NaN
# ifdef WM_SP
const uint32_t sNAN = 0x7ff7fffflu;
int nScalars = size / sizeof(scalar);
uint32_t* dPtr = reinterpret_cast<uint32_t*>(result);
for (int i = 0; i < nScalars; i++)
{
*dPtr++ = sNAN;
}
# else
const uint64_t sNAN = 0x7ff7ffffffffffffllu;
int nScalars = size/sizeof(scalar);
uint64_t* dPtr = reinterpret_cast<uint64_t*>(result);
for (int i = 0; i < nScalars; i++)
# endif
const size_t nScalars = size/sizeof(scalar);
for (size_t i = 0; i < nScalars; ++i)
{
*dPtr++ = sNAN;
}
# endif
// Restore our own hooks
__malloc_hook = my_malloc_hook;
__malloc_hook = nanMallocHook_;
return result;
}
@ -106,14 +96,14 @@ void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller)
#ifdef LINUX_GNUC
void Foam::sigFpe::sigFpeHandler(int)
void Foam::sigFpe::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGFPE, &oldAction_, NULL) < 0)
{
FatalErrorIn
(
"Foam::sigSegv::sigFpeHandler()"
"Foam::sigSegv::sigHandler()"
) << "Cannot reset SIGFPE trapping"
<< abort(FatalError);
}
@ -166,7 +156,7 @@ Foam::sigFpe::~sigFpe()
// Reset to standard malloc
if (oldAction_.sa_handler)
{
__malloc_hook = old_malloc_hook;
__malloc_hook = oldMallocHook_;
}
# endif
@ -189,13 +179,10 @@ void Foam::sigFpe::set(const bool verbose)
if (env("FOAM_SIGFPE"))
{
if (verbose)
{
Info<< "SigFpe : Enabling floating point exception trapping"
<< " (FOAM_SIGFPE)." << endl;
}
bool supported = false;
# ifdef LINUX_GNUC
supported = true;
feenableexcept
(
@ -205,7 +192,7 @@ void Foam::sigFpe::set(const bool verbose)
);
struct sigaction newAction;
newAction.sa_handler = sigFpeHandler;
newAction.sa_handler = sigHandler;
newAction.sa_flags = SA_NODEFER;
sigemptyset(&newAction.sa_mask);
if (sigaction(SIGFPE, &newAction, &oldAction_) < 0)
@ -219,6 +206,7 @@ void Foam::sigFpe::set(const bool verbose)
# elif defined(sgiN32) || defined(sgiN32Gcc)
supported = true;
sigfpe_[_DIVZERO].abort=1;
sigfpe_[_OVERFL].abort=1;
@ -240,23 +228,50 @@ void Foam::sigFpe::set(const bool verbose)
);
# endif
if (verbose)
{
if (supported)
{
Info<< "sigFpe : Enabling floating point exception trapping"
<< " (FOAM_SIGFPE)." << endl;
}
else
{
Info<< "sigFpe : Floating point exception trapping"
<< " - not supported on this platform" << endl;
}
}
}
if (env("FOAM_SETNAN"))
{
if (verbose)
{
Info<< "SetNaN : Initialising allocated memory to NaN"
<< " (FOAM_SETNAN)." << endl;
}
bool supported = false;
# ifdef LINUX_GNUC
supported = true;
// Set our malloc
__malloc_hook = Foam::sigFpe::my_malloc_hook;
__malloc_hook = Foam::sigFpe::nanMallocHook_;
# endif
if (verbose)
{
if (supported)
{
Info<< "SetNaN : Initialising allocated memory to NaN"
<< " (FOAM_SETNAN)." << endl;
}
else
{
Info<< "SetNaN : Initialise allocated memory to NaN"
<< " - not supported on this platform" << endl;
}
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,6 @@ SourceFiles
#ifndef sigFpe_H
#define sigFpe_H
#include "OSspecific.H"
#include <signal.h>
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
@ -73,10 +72,10 @@ class sigFpe
# ifdef LINUX
//- Saved old malloc
static void *(*old_malloc_hook)(size_t, const void *);
static void *(*oldMallocHook_)(size_t, const void *);
//- nan malloc function. From malloc_hook manpage.
static void* my_malloc_hook(size_t size, const void *caller);
//- NaN malloc function. From malloc_hook manpage.
static void* nanMallocHook_(size_t size, const void *caller);
# endif
@ -86,7 +85,7 @@ class sigFpe
# ifdef LINUX_GNUC
//- Handler for caught signals
static void sigFpeHandler(int);
static void sigHandler(int);
# endif
@ -96,6 +95,7 @@ public:
// Constructors
//- Construct null
sigFpe();
@ -105,6 +105,8 @@ public:
// Member functions
//- Activate SIGFPE signal handler when FOAM_SIGFPE is %set
// Fill memory with NaN when FOAM_SETNAN is %set
void set(const bool verbose);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,8 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "sigInt.H"
#include "error.H"
#include "JobInfo.H"
#include "IOstreams.H"
@ -32,16 +32,17 @@ License
struct sigaction Foam::sigInt::oldAction_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::sigInt::sigIntHandler(int)
void Foam::sigInt::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGINT, &oldAction_, NULL) < 0)
{
FatalErrorIn
(
"Foam::sigInt::sigIntHandler()"
"Foam::sigInt::sigHandler()"
) << "Cannot reset SIGINT trapping"
<< abort(FatalError);
}
@ -80,7 +81,7 @@ Foam::sigInt::~sigInt()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::sigInt::set(const bool verbose)
void Foam::sigInt::set(const bool)
{
if (oldAction_.sa_handler)
{
@ -92,7 +93,7 @@ void Foam::sigInt::set(const bool verbose)
}
struct sigaction newAction;
newAction.sa_handler = sigIntHandler;
newAction.sa_handler = sigHandler;
newAction.sa_flags = SA_NODEFER;
sigemptyset(&newAction.sa_mask);
if (sigaction(SIGINT, &newAction, &oldAction_) < 0)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,9 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#ifndef sigInt_H
#define sigInt_H
#include <signal.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,13 +62,14 @@ class sigInt
// Private Member Functions
static void sigIntHandler(int);
static void sigHandler(int);
public:
// Constructors
//- Construct null
sigInt();
@ -76,6 +79,7 @@ public:
// Member functions
//- Activate SIGINT signal handler
void set(const bool verbose);
};
@ -84,4 +88,8 @@ public:
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,8 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "sigQuit.H"
#include "error.H"
#include "JobInfo.H"
#include "IOstreams.H"
@ -32,16 +32,17 @@ License
struct sigaction Foam::sigQuit::oldAction_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::sigQuit::sigQuitHandler(int)
void Foam::sigQuit::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGQUIT, &oldAction_, NULL) < 0)
{
FatalErrorIn
(
"Foam::sigQuit::sigQuitHandler()"
"Foam::sigQuit::sigHandler()"
) << "Cannot reset SIGQUIT trapping"
<< abort(FatalError);
}
@ -94,7 +95,7 @@ void Foam::sigQuit::set(const bool verbose)
}
struct sigaction newAction;
newAction.sa_handler = sigQuitHandler;
newAction.sa_handler = sigHandler;
newAction.sa_flags = SA_NODEFER;
sigemptyset(&newAction.sa_mask);
if (sigaction(SIGQUIT, &newAction, &oldAction_) < 0)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,9 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#ifndef sigQuit_H
#define sigQuit_H
#include <signal.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,13 +62,15 @@ class sigQuit
// Private Member Functions
static void sigQuitHandler(int);
//- Handler for caught signals
static void sigHandler(int);
public:
// Constructors
//- Construct null
sigQuit();
@ -76,6 +80,7 @@ public:
// Member functions
//- Activate SIGQUIT signal handler
void set(const bool verbose);
};
@ -84,4 +89,8 @@ public:
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,8 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "sigSegv.H"
#include "error.H"
#include "JobInfo.H"
#include "IOstreams.H"
@ -32,16 +32,17 @@ License
struct sigaction Foam::sigSegv::oldAction_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::sigSegv::sigSegvHandler(int)
void Foam::sigSegv::sigHandler(int)
{
// Reset old handling
if (sigaction(SIGSEGV, &oldAction_, NULL) < 0)
{
FatalErrorIn
(
"Foam::sigSegv::sigSegvHandler()"
"Foam::sigSegv::sigHandler()"
) << "Cannot reset SIGSEGV trapping"
<< abort(FatalError);
}
@ -82,7 +83,7 @@ Foam::sigSegv::~sigSegv()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::sigSegv::set(const bool verbose)
void Foam::sigSegv::set(const bool)
{
if (oldAction_.sa_handler)
{
@ -94,7 +95,7 @@ void Foam::sigSegv::set(const bool verbose)
}
struct sigaction newAction;
newAction.sa_handler = sigSegvHandler;
newAction.sa_handler = sigHandler;
newAction.sa_flags = SA_NODEFER;
sigemptyset(&newAction.sa_mask);
if (sigaction(SIGSEGV, &newAction, &oldAction_) < 0)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,9 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#ifndef sigSegv_H
#define sigSegv_H
#include <signal.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,13 +62,15 @@ class sigSegv
// Private Member Functions
static void sigSegvHandler(int);
//- Handler for caught signals
static void sigHandler(int);
public:
// Constructors
//- Construct null
sigSegv();
@ -76,6 +80,7 @@ public:
// Member functions
//- Activate SIGSEGV signal handler
void set(const bool verbose);
};
@ -84,4 +89,8 @@ public:
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -9,6 +9,7 @@ $(bools)/bool/bool.C
$(bools)/bool/boolIO.C
$(bools)/Switch/Switch.C
$(bools)/Switch/SwitchIO.C
$(bools)/lists/boolList.C
chars = primitives/chars
$(chars)/char/charIO.C
@ -22,10 +23,16 @@ $(ints)/longLong/longLongIO.C
$(ints)/ulong/ulongIO.C
$(ints)/label/label.C
$(ints)/uLabel/uLabel.C
$(ints)/lists/labelIOList.C
$(ints)/lists/labelListIOList.C
primitives/Scalar/doubleScalar/doubleScalar.C
primitives/Scalar/floatScalar/floatScalar.C
primitives/Scalar/scalar/scalar.C
primitives/Scalar/lists/scalarList.C
primitives/Scalar/lists/scalarIOList.C
primitives/Scalar/lists/scalarListIOList.C
primitives/DiagTensor/diagTensor/diagTensor.C
primitives/SphericalTensor/sphericalTensor/sphericalTensor.C
primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C
@ -33,18 +40,33 @@ primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C
primitives/SymmTensor/symmTensor/symmTensor.C
primitives/Tensor/labelTensor/labelTensor.C
primitives/Tensor/tensor/tensor.C
primitives/Tensor/lists/sphericalTensorList.C
primitives/Tensor/lists/symmTensorList.C
primitives/Tensor/lists/tensorList.C
primitives/Vector/complexVector/complexVector.C
primitives/Vector/labelVector/labelVector.C
primitives/Vector/vector/vector.C
primitives/Vector/lists/vectorList.C
primitives/Vector/lists/vectorIOList.C
primitives/Vector/lists/vectorListIOList.C
primitives/Tensor2D/tensor2D/tensor2D.C
primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
primitives/Vector2D/vector2D/vector2D.C
primitives/complex/complex.C
primitives/globalIndexAndTransform/globalIndexAndTransform.C
primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C
primitives/quaternion/quaternion.C
primitives/septernion/septernion.C
/* functions, data entries */
primitives/functions/DataEntry/makeDataEntries.C
primitives/functions/DataEntry/polynomial/polynomial.C
primitives/functions/DataEntry/polynomial/polynomialIO.C
strings = primitives/strings
$(strings)/string/string.C
$(strings)/string/stringIO.C
@ -54,6 +76,7 @@ $(strings)/fileName/fileName.C
$(strings)/fileName/fileNameIO.C
$(strings)/keyType/keyType.C
$(strings)/wordRe/wordRe.C
$(strings)/lists/hashedWordList.C
primitives/hashes/Hasher/Hasher.C
@ -80,21 +103,6 @@ containers/Lists/ListOps/ListOps.C
containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
containers/LinkedLists/linkTypes/DLListBase/DLListBase.C
primitiveLists = primitives/Lists
$(primitiveLists)/boolList.C
$(primitiveLists)/labelIOList.C
$(primitiveLists)/labelListIOList.C
$(primitiveLists)/scalarList.C
$(primitiveLists)/scalarIOList.C
$(primitiveLists)/scalarListIOList.C
$(primitiveLists)/vectorList.C
$(primitiveLists)/vectorIOList.C
$(primitiveLists)/vectorListIOList.C
$(primitiveLists)/sphericalTensorList.C
$(primitiveLists)/symmTensorList.C
$(primitiveLists)/tensorList.C
$(primitiveLists)/hashedWordList.C
Streams = db/IOstreams
$(Streams)/token/tokenIO.C

View File

@ -0,0 +1,675 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2011 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Distribution.H"
#include "OFstream.H"
#include "ListOps.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Distribution<Type>::Distribution()
:
List< List<scalar> >(pTraits<Type>::nComponents),
binWidth_(pTraits<Type>::one),
listStarts_(pTraits<Type>::nComponents, 0)
{}
template<class Type>
Foam::Distribution<Type>::Distribution(const Type& binWidth)
:
List< List<scalar> >(pTraits<Type>::nComponents),
binWidth_(binWidth),
listStarts_(pTraits<Type>::nComponents, 0)
{}
template<class Type>
Foam::Distribution<Type>::Distribution(const Distribution<Type>& d)
:
List< List<scalar> >(static_cast< const List< List<scalar> >& >(d)),
binWidth_(d.binWidth()),
listStarts_(d.listStarts())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::Distribution<Type>::~Distribution()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
Foam::scalar Foam::Distribution<Type>::totalWeight(direction cmpt) const
{
const List<scalar>& cmptDistribution = (*this)[cmpt];
scalar sumOfWeights = 0.0;
forAll(cmptDistribution, i)
{
sumOfWeights += cmptDistribution[i];
}
return sumOfWeights;
}
template<class Type>
Foam::List<Foam::label> Foam::Distribution<Type>::keys(direction cmpt) const
{
List<label> keys = identity((*this)[cmpt].size());
forAll(keys, k)
{
keys[k] += listStarts_[cmpt];
}
return keys;
}
template<class Type>
Foam::label Foam::Distribution<Type>::index
(
direction cmpt,
label n
)
{
List<scalar>& cmptDistribution = (*this)[cmpt];
if (cmptDistribution.empty())
{
// Initialise this list with this value
cmptDistribution.setSize(2, 0.0);
listStarts_[cmpt] = n;
return 0;
}
label listIndex = -1;
label& listStart = listStarts_[cmpt];
label testIndex = n - listStart;
if (testIndex < 0)
{
// Underflow of this List, storage increase and remapping
// required
List<scalar> newCmptDistribution(2*cmptDistribution.size(), 0.0);
label sOld = cmptDistribution.size();
forAll(cmptDistribution, i)
{
newCmptDistribution[i + sOld] = cmptDistribution[i];
}
cmptDistribution = newCmptDistribution;
listStart -= sOld;
// Recursively call this function in case another remap is required.
listIndex = index(cmpt, n);
}
else if (testIndex > cmptDistribution.size() - 1)
{
// Overflow of this List, storage increase required
cmptDistribution.setSize(2*cmptDistribution.size(), 0.0);
// Recursively call this function in case another storage
// alteration is required.
listIndex = index(cmpt, n);
}
else
{
listIndex = n - listStart;
}
return listIndex;
}
template<class Type>
Foam::Pair<Foam::label> Foam::Distribution<Type>::validLimits
(
direction cmpt
) const
{
const List<scalar>& cmptDistribution = (*this)[cmpt];
// limits.first(): lower bound, i.e. the first non-zero entry
// limits.second(): upper bound, i.e. the last non-zero entry
Pair<label> limits(-1, -1);
forAll(cmptDistribution, i)
{
if (cmptDistribution[i] > 0.0)
{
if (limits.first() == -1)
{
limits.first() = i;
limits.second() = i;
}
else
{
limits.second() = i;
}
}
}
return limits;
}
template<class Type>
Type Foam::Distribution<Type>::mean() const
{
Type meanValue(pTraits<Type>::zero);
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List<scalar>& cmptDistribution = (*this)[cmpt];
scalar totalCmptWeight = totalWeight(cmpt);
List<label> theKeys = keys(cmpt);
forAll(theKeys, k)
{
label key = theKeys[k];
setComponent(meanValue, cmpt) +=
(0.5 + scalar(key))
*component(binWidth_, cmpt)
*cmptDistribution[k]
/totalCmptWeight;
}
}
return meanValue;
}
template<class Type>
Type Foam::Distribution<Type>::median() const
{
Type medianValue(pTraits<Type>::zero);
List< List < Pair<scalar> > > normDistribution = normalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
List< Pair<scalar> >& normDist = normDistribution[cmpt];
if (normDist.size())
{
if (normDist.size() == 1)
{
setComponent(medianValue, cmpt) = normDist[0].first();
}
else if
(
normDist.size() > 1
&& normDist[0].second()*component(binWidth_, cmpt) > 0.5
)
{
scalar xk =
normDist[0].first()
+ 0.5*component(binWidth_, cmpt);
scalar xkm1 =
normDist[0].first()
- 0.5*component(binWidth_, cmpt);
scalar Sk = (normDist[0].second())*component(binWidth_, cmpt);
setComponent(medianValue, cmpt) = 0.5*(xk - xkm1)/(Sk) + xkm1;
}
else
{
label previousNonZeroIndex = 0;
scalar cumulative = 0.0;
forAll(normDist, nD)
{
if
(
cumulative
+ (normDist[nD].second()*component(binWidth_, cmpt))
> 0.5
)
{
scalar xk =
normDist[nD].first()
+ 0.5*component(binWidth_, cmpt);
scalar xkm1 =
normDist[previousNonZeroIndex].first()
+ 0.5*component(binWidth_, cmpt);
scalar Sk =
cumulative
+ (normDist[nD].second()*component(binWidth_, cmpt));
scalar Skm1 = cumulative;
setComponent(medianValue, cmpt) =
(0.5 - Skm1)*(xk - xkm1)/(Sk - Skm1) + xkm1;
break;
}
else if (mag(normDist[nD].second()) > VSMALL)
{
cumulative +=
normDist[nD].second()*component(binWidth_, cmpt);
previousNonZeroIndex = nD;
}
}
}
}
}
return medianValue;
}
template<class Type>
void Foam::Distribution<Type>::add
(
const Type& valueToAdd,
const Type& weight
)
{
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
List<scalar>& cmptDistribution = (*this)[cmpt];
label n =
label(component(valueToAdd, cmpt)/component(binWidth_, cmpt))
- label(neg(component(valueToAdd, cmpt)/component(binWidth_, cmpt)));
label listIndex = index(cmpt, n);
cmptDistribution[listIndex] += component(weight, cmpt);
}
}
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Distribution<Type>::normalised() const
{
List< List < Pair<scalar> > > normDistribution(pTraits<Type>::nComponents);
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List<scalar>& cmptDistribution = (*this)[cmpt];
if (cmptDistribution.empty())
{
continue;
}
scalar totalCmptWeight = totalWeight(cmpt);
List<label> cmptKeys = keys(cmpt);
List< Pair<scalar> >& normDist = normDistribution[cmpt];
Pair<label> limits = validLimits(cmpt);
normDist.setSize(limits.second() - limits.first() + 1);
for
(
label k = limits.first(), i = 0;
k <= limits.second();
k++, i++
)
{
label key = cmptKeys[k];
normDist[i].first() =
(0.5 + scalar(key))*component(binWidth_, cmpt);
normDist[i].second() =
cmptDistribution[k]
/totalCmptWeight
/component(binWidth_, cmpt);
}
}
return normDistribution;
}
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Distribution<Type>::raw() const
{
List< List < Pair<scalar> > > rawDistribution(pTraits<Type>::nComponents);
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List<scalar>& cmptDistribution = (*this)[cmpt];
if (cmptDistribution.empty())
{
continue;
}
List<label> cmptKeys = keys(cmpt);
List< Pair<scalar> >& rawDist = rawDistribution[cmpt];
Pair<label> limits = validLimits(cmpt);
rawDist.setSize(limits.second() - limits.first() + 1);
for
(
label k = limits.first(), i = 0;
k <= limits.second();
k++, i++
)
{
label key = cmptKeys[k];
rawDist[i].first() = (0.5 + scalar(key))*component(binWidth_, cmpt);
rawDist[i].second() = cmptDistribution[k];
}
}
return rawDistribution;
}
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Distribution<Type>::cumulativeNormalised() const
{
List< List< Pair<scalar> > > normalisedDistribution = normalised();
List< List < Pair<scalar> > > cumulativeNormalisedDistribution =
normalisedDistribution;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& normalisedCmpt =
normalisedDistribution[cmpt];
List< Pair<scalar> >& cumNormalisedCmpt =
cumulativeNormalisedDistribution[cmpt];
scalar sum = 0.0;
forAll(normalisedCmpt, i)
{
cumNormalisedCmpt[i].first() =
normalisedCmpt[i].first()
+ 0.5*component(binWidth_, cmpt);
cumNormalisedCmpt[i].second() =
normalisedCmpt[i].second()*component(binWidth_, cmpt) + sum;
sum = cumNormalisedCmpt[i].second();
}
}
return cumulativeNormalisedDistribution;
}
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Distribution<Type>::cumulativeRaw() const
{
List< List< Pair<scalar> > > rawDistribution = raw();
List< List < Pair<scalar> > > cumulativeRawDistribution = rawDistribution;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawCmpt = rawDistribution[cmpt];
List< Pair<scalar> >& cumRawCmpt = cumulativeRawDistribution[cmpt];
scalar sum = 0.0;
forAll(rawCmpt, i)
{
cumRawCmpt[i].first() =
rawCmpt[i].first()
+ 0.5*component(binWidth_, cmpt);
cumRawCmpt[i].second() = rawCmpt[i].second() + sum;
sum = cumRawCmpt[i].second();
}
}
return cumulativeRawDistribution;
}
template<class Type>
void Foam::Distribution<Type>::clear()
{
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
(*this)[cmpt].clear();
listStarts_[cmpt] = 0;
}
}
template<class Type>
void Foam::Distribution<Type>::write(const fileName& filePrefix) const
{
List< List< Pair<scalar> > > rawDistribution = raw();
List< List < Pair<scalar> > > normDistribution = normalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawPairs = rawDistribution[cmpt];
const List< Pair<scalar> >& normPairs = normDistribution[cmpt];
OFstream os(filePrefix + '_' + pTraits<Type>::componentNames[cmpt]);
os << "# key normalised raw" << endl;
forAll(normPairs, i)
{
os << normPairs[i].first()
<< ' ' << normPairs[i].second()
<< ' ' << rawPairs[i].second()
<< nl;
}
}
List< List< Pair<scalar> > > rawCumDist = cumulativeRaw();
List< List < Pair<scalar> > > normCumDist = cumulativeNormalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawPairs = rawCumDist[cmpt];
const List< Pair<scalar> >& normPairs = normCumDist[cmpt];
OFstream os
(
filePrefix + "_cumulative_" + pTraits<Type>::componentNames[cmpt]
);
os << "# key normalised raw" << endl;
forAll(normPairs, i)
{
os << normPairs[i].first()
<< ' ' << normPairs[i].second()
<< ' ' << rawPairs[i].second()
<< nl;
}
}
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class Type>
void Foam::Distribution<Type>::operator=
(
const Distribution<Type>& rhs
)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"Foam::Distribution<Type>::operator="
"(const Foam::Distribution<Type>&)"
) << "Attempted assignment to self"
<< abort(FatalError);
}
List< List<scalar> >::operator=(rhs);
binWidth_ = rhs.binWidth();
listStarts_ = rhs.listStarts();
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
template <class Type>
Foam::Istream& Foam::operator>>
(
Istream& is,
Distribution<Type>& d
)
{
is >> static_cast<List< List<scalar> >&>(d)
>> d.binWidth_
>> d.listStarts_;
// Check state of Istream
is.check("Istream& operator>>(Istream&, Distribution<Type>&)");
return is;
}
template<class Type>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const Distribution<Type>& d
)
{
os << static_cast<const List< List<scalar> >& >(d)
<< d.binWidth_ << token::SPACE
<< d.listStarts_;
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, " "const Distribution&)");
return os;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template <class Type>
Foam::Distribution<Type> Foam::operator+
(
const Distribution<Type>& d1,
const Distribution<Type>& d2
)
{
// The coarsest binWidth is the sensible choice
Distribution<Type> d(max(d1.binWidth(), d2.binWidth()));
List< List< List < Pair<scalar> > > > rawDists(2);
rawDists[0] = d1.raw();
rawDists[1] = d2.raw();
forAll(rawDists, rDI)
{
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
List<scalar>& cmptDistribution = d[cmpt];
const List < Pair<scalar> >& cmptRaw = rawDists[rDI][cmpt];
forAll(cmptRaw, rI)
{
scalar valueToAdd = cmptRaw[rI].first();
scalar cmptWeight = cmptRaw[rI].second();
label n =
label
(
component(valueToAdd, cmpt)
/component(d.binWidth(), cmpt)
)
- label
(
neg(component(valueToAdd, cmpt)
/component(d.binWidth(), cmpt))
);
label listIndex = d.index(cmpt, n);
cmptDistribution[listIndex] += cmptWeight;
}
}
}
return Distribution<Type>(d);
}
// ************************************************************************* //

View File

@ -0,0 +1,207 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2011 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::Distribution
Description
Accumulating histogram of component values.
Specified bin resolution, automatic generation of bins.
SourceFiles
DistributionI.H
Distribution.C
DistributionIO.C
\*---------------------------------------------------------------------------*/
#ifndef Distribution_H
#define Distribution_H
#include "List.H"
#include "Pair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
class Distribution;
template<class Type>
Istream& operator>>(Istream&, Distribution<Type>&);
template<class Type>
Ostream& operator<<(Ostream&, const Distribution<Type>&);
/*---------------------------------------------------------------------------*\
Class Distribution Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class Distribution
:
public List< List<scalar> >
{
// Private data
//- Width of the bin for each component
Type binWidth_;
//- The start bin index of each component
List<label> listStarts_;
public:
//- Component type
typedef typename pTraits<Type>::cmptType cmptType;
// Constructors
//- Construct null
Distribution();
//- Construct from separate binWidth for each component
Distribution(const Type& binWidth);
//- Construct as copy
Distribution(const Distribution& d);
//- Destructor
~Distribution();
// Member Functions
//- Sum the total weight added to the component in the
// argument
scalar totalWeight(direction cmpt) const;
List<label> keys(direction cmpt) const;
//- Return the appropriate List index for the given bin index.
// Resizes the List if required
label index(direction cmpt, label n);
//- Returns the indices of the first and last non-zero entries
Pair<label> validLimits(direction cmpt) const;
Type mean() const;
// From http://mathworld.wolfram.com/StatisticalMedian.html
// The statistical median is the value of the Distribution
// variable where the cumulative Distribution = 0.5.
Type median() const;
//- Add a value to the distribution, optionally specifying a weight
void add
(
const Type& valueToAdd,
const Type& weight = pTraits<Type>::one
);
//- Return the normalised distribution (probability density)
// and bins
List< List<Pair<scalar> > > normalised() const;
//- Return the distribution of the total bin weights
List< List < Pair<scalar> > > raw() const;
//- Return the cumulative normalised distribution and
// integration locations (at end of bins)
List< List<Pair<scalar> > > cumulativeNormalised() const;
//- Return the cumulative total bin weights and integration
// locations (at end of bins)
List< List<Pair<scalar> > > cumulativeRaw() const;
//- Resets the Distribution by clearing the stored lists.
// Leaves the same number of them and the same binWidth.
void clear();
// Access
//- Return the bin width
inline const Type& binWidth() const;
//- Return the List start bin indices
inline const List<label>& listStarts() const;
// Write
//- Write the distribution to file: key normalised raw.
// Produces a separate file for each component.
void write(const fileName& filePrefix) const;
// Member Operators
void operator=(const Distribution<Type>&);
// IOstream Operators
friend Istream& operator>> <Type>
(
Istream&,
Distribution<Type>&
);
friend Ostream& operator<< <Type>
(
Ostream&,
const Distribution<Type>&
);
};
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Type>
Distribution<Type> operator+
(
const Distribution<Type>&,
const Distribution<Type>&
);
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "DistributionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "Distribution.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,21 +23,24 @@ License
\*---------------------------------------------------------------------------*/
#include "dxSurfaceWriter.H"
#include "surfaceWriters.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
namespace Foam
template<class Type>
inline const Type& Foam::Distribution<Type>::binWidth() const
{
return binWidth_;
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeSurfaceWriters(dxSurfaceWriter);
template<class Type>
inline const
Foam::List<Foam::label>& Foam::Distribution<Type>::listStarts() const
{
return listStarts_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "Time.H"
#include "PstreamReduceOps.H"
#include "Pstream.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -260,7 +260,12 @@ Foam::SHA1Digest Foam::dictionary::digest() const
}
bool Foam::dictionary::found(const word& keyword, bool recursive) const
bool Foam::dictionary::found
(
const word& keyword,
bool recursive,
bool patternMatch
) const
{
if (hashedEntries_.found(keyword))
{
@ -268,7 +273,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
}
else
{
if (patternEntries_.size())
if (patternMatch && patternEntries_.size())
{
DLList<entry*>::const_iterator wcLink =
patternEntries_.begin();
@ -276,7 +281,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
patternRegexps_.begin();
// Find in patterns using regular expressions only
if (findInPatterns(true, keyword, wcLink, reLink))
if (findInPatterns(patternMatch, keyword, wcLink, reLink))
{
return true;
}
@ -284,7 +289,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
if (recursive && &parent_ != &dictionary::null)
{
return parent_.found(keyword, recursive);
return parent_.found(keyword, recursive, patternMatch);
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -264,7 +264,13 @@ public:
//- Search dictionary for given keyword
// If recursive, search parent dictionaries
bool found(const word&, bool recursive=false) const;
// If patternMatch, use regular expressions
bool found
(
const word&,
bool recursive=false,
bool patternMatch = true
) const;
//- Find and return an entry data stream pointer if present
// otherwise return NULL.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,10 +58,10 @@ Foam::argList::initValidTables::initValidTables()
validParOptions.set("parallel", "");
argList::addOption
(
"roots", "(dir1 .. dirn)",
"roots", "(dir1 .. dirN)",
"slave root directories for distributed running"
);
validParOptions.set("roots", "(dir1 .. dirn)");
validParOptions.set("roots", "(dir1 .. dirN)");
Pstream::addValidParOptions(validParOptions);
}
@ -138,8 +138,8 @@ void Foam::argList::noBanner()
void Foam::argList::noParallel()
{
optionUsage.erase("parallel");
validOptions.erase("parallel");
removeOption("parallel");
removeOption("roots");
validParOptions.clear();
}
@ -507,13 +507,23 @@ Foam::argList::argList
jobInfo.add("startTime", timeString);
jobInfo.add("userName", userName());
jobInfo.add("foamVersion", word(FOAMversion));
jobInfo.add("foamBuild", Foam::FOAMbuild);
jobInfo.add("code", executable_);
jobInfo.add("argList", argListString);
jobInfo.add("currentDir", cwd());
jobInfo.add("PPID", ppid());
jobInfo.add("PGID", pgid());
// add build information - only use the first word
{
std::string build(Foam::FOAMbuild);
std::string::size_type found = build.find(' ');
if (found != std::string::npos)
{
build.resize(found);
}
jobInfo.add("foamBuild", build);
}
// Case is a single processor run unless it is running parallel
int nProcs = 1;
@ -537,10 +547,10 @@ Foam::argList::argList
if (options_.found("roots"))
{
source = "'-roots' option";
IStringStream str(options_["roots"]);
str >> roots;
dictNProcs = roots.size()+1;
source = "roots-command-line";
}
else
{
@ -593,7 +603,7 @@ Foam::argList::argList
{
forAll(roots, i)
{
roots[i] = roots[i].expand();
roots[i].expand();
}
if (roots.size() != Pstream::nProcs()-1)
@ -883,9 +893,10 @@ void Foam::argList::printUsage() const
printNotes();
Info<< nl
<<"Using OpenFOAM-" << Foam::FOAMversion
<<" (build: " << Foam::FOAMbuild << ") - see www.OpenFOAM.com"
<< nl << endl;
<<"Using: OpenFOAM-" << Foam::FOAMversion
<< " (see www.OpenFOAM.com)" << nl
<<"Build: " << Foam::FOAMbuild << nl
<< endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,7 +59,7 @@ Description
Note
- The document browser used is defined by the @b FOAM_DOC_BROWSER
environment variable or the <tt>Documentation/docBrowser</tt> entry
in the <tt>~OpenFOAM/controlDict</tt> file.
in the <tt>~OpenFOAM/controlDict</tt> file.
The \%f token is used as a placeholder for the file name.
- The valid (mandatory) arguments can be adjusted
by directly manipulating the argList::validArgs static member.
@ -83,6 +83,7 @@ SourceFiles
#include "fileName.H"
#include "parRun.H"
#include "IStringStream.H"
#include "OSspecific.H"
#include "sigFpe.H"
#include "sigInt.H"
@ -94,7 +95,9 @@ SourceFiles
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
/*---------------------------------------------------------------------------*\
Class argList Declaration
\*---------------------------------------------------------------------------*/
class argList
{
@ -165,7 +168,7 @@ public:
//- Max screen width for displaying usage (default: 80)
static string::size_type usageMax;
//! @cond ignoreDocumentation
//! @cond internalClass
class initValidTables
{
public:

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