diff --git a/COPYING b/COPYING index 7e02780f0b5e88e02abfb88633829987f065d70d..2101277c180537b6546e0149f606b1b2a369fee6 100644 --- a/COPYING +++ b/COPYING @@ -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 diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index fa6c09664bde20fc97104312985669caeeec1d22..227041536f1268daf4b3ab5b1356ea9d9fe131d0 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -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 diff --git a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H index e9f0272772d0c5d2a3419ca7ef30c147f6b75d73..71ee8d60f6da68c17e17e9c7dfee69044eaf696a 100644 --- a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H +++ b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H @@ -23,7 +23,7 @@ fvMesh mesh fvMesh::defaultRegion, runTime.timeName(), runTime, - IOobject::NO_READ + IOobject::MUST_READ ), xferMove<Field<vector> >(points), faces.xfer(), diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options index 9a4524781991ee2dda50e905632a3fc35a8be60a..c4d65fa137e5afa137669220ffae425c4d126430 100644 --- a/applications/solvers/combustion/dieselEngineFoam/Make/options +++ b/applications/solvers/combustion/dieselEngineFoam/Make/options @@ -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 diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options index 3b1786aa08b6821b38799bebcace1e7560c5eb31..124371575d752b3051af50923a0bde4f20fc3609 100644 --- a/applications/solvers/combustion/dieselFoam/Make/options +++ b/applications/solvers/combustion/dieselFoam/Make/options @@ -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 diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index cba08b26296a50f4a77829b18606bdee63089796..045e37a344ae3f45dcc991ccb430c3144287ba0b 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -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 diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options index 7058e8a503e189caeb52b4c1547a92252f196da6..96c99816d0fc80bff0e7e70ab5f9c86c02c6fd32 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options @@ -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 \ diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options index 329dffc84d696ed65864b4bcb1290ce2f953864e..a2e3c13d24096faafeff43dc7069c955e52789e5 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -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 diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/Make/options b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/Make/options index 3c4206dc24a7aa2bad9124f943e263402bf7821d..34ba95f0dcdf93d49a8bd8c2536fc1d18c9470b2 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/Make/options +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/Make/options @@ -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 \ diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options index 1ad3529232921e8444f9693a30f68b9caf62fcd6..5e7b8b351892e7c2aa2049d5db22768f27c11318 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options @@ -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 \ diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options index 7596b87bbd9a20ca831a782dd395fc3ee584f340..e679c15b7e6f6458bb4f8a94c0dedb58dd9f293c 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options @@ -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 diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options index 34867be0b413990e852ce02b38ca117e30d6973c..ba7c9544a84706195ba131dbd07e89e552e4f7fc 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options @@ -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 diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index 2dbb2590f78aa5ebdbb10fd65f71d023520e7d75..062f9fbd28a4abd642f445ee8d6f60ed86cf316b 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -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 diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/Make/options b/applications/solvers/lagrangian/steadyReactingParcelFoam/Make/options index 7596b87bbd9a20ca831a782dd395fc3ee584f340..e679c15b7e6f6458bb4f8a94c0dedb58dd9f293c 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/Make/options @@ -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 diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 35a21df21a69c9bc500c75cf686a11e29da03815..5d6abe8613131d513af2d0ef4ae6057e01b14294 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -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 \ diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index bcf535873c1cf939735ad08cd53a4540286ce0e5..593b3503e1870d42254582069f7b853ba46a81bf 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -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) { diff --git a/applications/test/Distribution/Make/files b/applications/test/Distribution/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..3b3486c124c8cd563d5a933ab9cf578ee086a6b5 --- /dev/null +++ b/applications/test/Distribution/Make/files @@ -0,0 +1,3 @@ +Test-Distribution.C + +EXE = $(FOAM_USER_APPBIN)/Test-DistributionTest diff --git a/applications/test/Distribution/Make/options b/applications/test/Distribution/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..18e6fe47afacb902cddccf82632772447704fd88 --- /dev/null +++ b/applications/test/Distribution/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/test/Distribution/Test-Distribution.C b/applications/test/Distribution/Test-Distribution.C new file mode 100644 index 0000000000000000000000000000000000000000..8f84237019f14f759d44168676371364439e53ed --- /dev/null +++ b/applications/test/Distribution/Test-Distribution.C @@ -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; +} + + +// ************************************************************************* // diff --git a/applications/test/HashTable2/Make/files b/applications/test/HashTable2/Make/files index 2bf9c9217ddbe19c32ec49588df1d17a2f30a16c..e5bc377b8b522479d953663e513da442d2d506bc 100644 --- a/applications/test/HashTable2/Make/files +++ b/applications/test/HashTable2/Make/files @@ -1,3 +1,3 @@ -hashTableTest2.C +Test-HashTable2.C -EXE = $(FOAM_USER_APPBIN)/hashTableTest2 +EXE = $(FOAM_USER_APPBIN)/Test-HashTable2 diff --git a/applications/test/HashTable2/hashTableTest2.C b/applications/test/HashTable2/Test-HashTable2.C similarity index 95% rename from applications/test/HashTable2/hashTableTest2.C rename to applications/test/HashTable2/Test-HashTable2.C index f1bfd70c041509270f2425e932d0fc4ff5fc9c85..468c3960a0a5f1d197a19b75f9fdb44328c91749 100644 --- a/applications/test/HashTable2/hashTableTest2.C +++ b/applications/test/HashTable2/Test-HashTable2.C @@ -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 \*---------------------------------------------------------------------------*/ diff --git a/applications/test/HashTable3/Make/files b/applications/test/HashTable3/Make/files index e8ec193ffa2e78cf5a570a32b4e3952096365d70..67aef16a29824c9fbfc77269fc07b4a49f1ccacd 100644 --- a/applications/test/HashTable3/Make/files +++ b/applications/test/HashTable3/Make/files @@ -1,3 +1,3 @@ -hashTableTest3.C +Test-HashTable3.C -EXE = $(FOAM_USER_APPBIN)/hashTableTest3 +EXE = $(FOAM_USER_APPBIN)/Test-HashTable3 diff --git a/applications/test/HashTable3/hashTableTest3.C b/applications/test/HashTable3/Test-HashTable3.C similarity index 97% rename from applications/test/HashTable3/hashTableTest3.C rename to applications/test/HashTable3/Test-HashTable3.C index e295b861dab24966d70b86584af596a8116543c4..8931084ef2e7c9d54f58841f1f371f5f688f247e 100644 --- a/applications/test/HashTable3/hashTableTest3.C +++ b/applications/test/HashTable3/Test-HashTable3.C @@ -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 \*---------------------------------------------------------------------------*/ diff --git a/applications/test/NamedEnum/Make/files b/applications/test/NamedEnum/Make/files index e861aaa1b29ea96f18a320b75aa25b5a2a8f65b0..755b72ba5e929e04c15dcd5f6258eb2ac88ab808 100644 --- a/applications/test/NamedEnum/Make/files +++ b/applications/test/NamedEnum/Make/files @@ -1,3 +1,3 @@ Test-namedEnum.C -EXE = $(FOAM_USER_APPBIN)/NamedEnum +EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum diff --git a/applications/test/dataEntry/Make/options b/applications/test/dataEntry/Make/options index 79fef3bb9383878d9e71090a3c4aae90be08af52..a4d63bfba8aa2ddbb7a26f7adbaab5b4509676d7 100644 --- a/applications/test/dataEntry/Make/options +++ b/applications/test/dataEntry/Make/options @@ -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 diff --git a/applications/test/dataEntry/Test-DataEntry.C b/applications/test/dataEntry/Test-DataEntry.C index f9b76db9f1cdb87de2cb38d454959f51bca81db6..631cc03e0297631c4d93396a1069530999448c27 100644 --- a/applications/test/dataEntry/Test-DataEntry.C +++ b/applications/test/dataEntry/Test-DataEntry.C @@ -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 \*---------------------------------------------------------------------------*/ diff --git a/applications/test/dimensionedType/Make/files b/applications/test/dimensionedType/Make/files index 36a682e2812e3d9646538e670018fbb89f822072..38f7d4ee8d19d5c80ca6275c26e351a8982ca50b 100644 --- a/applications/test/dimensionedType/Make/files +++ b/applications/test/dimensionedType/Make/files @@ -1,3 +1,3 @@ Test-dimensionedType.C -EXE = $(FOAM_USER_APPBIN)/dimensionedType +EXE = $(FOAM_USER_APPBIN)/Test-dimensionedType diff --git a/applications/test/globalMeshData/Test-globalMeshData.C b/applications/test/globalMeshData/Test-globalMeshData.C index 551e3e536565a9a7cbc16e487cdb03672cd51cfc..6feaf5cc05d2cceb17f958852c9a00890575dbb6 100644 --- a/applications/test/globalMeshData/Test-globalMeshData.C +++ b/applications/test/globalMeshData/Test-globalMeshData.C @@ -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; } } - } - } - - - - // 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); + const labelList& transformedSlavePoints = transformedSlaves[pointI]; - // 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; - } - } - } - - - - - - // 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; + Pout<< "Master point:" << pointI + << " coord:" << coords[pointI] + << " connected to transformed slave points:" << endl; - forAll(bCells, i) - { - Pout<< " " << cc[bCells[i]] << endl; + forAll(transformedSlavePoints, i) + { + Pout<< " " << coords[transformedSlavePoints[i]] + << endl; + } } } } - - // Test:print (collocated) shared edges + // Test:print 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; diff --git a/applications/test/lduMatrix/Make/files b/applications/test/lduMatrix/Make/files deleted file mode 100644 index 69b87cfc1eb9d5d0362da3deed7ac8f851cbc0b2..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-lduMatrix3.C - -EXE = $(FOAM_USER_APPBIN)/Test-lduMatrix diff --git a/applications/test/lduMatrix/Make/options b/applications/test/lduMatrix/Make/options deleted file mode 100644 index 725122ea1df804ba46bb14bdca8a527b9e8386cc..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/Make/options +++ /dev/null @@ -1,4 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = -lfiniteVolume diff --git a/applications/test/lduMatrix/Test-lduMatrix.C b/applications/test/lduMatrix/Test-lduMatrix.C deleted file mode 100644 index 963aa096a6c98dd0a69ccf02e03cbceb026ec368..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/Test-lduMatrix.C +++ /dev/null @@ -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; -} - - -// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix2.C b/applications/test/lduMatrix/Test-lduMatrix2.C deleted file mode 100644 index ec63ac95c3f7370413f22d24f1ba807ab967d819..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/Test-lduMatrix2.C +++ /dev/null @@ -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; -} - - -// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix3.C b/applications/test/lduMatrix/Test-lduMatrix3.C deleted file mode 100644 index c33034d5e303a568f325a12acf5157f891cef040..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/Test-lduMatrix3.C +++ /dev/null @@ -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; -} - - -// ************************************************************************* // diff --git a/applications/test/lduMatrix/createFields.H b/applications/test/lduMatrix/createFields.H deleted file mode 100644 index 57714aa787144ff08e6d273d8efba6fb2d451f99..0000000000000000000000000000000000000000 --- a/applications/test/lduMatrix/createFields.H +++ /dev/null @@ -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); diff --git a/applications/test/maxMem/Make/options b/applications/test/maxMem/Make/options index 6a57715f81d25c4b903cc2e2c4cafb68eb0c7ed2..1570a9377ecf2e20596ae3a8c953c470641a242d 100644 --- a/applications/test/maxMem/Make/options +++ b/applications/test/maxMem/Make/options @@ -1 +1 @@ -EXE_LIBS = $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o +EXE_LIBS = $(FOAM_EXT_LIBBIN)/libfbsdmalloc.o diff --git a/applications/test/pTraits/Make/files b/applications/test/pTraits/Make/files index 7cebcf09d9b0378495196ec2e41902aeb857e635..268e879af24328b2cdea25625149fdfbe0c8f908 100644 --- a/applications/test/pTraits/Make/files +++ b/applications/test/pTraits/Make/files @@ -1,2 +1,2 @@ Test-pTraits.C -EXE = $(FOAM_USER_APPBIN)/pTraits +EXE = $(FOAM_USER_APPBIN)/Test-pTraits diff --git a/applications/test/parallel/Test-parallel.C b/applications/test/parallel/Test-parallel.C index b5edd16aff237193218670865ad0dba649e003dd..360cbe82244d61b476643dbae15050a3e7f895b6 100644 --- a/applications/test/parallel/Test-parallel.C +++ b/applications/test/parallel/Test-parallel.C @@ -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; } diff --git a/applications/test/simpleMatrix/Make/files b/applications/test/simpleMatrix/Make/files index 2b80bbe4f7fbfb775cd6c5b2cda26ae02cd7eee3..804d3ecefecb2ab0b9b63201d0509a56fdcd787a 100644 --- a/applications/test/simpleMatrix/Make/files +++ b/applications/test/simpleMatrix/Make/files @@ -1,3 +1,3 @@ Test-simpleMatrix.C -EXE = $(FOAM_USER_APPBIN)/simpleMatrix +EXE = $(FOAM_USER_APPBIN)/Test-simpleMatrix diff --git a/applications/test/syncTools/Test-syncTools.C b/applications/test/syncTools/Test-syncTools.C index e7fa0ae0b0127e76ceed07ba4895876e003f6e7e..094068e94ab0e660e1c33509025f06383e062a86 100644 --- a/applications/test/syncTools/Test-syncTools.C +++ b/applications/test/syncTools/Test-syncTools.C @@ -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) diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 59f2aaad4bf8f2f4a0a540f6fbd9807b575286cb..8a7296eca00a1627cdc50abb9e53a27c9ad0ec64 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -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(); diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 804d5193863e6c67834f7223d9f2b8c7d03b9365..826bc4c144f01bf27c3e9f1ac301e3c612c58611 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -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 \ diff --git a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H index b8e113d8f9cfae721f98815bd4d17eae11cd3dd5..37b514bb1868b48881b9d39c633ebe34ac34adb4 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H +++ b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H @@ -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(); diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index 8960ba75227e94676f119949256c1d4b8723d569..a447f8af63cd02b400fc25b72fe20883c2f76527 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files index 90ac11a3e8d1b040eac3f50e87be93b35aa1bfa9..e71b857bb2e229412366860d8eaef07c1192bf3b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files @@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C vtkPV3FoamUpdateInfo.C vtkPV3FoamUtils.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam +LIB = $(FOAM_LIBBIN)/libvtkPV3Foam diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options index 6d10cc1a05bceb1c5ccdcb66e377f22ba64f35fa..b381bd7d43eb74162751c531c7806fe7f0b5aeeb 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options @@ -19,5 +19,5 @@ LIB_LIBS = \ -lfiniteVolume \ -lgenericPatchFields \ -llagrangian \ - -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \ + -L$(FOAM_LIBBIN) -lvtkPV3Readers \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files index 3d452f747a10e0ef24ab3166dd858a1f31dda161..f084cc9f28fbc5faa5d02b2a857a9e4fc7f5eaf5 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files @@ -2,4 +2,4 @@ vtkPV3blockMesh.C vtkPV3blockMeshConvert.C vtkPV3blockMeshUtils.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh +LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options index 1964824e54c7348e5c27582d82be8614ead694dc..53f300a9f72cb671e6b2ba589c16322369791c87 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options @@ -10,5 +10,5 @@ EXE_INC = \ LIB_LIBS = \ -lmeshTools \ -lblockMesh \ - -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \ + -L$(FOAM_LIBBIN) -lvtkPV3Readers \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files index c5f3c12ebd1700638c358ed7f95d99222663d9b6..134b8de963e813e2955fdac51ea10d5e684e6c94 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files @@ -1,3 +1,3 @@ vtkPV3Readers.C -LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers +LIB = $(FOAM_LIBBIN)/libvtkPV3Readers diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options b/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options index a140053895021e4469c8f776270a59a1acf433c7..0cb69c876f20e53fb396829e8b91ca5bd0e9dcb4 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/Make/options @@ -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 diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H index 8e9d055d74cd64fb580e4739b643df7790d454f4..a269ef7448bfdcd9a61b6b055fd7c58937e4e312 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H @@ -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(); diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C index d9c9388adc704a2243643d74caa9581eec96e748..1a92c004a2b3de0faa4499a30a80250a57806cf0 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C @@ -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" diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index 2c7bbe35af6d986848ed43faf1848e9eb1da34b3..c34ce71daf915f846bcfbc35718f6845d6034613 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -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; } ); diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C index 89cf00cd1b10e60911298a56ab7209d7fa655990..b3f5e7baabef2282d0e8b1e2ede2a315c6d659ad 100644 --- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C +++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C @@ -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"); } diff --git a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C index f752631d725bc0180f495dca5e22be007ba9ac10..d8a52f764331ac9c451a5df07ef3a79241681cb0 100644 --- a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C +++ b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C @@ -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 diff --git a/bin/foamExec b/bin/foamExec index 534f4336f3a689d3d9e1c9c20888107d02096a85..47a2428ccd7466be73bc1e9fd6e6f33b9f4b329c 100755 --- a/bin/foamExec +++ b/bin/foamExec @@ -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 "$@" #------------------------------------------------------------------------------ diff --git a/bin/foamPack b/bin/foamPack index 59c37a87fe761be5a6139e49a80cbcc75c752367..3faa48cfdf3e8388e201a3fdb997d67535741648 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -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 +} #------------------------------------------------------------------------------ diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll index d91803197a87b2003f98b3598c18e22a4d73b704..18f67129ed57fe4436b9405e74403068c178c0d4 100755 --- a/bin/foamPackBinAll +++ b/bin/foamPackBinAll @@ -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 #------------------------------------------------------------------------------ diff --git a/bin/foamPackThirdParty b/bin/foamPackThirdParty index e0f07178d74e541a8a5e06339479f5b7e49b72c9..37625b42cd36548c1ee26d149e813de8caa5d6ed 100755 --- a/bin/foamPackThirdParty +++ b/bin/foamPackThirdParty @@ -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 +} #------------------------------------------------------------------------------ diff --git a/bin/mpirunDebug b/bin/mpirunDebug index ebb3e5cd5c0695536d80ba56e93d3f6b34de6f14..b3eef1ea73f032fcb7e9975a135aa5f0b29453c6 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -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 diff --git a/bin/tools/foamListBinDirs b/bin/tools/foamListBinDirs index 2a25a8709c77f16c0ffcc8207e18169abcf94635..336bd91cdef8abe88f7c0271e92c8bb511a8c069 100755 --- a/bin/tools/foamListBinDirs +++ b/bin/tools/foamListBinDirs @@ -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 - -# check new/old places for executables - same as $FOAM_APPBIN -[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || { +[ -d $packDir ] || { + echo "Error: directory $packDir does not exist" 1>&2 + exit 1 +} + + +# +# 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 diff --git a/bin/tools/foamListThirdPartyBinDirs b/bin/tools/foamListThirdPartyBinDirs index 319961b944173c234be9971193e8c7af8af066ad..872049628e203e49bfa23034ab654ddc40e483fa 100755 --- a/bin/tools/foamListThirdPartyBinDirs +++ b/bin/tools/foamListThirdPartyBinDirs @@ -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 \ diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook index 7710f0ca52c6a32b92d8e0ca0d077fdb35cc289c..d44edba275e1336e5aeeeeaabee4bb930e4f46b8 100755 --- a/bin/tools/pre-commit-hook +++ b/bin/tools/pre-commit-hook @@ -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 diff --git a/bin/tools/pre-receive-hook b/bin/tools/pre-receive-hook index 048feb3188af3aff0683fe8c1724bb839e4b950f..cf4dcb42be6bc0f55b9573cc233b492cfa179499 100755 --- a/bin/tools/pre-receive-hook +++ b/bin/tools/pre-receive-hook @@ -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 diff --git a/doc/changes/inotify.txt b/doc/changes/inotify.txt index 0c7969da81944319dfb31338659897b8c8c34dcf..0f91d7c03b35140c3fa0f33656638165fe231e47 100644 --- a/doc/changes/inotify.txt +++ b/doc/changes/inotify.txt @@ -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 diff --git a/doc/changes/pointAndEdgeSync.txt b/doc/changes/pointAndEdgeSync.txt new file mode 100644 index 0000000000000000000000000000000000000000..7dd385acce1fc426c6513cc8b9a092338e47bd2a --- /dev/null +++ b/doc/changes/pointAndEdgeSync.txt @@ -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). diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt index 0797151faf6300a61523e11a1e74a5988a796e4a..99f42b3194914eb41555ae7cd8830a1394ffad02 100644 --- a/doc/changes/splitCyclic.txt +++ b/doc/changes/splitCyclic.txt @@ -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 diff --git a/doc/changes/staticLinkage.txt b/doc/changes/staticLinkage.txt new file mode 100644 index 0000000000000000000000000000000000000000..916a5107ed00ac248a90b6c67b20261e13ab0f97 --- /dev/null +++ b/doc/changes/staticLinkage.txt @@ -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 diff --git a/doc/doxygen/Allwmake b/doc/doxygen/Allwmake index a34eb3fd7e0cce80561fd61bc768738bb5e0cd02..fbc20d93fd054d2fa63b80606e6f0e36924c027e 100755 --- a/doc/doxygen/Allwmake +++ b/doc/doxygen/Allwmake @@ -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 diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index 51a8ae2b503a66ce1d7d4767c375d3c28e1780de..a1c4e6a5fcf8c4e26618747bb1e2df14ab3e8f89 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -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. diff --git a/doc/doxygen/_Footer b/doc/doxygen/_Footer index 11d8da9cb56840a3ce070bda8929d6e024111f7c..f68739e80373b5855fc475fa1e73755b24bc1e35 100644 --- a/doc/doxygen/_Footer +++ b/doc/doxygen/_Footer @@ -2,7 +2,7 @@ </div> <!-- main --> <div class="footer"> <p> - Copyright © 2000-2010 + Copyright © 2004-2011 <a href="http://www.openfoam.com/about">OpenCFD Limited</a> | OPENFOAM® and OpenCFD® are registered trademarks of OpenCFD Ltd. </p> diff --git a/etc/aliases.csh b/etc/aliases.csh index 0da2259b201dc213ab851759819f294131fd876b..9005f180ddddd440ce8a92425560450a2061522e 100644 --- a/etc/aliases.csh +++ b/etc/aliases.csh @@ -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' diff --git a/etc/aliases.sh b/etc/aliases.sh index 504473d2cbeaaacac7704be3f07c487ec1c8c13b..870b457f5fff62badcf56d5f8be4a28804762b4b 100644 --- a/etc/aliases.sh +++ b/etc/aliases.sh @@ -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' diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 0e1b0ab17d1a99937ad8e61629e4fe5ea92e1c9e..8d9ae615f5942f61cc25a465e7285ac9596e849c 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -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 + + +# 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 + -# if needed, set MAJOR version to correspond to VERSION +# 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 diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index bfbe3038fd233180ed798c7b4359c957ee21328e..dda442713570538a8968b54a3c58af369aaf842b 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -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 diff --git a/etc/apps/scotch/bashrc b/etc/apps/scotch/bashrc index fcd19bfaa35cd49306fb7e6901c6efc948f1f82b..0fb6952110d09fa9cc2c6aab67e149f4b9e48e7f 100644 --- a/etc/apps/scotch/bashrc +++ b/etc/apps/scotch/bashrc @@ -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##*/} # ----------------------------------------------------------------------------- diff --git a/etc/bashrc b/etc/bashrc index 02d37cbb65b1cf4dc10f6ff0e21bd4624a762d31..95c83e82f8012185453f70e92842fea3138756a8 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -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 diff --git a/etc/cellModels b/etc/cellModels index a90eaa94e7227bfce45c83b9cb0995a25decaeab..68fdd9f42bb83c0eaf8a22170fb8d10b2774195d 100644 --- a/etc/cellModels +++ b/etc/cellModels @@ -149,7 +149,7 @@ pyr (0 1) (1 2) (2 3) - (3 4) + (0 3) (0 4) (1 4) (2 4) diff --git a/etc/cshrc b/etc/cshrc index fb65228cb3c46a89558b69c25dae2adf0926d437..9b9f04c47c2a2d1d6bd0e70280d7de40f69fd46a 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -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"` diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index 256381c54b2db5b896d73d6d5610c4098c8de51a..68d08b4ca61fa1988fd32868b77233776edc676b 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -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 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index 60d4a21cd1e742f06db52411230117fa3787767e..4820f82dcd3e05c3d281258c9a1e7034da952b49 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -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 diff --git a/etc/settings.csh b/etc/settings.csh index d6967a6627a04dc6c601c253bbcceb5ed033c5c5..a9c7db71183c38369c344fa32af94b2ff6953aba 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -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 diff --git a/etc/settings.sh b/etc/settings.sh index 28eaa516607732b6dc1fe5abd15cd6ead70f8879..728b197720f14a9f1eb5b7ac576051860c5e0c91 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -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 diff --git a/src/Allwmake b/src/Allwmake index f3c4420474f56a0740a88658e236f11e72325074..00bbf8e5e6e91459e1c6913012629a2963c7247a 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -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 diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index a0557933d9014c5bf97ef13b0dce407d89227d55..18ee90456a35ae3d362c1fb5c739f46480a8fa50 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -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 (env("FOAM_SETNAN")) - { if (verbose) { - Info<< "SetNaN : Initialising allocated memory to NaN" - << " (FOAM_SETNAN)." << endl; + 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")) + { + 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; + } + } } } diff --git a/src/OSspecific/POSIX/signals/sigFpe.H b/src/OSspecific/POSIX/signals/sigFpe.H index ea81c98f8d0db1d8506dc66aeebf1f6d97adce56..9ecad0c87cabcbc48dda4747f62b06dfa7b145e5 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.H +++ b/src/OSspecific/POSIX/signals/sigFpe.H @@ -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); }; diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index c9d5d2bafc02fc489aed231e3ff0210a290a57fc..acefe43d5a0b93e2ecfd31cdea1a524e187eb968 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -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) diff --git a/src/OSspecific/POSIX/signals/sigInt.H b/src/OSspecific/POSIX/signals/sigInt.H index d9d34062c29d4dd911d9c0216986793f38316b19..e124ac3098fccf33617a96178b0a1e62200e26cb 100644 --- a/src/OSspecific/POSIX/signals/sigInt.H +++ b/src/OSspecific/POSIX/signals/sigInt.H @@ -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 + // ************************************************************************* // diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index 481b6c50716f267e6d92a1439b269e0597a7c996..e88f74dfa41d370252148c37f16d8a48d4588f82 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -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) diff --git a/src/OSspecific/POSIX/signals/sigQuit.H b/src/OSspecific/POSIX/signals/sigQuit.H index a4933e00a1646f6b1ebba5a7c7b2ce316b66cc5f..57afd98df424fbad2b55c45d471f197be5ac4323 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.H +++ b/src/OSspecific/POSIX/signals/sigQuit.H @@ -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 + // ************************************************************************* // diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index a4fad40b8b47147ee09198cc02d3f100c44a537f..98a02a9defbe3f45415f1db243ed6d0a5f68d169 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -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) diff --git a/src/OSspecific/POSIX/signals/sigSegv.H b/src/OSspecific/POSIX/signals/sigSegv.H index b8cf2398fe48ba324f92c2e9e0b1230ad5d57e45..a3de76f329c25944f0f9d3a28f5061acccdc9681 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.H +++ b/src/OSspecific/POSIX/signals/sigSegv.H @@ -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 + // ************************************************************************* // diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 9cc3dd17b985851651f3f2153259b356ce8c80fa..bf4c345becf9ab4a208b55a0cdd25cd5cfb8bb51 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -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 diff --git a/src/OpenFOAM/containers/Lists/Distribution/Distribution.C b/src/OpenFOAM/containers/Lists/Distribution/Distribution.C new file mode 100644 index 0000000000000000000000000000000000000000..6457ca7ea8b84f417ae8311c616926fab8ff3c54 --- /dev/null +++ b/src/OpenFOAM/containers/Lists/Distribution/Distribution.C @@ -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); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/containers/Lists/Distribution/Distribution.H b/src/OpenFOAM/containers/Lists/Distribution/Distribution.H new file mode 100644 index 0000000000000000000000000000000000000000..985c37ea321b36a8aa8e32fcadcad29b0e2bb711 --- /dev/null +++ b/src/OpenFOAM/containers/Lists/Distribution/Distribution.H @@ -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 + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C b/src/OpenFOAM/containers/Lists/Distribution/DistributionI.H similarity index 76% rename from src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C rename to src/OpenFOAM/containers/Lists/Distribution/DistributionI.H index a53ba0f34fc63a7c2bdd5218ea25092c28fa9738..cf88b809ca24e356fc4edfedcd71836e362418a6 100644 --- a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C +++ b/src/OpenFOAM/containers/Lists/Distribution/DistributionI.H @@ -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 // ************************************************************************* // diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index 8bcb95df9a7a0d6e83fcb2f813639d07854ccd62..da542524b7b2c971a6ab9fd989dc12704e479b71 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -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 * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index cc8550bab9a62390c0a4aa035000f45915c310bf..7539f6d7de413349058c1d817b4e78f5a72aa18e 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -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 { diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 023ea225ebbb7d17bf0240b9977a012cd2e24ea7..ebd0dc9ea197d8c9d4c8f9a11d44657e0e072c00 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -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. diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 5423753eb42860e7d850e2867bf7b5d295ebd61f..1d23a86c9cb72cd37deb8cc75e205b965ae678d3 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -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; } diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index 7d8ac59b9ec3b907d063ddd5c0e987c323b5dbf1..33e951ce071be4de82a94e0255570d107661162b 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -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: diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C index 03dc2d55366337c1e620ea70796b0e27a5d21cbb..121f016c2f3fef50d92034e3e3f310c5ac0b372e 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C @@ -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,6 +260,11 @@ void Foam::LUscalarMatrix::convert } else if (interface.myProcNo_ < interface.neighbProcNo_) { + // Interface to neighbour proc. Find on neighbour proc the + // corresponding interface. The problem is that there can + // be multiple interfaces between two processors (from + // processorCyclics) so also compare the communication tag + const PtrList<procLduInterface>& neiInterfaces = lduMatrices[interface.neighbProcNo_].interfaces_; @@ -269,8 +274,11 @@ void Foam::LUscalarMatrix::convert { if ( - neiInterfaces[ninti].neighbProcNo_ - == interface.myProcNo_ + ( + neiInterfaces[ninti].neighbProcNo_ + == interface.myProcNo_ + ) + && (neiInterfaces[ninti].tag_ == interface.tag_) ) { neiInterfacei = ninti; diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C index 0a4b7132027802f08b7d877413ece016239d3c83..979ef370274934aa630144e6072b227cc77bd317 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C @@ -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 @@ -39,7 +39,8 @@ Foam::procLduInterface::procLduInterface faceCells_(interface.interface().faceCells()), coeffs_(coeffs), myProcNo_(-1), - neighbProcNo_(-1) + neighbProcNo_(-1), + tag_(-1) { if (isA<processorLduInterface>(interface.interface())) { @@ -48,6 +49,7 @@ Foam::procLduInterface::procLduInterface myProcNo_ = pldui.myProcNo(); neighbProcNo_ = pldui.neighbProcNo(); + tag_ = pldui.tag(); } else if (isA<cyclicLduInterface>(interface.interface())) { @@ -70,7 +72,8 @@ Foam::procLduInterface::procLduInterface(Istream& is) faceCells_(is), coeffs_(is), myProcNo_(readLabel(is)), - neighbProcNo_(readLabel(is)) + neighbProcNo_(readLabel(is)), + tag_(readLabel(is)) {} @@ -81,7 +84,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const procLduInterface& cldui) os << cldui.faceCells_ << cldui.coeffs_ << cldui.myProcNo_ - << cldui.neighbProcNo_; + << cldui.neighbProcNo_ + << cldui.tag_; return os; } diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H index 0e03bfdb375511ad7482c561cd68a10e4144dc48..defaa331ffbb78821e637add8caf8144ec204d94 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H @@ -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,6 +57,7 @@ class procLduInterface scalarField coeffs_; label myProcNo_; label neighbProcNo_; + label tag_; // Private Member Functions diff --git a/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C index 1ca2f9929d70b0d6ed1e052df0e570116913871d..bd401abe860060420f79f35b2aa8fe7172a4393c 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C +++ b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C @@ -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 diff --git a/src/OpenFOAM/meshes/meshTools/mergePoints.C b/src/OpenFOAM/meshes/meshTools/mergePoints.C index d11a2e5318512aac27db423702987833d0f32893..9aa614627d964a0ec90f1a81f68c67b1f22539cf 100644 --- a/src/OpenFOAM/meshes/meshTools/mergePoints.C +++ b/src/OpenFOAM/meshes/meshTools/mergePoints.C @@ -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 @@ -61,11 +61,26 @@ bool Foam::mergePoints return false; } + // We're comparing distance squared to origin first. + // Say if starting from two close points: + // x, y, z + // x+mergeTol, y+mergeTol, z+mergeTol + // Then the magSqr of both will be + // x^2+y^2+z^2 + // x^2+y^2+z^2 + 2*mergeTol*(x+z+y) + mergeTol^2*... + // so the difference will be 2*mergeTol*(x+y+z) const scalar mergeTolSqr = sqr(mergeTol); // Sort points by magSqr - SortableList<scalar> sortedMagSqr(magSqr(points - compareOrigin)); + const pointField d(points - compareOrigin); + SortableList<scalar> sortedMagSqr(magSqr(d)); + scalarField sortedTol(points.size()); + forAll(sortedMagSqr.indices(), sortI) + { + const point& pt = d[sortedMagSqr.indices()[sortI]]; + sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z())); + } bool hasMerged = false; @@ -94,7 +109,7 @@ bool Foam::mergePoints ( sortedMagSqr[prevSortI] - sortedMagSqr[sortI] - ) <= mergeTolSqr; + ) <= sortedTol[sortI]; prevSortI-- ) { diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 5790d951ebb06345a2e0f4f75b823cdba5838141..aeb05000b7da28b14d97923fb142d499c05feb05 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -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 @@ -30,7 +30,6 @@ License #include "processorPolyPatch.H" #include "demandDrivenData.H" #include "globalPoints.H" -//#include "geomGlobalPoints.H" #include "polyMesh.H" #include "mapDistribute.H" #include "labelIOList.H" @@ -38,6 +37,7 @@ License #include "mergePoints.H" #include "matchPoints.H" #include "OFstream.H" +#include "globalIndexAndTransform.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -117,6 +117,126 @@ void Foam::globalMeshData::initProcAddr() } +void Foam::globalMeshData::calcSharedPoints() const +{ + if + ( + nGlobalPoints_ != -1 + || sharedPointLabelsPtr_.valid() + || sharedPointAddrPtr_.valid() + ) + { + FatalErrorIn("globalMeshData::calcSharedPoints()") + << "Shared point addressing already done" << abort(FatalError); + } + + // Calculate all shared points (exclude points that are only + // on two coupled patches). This does all the hard work. + globalPoints parallelPoints(mesh_, false, true); + + // Count the number of master points + label nMaster = 0; + forAll(parallelPoints.pointPoints(), i) + { + const labelList& pPoints = parallelPoints.pointPoints()[i]; + const labelList& transPPoints = + parallelPoints.transformedPointPoints()[i]; + + if (pPoints.size()+transPPoints.size() > 0) + { + nMaster++; + } + } + + // Allocate global numbers + globalIndex masterNumbering(nMaster); + + nGlobalPoints_ = masterNumbering.size(); + + + // Push master number to slaves + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // 1. Fill master and slave slots + nMaster = 0; + labelList master(parallelPoints.map().constructSize(), -1); + forAll(parallelPoints.pointPoints(), i) + { + const labelList& pPoints = parallelPoints.pointPoints()[i]; + const labelList& transPPoints = + parallelPoints.transformedPointPoints()[i]; + + if (pPoints.size()+transPPoints.size() > 0) + { + master[i] = masterNumbering.toGlobal(nMaster); + forAll(pPoints, j) + { + master[pPoints[j]] = master[i]; + } + forAll(transPPoints, j) + { + master[transPPoints[j]] = master[i]; + } + nMaster++; + } + } + + + // 2. Push slave slots back to local storage on originating processor + // For all the four types of points: + // - local master : already set + // - local transformed slave point : the reverse transform at + // reverseDistribute will have copied it back to its originating local + // point + // - remote untransformed slave point : sent back to originating processor + // - remote transformed slave point : the reverse transform will + // copy it back into the remote slot which then gets sent back to + // originating processor + + parallelPoints.map().reverseDistribute + ( + parallelPoints.map().constructSize(), + master + ); + + + // Collect all points that are a master or refer to a master. + nMaster = 0; + forAll(parallelPoints.pointPoints(), i) + { + if (master[i] != -1) + { + nMaster++; + } + } + + sharedPointLabelsPtr_.reset(new labelList(nMaster)); + labelList& sharedPointLabels = sharedPointLabelsPtr_(); + sharedPointAddrPtr_.reset(new labelList(nMaster)); + labelList& sharedPointAddr = sharedPointAddrPtr_(); + nMaster = 0; + + forAll(parallelPoints.pointPoints(), i) + { + if (master[i] != -1) + { + // I am master or slave + sharedPointLabels[nMaster] = i; + sharedPointAddr[nMaster] = master[i]; + nMaster++; + } + } + + if (debug) + { + Pout<< "globalMeshData : nGlobalPoints_:" << nGlobalPoints_ << nl + << "globalMeshData : sharedPointLabels_:" + << sharedPointLabelsPtr_().size() << nl + << "globalMeshData : sharedPointAddr_:" + << sharedPointAddrPtr_().size() << endl; + } +} + + // Given information about locally used edges allocate global shared edges. void Foam::globalMeshData::countSharedEdges ( @@ -166,7 +286,12 @@ void Foam::globalMeshData::countSharedEdges // clusters of shared points) void Foam::globalMeshData::calcSharedEdges() const { - if (nGlobalEdges_ != -1 || sharedEdgeLabelsPtr_ || sharedEdgeAddrPtr_) + if + ( + nGlobalEdges_ != -1 + || sharedEdgeLabelsPtr_.valid() + || sharedEdgeAddrPtr_.valid() + ) { FatalErrorIn("globalMeshData::calcSharedEdges()") << "Shared edge addressing already done" << abort(FatalError); @@ -370,12 +495,12 @@ void Foam::globalMeshData::calcSharedEdges() const } } - sharedEdgeLabelsPtr_ = new labelList(); - labelList& sharedEdgeLabels = *sharedEdgeLabelsPtr_; + sharedEdgeLabelsPtr_.reset(new labelList()); + labelList& sharedEdgeLabels = sharedEdgeLabelsPtr_(); sharedEdgeLabels.transfer(dynSharedEdgeLabels); - sharedEdgeAddrPtr_ = new labelList(); - labelList& sharedEdgeAddr = *sharedEdgeAddrPtr_; + sharedEdgeAddrPtr_.reset(new labelList()); + labelList& sharedEdgeAddr = sharedEdgeAddrPtr_(); sharedEdgeAddr.transfer(dynSharedEdgeAddr); if (debug) @@ -389,141 +514,140 @@ void Foam::globalMeshData::calcSharedEdges() const } -// Helper function to count coincident faces. This part used to be -// in updateMesh but I've had to move it to a separate function -// because of aliasing optimisation errors in icc9.1 on the -// Itanium. -Foam::label Foam::globalMeshData::countCoincidentFaces -( - const scalar tolDim, - const vectorField& separationDist -) +void Foam::globalMeshData::calcGlobalPointSlaves() const { - label nCoincident = 0; - - forAll(separationDist, faceI) + if (debug) { - if (mag(separationDist[faceI]) < tolDim) - { - // Faces coincide - nCoincident++; - } + Pout<< "globalMeshData::calcGlobalPointSlaves() :" + << " calculating coupled master to slave point addressing." + << endl; } - return nCoincident; -} + // Calculate connected points for master points. + globalPoints globalData(mesh_, coupledPatch(), true, true); + globalPointNumberingPtr_.reset(new globalIndex(globalData.globalIndices())); -void Foam::globalMeshData::calcGlobalPointSlaves -( - const globalPoints& globalData, - autoPtr<globalIndex>& globalIndicesPtr, - autoPtr<labelListList>& globalPointSlavesPtr, - autoPtr<mapDistribute>& globalPointSlavesMapPtr -) const -{ - // Create global numbering for coupled points - globalIndicesPtr.reset + globalPointSlavesPtr_.reset ( - new globalIndex(globalData.globalIndices()) + new labelListList + ( + globalData.pointPoints().xfer() + ) ); - const globalIndex& globalIndices = globalIndicesPtr(); - - // Create master to slave addressing. Empty for slave points. - globalPointSlavesPtr.reset + globalPointTransformedSlavesPtr_.reset ( - new labelListList(coupledPatch().nPoints()) - ); - labelListList& globalPointSlaves = globalPointSlavesPtr(); - - - const Map<label>& meshToProcPoint = globalData.meshToProcPoint(); - - forAllConstIter(Map<label>, meshToProcPoint, iter) - { - label localPointI = iter.key(); - const labelList& pPoints = globalData.procPoints()[iter()]; - - // Am I master? - if + new labelListList ( - globalIndices.isLocal(pPoints[0]) - && globalIndices.toLocal(pPoints[0]) == localPointI + globalData.transformedPointPoints().xfer() ) - { - labelList& slaves = globalPointSlaves[localPointI]; - slaves.setSize(pPoints.size()-1); - for (label i = 1; i < pPoints.size(); i++) - { - slaves[i-1] = pPoints[i]; - } - } - } - - // Create schedule to get information from slaves onto master - - // Construct compact numbering and distribution map. - // Changes globalPointSlaves to be indices into compact data + ); - List<Map<label> > compactMap(Pstream::nProcs()); - globalPointSlavesMapPtr.reset + globalPointSlavesMapPtr_.reset ( new mapDistribute ( - globalIndices, - globalPointSlaves, - compactMap + globalData.map().xfer() ) ); - - if (debug) - { - Pout<< "globalMeshData::calcGlobalPointSlaves(..) :" - << " coupled points:" << coupledPatch().nPoints() - << " additional remote points:" - << globalPointSlavesMapPtr().constructSize() - - coupledPatch().nPoints() - << endl; - } } -void Foam::globalMeshData::calcGlobalPointSlaves() const +void Foam::globalMeshData::calcPointConnectivity +( + List<labelPairList>& allPointConnectivity +) const { - if (debug) + const globalIndexAndTransform& transforms = globalTransforms(); + const labelListList& slaves = globalPointSlaves(); + const labelListList& transformedSlaves = globalPointTransformedSlaves(); + + + // Create field with my local data + labelPairList myData(globalPointSlavesMap().constructSize()); + forAll(slaves, pointI) { - Pout<< "globalMeshData::calcGlobalPointSlaves() :" - << " calculating coupled master to collocated" - << " slave point addressing." - << endl; + myData[pointI] = globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + pointI, + transforms.nullTransformIndex() + ); } + // Send over. + globalPointSlavesMap().distribute(myData); + - // Calculate collocated connected points for master points. - globalPoints collocatedGlobalData(mesh_, coupledPatch(), true, false); + // String of connected points with their transform + allPointConnectivity.setSize(globalPointSlavesMap().constructSize()); + forAll(slaves, pointI) + { + // Reconstruct string of connected points + const labelList& pSlaves = slaves[pointI]; + const labelList& pTransformSlaves = transformedSlaves[pointI]; + labelPairList& pConnectivity = allPointConnectivity[pointI]; + pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size()); + label connI = 0; - calcGlobalPointSlaves + // Add myself + pConnectivity[connI++] = myData[pointI]; + // Add untransformed points + forAll(pSlaves, i) + { + pConnectivity[connI++] = myData[pSlaves[i]]; + } + // Add transformed points. + forAll(pTransformSlaves, i) + { + // Get transform from index + label transformI = globalPointSlavesMap().whichTransform + ( + pTransformSlaves[i] + ); + // Add transform to connectivity + const labelPair& n = myData[pTransformSlaves[i]]; + label procI = globalIndexAndTransform::processor(n); + label index = globalIndexAndTransform::index(n); + pConnectivity[connI++] = globalIndexAndTransform::encode + ( + procI, + index, + transformI + ); + } + + // Put back in slots + forAll(pSlaves, i) + { + allPointConnectivity[pSlaves[i]] = pConnectivity; + } + forAll(pTransformSlaves, i) + { + allPointConnectivity[pTransformSlaves[i]] = pConnectivity; + } + } + globalPointSlavesMap().reverseDistribute ( - collocatedGlobalData, - globalPointNumberingPtr_, - globalPointSlavesPtr_, - globalPointSlavesMapPtr_ + allPointConnectivity.size(), + allPointConnectivity ); } -void Foam::globalMeshData::calcGlobalEdgeSlaves +void Foam::globalMeshData::calcGlobalPointEdges ( - const labelListList& pointSlaves, - const mapDistribute& pointSlavesMap, - const globalIndex& globalEdgeIndices, - autoPtr<labelListList>& globalEdgeSlavesPtr, - autoPtr<mapDistribute>& globalEdgeSlavesMapPtr + labelListList& globalPointEdges, + List<labelPairList>& globalPointPoints ) const { - // Coupled point to global coupled edges. - labelListList globalPointEdges(pointSlavesMap.constructSize()); + const edgeList& edges = coupledPatch().edges(); + const labelListList& pointEdges = coupledPatch().pointEdges(); + const globalIndex& globalEdgeNumbers = globalEdgeNumbering(); + const labelListList& slaves = globalPointSlaves(); + const labelListList& transformedSlaves = globalPointTransformedSlaves(); // Create local version - const labelListList& pointEdges = coupledPatch().pointEdges(); + globalPointEdges.setSize(globalPointSlavesMap().constructSize()); + globalPointPoints.setSize(globalPointSlavesMap().constructSize()); forAll(pointEdges, pointI) { const labelList& pEdges = pointEdges[pointI]; @@ -531,520 +655,807 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves globalPEdges.setSize(pEdges.size()); forAll(pEdges, i) { - globalPEdges[i] = globalEdgeIndices.toGlobal(pEdges[i]); + globalPEdges[i] = globalEdgeNumbers.toGlobal(pEdges[i]); } - } - - // Pull slave data to master - pointSlavesMap.distribute(globalPointEdges); - - // Now check on master if any of my edges are also on slave. - // This assumes that if slaves have a coupled edge it is also on - // the master (otherwise the mesh would be illegal anyway) - - labelHashSet pointEdgeSet; - - const edgeList& edges = coupledPatch().edges(); - // Create master to slave addressing. Empty for slave edges. - globalEdgeSlavesPtr.reset(new labelListList(edges.size())); - labelListList& globalEdgeSlaves = globalEdgeSlavesPtr(); + labelPairList& globalPPoints = globalPointPoints[pointI]; + globalPPoints.setSize(pEdges.size()); + forAll(pEdges, i) + { + label otherPointI = edges[pEdges[i]].otherVertex(pointI); + globalPPoints[i] = globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + otherPointI, + globalTransforms().nullTransformIndex() + ); + } + } - forAll(edges, edgeI) + // Pull slave data to master. Dummy transform. + globalPointSlavesMap().distribute(globalPointEdges); + globalPointSlavesMap().distribute(globalPointPoints); + // Add all pointEdges + forAll(slaves, pointI) { - const edge& e = edges[edgeI]; - const labelList& slaves0 = pointSlaves[e[0]]; - const labelList& slaves1 = pointSlaves[e[1]]; + const labelList& pSlaves = slaves[pointI]; + const labelList& pTransformSlaves = transformedSlaves[pointI]; - // Check for edges that are in both slaves0 and slaves1. - pointEdgeSet.clear(); - forAll(slaves0, i) + label n = 0; + forAll(pSlaves, i) { - const labelList& connectedEdges = globalPointEdges[slaves0[i]]; - pointEdgeSet.insert(connectedEdges); + n += globalPointEdges[pSlaves[i]].size(); } - forAll(slaves1, i) + forAll(pTransformSlaves, i) { - const labelList& connectedEdges = globalPointEdges[slaves1[i]]; + n += globalPointEdges[pTransformSlaves[i]].size(); + } - forAll(connectedEdges, j) + // Add all the point edges of the slaves to those of the (master) point + { + labelList& globalPEdges = globalPointEdges[pointI]; + label sz = globalPEdges.size(); + globalPEdges.setSize(sz+n); + forAll(pSlaves, i) { - label globalEdgeI = connectedEdges[j]; - - if (pointEdgeSet.found(globalEdgeI)) + const labelList& otherData = globalPointEdges[pSlaves[i]]; + forAll(otherData, j) { - // Found slave edge. - label sz = globalEdgeSlaves[edgeI].size(); - globalEdgeSlaves[edgeI].setSize(sz+1); - globalEdgeSlaves[edgeI][sz] = globalEdgeI; + globalPEdges[sz++] = otherData[j]; } } - } - } - - - // Construct map - List<Map<label> > compactMap(Pstream::nProcs()); - globalEdgeSlavesMapPtr.reset - ( - new mapDistribute - ( - globalEdgeIndices, - globalEdgeSlaves, - compactMap - ) - ); - - if (debug) - { - Pout<< "globalMeshData::calcGlobalEdgeSlaves() :" - << " coupled edge:" << edges.size() - << " additional remote edges:" - << globalEdgeSlavesMapPtr().constructSize() - edges.size() - << endl; - } -} - - -void Foam::globalMeshData::calcGlobalEdgeSlaves() const -{ - if (debug) - { - Pout<< "globalMeshData::calcGlobalEdgeSlaves() :" - << " calculating coupled master to collocated slave" - << " edge addressing." << endl; - } - - // - Send across connected edges (in global edge addressing) - // - Check on receiving side whether edge has same slave edge - // on both endpoints. - - // Create global numbering for coupled edges - const globalIndex& globalIndices = globalEdgeNumbering(); - - calcGlobalEdgeSlaves - ( - globalPointSlaves(), - globalPointSlavesMap(), - globalIndices, - globalEdgeSlavesPtr_, - globalEdgeSlavesMapPtr_ - ); -} - - -// Calculate uncoupled boundary faces (without calculating -// primitiveMesh::pointFaces()) -void Foam::globalMeshData::calcPointBoundaryFaces -( - labelListList& pointBoundaryFaces -) const -{ - const polyBoundaryMesh& bMesh = mesh_.boundaryMesh(); - const Map<label>& meshPointMap = coupledPatch().meshPointMap(); - - // 1. Count - - labelList nPointFaces(coupledPatch().nPoints(), 0); - - forAll(bMesh, patchI) - { - const polyPatch& pp = bMesh[patchI]; - - if (!pp.coupled()) - { - forAll(pp, i) + forAll(pTransformSlaves, i) { - const face& f = pp[i]; - - forAll(f, fp) + const labelList& otherData = + globalPointEdges[pTransformSlaves[i]]; + forAll(otherData, j) { - Map<label>::const_iterator iter = meshPointMap.find(f[fp]); - if (iter != meshPointMap.end()) - { - nPointFaces[iter()]++; - } + globalPEdges[sz++] = otherData[j]; } } - } - } - - // 2. Size - - pointBoundaryFaces.setSize(coupledPatch().nPoints()); - forAll(nPointFaces, pointI) - { - pointBoundaryFaces[pointI].setSize(nPointFaces[pointI]); - } - nPointFaces = 0; - - - // 3. Fill + // Put back in slots + forAll(pSlaves, i) + { + globalPointEdges[pSlaves[i]] = globalPEdges; + } + forAll(pTransformSlaves, i) + { + globalPointEdges[pTransformSlaves[i]] = globalPEdges; + } + } - forAll(bMesh, patchI) - { - const polyPatch& pp = bMesh[patchI]; - if (!pp.coupled()) + // Same for corresponding pointPoints { - forAll(pp, i) + labelPairList& globalPPoints = globalPointPoints[pointI]; + label sz = globalPPoints.size(); + globalPPoints.setSize(sz + n); + + // Add untransformed points + forAll(pSlaves, i) { - const face& f = pp[i]; - forAll(f, fp) + const labelPairList& otherData = globalPointPoints[pSlaves[i]]; + forAll(otherData, j) { - Map<label>::const_iterator iter = meshPointMap.find(f[fp]); - if (iter != meshPointMap.end()) - { - label bFaceI = pp.start() + i - mesh_.nInternalFaces(); - pointBoundaryFaces[iter()][nPointFaces[iter()]++] = - bFaceI; - } + globalPPoints[sz++] = otherData[j]; } } - } - } -} + // Add transformed points. + forAll(pTransformSlaves, i) + { + // Get transform from index + label transformI = globalPointSlavesMap().whichTransform + ( + pTransformSlaves[i] + ); + const labelPairList& otherData = + globalPointPoints[pTransformSlaves[i]]; + forAll(otherData, j) + { + // Add transform to connectivity + const labelPair& n = otherData[j]; + label procI = globalIndexAndTransform::processor(n); + label index = globalIndexAndTransform::index(n); + globalPPoints[sz++] = globalIndexAndTransform::encode + ( + procI, + index, + transformI + ); + } + } -void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const -{ - if (debug) - { - Pout<< "globalMeshData::calcGlobalPointBoundaryFaces() :" - << " calculating coupled point to boundary face addressing." - << endl; + // Put back in slots + forAll(pSlaves, i) + { + globalPointPoints[pSlaves[i]] = globalPPoints; + } + forAll(pTransformSlaves, i) + { + globalPointPoints[pTransformSlaves[i]] = globalPPoints; + } + } } - - // Construct local point to (uncoupled)boundaryfaces. - labelListList pointBoundaryFaces; - calcPointBoundaryFaces(pointBoundaryFaces); - - - // Global indices for boundary faces - globalBoundaryFaceNumberingPtr_.reset + // Push back + globalPointSlavesMap().reverseDistribute ( - new globalIndex(mesh_.nFaces()-mesh_.nInternalFaces()) + globalPointEdges.size(), + globalPointEdges ); - globalIndex& globalIndices = globalBoundaryFaceNumberingPtr_(); - - - // Convert local boundary faces to global numbering - globalPointBoundaryFacesPtr_.reset + // Push back + globalPointSlavesMap().reverseDistribute ( - new labelListList(globalPointSlavesMap().constructSize()) + globalPointPoints.size(), + globalPointPoints ); - labelListList& globalPointBoundaryFaces = globalPointBoundaryFacesPtr_(); - - forAll(pointBoundaryFaces, pointI) - { - const labelList& bFaces = pointBoundaryFaces[pointI]; - labelList& globalFaces = globalPointBoundaryFaces[pointI]; - globalFaces.setSize(bFaces.size()); - forAll(bFaces, i) - { - globalFaces[i] = globalIndices.toGlobal(bFaces[i]); - } - } - - - // Pull slave pointBoundaryFaces to master - globalPointSlavesMap().distribute(globalPointBoundaryFaces); +} - // Merge slave labels into master globalPointBoundaryFaces - const labelListList& pointSlaves = globalPointSlaves(); +// Find transformation to take remotePoint to localPoint. Use info to find +// the transforms. +Foam::label Foam::globalMeshData::findTransform +( + const labelPairList& info, + const labelPair& remotePoint, + const label localPoint +) const +{ + const label remoteProcI = globalIndexAndTransform::processor(remotePoint); + const label remoteIndex = globalIndexAndTransform::index(remotePoint); - forAll(pointSlaves, pointI) + label remoteTransformI = -1; + label localTransformI = -1; + forAll(info, i) { - const labelList& slaves = pointSlaves[pointI]; + label procI = globalIndexAndTransform::processor(info[i]); + label pointI = globalIndexAndTransform::index(info[i]); + label transformI = globalIndexAndTransform::transformIndex(info[i]); - if (slaves.size() > 0) + if (procI == Pstream::myProcNo() && pointI == localPoint) { - labelList& myBFaces = globalPointBoundaryFaces[pointI]; - - forAll(slaves, i) - { - const labelList& slaveBFaces = - globalPointBoundaryFaces[slaves[i]]; - - // Add all slaveBFaces. Note that need to check for - // uniqueness only in case of cyclics. - - label sz = myBFaces.size(); - myBFaces.setSize(sz+slaveBFaces.size()); - forAll(slaveBFaces, j) - { - label slave = slaveBFaces[j]; - if (findIndex(SubList<label>(myBFaces, sz), slave) == -1) - { - myBFaces[sz++] = slave; - } - } - myBFaces.setSize(sz); - } + localTransformI = transformI; + //Pout<< "For local :" << localPoint + // << " found transform:" << localTransformI + // << endl; } - } - - - // Copy merged boundaryFaces back from master into slave slot - forAll(pointSlaves, pointI) - { - const labelList& bFaces = globalPointBoundaryFaces[pointI]; - const labelList& slaves = pointSlaves[pointI]; - - forAll(slaves, i) + if (procI == remoteProcI && pointI == remoteIndex) { - globalPointBoundaryFaces[slaves[i]] = bFaces; + remoteTransformI = transformI; + //Pout<< "For remote:" << remotePoint + // << " found transform:" << remoteTransformI + // << " at index:" << i + // << endl; } } + if (remoteTransformI == -1 || localTransformI == -1) + { + FatalErrorIn("globalMeshData::findTransform(..)") + << "Problem. Cannot find " << remotePoint + << " or " << localPoint << " in " << info + << endl + << "remoteTransformI:" << remoteTransformI << endl + << "localTransformI:" << localTransformI + << abort(FatalError); + } - // Sync back to slaves. - globalPointSlavesMap().reverseDistribute + return globalTransforms().subtractTransformIndex ( - coupledPatch().nPoints(), - globalPointBoundaryFaces + remoteTransformI, + localTransformI ); - - - // Construct a map to get the face data directly - List<Map<label> > compactMap(Pstream::nProcs()); - globalPointBoundaryFacesMapPtr_.reset - ( - new mapDistribute - ( - globalIndices, - globalPointBoundaryFaces, - compactMap - ) - ); - - if (debug) - { - Pout<< "globalMeshData::calcGlobalPointBoundaryFaces() :" - << " coupled points:" << coupledPatch().nPoints() - << " local boundary faces:" << globalIndices.localSize() - << " additional remote faces:" - << globalPointBoundaryFacesMapPtr_().constructSize() - - globalIndices.localSize() - << endl; - } } -void Foam::globalMeshData::calcGlobalPointBoundaryCells() const +void Foam::globalMeshData::calcGlobalEdgeSlaves() const { if (debug) { - Pout<< "globalMeshData::calcGlobalPointBoundaryCells() :" - << " calculating coupled point to boundary cell addressing." - << endl; + Pout<< "globalMeshData::calcGlobalEdgeSlaves() :" + << " calculating coupled master to slave edge addressing." << endl; } - // Create map of boundary cells and point-cell addressing - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + const edgeList& edges = coupledPatch().edges(); + const globalIndex& globalEdgeNumbers = globalEdgeNumbering(); - label bCellI = 0; - Map<label> meshCellMap(4*coupledPatch().nPoints()); - DynamicList<label> cellMap(meshCellMap.size()); - // Create addressing for point to boundary cells (local) - labelListList pointBoundaryCells(coupledPatch().nPoints()); + // The whole problem with deducting edge-connectivity from + // point-connectivity is that one of the the endpoints might be + // a local master but the other endpoint might not. So we first + // need to make sure that all points know about connectivity and + // the transformations. - forAll(coupledPatch().meshPoints(), pointI) - { - label meshPointI = coupledPatch().meshPoints()[pointI]; - const labelList& pCells = mesh_.pointCells(meshPointI); - labelList& bCells = pointBoundaryCells[pointI]; - bCells.setSize(pCells.size()); + // 1. collect point connectivity - basically recreating globalPoints ouput. + // All points will now have a string of points. The transforms are + // in respect to the master. + List<labelPairList> allPointConnectivity; + calcPointConnectivity(allPointConnectivity); - forAll(pCells, i) - { - label cellI = pCells[i]; - Map<label>::iterator fnd = meshCellMap.find(cellI); - if (fnd != meshCellMap.end()) - { - bCells[i] = fnd(); - } - else - { - meshCellMap.insert(cellI, bCellI); - cellMap.append(cellI); - bCells[i] = bCellI; - bCellI++; - } - } - } + // 2. Get all pointEdges and pointPoints + // Coupled point to global coupled edges and corresponding endpoint. + labelListList globalPointEdges; + List<labelPairList> globalPointPoints; + calcGlobalPointEdges(globalPointEdges, globalPointPoints); - boundaryCellsPtr_.reset(new labelList()); - labelList& boundaryCells = boundaryCellsPtr_(); - boundaryCells.transfer(cellMap.shrink()); + // 3. Now all points have + // - all the connected points with original transform + // - all the connected global edges + // Now all we need to do is go through all the edges and check + // both endpoints. If there is a edge between the two which is + // produced by transforming both points in the same way it is a shared + // edge. - // Convert point-cells to global point numbers - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Collect strings of connected edges. + List<labelPairList> allEdgeConnectivity(edges.size()); - globalBoundaryCellNumberingPtr_.reset - ( - new globalIndex(boundaryCells.size()) - ); - globalIndex& globalIndices = globalBoundaryCellNumberingPtr_(); - - - globalPointBoundaryCellsPtr_.reset - ( - new labelListList(globalPointSlavesMap().constructSize()) - ); - labelListList& globalPointBoundaryCells = globalPointBoundaryCellsPtr_(); - - forAll(pointBoundaryCells, pointI) + forAll(edges, edgeI) { - const labelList& pCells = pointBoundaryCells[pointI]; - labelList& globalCells = globalPointBoundaryCells[pointI]; - globalCells.setSize(pCells.size()); - forAll(pCells, i) + const edge& e = edges[edgeI]; + const labelList& pEdges0 = globalPointEdges[e[0]]; + const labelPairList& pPoints0 = globalPointPoints[e[0]]; + const labelList& pEdges1 = globalPointEdges[e[1]]; + const labelPairList& pPoints1 = globalPointPoints[e[1]]; + + // Most edges will be size 2 + DynamicList<labelPair> eEdges(2); + // Append myself. + eEdges.append + ( + globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + edgeI, + globalTransforms().nullTransformIndex() + ) + ); + + forAll(pEdges0, i) { - globalCells[i] = globalIndices.toGlobal(pCells[i]); + forAll(pEdges1, j) + { + if + ( + pEdges0[i] == pEdges1[j] + && pEdges0[i] != globalEdgeNumbers.toGlobal(edgeI) + ) + { + // Found a shared edge. Now check if the endpoints + // go through the same transformation. + // Local: e[0] remote:pPoints1[j] + // Local: e[1] remote:pPoints0[i] + + + // Find difference in transforms to go from point on remote + // edge (pPoints1[j]) to this point. + + label transform0 = findTransform + ( + allPointConnectivity[e[0]], + pPoints1[j], + e[0] + ); + label transform1 = findTransform + ( + allPointConnectivity[e[1]], + pPoints0[i], + e[1] + ); + + if (transform0 == transform1) + { + label procI = globalEdgeNumbers.whichProcID(pEdges0[i]); + eEdges.append + ( + globalIndexAndTransform::encode + ( + procI, + globalEdgeNumbers.toLocal(procI, pEdges0[i]), + transform0 + ) + ); + } + } + } } - } - - - // Pull slave pointBoundaryCells to master - globalPointSlavesMap().distribute(globalPointBoundaryCells); + allEdgeConnectivity[edgeI].transfer(eEdges); + sort(allEdgeConnectivity[edgeI], globalIndexAndTransform::less()); + } - // Merge slave labels into master globalPointBoundaryCells - const labelListList& pointSlaves = globalPointSlaves(); + // We now have - in allEdgeConnectivity - a list of edges which are shared + // between multiple processors. Filter into non-transformed and transformed + // connections. - forAll(pointSlaves, pointI) + globalEdgeSlavesPtr_.reset(new labelListList(edges.size())); + labelListList& globalEdgeSlaves = globalEdgeSlavesPtr_(); + List<labelPairList> transformedEdges(edges.size()); + forAll(allEdgeConnectivity, edgeI) { - const labelList& slaves = pointSlaves[pointI]; - - if (slaves.size() > 0) + const labelPairList& edgeInfo = allEdgeConnectivity[edgeI]; + if (edgeInfo.size() >= 2) { - labelList& myBCells = globalPointBoundaryCells[pointI]; + const labelPair& masterInfo = edgeInfo[0]; - forAll(slaves, i) + // Check if master edge (= first element (since sorted)) is me. + if + ( + ( + globalIndexAndTransform::processor(masterInfo) + == Pstream::myProcNo() + ) + && (globalIndexAndTransform::index(masterInfo) == edgeI) + ) { - const labelList& slaveBCells = - globalPointBoundaryCells[slaves[i]]; + // Sort into transformed and untransformed + labelList& eEdges = globalEdgeSlaves[edgeI]; + eEdges.setSize(edgeInfo.size()-1); + + labelPairList& trafoEEdges = transformedEdges[edgeI]; + trafoEEdges.setSize(edgeInfo.size()-1); - // Add all slaveBCells. Note that need to check for - // uniqueness only in case of cyclics. + label nonTransformI = 0; + label transformI = 0; - label sz = myBCells.size(); - myBCells.setSize(sz+slaveBCells.size()); - forAll(slaveBCells, j) + for (label i = 1; i < edgeInfo.size(); i++) { - label slave = slaveBCells[j]; - if (findIndex(SubList<label>(myBCells, sz), slave) == -1) + const labelPair& info = edgeInfo[i]; + label procI = globalIndexAndTransform::processor(info); + label index = globalIndexAndTransform::index(info); + label transform = globalIndexAndTransform::transformIndex + ( + info + ); + + if (transform == globalTransforms().nullTransformIndex()) { - myBCells[sz++] = slave; + eEdges[nonTransformI++] = globalEdgeNumbers.toGlobal + ( + procI, + index + ); + } + else + { + trafoEEdges[transformI++] = info; } } - myBCells.setSize(sz); - } - } - } - - // Copy merged boundaryCells back from master into slave slot - forAll(pointSlaves, pointI) - { - const labelList& bCells = globalPointBoundaryCells[pointI]; - const labelList& slaves = pointSlaves[pointI]; - - forAll(slaves, i) - { - globalPointBoundaryCells[slaves[i]] = bCells; + eEdges.setSize(nonTransformI); + trafoEEdges.setSize(transformI); + } } } - // Sync back to slaves. - globalPointSlavesMap().reverseDistribute - ( - coupledPatch().nPoints(), - globalPointBoundaryCells - ); - + // Construct map + globalEdgeTransformedSlavesPtr_.reset(new labelListList()); - // Construct a map to get the cell data directly List<Map<label> > compactMap(Pstream::nProcs()); - globalPointBoundaryCellsMapPtr_.reset + globalEdgeSlavesMapPtr_.reset ( new mapDistribute ( - globalIndices, - globalPointBoundaryCells, - compactMap - ) - ); - - if (debug) - { - Pout<< "globalMeshData::calcGlobalPointBoundaryCells() :" - << " coupled points:" << coupledPatch().nPoints() - << " local boundary cells:" << globalIndices.localSize() - << " additional remote cells:" - << globalPointBoundaryCellsMapPtr_().constructSize() - - globalIndices.localSize() - << endl; - } -} - - -void Foam::globalMeshData::calcGlobalPointAllSlaves() const -{ - if (debug) - { - Pout<< "globalMeshData::calcGlobalPointAllSlaves() :" - << " calculating coupled master to slave point addressing." - << endl; - } + globalEdgeNumbers, + globalEdgeSlaves, - // Calculate collocated&non-collocated connected points for master points. - globalPoints allGlobalData(mesh_, coupledPatch(), true, true); + globalTransforms(), + transformedEdges, + globalEdgeTransformedSlavesPtr_(), - calcGlobalPointSlaves - ( - allGlobalData, - globalPointAllNumberingPtr_, - globalPointAllSlavesPtr_, - globalPointAllSlavesMapPtr_ + compactMap + ) ); -} -void Foam::globalMeshData::calcGlobalEdgeAllSlaves() const -{ if (debug) { - Pout<< "globalMeshData::calcGlobalEdgeAllSlaves() :" - << " calculating coupled master to slave edge addressing." + Pout<< "globalMeshData::calcGlobalEdgeSlaves() :" + << " coupled edges:" << edges.size() + << " additional coupled edges:" + << globalEdgeSlavesMapPtr_().constructSize() - edges.size() << endl; } +} - // - Send across connected edges (in global edge addressing) - // - Check on receiving side whether edge has same slave edge - // on both endpoints. - - // Create global numbering for coupled edges - const globalIndex& globalIndices = globalEdgeNumbering(); - calcGlobalEdgeSlaves - ( - globalPointAllSlaves(), - globalPointAllSlavesMap(), - globalIndices, - globalEdgeAllSlavesPtr_, - globalEdgeAllSlavesMapPtr_ - ); -} +//// Calculate uncoupled boundary faces (without calculating +//// primitiveMesh::pointFaces()) +//void Foam::globalMeshData::calcPointBoundaryFaces +//( +// labelListList& pointBoundaryFaces +//) const +//{ +// const polyBoundaryMesh& bMesh = mesh_.boundaryMesh(); +// const Map<label>& meshPointMap = coupledPatch().meshPointMap(); +// +// // 1. Count +// +// labelList nPointFaces(coupledPatch().nPoints(), 0); +// +// forAll(bMesh, patchI) +// { +// const polyPatch& pp = bMesh[patchI]; +// +// if (!pp.coupled()) +// { +// forAll(pp, i) +// { +// const face& f = pp[i]; +// +// forAll(f, fp) +// { +// Map<label>::const_iterator iter = meshPointMap.find +// ( +// f[fp] +// ); +// if (iter != meshPointMap.end()) +// { +// nPointFaces[iter()]++; +// } +// } +// } +// } +// } +// +// +// // 2. Size +// +// pointBoundaryFaces.setSize(coupledPatch().nPoints()); +// forAll(nPointFaces, pointI) +// { +// pointBoundaryFaces[pointI].setSize(nPointFaces[pointI]); +// } +// nPointFaces = 0; +// +// +// // 3. Fill +// +// forAll(bMesh, patchI) +// { +// const polyPatch& pp = bMesh[patchI]; +// +// if (!pp.coupled()) +// { +// forAll(pp, i) +// { +// const face& f = pp[i]; +// forAll(f, fp) +// { +// Map<label>::const_iterator iter = meshPointMap.find +// ( +// f[fp] +// ); +// if (iter != meshPointMap.end()) +// { +// label bFaceI = +// pp.start() + i - mesh_.nInternalFaces(); +// pointBoundaryFaces[iter()][nPointFaces[iter()]++] = +// bFaceI; +// } +// } +// } +// } +// } +//} +// +// +//void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const +//{ +// if (debug) +// { +// Pout<< "globalMeshData::calcGlobalPointBoundaryFaces() :" +// << " calculating coupled point to boundary face addressing." +// << endl; +// } +// +// // Construct local point to (uncoupled)boundaryfaces. +// labelListList pointBoundaryFaces; +// calcPointBoundaryFaces(pointBoundaryFaces); +// +// +// // Global indices for boundary faces +// globalBoundaryFaceNumberingPtr_.reset +// ( +// new globalIndex(mesh_.nFaces()-mesh_.nInternalFaces()) +// ); +// globalIndex& globalIndices = globalBoundaryFaceNumberingPtr_(); +// +// +// // Convert local boundary faces to global numbering +// globalPointBoundaryFacesPtr_.reset +// ( +// new labelListList(globalPointSlavesMap().constructSize()) +// ); +// labelListList& globalPointBoundaryFaces = globalPointBoundaryFacesPtr_(); +// +// forAll(pointBoundaryFaces, pointI) +// { +// const labelList& bFaces = pointBoundaryFaces[pointI]; +// labelList& globalFaces = globalPointBoundaryFaces[pointI]; +// globalFaces.setSize(bFaces.size()); +// forAll(bFaces, i) +// { +// globalFaces[i] = globalIndices.toGlobal(bFaces[i]); +// } +// } +// +// +// // Pull slave pointBoundaryFaces to master +// globalPointSlavesMap().distribute +// ( +// globalTransforms(), +// globalPointBoundaryFaces +// ); +// +// +// // Merge slave labels into master globalPointBoundaryFaces. +// // Split into untransformed and transformed values. +// const labelListList& pointSlaves = globalPointSlaves(); +// const labelListList& pointTransformSlaves = +// globalPointTransformedSlaves(); +// +// +// List<labelPairList> transformedFaces; +// +// +// forAll(pointSlaves, pointI) +// { +// const labelList& slaves = pointSlaves[pointI]; +// +// if (slaves.size() > 0) +// { +// labelList& myBFaces = globalPointBoundaryFaces[pointI]; +// +// forAll(slaves, i) +// { +// const labelList& slaveBFaces = +// globalPointBoundaryFaces[slaves[i]]; +// +// // Add all slaveBFaces. Note that need to check for +// // uniqueness only in case of cyclics. +// +// label sz = myBFaces.size(); +// myBFaces.setSize(sz+slaveBFaces.size()); +// forAll(slaveBFaces, j) +// { +// label slave = slaveBFaces[j]; +// if (findIndex(SubList<label>(myBFaces, sz), slave) == -1) +// { +// myBFaces[sz++] = slave; +// } +// } +// myBFaces.setSize(sz); +// } +// } +// } +// +// +// // Copy merged boundaryFaces back from master into slave slot +// forAll(pointSlaves, pointI) +// { +// const labelList& bFaces = globalPointBoundaryFaces[pointI]; +// const labelList& slaves = pointSlaves[pointI]; +// +// forAll(slaves, i) +// { +// globalPointBoundaryFaces[slaves[i]] = bFaces; +// } +// } +// +// +// // Sync back to slaves. +// globalPointSlavesMap().reverseDistribute +// ( +// coupledPatch().nPoints(), +// globalPointBoundaryFaces +// ); +// +// +// // Construct a map to get the face data directly +// List<Map<label> > compactMap(Pstream::nProcs()); +// +// globalPointTransformedBoundaryFacesPtr_.reset +// ( +// new labelList(transformedFaces.size()) +// ); +// +// globalPointBoundaryFacesMapPtr_.reset +// ( +// new mapDistribute +// ( +// globalIndices, +// globalPointBoundaryFaces, +// +// globalTransforms(), +// transformedFaces, +// globalPointTransformedBoundaryFacesPtr_, +// +// compactMap +// ) +// ); +// +// if (debug) +// { +// Pout<< "globalMeshData::calcGlobalPointBoundaryFaces() :" +// << " coupled points:" << coupledPatch().nPoints() +// << " local boundary faces:" << globalIndices.localSize() +// << " additional coupled faces:" +// << globalPointBoundaryFacesMapPtr_().constructSize() +// - globalIndices.localSize() +// << endl; +// } +//} + + +//void Foam::globalMeshData::calcGlobalPointBoundaryCells() const +//{ +// if (debug) +// { +// Pout<< "globalMeshData::calcGlobalPointBoundaryCells() :" +// << " calculating coupled point to boundary cell addressing." +// << endl; +// } +// +// // Create map of boundary cells and point-cell addressing +// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// label bCellI = 0; +// Map<label> meshCellMap(4*coupledPatch().nPoints()); +// DynamicList<label> cellMap(meshCellMap.size()); +// +// // Create addressing for point to boundary cells (local) +// labelListList pointBoundaryCells(coupledPatch().nPoints()); +// +// forAll(coupledPatch().meshPoints(), pointI) +// { +// label meshPointI = coupledPatch().meshPoints()[pointI]; +// const labelList& pCells = mesh_.pointCells(meshPointI); +// +// labelList& bCells = pointBoundaryCells[pointI]; +// bCells.setSize(pCells.size()); +// +// forAll(pCells, i) +// { +// label cellI = pCells[i]; +// Map<label>::iterator fnd = meshCellMap.find(cellI); +// +// if (fnd != meshCellMap.end()) +// { +// bCells[i] = fnd(); +// } +// else +// { +// meshCellMap.insert(cellI, bCellI); +// cellMap.append(cellI); +// bCells[i] = bCellI; +// bCellI++; +// } +// } +// } +// +// +// boundaryCellsPtr_.reset(new labelList()); +// labelList& boundaryCells = boundaryCellsPtr_(); +// boundaryCells.transfer(cellMap.shrink()); +// +// +// // Convert point-cells to global point numbers +// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// globalBoundaryCellNumberingPtr_.reset +// ( +// new globalIndex(boundaryCells.size()) +// ); +// globalIndex& globalIndices = globalBoundaryCellNumberingPtr_(); +// +// +// globalPointBoundaryCellsPtr_.reset +// ( +// new labelListList(globalPointSlavesMap().constructSize()) +// ); +// labelListList& globalPointBoundaryCells = globalPointBoundaryCellsPtr_(); +// +// forAll(pointBoundaryCells, pointI) +// { +// const labelList& pCells = pointBoundaryCells[pointI]; +// labelList& globalCells = globalPointBoundaryCells[pointI]; +// globalCells.setSize(pCells.size()); +// forAll(pCells, i) +// { +// globalCells[i] = globalIndices.toGlobal(pCells[i]); +// } +// } +// +// +// // Pull slave pointBoundaryCells to master +// globalPointSlavesMap().distribute(globalPointBoundaryCells); +// +// +// // Merge slave labels into master globalPointBoundaryCells +// const labelListList& pointSlaves = globalPointSlaves(); +// +// forAll(pointSlaves, pointI) +// { +// const labelList& slaves = pointSlaves[pointI]; +// +// if (slaves.size() > 0) +// { +// labelList& myBCells = globalPointBoundaryCells[pointI]; +// +// forAll(slaves, i) +// { +// const labelList& slaveBCells = +// globalPointBoundaryCells[slaves[i]]; +// +// // Add all slaveBCells. Note that need to check for +// // uniqueness only in case of cyclics. +// +// label sz = myBCells.size(); +// myBCells.setSize(sz+slaveBCells.size()); +// forAll(slaveBCells, j) +// { +// label slave = slaveBCells[j]; +// if (findIndex(SubList<label>(myBCells, sz), slave) == -1) +// { +// myBCells[sz++] = slave; +// } +// } +// myBCells.setSize(sz); +// } +// } +// } +// +// +// // Copy merged boundaryCells back from master into slave slot +// forAll(pointSlaves, pointI) +// { +// const labelList& bCells = globalPointBoundaryCells[pointI]; +// const labelList& slaves = pointSlaves[pointI]; +// +// forAll(slaves, i) +// { +// globalPointBoundaryCells[slaves[i]] = bCells; +// } +// } +// +// +// // Sync back to slaves. +// globalPointSlavesMap().reverseDistribute +// ( +// coupledPatch().nPoints(), +// globalPointBoundaryCells +// ); +// +// +// // Construct a map to get the cell data directly +// List<Map<label> > compactMap(Pstream::nProcs()); +// globalPointBoundaryCellsMapPtr_.reset +// ( +// new mapDistribute +// ( +// globalIndices, +// globalPointBoundaryCells, +// compactMap +// ) +// ); +// +// if (debug) +// { +// Pout<< "globalMeshData::calcGlobalPointBoundaryCells() :" +// << " coupled points:" << coupledPatch().nPoints() +// << " local boundary cells:" << globalIndices.localSize() +// << " additional coupled cells:" +// << globalPointBoundaryCellsMapPtr_().constructSize() +// - globalIndices.localSize() +// << endl; +// } +//} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -1054,7 +1465,6 @@ Foam::globalMeshData::globalMeshData(const polyMesh& mesh) : processorTopology(mesh.boundaryMesh()), mesh_(mesh), - bb_(vector::zero, vector::zero), nTotalPoints_(-1), nTotalFaces_(-1), nTotalCells_(-1), @@ -1062,8 +1472,8 @@ Foam::globalMeshData::globalMeshData(const polyMesh& mesh) processorPatchIndices_(0), processorPatchNeighbours_(0), nGlobalPoints_(-1), - sharedPointLabels_(0), - sharedPointAddr_(0), + sharedPointLabelsPtr_(NULL), + sharedPointAddrPtr_(NULL), sharedPointGlobalLabelsPtr_(NULL), nGlobalEdges_(-1), sharedEdgeLabelsPtr_(NULL), @@ -1073,42 +1483,6 @@ Foam::globalMeshData::globalMeshData(const polyMesh& mesh) } -// Read constructor given IOobject and a polyMesh reference -Foam::globalMeshData::globalMeshData(const IOobject& io, const polyMesh& mesh) -: - processorTopology(mesh.boundaryMesh()), - mesh_(mesh), - bb_(mesh.points()), - nTotalPoints_(-1), - nTotalFaces_(-1), - nTotalCells_(-1), - processorPatches_(0), - processorPatchIndices_(0), - processorPatchNeighbours_(0), - nGlobalPoints_(-1), - sharedPointLabels_(0), - sharedPointAddr_(0), - sharedPointGlobalLabelsPtr_(NULL), - nGlobalEdges_(-1), - sharedEdgeLabelsPtr_(NULL), - sharedEdgeAddrPtr_(NULL) -{ - initProcAddr(); - - IOdictionary dict(io); - - dict.lookup("nTotalPoints") >> nTotalPoints_; - dict.lookup("nTotalFaces") >> nTotalFaces_; - dict.lookup("nTotalCells") >> nTotalCells_; - dict.lookup("nGlobalPoints") >> nGlobalPoints_; - dict.lookup("sharedPointLabels") >> sharedPointLabels_; - dict.lookup("sharedPointAddr") >> sharedPointAddr_; - labelList sharedPointGlobalLabels(dict.lookup("sharedPointGlobalLabels")); - - sharedPointGlobalLabelsPtr_ = new labelList(sharedPointGlobalLabels); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::globalMeshData::~globalMeshData() @@ -1119,44 +1493,43 @@ Foam::globalMeshData::~globalMeshData() void Foam::globalMeshData::clearOut() { - deleteDemandDrivenData(sharedPointGlobalLabelsPtr_); - // Edge + // Point nGlobalPoints_ = -1; - deleteDemandDrivenData(sharedEdgeLabelsPtr_); - deleteDemandDrivenData(sharedEdgeAddrPtr_); + sharedPointLabelsPtr_.clear(); + sharedPointAddrPtr_.clear(); + sharedPointGlobalLabelsPtr_.clear(); + // Edge + nGlobalEdges_ = -1; + sharedEdgeLabelsPtr_.clear(); + sharedEdgeAddrPtr_.clear(); + + // Coupled patch coupledPatchPtr_.clear(); coupledPatchMeshEdgesPtr_.clear(); coupledPatchMeshEdgeMapPtr_.clear(); + globalTransformsPtr_.clear(); // Point globalPointNumberingPtr_.clear(); globalPointSlavesPtr_.clear(); + globalPointTransformedSlavesPtr_.clear(); globalPointSlavesMapPtr_.clear(); // Edge globalEdgeNumberingPtr_.clear(); globalEdgeSlavesPtr_.clear(); + globalEdgeTransformedSlavesPtr_.clear(); globalEdgeSlavesMapPtr_.clear(); - // Face - globalBoundaryFaceNumberingPtr_.clear(); - globalPointBoundaryFacesPtr_.clear(); - globalPointBoundaryFacesMapPtr_.clear(); - // Cell - boundaryCellsPtr_.clear(); - globalBoundaryCellNumberingPtr_.clear(); - globalPointBoundaryCellsPtr_.clear(); - globalPointBoundaryCellsMapPtr_.clear(); - - //- Non-collocated - - // Point - globalPointAllNumberingPtr_.clear(); - globalPointAllSlavesPtr_.clear(); - globalPointAllSlavesMapPtr_.clear(); - // Edge - globalEdgeAllSlavesPtr_.clear(); - globalEdgeAllSlavesMapPtr_.clear(); +// // Face +// globalBoundaryFaceNumberingPtr_.clear(); +// globalPointBoundaryFacesPtr_.clear(); +// globalPointBoundaryFacesMapPtr_.clear(); +// // Cell +// boundaryCellsPtr_.clear(); +// globalBoundaryCellNumberingPtr_.clear(); +// globalPointBoundaryCellsPtr_.clear(); +// globalPointBoundaryCellsMapPtr_.clear(); } @@ -1165,10 +1538,13 @@ void Foam::globalMeshData::clearOut() // Return shared point global labels. const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const { - if (!sharedPointGlobalLabelsPtr_) + if (!sharedPointGlobalLabelsPtr_.valid()) { - sharedPointGlobalLabelsPtr_ = new labelList(sharedPointLabels_.size()); - labelList& sharedPointGlobalLabels = *sharedPointGlobalLabelsPtr_; + sharedPointGlobalLabelsPtr_.reset + ( + new labelList(sharedPointLabels().size()) + ); + labelList& sharedPointGlobalLabels = sharedPointGlobalLabelsPtr_(); IOobject addrHeader ( @@ -1187,10 +1563,12 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const labelIOList pointProcAddressing(addrHeader); - forAll(sharedPointLabels_, i) + const labelList& pointLabels = sharedPointLabels(); + + forAll(pointLabels, i) { // Get my mesh point - label pointI = sharedPointLabels_[i]; + label pointI = pointLabels[i]; // Map to mesh point of original mesh sharedPointGlobalLabels[i] = pointProcAddressing[pointI]; @@ -1204,7 +1582,7 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const sharedPointGlobalLabels = -1; } } - return *sharedPointGlobalLabelsPtr_; + return sharedPointGlobalLabelsPtr_(); } @@ -1214,17 +1592,19 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const // Get all processors to send their shared points to master. // (not very efficient) - pointField sharedPoints(nGlobalPoints_); + pointField sharedPoints(nGlobalPoints()); + const labelList& pointAddr = sharedPointAddr(); + const labelList& pointLabels = sharedPointLabels(); if (Pstream::master()) { // Master: // insert my own data first - forAll(sharedPointLabels_, i) + forAll(pointLabels, i) { - label sharedPointI = sharedPointAddr_[i]; + label sharedPointI = pointAddr[i]; - sharedPoints[sharedPointI] = mesh_.points()[sharedPointLabels_[i]]; + sharedPoints[sharedPointI] = mesh_.points()[pointLabels[i]]; } // Receive data from slaves and insert @@ -1274,8 +1654,8 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const OPstream toMaster(Pstream::blocking, Pstream::masterNo()); toMaster - << sharedPointAddr_ - << UIndirectList<point>(mesh_.points(), sharedPointLabels_)(); + << pointAddr + << UIndirectList<point>(mesh_.points(), pointLabels)(); } // Receive sharedPoints @@ -1293,20 +1673,13 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const Foam::pointField Foam::globalMeshData::geometricSharedPoints() const { // Get coords of my shared points - pointField sharedPoints(sharedPointLabels_.size()); - - forAll(sharedPointLabels_, i) - { - label meshPointI = sharedPointLabels_[i]; - - sharedPoints[i] = mesh_.points()[meshPointI]; - } + pointField sharedPoints(mesh_.points(), sharedPointLabels()); // Append from all processors combineReduce(sharedPoints, plusEqOp<pointField>()); // Merge tolerance - scalar tolDim = matchTol_ * bb_.mag(); + scalar tolDim = matchTol_ * mesh_.bounds().mag(); // And see how many are unique labelList pMap; @@ -1325,6 +1698,36 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const } +Foam::label Foam::globalMeshData::nGlobalPoints() const +{ + if (nGlobalPoints_ == -1) + { + calcSharedPoints(); + } + return nGlobalPoints_; +} + + +const Foam::labelList& Foam::globalMeshData::sharedPointLabels() const +{ + if (!sharedPointLabelsPtr_.valid()) + { + calcSharedPoints(); + } + return sharedPointLabelsPtr_(); +} + + +const Foam::labelList& Foam::globalMeshData::sharedPointAddr() const +{ + if (!sharedPointAddrPtr_.valid()) + { + calcSharedPoints(); + } + return sharedPointAddrPtr_(); +} + + Foam::label Foam::globalMeshData::nGlobalEdges() const { if (nGlobalEdges_ == -1) @@ -1337,21 +1740,21 @@ Foam::label Foam::globalMeshData::nGlobalEdges() const const Foam::labelList& Foam::globalMeshData::sharedEdgeLabels() const { - if (!sharedEdgeLabelsPtr_) + if (!sharedEdgeLabelsPtr_.valid()) { calcSharedEdges(); } - return *sharedEdgeLabelsPtr_; + return sharedEdgeLabelsPtr_(); } const Foam::labelList& Foam::globalMeshData::sharedEdgeAddr() const { - if (!sharedEdgeAddrPtr_) + if (!sharedEdgeAddrPtr_.valid()) { calcSharedEdges(); } - return *sharedEdgeAddrPtr_; + return sharedEdgeAddrPtr_(); } @@ -1465,6 +1868,17 @@ const Foam::globalIndex& Foam::globalMeshData::globalPointNumbering() const } +const Foam::globalIndexAndTransform& +Foam::globalMeshData::globalTransforms() const +{ + if (!globalTransformsPtr_.valid()) + { + globalTransformsPtr_.reset(new globalIndexAndTransform(mesh_)); + } + return globalTransformsPtr_(); +} + + const Foam::labelListList& Foam::globalMeshData::globalPointSlaves() const { if (!globalPointSlavesPtr_.valid()) @@ -1475,6 +1889,17 @@ const Foam::labelListList& Foam::globalMeshData::globalPointSlaves() const } +const Foam::labelListList& Foam::globalMeshData::globalPointTransformedSlaves() +const +{ + if (!globalPointTransformedSlavesPtr_.valid()) + { + calcGlobalPointSlaves(); + } + return globalPointTransformedSlavesPtr_(); +} + + const Foam::mapDistribute& Foam::globalMeshData::globalPointSlavesMap() const { if (!globalPointSlavesMapPtr_.valid()) @@ -1508,142 +1933,24 @@ const Foam::labelListList& Foam::globalMeshData::globalEdgeSlaves() const } -const Foam::mapDistribute& Foam::globalMeshData::globalEdgeSlavesMap() const -{ - if (!globalEdgeSlavesMapPtr_.valid()) - { - calcGlobalEdgeSlaves(); - } - return globalEdgeSlavesMapPtr_(); -} - - -const Foam::globalIndex& Foam::globalMeshData::globalBoundaryFaceNumbering() -const -{ - if (!globalBoundaryFaceNumberingPtr_.valid()) - { - calcGlobalPointBoundaryFaces(); - } - return globalBoundaryFaceNumberingPtr_(); -} - - -const Foam::labelListList& Foam::globalMeshData::globalPointBoundaryFaces() -const -{ - if (!globalPointBoundaryFacesPtr_.valid()) - { - calcGlobalPointBoundaryFaces(); - } - return globalPointBoundaryFacesPtr_(); -} - - -const Foam::mapDistribute& Foam::globalMeshData::globalPointBoundaryFacesMap() -const -{ - if (!globalPointBoundaryFacesMapPtr_.valid()) - { - calcGlobalPointBoundaryFaces(); - } - return globalPointBoundaryFacesMapPtr_(); -} - - -const Foam::labelList& Foam::globalMeshData::boundaryCells() const -{ - if (!boundaryCellsPtr_.valid()) - { - calcGlobalPointBoundaryCells(); - } - return boundaryCellsPtr_(); -} - - -const Foam::globalIndex& Foam::globalMeshData::globalBoundaryCellNumbering() -const -{ - if (!globalBoundaryCellNumberingPtr_.valid()) - { - calcGlobalPointBoundaryCells(); - } - return globalBoundaryCellNumberingPtr_(); -} - - -const Foam::labelListList& Foam::globalMeshData::globalPointBoundaryCells() -const -{ - if (!globalPointBoundaryCellsPtr_.valid()) - { - calcGlobalPointBoundaryCells(); - } - return globalPointBoundaryCellsPtr_(); -} - - -const Foam::mapDistribute& Foam::globalMeshData::globalPointBoundaryCellsMap() +const Foam::labelListList& Foam::globalMeshData::globalEdgeTransformedSlaves() const { - if (!globalPointBoundaryCellsMapPtr_.valid()) - { - calcGlobalPointBoundaryCells(); - } - return globalPointBoundaryCellsMapPtr_(); -} - - - -// Non-collocated coupled point/edge addressing - -const Foam::globalIndex& Foam::globalMeshData::globalPointAllNumbering() const -{ - if (!globalPointAllNumberingPtr_.valid()) - { - calcGlobalPointAllSlaves(); - } - return globalPointAllNumberingPtr_(); -} - - -const Foam::labelListList& Foam::globalMeshData::globalPointAllSlaves() const -{ - if (!globalPointAllSlavesPtr_.valid()) - { - calcGlobalPointAllSlaves(); - } - return globalPointAllSlavesPtr_(); -} - - -const Foam::mapDistribute& Foam::globalMeshData::globalPointAllSlavesMap() const -{ - if (!globalPointAllSlavesMapPtr_.valid()) - { - calcGlobalPointAllSlaves(); - } - return globalPointAllSlavesMapPtr_(); -} - - -const Foam::labelListList& Foam::globalMeshData::globalEdgeAllSlaves() const -{ - if (!globalEdgeAllSlavesPtr_.valid()) + if (!globalEdgeTransformedSlavesPtr_.valid()) { - calcGlobalEdgeAllSlaves(); + calcGlobalEdgeSlaves(); } - return globalEdgeAllSlavesPtr_(); + return globalEdgeTransformedSlavesPtr_(); } -const Foam::mapDistribute& Foam::globalMeshData::globalEdgeAllSlavesMap() const +const Foam::mapDistribute& Foam::globalMeshData::globalEdgeSlavesMap() const { - if (!globalEdgeAllSlavesMapPtr_.valid()) + if (!globalEdgeSlavesMapPtr_.valid()) { - calcGlobalEdgeAllSlaves(); + calcGlobalEdgeSlaves(); } - return globalEdgeAllSlavesMapPtr_(); + return globalEdgeSlavesMapPtr_(); } @@ -1874,7 +2181,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints } } - // Allocate globals for master + // Allocate globals for master labelList masterToGlobal(pointSlavesMap.constructSize(), -456); forAll(masterPoints, i) @@ -1935,6 +2242,8 @@ void Foam::globalMeshData::movePoints(const pointField& newPoints) { // Topology does not change and we don't store any geometry so nothing // needs to be done. + // Only global transformations might change but this is not really + // supported. } @@ -1947,268 +2256,34 @@ void Foam::globalMeshData::updateMesh() // Do processor patch addressing initProcAddr(); - // Note: boundBox does reduce - bb_ = boundBox(mesh_.points()); - - scalar tolDim = matchTol_ * bb_.mag(); - - if (debug) - { - Pout<< "globalMeshData : bb_:" << bb_ - << " merge dist:" << tolDim << endl; - } - - - // Option 1. Topological - { - // Calculate all shared points (excluded points that are only - // on two coupled patches). This does all the hard work. - globalPoints parallelPoints(mesh_, false, true); - - // Copy data out. - nGlobalPoints_ = parallelPoints.nGlobalPoints(); - sharedPointLabels_ = parallelPoints.sharedPointLabels(); - sharedPointAddr_ = parallelPoints.sharedPointAddr(); - } - //// Option 2. Geometric - //{ - // // Calculate all shared points. This does all the hard work. - // geomGlobalPoints parallelPoints(mesh_, tolDim); - // - // // Copy data out. - // nGlobalPoints_ = parallelPoints.nGlobalPoints(); - // sharedPointLabels_ = parallelPoints.sharedPointLabels(); - // sharedPointAddr_ = parallelPoints.sharedPointAddr(); - // - // nGlobalEdges_ = parallelPoints.nGlobalEdges(); - // sharedEdgeLabels_ = parallelPoints.sharedEdgeLabels(); - // sharedEdgeAddr_ = parallelPoints.sharedEdgeAddr(); - //} + scalar tolDim = matchTol_ * mesh_.bounds().mag(); if (debug) { - Pout<< "globalMeshData : nGlobalPoints_:" << nGlobalPoints_ << nl - << "globalMeshData : sharedPointLabels_:" - << sharedPointLabels_.size() << nl - << "globalMeshData : sharedPointAddr_:" - << sharedPointAddr_.size() << endl; + Pout<< "globalMeshData : merge dist:" << tolDim << endl; } - - // Total number of faces. Start off from all faces. Remove coincident - // processor faces (on highest numbered processor) before summing. - nTotalFaces_ = mesh_.nFaces(); - - // Do not count processor-patch faces that are coincident. - forAll(processorPatches_, i) - { - label patchI = processorPatches_[i]; - - if (isType<processorPolyPatch>(mesh_.boundaryMesh()[patchI])) - { - // Normal, unseparated processor patch. Remove duplicates. - nTotalFaces_ -= mesh_.boundaryMesh()[patchI].size(); - } - } - reduce(nTotalFaces_, sumOp<label>()); + // Total number of faces. + nTotalFaces_ = returnReduce(mesh_.nFaces(), sumOp<label>()); if (debug) { Pout<< "globalMeshData : nTotalFaces_:" << nTotalFaces_ << endl; } - - nTotalCells_ = mesh_.nCells(); - reduce(nTotalCells_, sumOp<label>()); + nTotalCells_ = returnReduce(mesh_.nCells(), sumOp<label>()); if (debug) { Pout<< "globalMeshData : nTotalCells_:" << nTotalCells_ << endl; } - nTotalPoints_ = mesh_.nPoints(); - - // Correct points for duplicate ones. We have - // - points shared between 2 processor patches only. Count only on - // lower numbered processor. Make sure to count only once since points - // can be on multiple patches on the same processor. - // - globally shared points. - - if (Pstream::parRun()) - { - const label UNSET = 0; // not set - const label SHARED = 1; // globally shared - const label VISITED = 2; // corrected for - - // Mark globally shared points - PackedList<2> pointStatus(mesh_.nPoints(), UNSET); - - forAll(sharedPointLabels_, i) - { - label meshPointI = sharedPointLabels_[i]; - - pointStatus.set(meshPointI, SHARED); - } - - PstreamBuffers pBufs(Pstream::nonBlocking); - - // Send patch local points - forAll(processorPatches_, i) - { - label patchI = processorPatches_[i]; - - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]); - - UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs); - - toNeighbour << procPatch.localPoints(); - } - - pBufs.finishedSends(); - - // Receive patch local points and uncount if coincident (and not shared) - forAll(processorPatches_, i) - { - label patchI = processorPatches_[i]; - - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]); - - UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); - - pointField nbrPoints(fromNeighbour); - - if (Pstream::myProcNo() > procPatch.neighbProcNo()) - { - labelList pMap; - matchPoints - ( - procPatch.localPoints(), - nbrPoints, - scalarField(procPatch.nPoints(), tolDim), // tolerance - false, // verbosity - pMap // map from my points to nbrPoints - ); - - forAll(pMap, patchPointI) - { - label meshPointI = procPatch.meshPoints()[patchPointI]; - - label stat = pointStatus.get(meshPointI); - - if (stat == UNSET) - { - // Mark point as visited so if point is on multiple proc - // patches it only gets uncounted once. - pointStatus.set(meshPointI, VISITED); - - if (pMap[patchPointI] != -1) - { - // Points share same coordinate so uncount. - nTotalPoints_--; - } - } - } - } - } - // Sum all points - reduce(nTotalPoints_, sumOp<label>()); - } - - // nTotalPoints has not been corrected yet for shared points. For these - // just collect all their coordinates and count unique ones. - - label mySharedPoints = sharedPointLabels_.size(); - reduce(mySharedPoints, sumOp<label>()); - - // Collect and merge shared points (does parallel communication) - pointField geomSharedPoints(geometricSharedPoints()); - label nGeomSharedPoints = geomSharedPoints.size(); - - // Shared points merged down to mergedPoints size. - nTotalPoints_ -= mySharedPoints - nGeomSharedPoints; + nTotalPoints_ = returnReduce(mesh_.nPoints(), sumOp<label>()); if (debug) { Pout<< "globalMeshData : nTotalPoints_:" << nTotalPoints_ << endl; } - - // - // Now we have all info we wanted. - // Do some checking (if debug is set) - // - - if (debug) - { - if (Pstream::master()) - { - // We have the geometricSharedPoints already so write them. - // Ideally would like to write the networks of connected points as - // well but this is harder. (Todo) - Pout<< "globalMeshData : writing geometrically separated shared" - << " points to geomSharedPoints.obj" << endl; - - OFstream str("geomSharedPoints.obj"); - - forAll(geomSharedPoints, i) - { - const point& pt = geomSharedPoints[i]; - - str << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() - << nl; - } - } - } -} - - -// Write data -bool Foam::globalMeshData::write() const -{ - IOdictionary dict - ( - IOobject - ( - "parallelData", - mesh_.facesInstance(), - mesh_.meshSubDir, - mesh_ - ) - ); - - dict.add("nTotalPoints", nTotalPoints()); - dict.add("nTotalFaces", nTotalFaces()); - dict.add("nTotalCells", nTotalCells()); - - dict.add("nGlobalPoints", nGlobalPoints()); - dict.add("sharedPointLabels", sharedPointLabels()); - dict.add("sharedPointAddr", sharedPointAddr()); - dict.add("sharedPointGlobalLabels", sharedPointGlobalLabels()); - - return dict.writeObject - ( - IOstream::ASCII, - IOstream::currentVersion, - IOstream::UNCOMPRESSED - ); -} - - -// * * * * * * * * * * * * * * * Ostream Operators * * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const globalMeshData& p) -{ - os << "nTotalPoints " << p.nTotalPoints() << token::END_STATEMENT << nl - << "nTotalFaces " << p.nTotalFaces() << token::END_STATEMENT << nl - << "nTotalCells " << p.nTotalCells() << token::END_STATEMENT << nl - << "nGlobalPoints " << p.nGlobalPoints() << token::END_STATEMENT << nl - << "sharedPointLabels " << p.sharedPointLabels() - << token::END_STATEMENT << nl - << "sharedPointAddr " << p.sharedPointAddr() - << token::END_STATEMENT << endl; - - return os; } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index 514f57caccbb5023220cb7dd279d741ce56b9d26..94d0cf5715edf4f38063223b1a420a6ff243bf70 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -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 @@ -32,52 +32,56 @@ Description - all processor patches to have correct ordering. - all processorPatches to have their transforms set. - The shared point addressing is quite interesting. It gives on each processor - the vertices that cannot be set using a normal swap on processor patches. - These are the vertices that are shared between more than 2 processors. - - There is an issue with these shared vertices if they originate from - cyclics (i.e. are now separated processor patches). They will all be - mapped to the same global point (so even though the processor points are - not on the same location) since topologically they are one and the same. - - So if you ask for sharedPoints() you get only one of the coordinates of - the topologically shared points. - - All the hard work of these shared points is done by the globalPoints class. - - Shared edges: similar to shared points gives on all processors the edges - that are shared between more than two patches (i.e. the edges on which - data cannot be synchronized by a straightforward edge data swap). Note - that shared edges will use shared points but not all edges between shared - points need to be shared edges (e.g. there might be an edge connecting - two disconnected regions of shared points). - - Currently an edge is considered shared + The shared point and edge addressing is quite interesting. + It calculates addressing for points and edges on coupled patches. In + the 'old' way a distincation was made between points/edges that are + only on two processors and those that are on multiple processors. The + problem is that those on multiple processors do not allow any + transformations and require a global reduction on the master processor. + + The alternative is to have an exchange schedule (through a 'mapDistribute') + which sends all point/edge data (no distinction is made between + those on two and those on more than two coupled patches) to the local + 'master'. This master then does any calculation and sends + the result back to the 'slave' points/edges. This only needs to be done + on points on coupled faces. Any transformation is done using a predetermined + set of transformations - since transformations have to be space filling + only a certain number of transformation is supported. + + The exchange needs + - a field of data + - a mapDistribute which does all parallel exchange and transformations + This appens remote data to the end of the field. + - a set of indices which indicate where to get untransformed data in the + field + - a set of indices which indicate where to get transformed data in the + field + + See also mapDistribute, globalIndexAndTransform + + Notes: + - compared to 17x nTotalFaces, nTotalPoints do not compensate for + shared points since this would trigger full connectivity analysis + - most calculation is demand driven and uses parallel communication + so make sure to invoke on all processors at the same time. + - old sharedEdge calculation: currently an edge is considered shared if it uses two shared points and is used more than once. This is not correct on processor patches but it only slightly overestimates the number of shared edges. Doing full analysis of how many patches use the edge would be too complicated. - Shared edge calculation is demand driven so always make sure to have - your first call to one of the access functions synchronous amongst all - processors! - - SourceFiles globalMeshData.C + globalMeshDataTemplates.C \*---------------------------------------------------------------------------*/ #ifndef globalMeshData_H #define globalMeshData_H -#include "Switch.H" #include "processorTopology.H" #include "labelPair.H" #include "indirectPrimitivePatch.H" -#include "boundBox.H" -#include "IOobject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,13 +90,11 @@ namespace Foam // Forward declaration of friend functions and operators -class globalMeshData; -Ostream& operator<<(Ostream&, const globalMeshData&); -class globalIndex; class polyMesh; class mapDistribute; template<class T> class EdgeMap; -class globalPoints; +class globalIndex; +class globalIndexAndTransform; /*---------------------------------------------------------------------------*\ Class globalMeshData Declaration @@ -126,9 +128,6 @@ class globalMeshData }; - typedef List<labelPair> labelPairList; - - // Private data //- Reference to mesh @@ -137,9 +136,6 @@ class globalMeshData // Data related to the complete mesh - //- Bounding box of complete mesh - boundBox bb_; - //- Total number of points in the complete mesh label nTotalPoints_; @@ -165,23 +161,70 @@ class globalMeshData labelList processorPatchNeighbours_; + // Coupled point addressing + // This is addressing from coupled point to coupled points/faces/cells. + // This is a full schedule so includes points used by only two + // coupled patches. + + //- Patch of coupled faces. Additional patch edge to mesh edges + // correspondence: + // points: meshPoints(), meshPointMap() + // edges : meshEdges(), meshEdgeMap() + mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_; + mutable autoPtr<labelList> coupledPatchMeshEdgesPtr_; + mutable autoPtr<Map<label> > coupledPatchMeshEdgeMapPtr_; + + //- Global numbering for coupledPatch points + mutable autoPtr<globalIndex> globalPointNumberingPtr_; + + //- Global numbering for transforms + mutable autoPtr<globalIndexAndTransform> globalTransformsPtr_; + + // Coupled point to coupled points + + mutable autoPtr<labelListList> globalPointSlavesPtr_; + mutable autoPtr<labelListList> globalPointTransformedSlavesPtr_; + mutable autoPtr<mapDistribute> globalPointSlavesMapPtr_; + + // Coupled edge to coupled edges + + mutable autoPtr<globalIndex> globalEdgeNumberingPtr_; + mutable autoPtr<labelListList> globalEdgeSlavesPtr_; + mutable autoPtr<labelListList> globalEdgeTransformedSlavesPtr_; + mutable autoPtr<mapDistribute> globalEdgeSlavesMapPtr_; + + + //// Coupled point to boundary faces + // + //mutable autoPtr<globalIndex> globalBoundaryFaceNumberingPtr_; + //mutable autoPtr<labelListList> globalPointBoundaryFacesPtr_; + //mutable autoPtr<mapDistribute> globalPointBoundaryFacesMapPtr_; + // + //// Coupled point to collocated boundary cells + // + //mutable autoPtr<labelList> boundaryCellsPtr_; + //mutable autoPtr<globalIndex> globalBoundaryCellNumberingPtr_; + //mutable autoPtr<labelListList> globalPointBoundaryCellsPtr_; + //mutable autoPtr<mapDistribute> globalPointBoundaryCellsMapPtr_; + + // Globally shared point addressing //- Total number of global points - label nGlobalPoints_; + mutable label nGlobalPoints_; //- Indices of local points that are globally shared - labelList sharedPointLabels_; + mutable autoPtr<labelList> sharedPointLabelsPtr_; //- Indices of globally shared points in the master list // This list contains all the shared points in the mesh - labelList sharedPointAddr_; + mutable autoPtr<labelList> sharedPointAddrPtr_; //- Shared point global labels. // Global point index for every local shared point. // Only valid if constructed with this information or if // pointProcAddressing read. - mutable labelList* sharedPointGlobalLabelsPtr_; + mutable autoPtr<labelList> sharedPointGlobalLabelsPtr_; // Globally shared edge addressing. Derived from shared points. @@ -191,68 +234,11 @@ class globalMeshData mutable label nGlobalEdges_; //- Indices of local edges that are globally shared - mutable labelList* sharedEdgeLabelsPtr_; + mutable autoPtr<labelList> sharedEdgeLabelsPtr_; //- Indices of globally shared edge in the master list // This list contains all the shared edges in the mesh - mutable labelList* sharedEdgeAddrPtr_; - - - // Coupled point addressing - // This is addressing from coupled point to coupled points/faces/cells. - // Two variants: - // - collocated (so not physically separated) - // - also separated - // This is a full schedule so includes points only used by two - // coupled patches. - - mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_; - - mutable autoPtr<labelList> coupledPatchMeshEdgesPtr_; - - mutable autoPtr<Map<label> > coupledPatchMeshEdgeMapPtr_; - - // Collocated - - // Coupled point to collocated coupled points - - mutable autoPtr<globalIndex> globalPointNumberingPtr_; - mutable autoPtr<labelListList> globalPointSlavesPtr_; - mutable autoPtr<mapDistribute> globalPointSlavesMapPtr_; - - // Coupled edge to collocated coupled edges - - mutable autoPtr<globalIndex> globalEdgeNumberingPtr_; - mutable autoPtr<labelListList> globalEdgeSlavesPtr_; - mutable autoPtr<mapDistribute> globalEdgeSlavesMapPtr_; - - // Coupled point to collocated boundary faces - - mutable autoPtr<globalIndex> globalBoundaryFaceNumberingPtr_; - mutable autoPtr<labelListList> globalPointBoundaryFacesPtr_; - mutable autoPtr<mapDistribute> globalPointBoundaryFacesMapPtr_; - - // Coupled point to collocated boundary cells - - mutable autoPtr<labelList> boundaryCellsPtr_; - mutable autoPtr<globalIndex> globalBoundaryCellNumberingPtr_; - mutable autoPtr<labelListList> globalPointBoundaryCellsPtr_; - mutable autoPtr<mapDistribute> globalPointBoundaryCellsMapPtr_; - - - // Non-collocated as well - - // Coupled point to all coupled points - - mutable autoPtr<globalIndex> globalPointAllNumberingPtr_; - mutable autoPtr<labelListList> globalPointAllSlavesPtr_; - mutable autoPtr<mapDistribute> globalPointAllSlavesMapPtr_; - - // Coupled edge to all coupled edges (same numbering as - // collocated coupled edges) - - mutable autoPtr<labelListList> globalEdgeAllSlavesPtr_; - mutable autoPtr<mapDistribute> globalEdgeAllSlavesMapPtr_; + mutable autoPtr<labelList> sharedEdgeAddrPtr_; // Private Member Functions @@ -268,69 +254,38 @@ class globalMeshData label& ); + //- Calculate shared point addressing + void calcSharedPoints() const; + //- Calculate shared edge addressing void calcSharedEdges() const; - //- Count coincident faces. - static label countCoincidentFaces - ( - const scalar tolDim, - const vectorField& separationDist - ); - - //- Calculate global point addressing. - void calcGlobalPointSlaves - ( - const globalPoints&, - autoPtr<globalIndex>&, - autoPtr<labelListList>&, - autoPtr<mapDistribute>& - ) const; - - //- Calculate global point addressing. + //- Calculate global point addressing. void calcGlobalPointSlaves() const; - //- Calculate global edge addressing. - void calcGlobalEdgeSlaves - ( - const labelListList&, - const mapDistribute&, - const globalIndex&, - autoPtr<labelListList>&, - autoPtr<mapDistribute>& - ) const; - - //- Calculate global edge addressing. - void calcGlobalEdgeSlaves() const; - - //- Calculate coupled point to uncoupled boundary faces. Local only. - void calcPointBoundaryFaces(labelListList& pointBoundaryFaces) const; - - //- Calculate global point to global boundary face addressing. - void calcGlobalPointBoundaryFaces() const; - - //- Calculate global point to global boundary cell addressing. - void calcGlobalPointBoundaryCells() const; + // Global edge addressing + //- Calculate connected points + void calcPointConnectivity(List<labelPairList>&) const; - // Non-collocated + //- Calculate pointEdges and pointPoints addressing + void calcGlobalPointEdges + ( + labelListList& globalPointEdges, + List<labelPairList>& globalPointPoints + ) const; - //- Calculate global point addressing. - void calcGlobalPointAllSlaves() const; + //- Look up remote and local point and find using info the + // transforms to go from remotePoint to localPoint + label findTransform + ( + const labelPairList& info, + const labelPair& remotePoint, + const label localPoint + ) const; //- Calculate global edge addressing. - void calcGlobalEdgeAllSlaves() const; - - - //- Synchronise pointwise data - template<class Type, class CombineOp> - void syncPointData - ( - List<Type>& pointData, - const labelListList& slaves, - const mapDistribute& slavesMap, - const CombineOp& cop - ) const; + void calcGlobalEdgeSlaves() const; //- Disallow default bitwise copy construct @@ -348,7 +303,7 @@ public: // Static data members - //- Geomtric tolerance (fraction of bounding box) + //- Geometric tolerance (fraction of bounding box) static const Foam::scalar matchTol_; @@ -357,10 +312,6 @@ public: //- Construct from mesh, derive rest (does parallel communication!) globalMeshData(const polyMesh& mesh); - //- Old behaviour: read constructor given IOobject and a polyMesh - // reference. Only use this for testing! - globalMeshData(const IOobject& io, const polyMesh& mesh); - //- Destructor ~globalMeshData(); @@ -386,24 +337,21 @@ public: return processorPatches_.size() > 0; } - const boundBox& bb() const - { - return bb_; - } - - //- Return total number of points in decomposed mesh + //- Return total number of points in decomposed mesh. Not + // compensated for duplicate points! label nTotalPoints() const { return nTotalPoints_; } - //- Return total number of faces in decomposed mesh + //- Return total number of faces in decomposed mesh. Not + // compensated for duplicate faces! label nTotalFaces() const { return nTotalFaces_; } - //- Return total number of cells in decomposed mesh + //- Return total number of cells in decomposed mesh. label nTotalCells() const { return nTotalCells_; @@ -438,16 +386,10 @@ public: // Globally shared point addressing //- Return number of globally shared points - label nGlobalPoints() const - { - return nGlobalPoints_; - } + label nGlobalPoints() const; //- Return indices of local points that are globally shared - const labelList& sharedPointLabels() const - { - return sharedPointLabels_; - } + const labelList& sharedPointLabels() const; //- Return addressing into the complete globally shared points // list @@ -457,10 +399,7 @@ public: // points. Shared point addressing gives the index in the // list of all globally shared points for each of the locally // shared points. - const labelList& sharedPointAddr() const - { - return sharedPointAddr_; - } + const labelList& sharedPointAddr() const; //- Return shared point global labels. Tries to read // 'pointProcAddressing' and returns list or -1 if none @@ -515,70 +454,58 @@ public: //- Return map from mesh edges to coupledPatch edges const Map<label>& coupledPatchMeshEdgeMap() const; - - // Coupled point to collocated coupled points. Coupled points are + //- Global transforms numbering + const globalIndexAndTransform& globalTransforms() const; + + //- Helper: synchronise data with transforms + template<class Type, class CombineOp> + static void syncData + ( + List<Type>& pointData, + const labelListList& slaves, + const labelListList& transformedSlaves, + const mapDistribute& slavesMap, + const globalIndexAndTransform&, + const CombineOp& cop, + const bool isPosition + ); + + //- Helper: synchronise data without transforms + template<class Type, class CombineOp> + static void syncData + ( + List<Type>& pointData, + const labelListList& slaves, + const labelListList& transformedSlaves, + const mapDistribute& slavesMap, + const CombineOp& cop + ); + + + // Coupled point to coupled points. Coupled points are // points on any coupled patch. //- Numbering of coupled points is according to coupledPatch. const globalIndex& globalPointNumbering() const; - //- For every coupled point the indices into the field - // distributed by below map. const labelListList& globalPointSlaves() const; + const labelListList& globalPointTransformedSlaves() const; const mapDistribute& globalPointSlavesMap() const; - //- Helper to synchronise mesh data + //- Helper to synchronise mesh point data template<class Type, class CombineOp> void syncPointData ( List<Type>& pointData, - const CombineOp& cop + const CombineOp& cop, + const bool isPosition ) const; // Coupled edge to coupled edges. const globalIndex& globalEdgeNumbering() const; const labelListList& globalEdgeSlaves() const; + const labelListList& globalEdgeTransformedSlaves() const; const mapDistribute& globalEdgeSlavesMap() const; - // Coupled point to boundary faces. These are uncoupled boundary - // faces only but include empty patches. - - //- Numbering of boundary faces is face-mesh.nInternalFaces() - const globalIndex& globalBoundaryFaceNumbering() const; - const labelListList& globalPointBoundaryFaces() const; - const mapDistribute& globalPointBoundaryFacesMap() const; - - // Coupled point to boundary cell - - //- From boundary cell to mesh cell - const labelList& boundaryCells() const; - - //- Numbering of boundary cells is according to boundaryCells() - const globalIndex& globalBoundaryCellNumbering() const; - const labelListList& globalPointBoundaryCells() const; - const mapDistribute& globalPointBoundaryCellsMap() const; - - - // Collocated & non-collocated - - // Coupled point to all coupled points (collocated and - // non-collocated). - - const globalIndex& globalPointAllNumbering()const; - const labelListList& globalPointAllSlaves() const; - const mapDistribute& globalPointAllSlavesMap() const; - //- Helper to synchronise mesh data - template<class Type, class CombineOp> - void syncPointAllData - ( - List<Type>& pointData, - const CombineOp& cop - ) const; - - // Coupled edge to all coupled edges (same numbering as - // collocated) - - const labelListList& globalEdgeAllSlaves() const; - const mapDistribute& globalEdgeAllSlavesMap() const; // Other @@ -617,16 +544,6 @@ public: // full parallel analysis to determine shared points and // boundaries. void updateMesh(); - - - // Write - - bool write() const; - - - // Ostream Operator - - friend Ostream& operator<<(Ostream&, const globalMeshData&); }; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C index 82bbfe7694c6f7e2002a9355440d85b6502eb1f2..93005abcac15386d791112c7c5a167d467c78351 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C @@ -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 @@ -30,97 +30,155 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type, class CombineOp> -void Foam::globalMeshData::syncPointData +void Foam::globalMeshData::syncData ( - List<Type>& pointData, + List<Type>& elems, const labelListList& slaves, + const labelListList& transformedSlaves, const mapDistribute& slavesMap, - const CombineOp& cop -) const + const globalIndexAndTransform& transforms, + const CombineOp& cop, + const bool isPosition +) { - if (pointData.size() != mesh_.nPoints()) - { - FatalErrorIn("globalMeshData::syncPointData(..)") - << "Number of elements in data:" << pointData.size() - << " differs from number of points in mesh:" << mesh_.nPoints() - << abort(FatalError); - } - - const indirectPrimitivePatch& cpp = coupledPatch(); - const labelList& meshPoints = cpp.meshPoints(); - - // Copy mesh (point)data to coupled patch (point)data - Field<Type> cppFld(slavesMap.constructSize()); - forAll(meshPoints, patchPointI) - { - cppFld[patchPointI] = pointData[meshPoints[patchPointI]]; - } - // Pull slave data onto master - slavesMap.distribute(cppFld); + slavesMap.distribute(transforms, elems, isPosition); // Combine master data with slave data - forAll(slaves, patchPointI) + forAll(slaves, i) { - const labelList& slavePoints = slaves[patchPointI]; + Type& elem = elems[i]; - // Combine master with slave data - forAll(slavePoints, i) - { - cop(cppFld[patchPointI], cppFld[slavePoints[i]]); - } - // Copy result back to slave slots - forAll(slavePoints, i) + const labelList& slavePoints = slaves[i]; + const labelList& transformSlavePoints = transformedSlaves[i]; + + if (slavePoints.size()+transformSlavePoints.size() > 0) { - cppFld[slavePoints[i]] = cppFld[patchPointI]; + // Combine master with untransformed slave data + forAll(slavePoints, j) + { + cop(elem, elems[slavePoints[j]]); + } + + // Combine master with transformed slave data + forAll(transformSlavePoints, j) + { + cop(elem, elems[transformSlavePoints[j]]); + } + + + // Copy result back to slave slots + forAll(slavePoints, j) + { + elems[slavePoints[j]] = elem; + } + forAll(transformSlavePoints, j) + { + elems[transformSlavePoints[j]] = elem; + } } } - // Push master data back to slaves - slavesMap.reverseDistribute(meshPoints.size(), cppFld); - - // Update mesh (point)data from coupled patch (point)data - forAll(meshPoints, patchPointI) - { - pointData[meshPoints[patchPointI]] = cppFld[patchPointI]; - } + // Push slave-slot data back to slaves + slavesMap.reverseDistribute + ( + transforms, + elems.size(), + elems, + isPosition + ); } template<class Type, class CombineOp> -void Foam::globalMeshData::syncPointData +void Foam::globalMeshData::syncData ( - List<Type>& pointData, + List<Type>& elems, + const labelListList& slaves, + const labelListList& transformedSlaves, + const mapDistribute& slavesMap, const CombineOp& cop -) const +) { - const labelListList& slaves = globalPointSlaves(); - const mapDistribute& map = globalPointSlavesMap(); + // Pull slave data onto master + slavesMap.distribute(elems); - syncPointData - ( - pointData, - slaves, - map, - cop - ); + // Combine master data with slave data + forAll(slaves, i) + { + Type& elem = elems[i]; + + const labelList& slavePoints = slaves[i]; + const labelList& transformSlavePoints = transformedSlaves[i]; + + if (slavePoints.size()+transformSlavePoints.size() > 0) + { + // Combine master with untransformed slave data + forAll(slavePoints, j) + { + cop(elem, elems[slavePoints[j]]); + } + + // Combine master with transformed slave data + forAll(transformSlavePoints, j) + { + cop(elem, elems[transformSlavePoints[j]]); + } + + + // Copy result back to slave slots + forAll(slavePoints, j) + { + elems[slavePoints[j]] = elem; + } + forAll(transformSlavePoints, j) + { + elems[transformSlavePoints[j]] = elem; + } + } + } + + // Push slave-slot data back to slaves + slavesMap.reverseDistribute(elems.size(), elems); } template<class Type, class CombineOp> -void Foam::globalMeshData::syncPointAllData +void Foam::globalMeshData::syncPointData ( List<Type>& pointData, - const CombineOp& cop + const CombineOp& cop, + const bool isPosition ) const { - syncPointData + if (pointData.size() != mesh_.nPoints()) + { + FatalErrorIn("globalMeshData::syncPointData(..)") + << "Number of elements in data:" << pointData.size() + << " differs from number of points in mesh:" << mesh_.nPoints() + << abort(FatalError); + } + + // Transfer onto coupled patch + const indirectPrimitivePatch& cpp = coupledPatch(); + List<Type> cppFld(UIndirectList<Type>(pointData, cpp.meshPoints())); + + syncData ( - pointData, - globalPointAllSlaves(), - globalPointAllSlavesMap(), - cop + cppFld, + globalPointSlaves(), + globalPointTransformedSlaves(), + globalPointSlavesMap(), + globalTransforms(), + cop, + isPosition ); + + // Extract back onto mesh + forAll(cpp.meshPoints(), i) + { + pointData[cpp.meshPoints()[i]] = cppFld[i]; + } } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index da811b1a1b45c30b8e091ccbd14d772f7a1155f8..9a1954c507f14b21123fb18785c753dcabfd426e 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -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,91 +25,18 @@ License #include "globalPoints.H" #include "processorPolyPatch.H" -#include "processorCyclicPolyPatch.H" #include "cyclicPolyPatch.H" #include "polyMesh.H" +#include "mapDistribute.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(Foam::globalPoints, 0); -const Foam::label Foam::globalPoints::fromCollocated = labelMax/2; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Routines to handle global indices -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Foam::label Foam::globalPoints::toGlobal -( - const label localPointI, - const bool isCollocated -) const -{ - label globalPointI = globalIndices_.toGlobal(localPointI); - - if (isCollocated) - { - return globalPointI + fromCollocated; - } - else - { - return globalPointI; - } -} - - -bool Foam::globalPoints::isCollocated(const label globalI) const -{ - return globalI >= fromCollocated; -} - - -Foam::label Foam::globalPoints::removeCollocated(const label globalI) const -{ - if (globalI >= fromCollocated) - { - return globalI - fromCollocated; - } - else - { - return globalI; - } -} - - -bool Foam::globalPoints::isLocal(const label globalI) const -{ - return globalIndices_.isLocal(removeCollocated(globalI)); -} - - -Foam::label Foam::globalPoints::whichProcID(const label globalI) const -{ - return globalIndices_.whichProcID(removeCollocated(globalI)); -} - - -Foam::label Foam::globalPoints::toLocal -( - const label procI, - const label globalI -) const -{ - return globalIndices_.toLocal(procI, removeCollocated(globalI)); -} - - -Foam::label Foam::globalPoints::toLocal(const label globalI) const -{ - return toLocal(Pstream::myProcNo(), globalI); -} - - -// Collect all topological information about a point on a patch. - -// Total number of points on processor patches. Is upper limit for number +// Total number of points on coupled patches. Is upper limit for number // of shared points Foam::label Foam::globalPoints::countPatchPoints ( @@ -121,34 +48,54 @@ Foam::label Foam::globalPoints::countPatchPoints forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; - - if - ( - (Pstream::parRun() && isA<processorPolyPatch>(pp)) - || isA<cyclicPolyPatch>(pp) - ) + if (pp.coupled()) { nTotPoints += pp.nPoints(); } } - return nTotPoints; } +Foam::labelPairList Foam::globalPoints::addSendTransform +( + const label patchI, + const labelPairList& info +) const +{ + labelPairList sendInfo(info.size()); + + forAll(info, i) + { + sendInfo[i] = globalIndexAndTransform::encode + ( + globalIndexAndTransform::processor(info[i]), + globalIndexAndTransform::index(info[i]), + globalTransforms_.addToTransformIndex + ( + globalIndexAndTransform::transformIndex(info[i]), + patchI, + true // patchI is sending side + ) + ); + } + return sendInfo; +} + + // Collect all topological information about a point on a patch. // (this information is the patch faces using the point and the relative // position of the point in the face) void Foam::globalPoints::addToSend ( - const primitivePatch& pp, + const polyPatch& pp, const label patchPointI, - const labelList& knownInfo, + const labelPairList& knownInfo, DynamicList<label>& patchFaces, DynamicList<label>& indexInFace, - DynamicList<labelList>& allInfo -) + DynamicList<labelPairList>& allInfo +) const { label meshPointI = pp.meshPoints()[patchPointI]; @@ -164,7 +111,9 @@ void Foam::globalPoints::addToSend patchFaces.append(patchFaceI); indexInFace.append(findIndex(f, meshPointI)); - allInfo.append(knownInfo); + + // Add patch transformation + allInfo.append(addSendTransform(pp.index(), knownInfo)); } } @@ -173,29 +122,82 @@ void Foam::globalPoints::addToSend // nbrInfo is for a point a list of all the global points using it bool Foam::globalPoints::mergeInfo ( - const labelList& nbrInfo, - labelList& myInfo -) + const labelPairList& nbrInfo, + const label localPointI, + labelPairList& myInfo +) const { - labelList newInfo(myInfo); + bool anyChanged = false; + + labelPairList newInfo(myInfo); label newI = newInfo.size(); newInfo.setSize(newI + nbrInfo.size()); forAll(nbrInfo, i) { - label index = findIndex(myInfo, nbrInfo[i]); + const labelPair& info = nbrInfo[i]; + label nbrProcI = globalIndexAndTransform::processor(info); + label nbrIndex = globalIndexAndTransform::index(info); + label nbrTransform = globalIndexAndTransform::transformIndex(info); + + // Check if already have information about nbr point. There are two + // possibilities: + // - information found about same point but different transform. + // Combine transforms + // - information not found. + + label myIndex = -1; + forAll(myInfo, myI) + { + if (myInfo[myI] == info) + { + // Fully identical. We already have nbrInfo. + myIndex = myI; + } + else if + ( + globalIndexAndTransform::processor(myInfo[myI]) == nbrProcI + && globalIndexAndTransform::index(myInfo[myI]) == nbrIndex + ) + { + // Only differing is the transform. + label myTransform = globalIndexAndTransform::transformIndex + ( + myInfo[myI] + ); + + // Combine mine and nbr transform + label t = globalTransforms_.mergeTransformIndex + ( + nbrTransform, + myTransform + ); + myIndex = myI; + + if (t != myTransform) + { + // Same point but different transformation + newInfo[myI] = globalIndexAndTransform::encode + ( + nbrProcI, + nbrIndex, + t + ); + anyChanged = true; + break; + } + } + } - if (index == -1) + if (myIndex == -1) { + // New point newInfo[newI++] = nbrInfo[i]; + anyChanged = true; } } newInfo.setSize(newI); - - // Did anything change? - bool anyChanged = (newI > myInfo.size()); - myInfo.transfer(newInfo); return anyChanged; @@ -234,11 +236,10 @@ Foam::label Foam::globalPoints::localToMeshPoint // Updates database of current information on meshpoints with nbrInfo. // Uses mergeInfo above. Returns true if data kept for meshPointI changed. -bool Foam::globalPoints::storeInfo +bool Foam::globalPoints::mergeInfo ( - const labelList& nbrInfo, - const label localPointI, - const bool isCollocated + const labelPairList& nbrInfo, + const label localPointI ) { label infoChanged = false; @@ -248,16 +249,26 @@ bool Foam::globalPoints::storeInfo if (iter != meshToProcPoint_.end()) { - if (mergeInfo(nbrInfo, procPoints_[iter()])) + if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()])) { infoChanged = true; } } else { - labelList knownInfo(1, toGlobal(localPointI, isCollocated)); + // Construct local index for point + labelPairList knownInfo + ( + 1, + globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + localPointI, + globalTransforms_.nullTransformIndex() + ) + ); - if (mergeInfo(nbrInfo, knownInfo)) + if (mergeInfo(nbrInfo, localPointI, knownInfo)) { // Update addressing from into procPoints meshToProcPoint_.insert(localPointI, procPoints_.size()); @@ -271,42 +282,65 @@ bool Foam::globalPoints::storeInfo } -void Foam::globalPoints::printProcPoints +// Updates database of current information on meshpoints with nbrInfo. +// Uses mergeInfo above. Returns true if data kept for meshPointI changed. +bool Foam::globalPoints::storeInitialInfo ( - const labelList& patchToMeshPoint, - const labelList& pointInfo, - Ostream& os -) const + const labelPairList& nbrInfo, + const label localPointI +) { - forAll(pointInfo, i) - { - label globalI = pointInfo[i]; + label infoChanged = false; - label procI = whichProcID(globalI); - os << " connected to proc " << procI; + // Get the index into the procPoints list. + Map<label>::iterator iter = meshToProcPoint_.find(localPointI); - if (isCollocated(globalI)) - { - os << " collocated localpoint:"; - } - else + if (iter != meshToProcPoint_.end()) + { + if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()])) { - os << " separated localpoint:"; + infoChanged = true; } + } + else + { + // Update addressing into procPoints + meshToProcPoint_.insert(localPointI, procPoints_.size()); + // Insert into list of equivalences. + procPoints_.append(nbrInfo); + + infoChanged = true; + } + return infoChanged; +} - os << toLocal(procI, globalI); - if (isLocal(globalI)) +void Foam::globalPoints::printProcPoints +( + const labelList& patchToMeshPoint, + const labelPairList& pointInfo +) const +{ + forAll(pointInfo, i) + { + label procI = globalIndexAndTransform::processor(pointInfo[i]); + label index = globalIndexAndTransform::index(pointInfo[i]); + label trafoI = globalIndexAndTransform::transformIndex(pointInfo[i]); + + Pout<< "proc:" << procI; + Pout<< " localpoint:"; + Pout<< index; + Pout<< " through transform:" + << trafoI << " bits:" + << globalTransforms_.decodeTransformIndex(trafoI); + + if (procI == Pstream::myProcNo()) { - label meshPointI = localToMeshPoint - ( - patchToMeshPoint, - toLocal(globalI) - ); - os << " at:" << mesh_.points()[meshPointI]; + label meshPointI = localToMeshPoint(patchToMeshPoint, index); + Pout<< " at:" << mesh_.points()[meshPointI]; } - os << endl; + Pout<< endl; } } @@ -325,16 +359,8 @@ void Foam::globalPoints::initOwnPoints { const polyPatch& pp = patches[patchI]; - if - ( - (Pstream::parRun() && isA<processorPolyPatch>(pp)) - || isA<cyclicPolyPatch>(pp) - ) + if (pp.coupled()) { - // Assume all processor points are collocated and all - // processorCyclic and cyclic are separated. - bool isCollocatedPoint = isType<processorPolyPatch>(pp); - const labelList& meshPoints = pp.meshPoints(); if (allPoints) @@ -348,19 +374,23 @@ void Foam::globalPoints::initOwnPoints meshToPatchPoint, meshPointI ); - labelList knownInfo + + labelPairList knownInfo ( 1, - toGlobal(localPointI, isCollocatedPoint) + globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + localPointI, + globalTransforms_.nullTransformIndex() + ) ); - // Update addressing from point to index in procPoints - meshToProcPoint_.insert(localPointI, procPoints_.size()); - // Insert into list of equivalences. - procPoints_.append(knownInfo); - // Update changedpoints info. - changedPoints.insert(localPointI); + if (storeInitialInfo(knownInfo, localPointI)) + { + changedPoints.insert(localPointI); + } } } else @@ -377,19 +407,21 @@ void Foam::globalPoints::initOwnPoints meshPointI ); - labelList knownInfo + labelPairList knownInfo ( 1, - toGlobal(localPointI, isCollocatedPoint) + globalIndexAndTransform::encode + ( + Pstream::myProcNo(), + localPointI, + globalTransforms_.nullTransformIndex() + ) ); - // Update addressing from point to index in procPoints - meshToProcPoint_.insert(localPointI, procPoints_.size()); - // Insert into list of equivalences. - procPoints_.append(knownInfo); - - // Update changedpoints info. - changedPoints.insert(localPointI); + if (storeInitialInfo(knownInfo, localPointI)) + { + changedPoints.insert(localPointI); + } } } } @@ -407,23 +439,21 @@ void Foam::globalPoints::sendPatchPoints ) const { const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const labelPairList& patchInfo = globalTransforms_.patchTransformSign(); forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; + // mergeSeparated=true : send from all processor patches + // =false: send from ones without transform + if ( - Pstream::parRun() - && ( - isType<processorPolyPatch>(pp) - || (mergeSeparated && isA<processorCyclicPolyPatch>(pp)) - ) + (Pstream::parRun() && isA<processorPolyPatch>(pp)) + && (mergeSeparated || patchInfo[patchI].first() == -1) ) { - // processor cyclics are considered separated, pure processor - // always collocated. - const processorPolyPatch& procPatch = refCast<const processorPolyPatch>(pp); @@ -433,7 +463,7 @@ void Foam::globalPoints::sendPatchPoints // index in patch face DynamicList<label> indexInFace(pp.nPoints()); // all information I currently hold about this patchPoint - DynamicList<labelList> allInfo(pp.nPoints()); + DynamicList<labelPairList> allInfo(pp.nPoints()); // Now collect information on all points mentioned in @@ -455,10 +485,10 @@ void Foam::globalPoints::sendPatchPoints { label index = meshToProcPoint_[localPointI]; - const labelList& knownInfo = procPoints_[index]; + const labelPairList& knownInfo = procPoints_[index]; // Add my information about localPointI to the - // send buffers + // send buffers. Encode the transformation addToSend ( pp, @@ -496,11 +526,13 @@ void Foam::globalPoints::receivePatchPoints ( const bool mergeSeparated, const Map<label>& meshToPatchPoint, + const labelList& patchToMeshPoint, PstreamBuffers& pBufs, labelHashSet& changedPoints ) { const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const labelPairList& patchInfo = globalTransforms_.patchTransformSign(); // Reset changed points changedPoints.clear(); @@ -511,22 +543,16 @@ void Foam::globalPoints::receivePatchPoints if ( - Pstream::parRun() - && ( - isType<processorPolyPatch>(pp) - || (mergeSeparated && isA<processorCyclicPolyPatch>(pp)) - ) + (Pstream::parRun() && isA<processorPolyPatch>(pp)) + && (mergeSeparated || patchInfo[patchI].first() == -1) ) { const processorPolyPatch& procPatch = refCast<const processorPolyPatch>(pp); - // Processor patch is always collocated, processorCyclic is not. - bool isCollocatedPoint = isType<processorPolyPatch>(pp); - labelList patchFaces; labelList indexInFace; - List<labelList> nbrInfo; + List<labelPairList> nbrInfo; { UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); @@ -556,13 +582,20 @@ void Foam::globalPoints::receivePatchPoints meshPointI ); - if (storeInfo(nbrInfo[i], localPointI, isCollocatedPoint)) + if (mergeInfo(nbrInfo[i], localPointI)) { changedPoints.insert(localPointI); } } } - else if (mergeSeparated && isA<cyclicPolyPatch>(pp)) + else if + ( + ( + isA<cyclicPolyPatch>(pp) + && refCast<const cyclicPolyPatch>(pp).owner() + ) + && (mergeSeparated || patchInfo[patchI].first() == -1) + ) { // Handle cyclics: send lower half to upper half and vice versa. // Or since they both are in memory just do it point by point. @@ -570,6 +603,8 @@ void Foam::globalPoints::receivePatchPoints const cyclicPolyPatch& cycPatch = refCast<const cyclicPolyPatch>(pp); + //Pout<< "Patch:" << patchI << " name:" << pp.name() << endl; + const labelList& meshPoints = pp.meshPoints(); const labelList coupledMeshPoints(reverseMeshPoints(cycPatch)); @@ -578,6 +613,11 @@ void Foam::globalPoints::receivePatchPoints label meshPointA = meshPoints[i]; label meshPointB = coupledMeshPoints[i]; + //Pout<< "Connection between point " << meshPointA + // << " at " << mesh_.points()[meshPointA] + // << " and " << meshPointB + // << " at " << mesh_.points()[meshPointB] << endl; + label localA = meshToLocalPoint ( meshToPatchPoint, @@ -594,24 +634,58 @@ void Foam::globalPoints::receivePatchPoints Map<label>::iterator procPointA = meshToProcPoint_.find(localA); + labelPairList infoA; if (procPointA != meshToProcPoint_.end()) { - // Store A info onto pointB - if (storeInfo(procPoints_[procPointA()], localB, false)) - { - changedPoints.insert(localB); - } + infoA = addSendTransform + ( + cycPatch.index(), + procPoints_[procPointA()] + ); } // Same for info on pointB Map<label>::iterator procPointB = meshToProcPoint_.find(localB); + labelPairList infoB; if (procPointB != meshToProcPoint_.end()) { - // Store B info onto pointA - if (storeInfo(procPoints_[procPointB()], localA, false)) + infoB = addSendTransform + ( + cycPatch.neighbPatchID(), + procPoints_[procPointB()] + ); + } + + + if (infoA.size()) + { + if (mergeInfo(infoA, localB)) + { + //Pout<< " Combined info at point " + // << mesh_.points()[meshPointB] + // << " now " << endl; + //printProcPoints + //( + // patchToMeshPoint, + // procPoints_[meshToProcPoint_[localB]] + //); + changedPoints.insert(localB); + } + } + if (infoB.size()) + { + if (mergeInfo(infoB, localA)) { + //Pout<< " Combined info at point " + // << mesh_.points()[meshPointA] + // << " now " << endl; + //printProcPoints + //( + // patchToMeshPoint, + // procPoints_[meshToProcPoint_[localA]] + //); changedPoints.insert(localA); } } @@ -630,17 +704,16 @@ void Foam::globalPoints::remove ) { // Save old ones. - Map<label> oldMeshToProcPoint(meshToProcPoint_); - meshToProcPoint_.clear(); - - List<labelList> oldProcPoints; - oldProcPoints.transfer(procPoints_); + Map<label> oldMeshToProcPoint(meshToProcPoint_.xfer()); + meshToProcPoint_.resize(oldMeshToProcPoint.size()); + DynamicList<labelPairList> oldProcPoints(procPoints_.xfer()); + procPoints_.setCapacity(oldProcPoints.size()); // Go through all equivalences forAllConstIter(Map<label>, oldMeshToProcPoint, iter) { label localPointI = iter.key(); - const labelList& pointInfo = oldProcPoints[iter()]; + const labelPairList& pointInfo = oldProcPoints[iter()]; if (pointInfo.size() == 2) { @@ -649,32 +722,40 @@ void Foam::globalPoints::remove // is in it. This would be an ordinary connection and can be // handled by normal face-face connectivity. - const label a = pointInfo[0]; - const label b = pointInfo[1]; + label proc0 = globalIndexAndTransform::processor(pointInfo[0]); + label proc1 = globalIndexAndTransform::processor(pointInfo[1]); if ( ( - isLocal(a) - && directNeighbours.found(toLocal(a)) + proc0 == Pstream::myProcNo() + && directNeighbours.found + ( + globalIndexAndTransform::index(pointInfo[0]) + ) ) || ( - isLocal(b) - && directNeighbours.found(toLocal(b)) + proc1 == Pstream::myProcNo() + && directNeighbours.found + ( + globalIndexAndTransform::index(pointInfo[1]) + ) ) ) { // Normal faceNeighbours - if (isLocal(a)) + if (proc0 == Pstream::myProcNo()) { //Pout<< "Removing direct neighbour:" - // << mesh_.points()[a[1]] + // << mesh_.points() + // [globalIndexAndTransform::index(pointInfo[0])] // << endl; } - else if (isLocal(b)) + else if (proc1 == Pstream::myProcNo()) { //Pout<< "Removing direct neighbour:" - // << mesh_.points()[b[1]] + // << mesh_.points() + // [globalIndexAndTransform::index(pointInfo[1])] // << endl; } } @@ -703,8 +784,12 @@ void Foam::globalPoints::remove // So this meshPoint will have info of size one only. if ( - !isLocal(pointInfo[0]) - || !directNeighbours.found(toLocal(pointInfo[0])) + globalIndexAndTransform::processor(pointInfo[0]) + != Pstream::myProcNo() + || !directNeighbours.found + ( + globalIndexAndTransform::index(pointInfo[0]) + ) ) { meshToProcPoint_.insert(localPointI, procPoints_.size()); @@ -719,439 +804,7 @@ void Foam::globalPoints::remove } procPoints_.shrink(); -} - - -// Compact indices -void Foam::globalPoints::compact(const labelList& patchToMeshPoint) -{ - labelList oldToNew(procPoints_.size(), -1); - labelList newToOld(meshToProcPoint_.size()); - - label newIndex = 0; - forAllConstIter(Map<label>, meshToProcPoint_, iter) - { - label oldIndex = iter(); - - if (oldToNew[oldIndex] == -1) - { - // Check if one of the procPoints already is merged. - const labelList& pointInfo = procPoints_[oldIndex]; - - if (pointInfo.size() >= 2) - { - // Merge out single entries - - label minIndex = labelMax; - - forAll(pointInfo, i) - { - if (isLocal(pointInfo[i])) - { - label localI = toLocal(pointInfo[i]); - - // Is localPoint itself already merged? - label index = meshToProcPoint_[localI]; - - //Pout<< " found point:" << localI - // << " with current index " << index << endl; - - if (oldToNew[index] != -1) - { - minIndex = min(minIndex, oldToNew[index]); - } - } - } - - if (minIndex < labelMax && minIndex != oldIndex) - { - // Make my index point to minIndex - oldToNew[oldIndex] = minIndex; - } - else - { - // Nothing compacted yet. Allocate new index. - oldToNew[oldIndex] = newIndex; - newToOld[newIndex] = oldIndex; - newIndex++; - } - } - else - { - //Pout<< "Removed singlepoint pointI:" << iter.key() - // << " currentindex:" << iter() - // << endl; - } - } - } - - // Redo indices - Map<label> oldMeshToProcPoint(meshToProcPoint_.xfer()); - forAllConstIter(Map<label>, oldMeshToProcPoint, iter) - { - label newIndex = oldToNew[iter()]; - if (newIndex != -1) - { - meshToProcPoint_.insert(iter.key(), newIndex); - } - } - - List<labelList> oldProcPoints; - oldProcPoints.transfer(procPoints_); - - newToOld.setSize(newIndex); - - procPoints_.setSize(newIndex); - - forAll(procPoints_, i) - { - // Transfer - procPoints_[i].transfer(oldProcPoints[newToOld[i]]); - } -} - - -// Get (indices of) points for which I am master (= lowest numbered point on -// lowest numbered processor). -// (equivalence lists should be complete by now) -Foam::labelList Foam::globalPoints::getMasterPoints -( - const labelList& patchToMeshPoint -) const -{ - //labelList masterPoints(nPatchPoints_); - //label nMaster = 0; - - labelHashSet masterPointSet(nPatchPoints_); - - - // Go through all equivalences and determine points where I am master. - forAllConstIter(Map<label>, meshToProcPoint_, iter) - { - label localPointI = iter.key(); - const labelList& pointInfo = procPoints_[iter()]; - - if (pointInfo.size() < 2) - { - // Points should have an equivalence list >= 2 since otherwise - // they would be direct neighbours and have been removed in the - // call to 'remove'. - label meshPointI = localToMeshPoint(patchToMeshPoint, localPointI); - - FatalErrorIn("globalPoints::getMasterPoints(..)") - << '[' << Pstream::myProcNo() << ']' - << " MeshPoint:" << meshPointI - << " coord:" << mesh_.points()[meshPointI] - << " has no corresponding point on a neighbouring processor" - << abort(FatalError); - } - else - { - // Check if lowest numbered processor and point is - // on this processor. Since already sorted is first element. - - if - ( - isLocal(pointInfo[0]) - && toLocal(pointInfo[0]) == localPointI - ) - { - // I am lowest numbered processor and point. Add to my list. - //masterPoints[nMaster++] = localPointI; - masterPointSet.insert(localPointI); - } - } - } - - return masterPointSet.toc(); -} - - -// Send subset of lists. -// Note: might not be used if separated -void Foam::globalPoints::sendSharedPoints -( - const bool mergeSeparated, - PstreamBuffers& pBufs, - const DynamicList<label>& changedIndices -) const -{ - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if - ( - Pstream::parRun() - && ( - isType<processorPolyPatch>(pp) - || (mergeSeparated && isA<processorCyclicPolyPatch>(pp)) - ) - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(pp); - - UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs); - - if (debug) - { - Pout<< "Sending to " << procPatch.neighbProcNo() - << " changed sharedPoints info:" - << changedIndices.size() << endl; - } - - // Send over changed elements - toNeighbour - << UIndirectList<label>(sharedPointAddr_, changedIndices)() - << UIndirectList<label>(sharedPointLabels_, changedIndices)(); - } - } -} - - -// Check if any connected local points already have a sharedPoint. This handles -// locally connected points. -void Foam::globalPoints::extendSharedPoints -( - const Map<label>& meshToShared, - DynamicList<label>& changedIndices -) -{ - forAllConstIter(Map<label>, meshToProcPoint_, iter) - { - label localI = iter.key(); - label sharedI = meshToShared[localI]; - - if (sharedPointLabels_[sharedI] == -1) - { - // No sharedpoint yet for me. Check if any of my connected - // points have. - - const labelList& pointInfo = procPoints_[iter()]; - forAll(pointInfo, i) - { - if (isLocal(pointInfo[i])) - { - label nbrLocalI = toLocal(pointInfo[i]); - label nbrSharedI = meshToShared[nbrLocalI]; - - if (sharedPointAddr_[nbrSharedI] != -1) - { - // I do have a sharedpoint for nbrSharedI. Reuse it. - sharedPointLabels_[sharedI] = localI; - sharedPointAddr_[sharedI] = - sharedPointAddr_[nbrSharedI]; - changedIndices.append(sharedI); - break; - } - } - } - } - } -} - - -// Receive shared point indices for all my shared points. Note that since -// there are only a few here we can build a reverse map using the point label -// instead of doing all this relative point indexing (patch face + index in -// face) as in send/receivePatchPoints -void Foam::globalPoints::receiveSharedPoints -( - const bool mergeSeparated, - const Map<label>& meshToPatchPoint, - const Map<label>& meshToShared, - PstreamBuffers& pBufs, - DynamicList<label>& changedIndices -) -{ - changedIndices.clear(); - - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - - // Receive and set shared points - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if - ( - Pstream::parRun() - && ( - isType<processorPolyPatch>(pp) - || (mergeSeparated && isA<processorCyclicPolyPatch>(pp)) - ) - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(pp); - - // Map from neighbouring mesh or patch point to sharedPoint) - Map<label> nbrSharedPoints(sharedPointAddr_.size()); - - { - // Receive points on neighbour and sharedPoints and build - // map from it. Note that we could have built the map on the - // neighbour and sent it over. - labelList nbrSharedPointAddr; - labelList nbrSharedPointLabels; - - { - UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); - fromNeighbour >> nbrSharedPointAddr >> nbrSharedPointLabels; - } - - // Insert into to map - forAll(nbrSharedPointLabels, i) - { - nbrSharedPoints.insert - ( - nbrSharedPointLabels[i], // mesh/patchpoint on neighbour - nbrSharedPointAddr[i] // sharedPoint label - ); - } - } - - - // Merge into whatever information I hold. - forAllConstIter(Map<label>, meshToProcPoint_, iter) - { - label localPointI = iter.key(); - label sharedI = meshToShared[localPointI]; - - if (sharedPointAddr_[sharedI] == -1) - { - // No shared point known yet for this point. - // See if was received from neighbour. - const labelList& knownInfo = procPoints_[iter()]; - - // Check through the whole equivalence list for any - // point from the neighbour. - forAll(knownInfo, j) - { - const label info = knownInfo[j]; - label procI = whichProcID(info); - label pointI = toLocal(procI, info); - - if - ( - procI == procPatch.neighbProcNo() - && nbrSharedPoints.found(pointI) - ) - { - // So this knownInfo contains the neighbour point - label sharedPointI = nbrSharedPoints[pointI]; - - sharedPointAddr_[sharedI] = sharedPointI; - sharedPointLabels_[sharedI] = localPointI; - changedIndices.append(sharedI); - - break; - } - } - } - } - } - else if (mergeSeparated && isA<cyclicPolyPatch>(pp)) - { - const cyclicPolyPatch& cycPatch = - refCast<const cyclicPolyPatch>(pp); - - // Build map from mesh or patch point to sharedPoint. - Map<label> localToSharedPoint(sharedPointAddr_.size()); - forAll(sharedPointLabels_, i) - { - if (sharedPointLabels_[i] != -1) - { - localToSharedPoint.insert - ( - sharedPointLabels_[i], - sharedPointAddr_[i] - ); - } - } - - // Sync all info. - - const labelList& meshPoints = cycPatch.meshPoints(); - const labelList coupledMeshPoints(reverseMeshPoints(cycPatch)); - - forAll(meshPoints, i) - { - label meshPointA = meshPoints[i]; - label meshPointB = coupledMeshPoints[i]; - - label localA = meshToLocalPoint - ( - meshToPatchPoint, - meshPointA - ); - label localB = meshToLocalPoint - ( - meshToPatchPoint, - meshPointB - ); - - // Do we already have shared point for pointA? - Map<label>::iterator fndA = localToSharedPoint.find(localA); - Map<label>::iterator fndB = localToSharedPoint.find(localB); - - if (fndA != localToSharedPoint.end()) - { - if (fndB != localToSharedPoint.end()) - { - if (fndA() != fndB()) - { - FatalErrorIn - ( - "globalPoints::receiveSharedPoints(..)" - ) << "On patch " << pp.name() - << " connected points " << meshPointA - << ' ' << mesh_.points()[meshPointA] - << " and " << meshPointB - << ' ' << mesh_.points()[meshPointB] - << " are mapped to different shared" - << " points: " - << fndA() << " and " << fndB() - << abort(FatalError); - } - } - else - { - // No shared point yet for B. - label sharedPointI = fndA(); - - // Store shared point for pointB - label sharedI = meshToShared[localB]; - - sharedPointAddr_[sharedI] = sharedPointI; - sharedPointLabels_[sharedI] = localB; - changedIndices.append(sharedI); - } - } - else - { - // No shared point yet for A. - if (fndB != localToSharedPoint.end()) - { - label sharedPointI = fndB(); - - // Store shared point for pointA - label sharedI = meshToShared[localA]; - - sharedPointAddr_[sharedI] = sharedPointI; - sharedPointLabels_[sharedI] = localA; - changedIndices.append(sharedI); - } - } - } - } - } - - // Extend shared points from local connections. - extendSharedPoints(meshToShared, changedIndices); + meshToProcPoint_.resize(2*procPoints_.size()); } @@ -1192,17 +845,8 @@ void Foam::globalPoints::calculateSharedPoints << endl; } - if (globalIndices_.size() >= fromCollocated) - { - FatalErrorIn("globalPoints::calculateSharedPoints(..)") - << "Integer overflow. Total number of points " - << globalIndices_.size() - << " is too large to be represented." << exit(FatalError); - } - - - labelHashSet changedPoints(nPatchPoints_); + labelHashSet changedPoints(2*nPatchPoints_); // Initialize procPoints with my patch points. Keep track of points // inserted (in changedPoints) @@ -1243,12 +887,12 @@ void Foam::globalPoints::calculateSharedPoints ( mergeSeparated, meshToPatchPoint, + patchToMeshPoint, pBufs, changedPoints ); } - // Save neighbours reachable through face-face communication. Map<label> neighbourList; if (!keepAllPoints) @@ -1281,6 +925,7 @@ void Foam::globalPoints::calculateSharedPoints ( mergeSeparated, meshToPatchPoint, + patchToMeshPoint, pBufs, changedPoints ); @@ -1291,184 +936,118 @@ void Foam::globalPoints::calculateSharedPoints } while (changed); + //Pout<< "**ALL** connected points:" << endl; + //forAllConstIter(Map<label>, meshToProcPoint_, iter) + //{ + // label localI = iter.key(); + // const labelPairList& pointInfo = procPoints_[iter()]; + // Pout<< "pointI:" << localI << " index:" << iter() + // << " coord:" + // << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)] + // << endl; + // printProcPoints(patchToMeshPoint, pointInfo); + // Pout<< endl; + //} + // + // Remove direct neighbours from point equivalences. if (!keepAllPoints) { - //Pout<< "**Removing direct neighbours:" << endl; - //forAllConstIter(Map<label>, neighbourList, iter) - //{ - // label localI = iter.key(); - // Pout<< "pointI:" << localI << " index:" << iter() - // << " coord:" - // << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)] - // << endl; - //} remove(patchToMeshPoint, neighbourList); } - // Compact out unused elements - compact(patchToMeshPoint); - - - - procPoints_.shrink(); - - // Sort procPoints in incremental order. This will make the master the - // first element. + // Sort procPoints in incremental order. This will make + // the master the first element on all processors. + // Note: why not sort in decreasing order? Give more work to higher + // processors. forAllConstIter(Map<label>, meshToProcPoint_, iter) { - sort(procPoints_[iter()]); + labelPairList& pointInfo = procPoints_[iter()]; + sort(pointInfo, globalIndexAndTransform::less()); } - // We can now remove the collocated bit - forAll(procPoints_, index) - { - labelList& pointInfo = procPoints_[index]; - - forAll(pointInfo, i) - { - pointInfo[i] = removeCollocated(pointInfo[i]); - } - } - - -//Pout<< "Now connected points:" << endl; -//forAllConstIter(Map<label>, meshToProcPoint_, iter) -//{ -// label localI = iter.key(); -// const labelList& pointInfo = procPoints_[iter()]; -// -// Pout<< "pointI:" << localI << " index:" << iter() -// << " coord:" -// << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)] -// << endl; -// -// printProcPoints(patchToMeshPoint, pointInfo, Pout); -//} // We now have - in procPoints_ - a list of points which are shared between - // multiple processors. These are the ones for which are sharedPoint - // needs to be determined. This is done by having the lowest numbered - // processor in the equivalence list 'ask' for a sharedPoint number - // and then distribute it across processor patches to the non-master - // processors. Note: below piece of coding is not very efficient. Uses - // a Map where possibly it shouldn't - - // Initialize sharedPoint addressing. Is for every entry in procPoints_ - // the sharedPoint. - sharedPointAddr_.setSize(meshToProcPoint_.size()); - sharedPointAddr_ = -1; - sharedPointLabels_.setSize(meshToProcPoint_.size()); - sharedPointLabels_ = -1; - - // Get point labels of points for which I am master (lowest - // numbered proc) - labelList masterPoints(getMasterPoints(patchToMeshPoint)); - - - // Get global numbering for master points - globalIndex globalMasterPoints(masterPoints.size()); - nGlobalPoints_ = globalMasterPoints.size(); - - // Number meshToProcPoint - label sharedI = 0; - Map<label> meshToShared(meshToProcPoint_.size()); - forAllConstIter(Map<label>, meshToProcPoint_, iter) - { - meshToShared.insert(iter.key(), sharedI++); - } + // multiple processors. Filter into non-transformed and transformed + // connections. - // Assign the entries for the masters - forAll(masterPoints, i) + pointPoints_.setSize(globalIndices_.localSize()); + List<labelPairList> transformedPoints(globalIndices_.localSize()); + forAllConstIter(Map<label>, meshToProcPoint_, iter) { - label localPointI = masterPoints[i]; - label sharedI = meshToShared[localPointI]; - - sharedPointLabels_[sharedI] = localPointI; - sharedPointAddr_[sharedI] = globalMasterPoints.toGlobal(i); - } - + const labelPairList& pointInfo = procPoints_[iter()]; - // Now we have a sharedPointLabel for some of the entries in procPoints. - // Send this information to neighbours. Receive their information. - // Loop until nothing changes. - - // Initial subset to send is points for which I have sharedPoints - DynamicList<label> changedIndices(sharedPointAddr_.size()); - forAll(sharedPointAddr_, i) - { - if (sharedPointAddr_[i] != -1) + if (pointInfo.size() >= 2) { - changedIndices.append(i); - } - } - - // Assign local slaves from local master - extendSharedPoints(meshToShared, changedIndices); - - - changed = false; + // Since sorted master point is the first element + const labelPair& masterInfo = pointInfo[0]; - do - { - if (debug) - { - Pout<< "Determined " << changedIndices.size() << " shared points." - << " Exchanging them" << endl; - } - PstreamBuffers pBufs - ( + if ( - Pstream::defaultCommsType == Pstream::scheduled - ? Pstream::nonBlocking - : Pstream::defaultCommsType + ( + globalIndexAndTransform::processor(masterInfo) + == Pstream::myProcNo() + ) + && (globalIndexAndTransform::index(masterInfo) == iter.key()) ) - ); - - sendSharedPoints(mergeSeparated, pBufs, changedIndices); - pBufs.finishedSends(); - receiveSharedPoints - ( - mergeSeparated, - meshToPatchPoint, - meshToShared, - pBufs, - changedIndices - ); + { + labelList& pPoints = pointPoints_[iter.key()]; + pPoints.setSize(pointInfo.size()-1); - changed = changedIndices.size() > 0; - reduce(changed, orOp<bool>()); + labelPairList& trafoPPoints = transformedPoints[iter.key()]; + trafoPPoints.setSize(pointInfo.size()-1); - } while (changed); + label nonTransformI = 0; + label transformI = 0; + for (label i = 1; i < pointInfo.size(); i++) + { + const labelPair& info = pointInfo[i]; + label procI = globalIndexAndTransform::processor(info); + label index = globalIndexAndTransform::index(info); + label transform = globalIndexAndTransform::transformIndex + ( + info + ); -// forAll(sharedPointLabels_, sharedI) -// { -// label localI = sharedPointLabels_[sharedI]; -// -// Pout<< "point:" << localI -// << " coord:" -// << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)] -// << " ON TO GLOBAL:" << sharedPointAddr_[sharedI] -// << endl; -// } - + if (transform == globalTransforms_.nullTransformIndex()) + { + pPoints[nonTransformI++] = globalIndices_.toGlobal + ( + procI, + index + ); + } + else + { + trafoPPoints[transformI++] = info; + } + } - forAll(sharedPointLabels_, i) - { - if (sharedPointLabels_[i] == -1) - { - FatalErrorIn("globalPoints::calculateSharedPoints(..)") - << "Problem: shared point on processor " << Pstream::myProcNo() - << " not set at index " << sharedPointLabels_[i] << endl - << "This might mean the individual processor domains are not" - << " connected and the overall domain consists of multiple" - << " regions. You can check this with checkMesh" - << abort(FatalError); + pPoints.setSize(nonTransformI); + trafoPPoints.setSize(transformI); + } } } + + List<Map<label> > compactMap; + map_.reset + ( + new mapDistribute + ( + globalIndices_, + pointPoints_, + + globalTransforms_, + transformedPoints, + transformedPointPoints_, + + compactMap + ) + ); + if (debug) { Pout<< "globalPoints::calculateSharedPoints(..) : " @@ -1489,12 +1068,10 @@ Foam::globalPoints::globalPoints : mesh_(mesh), globalIndices_(mesh_.nPoints()), + globalTransforms_(mesh), nPatchPoints_(countPatchPoints(mesh.boundaryMesh())), procPoints_(nPatchPoints_), - meshToProcPoint_(nPatchPoints_), - sharedPointAddr_(0), - sharedPointLabels_(0), - nGlobalPoints_(0) + meshToProcPoint_(nPatchPoints_) { // Empty patch maps to signal storing mesh point labels Map<label> meshToPatchPoint(0); @@ -1521,12 +1098,10 @@ Foam::globalPoints::globalPoints : mesh_(mesh), globalIndices_(coupledPatch.nPoints()), + globalTransforms_(mesh), nPatchPoints_(coupledPatch.nPoints()), procPoints_(nPatchPoints_), - meshToProcPoint_(nPatchPoints_), - sharedPointAddr_(0), - sharedPointLabels_(0), - nGlobalPoints_(0) + meshToProcPoint_(nPatchPoints_) { calculateSharedPoints ( diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H index 9161e67f15eb613e77f989d9cc86e9936569ec98..8b4372a89a88913d808e1ef5e89021c96a7bf82b 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H @@ -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 @@ -39,17 +39,15 @@ Description - f[0] ordering on patch faces to be ok. Works by constructing equivalence lists for all the points on processor - patches. These list are in globalIndex numbering (so consecutively numbered - per processor) + patches. These list are in globalIndexAndTransform numbering E.g. @verbatim ((7 93)(4 731)(3 114)) @endverbatim means point 93 on proc7 is connected to point 731 on proc4 and 114 on proc3. - It then gets the lowest numbered processor (the 'master') to request a - sharedPoint label from processor0 and it redistributes this label back to - the other processors in the equivalence list. + It then assigns the lowest numbered processor to be the local 'master' and + constructs a mapDistribute to send all data to this master. Algorithm: - get meshPoints of all my points on processor patches and initialize @@ -64,24 +62,9 @@ Description endloop until nothing changes At this point one will have complete point-point connectivity for all - points on processor patches. Now - - - (optional)remove point equivalences of size 2. These are - just normal points shared between two neighbouring procPatches. - - collect on each processor points for which it is the master - - request number of sharedPointLabels from the Pstream::master. - - This information gets redistributed to all processors in a similar way - as that in which the equivalence lists were collected: - - - initialize the indices of shared points I am the master for - loop - - send my known sharedPoints + meshPoints to all neighbours - - receive from all neighbour. Find which meshPoint on my processor - the sharedpoint is connected to - - mark indices for which information has changed - endloop until nothing changes. - + points on processor patches. Now (optionally) remove point + equivalences of size 2. These are just normal points shared + between two neighbouring procPatches. Note: the data held is either mesh point labels (construct from mesh only) or patch point labels (construct from mesh and patch). @@ -95,12 +78,9 @@ SourceFiles #define globalPoints_H #include "DynamicList.H" -#include "Map.H" -#include "primitivePatch.H" -#include "edgeList.H" -#include "globalIndex.H" #include "indirectPrimitivePatch.H" -#include "PackedBoolList.H" +#include "globalIndex.H" +#include "globalIndexAndTransform.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -112,7 +92,7 @@ class polyMesh; class polyBoundaryMesh; class cyclicPolyPatch; class polyPatch; -class coupledPolyPatch; +class mapDistribute; /*---------------------------------------------------------------------------*\ Class globalPoints Declaration @@ -120,92 +100,74 @@ class coupledPolyPatch; class globalPoints { - // Static data members - - //- Offset to add to points (in globalIndices) originating from - // collocated coupled points. - static const label fromCollocated; - - // Private data //- Mesh reference const polyMesh& mesh_; - //- Global numbering of points + //- Global numbering of untransformed points globalIndex globalIndices_; + //- Global numbering of transformed points + const globalIndexAndTransform globalTransforms_; + //- Sum of points on processor patches (unfiltered, point on 2 patches // counts as 2) const label nPatchPoints_; //- All points on boundaries and their corresponding connected points // on other processors. - DynamicList<labelList> procPoints_; + DynamicList<labelPairList> procPoints_; //- Map from mesh (or patch) point to index in procPoints Map<label> meshToProcPoint_; - //- Shared points used by this processor (= global point number) - labelList sharedPointAddr_; - - //- My mesh(or patch) points corresponding to the shared points - labelList sharedPointLabels_; - - //- Total number of shared points. - label nGlobalPoints_; - - - // Private Member Functions - - // Wrappers around global point numbering to add collocated bit - - //- Convert into globalIndices and add collocated bit - label toGlobal(const label, const bool isCollocated) const; - - //- Is collocated bit set - bool isCollocated(const label globalI) const; - //- Remove collocated bit - label removeCollocated(const label globalI) const; + // Calculated mapDistribute addressing - //- (remove collocated bit and) check if originates from local proc - bool isLocal(const label globalI) const; + //- Non-transformed connected points per point (in mapDistribute + // indices) + labelListList pointPoints_; - //- (remove collocated bit and) get originating processor - label whichProcID(const label globalI) const; + //- Transformed points per point (in mapDistribute indices) + labelListList transformedPointPoints_; - //- (remove collocated bit and) convert to local number on processor - label toLocal(const label procI, const label globalI) const; + //- Corresponding map + autoPtr<mapDistribute> map_; - //- (remove collocated bit and) convert to local number on - // Pstream::myProcNo - label toLocal(const label globalI) const; + // Private Member Functions //- Count all points on processorPatches. Is all points for which // information is collected. static label countPatchPoints(const polyBoundaryMesh&); + labelPairList addSendTransform + ( + const label patchI, + const labelPairList& info + ) const; + //- Add information about patchPointI in relative indices to send // buffers (patchFaces, indexInFace etc.) - static void addToSend + void addToSend ( - const primitivePatch&, + const polyPatch&, const label patchPointI, - const labelList&, + const labelPairList&, DynamicList<label>& patchFaces, DynamicList<label>& indexInFace, - DynamicList<labelList>& allInfo - ); + DynamicList<labelPairList>& allInfo + ) const; //- Merge info from neighbour into my data - static bool mergeInfo + bool mergeInfo ( - const labelList& nbrInfo, - labelList& myInfo - ); + const labelPairList& nbrInfo, + const label localPointI, + labelPairList& myInfo + ) const; //- From mesh point to 'local point'. Is the mesh point itself // if meshToPatchPoint is empty. @@ -223,18 +185,24 @@ class globalPoints ); //- Store (and merge) info for meshPointI - bool storeInfo + bool storeInitialInfo ( - const labelList& nbrInfo, - const label localPointI, - const bool isCollocated + const labelPairList& nbrInfo, + const label localPointI ); + //- Store (and merge) info for meshPointI + bool mergeInfo + ( + const labelPairList& nbrInfo, + const label localPointI + ); + + //- Debug printing void printProcPoints ( const labelList& patchToMeshPoint, - const labelList& pointInfo, - Ostream& os + const labelPairList& pointInfo ) const; //- Initialize procPoints_ to my patch points. allPoints = true: @@ -260,6 +228,7 @@ class globalPoints ( const bool mergeSeparated, const Map<label>&, + const labelList&, PstreamBuffers&, labelHashSet& ); @@ -268,34 +237,6 @@ class globalPoints // Used to remove normal face-face connected points. void remove(const labelList& patchToMeshPoint, const Map<label>&); - //- Compact out unused elements of procPoints. - void compact(const labelList& patchToMeshPoint); - - //- Get indices of point for which I am master (lowest numbered proc) - labelList getMasterPoints(const labelList& patchToMeshPoint) const; - - - //- Send subset of shared points to neighbours - void sendSharedPoints - ( - const bool mergeSeparated, - PstreamBuffers&, - const DynamicList<label>& - ) const; - - //- Take over any local shared points - void extendSharedPoints(const Map<label>&, DynamicList<label>&); - - //- Receive shared points and update subset. - void receiveSharedPoints - ( - const bool mergeSeparated, - const Map<label>& meshToPatchPoint, - const Map<label>& meshToShared, - PstreamBuffers&, - DynamicList<label>& - ); - //- Return mesh points of other side in same order as my meshPoints. static labelList reverseMeshPoints(const cyclicPolyPatch&); @@ -325,7 +266,7 @@ public: //- Construct from mesh. // keepAllPoints = false : filter out points that are on two - // neighbouring coupled patches (so can be swapped) + // neighbouring coupled patches only (so can be swapped) // mergeSeparated: // true : merge coupled points across separated patches. // false : do not merge across coupled separated patches. @@ -338,8 +279,7 @@ public: //- Construct from mesh and patch of coupled faces. Difference with // construct from mesh only is that this stores the meshToProcPoint, - // procPoints and sharedPointLabels as patch local point labels - // instead of mesh point labels. + // procPoints as patch local point labels instead of mesh point labels. globalPoints ( const polyMesh& mesh, @@ -353,43 +293,68 @@ public: // Access - //- From (mesh or patch) point to index in procPoints - const Map<label>& meshToProcPoint() const + //- Global numbering of untransformed (mesh or patch) points + const globalIndex& globalIndices() const { - return meshToProcPoint_; + return globalIndices_; } - //- procPoints is per point the connected points (in global - // point numbers) - const DynamicList<labelList>& procPoints() const + //- Global numbering of transformed (mesh or patch) points + const globalIndexAndTransform& globalTransforms() const { - return procPoints_; + return globalTransforms_; } - //- Global numbering of (mesh or patch) points - const globalIndex& globalIndices() const + //- Non-transformed connected points per point (in mapDistribute + // indices) + const labelListList& pointPoints() const { - return globalIndices_; + return pointPoints_; + } + + //- Non-transformed connected points per point (in mapDistribute + // indices) + labelListList& pointPoints() + { + return pointPoints_; + } + + //- Transformed points per point (in mapDistribute indices) + const labelListList& transformedPointPoints() const + { + return transformedPointPoints_; } - //- shared points used by this processor (= global point number) - const labelList& sharedPointAddr() const + //- Transformed points per point (in mapDistribute indices) + labelListList& transformedPointPoints() { - return sharedPointAddr_; + return transformedPointPoints_; } - //- my (mesh or patch)points corresponding to the shared points - const labelList& sharedPointLabels() const + //- Corresponding map + const mapDistribute& map() const { - return sharedPointLabels_; + return map_(); } - //- total number of shared points - label nGlobalPoints() const + //- Corresponding map + mapDistribute& map() { - return nGlobalPoints_; + return map_(); } + //- From (mesh or patch) point to index in procPoints + const Map<label>& meshToProcPoint() const + { + return meshToProcPoint_; + } + + //- procPoints is per point the connected points (in + // globalTransformAndIndex point numbers) + const DynamicList<labelPairList>& procPoints() const + { + return procPoints_; + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index c17667cd4b7a958bed4ea5d47d581a6f673068fe..95c2d1d2321fa152da5c1793b14dd94c49882ca5 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -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,6 +27,13 @@ License #include "commSchedule.H" #include "HashSet.H" #include "globalIndex.H" +#include "globalIndexAndTransform.H" +#include "transformField.H" +#include "ListOps.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::mapDistribute, 0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -194,118 +201,141 @@ void Foam::mapDistribute::checkReceivedSize } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -//- Construct from components -Foam::mapDistribute::mapDistribute -( - const label constructSize, - const Xfer<labelListList>& subMap, - const Xfer<labelListList>& constructMap -) -: - constructSize_(constructSize), - subMap_(subMap), - constructMap_(constructMap), - schedulePtr_() -{} - - -Foam::mapDistribute::mapDistribute -( - const labelList& sendProcs, - const labelList& recvProcs -) -: - constructSize_(0), - schedulePtr_() +void Foam::mapDistribute::printLayout(Ostream& os) const { - if (sendProcs.size() != recvProcs.size()) + // Determine offsets of remote data. + labelList minIndex(Pstream::nProcs(), labelMax); + labelList maxIndex(Pstream::nProcs(), labelMin); + forAll(constructMap_, procI) { - FatalErrorIn - ( - "mapDistribute::mapDistribute(const labelList&, const labelList&)" - ) << "The send and receive data is not the same length. sendProcs:" - << sendProcs.size() << " recvProcs:" << recvProcs.size() - << abort(FatalError); + const labelList& construct = constructMap_[procI]; + minIndex[procI] = min(minIndex[procI], min(construct)); + maxIndex[procI] = max(maxIndex[procI], max(construct)); } - // Per processor the number of samples we have to send/receive. - labelList nSend(Pstream::nProcs(), 0); - labelList nRecv(Pstream::nProcs(), 0); - - forAll(sendProcs, sampleI) + label localSize; + if (maxIndex[Pstream::myProcNo()] == labelMin) { - label sendProc = sendProcs[sampleI]; - label recvProc = recvProcs[sampleI]; + localSize = 0; + } + else + { + localSize = maxIndex[Pstream::myProcNo()]+1; + } - // Note that also need to include local communication (both - // RecvProc and sendProc on local processor) + os << "Layout: (constructSize:" << constructSize_ << ")" << endl + << "local (processor " << Pstream::myProcNo() << "):" << endl + << " start : 0" << endl + << " size : " << localSize << endl; - if (Pstream::myProcNo() == sendProc) + label offset = localSize; + forAll(minIndex, procI) + { + if (procI != Pstream::myProcNo()) { - // I am the sender. Count destination processor. - nSend[recvProc]++; + if (constructMap_[procI].size() > 0) + { + if (minIndex[procI] != offset) + { + FatalErrorIn("mapDistribute::printLayout(..)") + << "offset:" << offset + << " procI:" << procI + << " minIndex:" << minIndex[procI] + << abort(FatalError); + } + + label size = maxIndex[procI]-minIndex[procI]+1; + os << "processor " << procI << ':' << endl + << " start : " << offset << endl + << " size : " << size << endl; + + offset += size; + } } - if (Pstream::myProcNo() == recvProc) + } + forAll(transformElements_, trafoI) + { + if (transformElements_[trafoI].size() > 0) { - // I am the receiver. - nRecv[sendProc]++; + os << "transform " << trafoI << ':' << endl + << " start : " << transformStart_[trafoI] << endl + << " size : " << transformElements_[trafoI].size() << endl; } } +} - subMap_.setSize(Pstream::nProcs()); - constructMap_.setSize(Pstream::nProcs()); - forAll(nSend, procI) + +// Construct per processor compact addressing of the global elements +// needed. The ones from the local processor are not included since +// these are always all needed. +void Foam::mapDistribute::calcCompactAddressing +( + const globalIndex& globalNumbering, + const labelList& elements, + List<Map<label> >& compactMap +) const +{ + compactMap.setSize(Pstream::nProcs()); + + // Count all (non-local) elements needed. Just for presizing map. + labelList nNonLocal(Pstream::nProcs(), 0); + + forAll(elements, i) { - subMap_[procI].setSize(nSend[procI]); - constructMap_[procI].setSize(nRecv[procI]); + label globalIndex = elements[i]; + + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) + { + label procI = globalNumbering.whichProcID(globalIndex); + nNonLocal[procI]++; + } } - nSend = 0; - nRecv = 0; - forAll(sendProcs, sampleI) + forAll(compactMap, procI) { - label sendProc = sendProcs[sampleI]; - label recvProc = recvProcs[sampleI]; - - if (Pstream::myProcNo() == sendProc) + compactMap[procI].clear(); + if (procI != Pstream::myProcNo()) { - // I am the sender. Store index I need to send. - subMap_[recvProc][nSend[recvProc]++] = sampleI; + compactMap[procI].resize(2*nNonLocal[procI]); } - if (Pstream::myProcNo() == recvProc) + } + + + // Collect all (non-local) elements needed. + forAll(elements, i) + { + label globalIndex = elements[i]; + + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { - // I am the receiver. - constructMap_[sendProc][nRecv[sendProc]++] = sampleI; - // Largest entry inside constructMap - constructSize_ = sampleI+1; + label procI = globalNumbering.whichProcID(globalIndex); + label index = globalNumbering.toLocal(procI, globalIndex); + label nCompact = compactMap[procI].size(); + compactMap[procI].insert(index, nCompact); } } } -Foam::mapDistribute::mapDistribute +void Foam::mapDistribute::calcCompactAddressing ( const globalIndex& globalNumbering, - labelList& elements, + const labelListList& cellCells, List<Map<label> >& compactMap -) -: - constructSize_(0), - schedulePtr_() +) const { - // 1. Construct per processor compact addressing of the global elements - // needed. The ones from the local processor are not included since - // these are always all needed. compactMap.setSize(Pstream::nProcs()); + + // Count all (non-local) elements needed. Just for presizing map. + labelList nNonLocal(Pstream::nProcs(), 0); + + forAll(cellCells, cellI) { - // Count all (non-local) elements needed. Just for presizing map. - labelList nNonLocal(Pstream::nProcs(), 0); + const labelList& cCells = cellCells[cellI]; - forAll(elements, i) + forAll(cCells, i) { - label globalIndex = elements[i]; + label globalIndex = cCells[i]; if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { @@ -313,21 +343,26 @@ Foam::mapDistribute::mapDistribute nNonLocal[procI]++; } } + } - forAll(compactMap, procI) + forAll(compactMap, procI) + { + compactMap[procI].clear(); + if (procI != Pstream::myProcNo()) { - compactMap[procI].clear(); - if (procI != Pstream::myProcNo()) - { - compactMap[procI].resize(2*nNonLocal[procI]); - } + compactMap[procI].resize(2*nNonLocal[procI]); } + } - // Collect all (non-local) elements needed. - forAll(elements, i) + // Collect all (non-local) elements needed. + forAll(cellCells, cellI) + { + const labelList& cCells = cellCells[cellI]; + + forAll(cCells, i) { - label globalIndex = elements[i]; + label globalIndex = cCells[i]; if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { @@ -337,31 +372,23 @@ Foam::mapDistribute::mapDistribute compactMap[procI].insert(index, nCompact); } } - - //// Sort remote elements needed (not really necessary) - //forAll(compactMap, procI) - //{ - // if (procI != Pstream::myProcNo()) - // { - // Map<label>& globalMap = compactMap[procI]; - // - // SortableList<label> sorted(globalMap.toc().xfer()); - // - // forAll(sorted, i) - // { - // Map<label>::iterator iter = globalMap.find(sorted[i]); - // iter() = i; - // } - // } - //} } +} - // 2. The overall compact addressing is +void Foam::mapDistribute::exchangeAddressing +( + const globalIndex& globalNumbering, + labelList& elements, + List<Map<label> >& compactMap, + labelList& compactStart +) +{ + // The overall compact addressing is // - myProcNo data first (uncompacted) // - all other processors consecutively - labelList compactStart(Pstream::nProcs()); + compactStart.setSize(Pstream::nProcs()); compactStart[Pstream::myProcNo()] = 0; constructSize_ = globalNumbering.localSize(); forAll(compactStart, procI) @@ -375,7 +402,7 @@ Foam::mapDistribute::mapDistribute - // 3. Find out what to receive/send in compact addressing. + // Find out what to receive/send in compact addressing. // What I want to receive is what others have to send labelListList wantedRemoteElements(Pstream::nProcs()); @@ -426,96 +453,19 @@ Foam::mapDistribute::mapDistribute } -Foam::mapDistribute::mapDistribute +void Foam::mapDistribute::exchangeAddressing ( const globalIndex& globalNumbering, labelListList& cellCells, - List<Map<label> >& compactMap + List<Map<label> >& compactMap, + labelList& compactStart ) -: - constructSize_(0), - schedulePtr_() { - // 1. Construct per processor compact addressing of the global elements - // needed. The ones from the local processor are not included since - // these are always all needed. - compactMap.setSize(Pstream::nProcs()); - { - // Count all (non-local) elements needed. Just for presizing map. - labelList nNonLocal(Pstream::nProcs(), 0); - - forAll(cellCells, cellI) - { - const labelList& cCells = cellCells[cellI]; - - forAll(cCells, i) - { - label globalIndex = cCells[i]; - - if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) - { - label procI = globalNumbering.whichProcID(globalIndex); - nNonLocal[procI]++; - } - } - } - - forAll(compactMap, procI) - { - compactMap[procI].clear(); - if (procI != Pstream::myProcNo()) - { - compactMap[procI].resize(2*nNonLocal[procI]); - } - } - - - // Collect all (non-local) elements needed. - - - // Collect all (non-local) elements needed. - forAll(cellCells, cellI) - { - const labelList& cCells = cellCells[cellI]; - - forAll(cCells, i) - { - label globalIndex = cCells[i]; - - if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) - { - label procI = globalNumbering.whichProcID(globalIndex); - label index = globalNumbering.toLocal(procI, globalIndex); - label nCompact = compactMap[procI].size(); - compactMap[procI].insert(index, nCompact); - } - } - } - - //// Sort remote elements needed (not really necessary) - //forAll(compactMap, procI) - //{ - // if (procI != Pstream::myProcNo()) - // { - // Map<label>& globalMap = compactMap[procI]; - // - // SortableList<label> sorted(globalMap.toc().xfer()); - // - // forAll(sorted, i) - // { - // Map<label>::iterator iter = globalMap.find(sorted[i]); - // iter() = i; - // } - // } - //} - } - - - // 2. The overall compact addressing is + // The overall compact addressing is // - myProcNo data first (uncompacted) // - all other processors consecutively - labelList compactStart(Pstream::nProcs()); + compactStart.setSize(Pstream::nProcs()); compactStart[Pstream::myProcNo()] = 0; constructSize_ = globalNumbering.localSize(); forAll(compactStart, procI) @@ -529,7 +479,7 @@ Foam::mapDistribute::mapDistribute - // 3. Find out what to receive/send in compact addressing. + // Find out what to receive/send in compact addressing. // What I want to receive is what others have to send labelListList wantedRemoteElements(Pstream::nProcs()); @@ -585,17 +535,599 @@ Foam::mapDistribute::mapDistribute } +template<> +void Foam::mapDistribute::applyTransforms +( + const globalIndexAndTransform& globalTransforms, + List<point>& field, + const bool isPosition +) const +{ + const List<vectorTensorTransform>& totalTransform = + globalTransforms.transformPermutations(); + + forAll(totalTransform, trafoI) + { + const vectorTensorTransform& vt = totalTransform[trafoI]; + const labelList& elems = transformElements_[trafoI]; + label n = transformStart_[trafoI]; + + // Could be optimised to avoid memory allocations + + if (isPosition) + { + Field<point> transformFld + ( + vt.transformPosition(Field<point>(field, elems)) + ); + forAll(transformFld, i) + { + //cop(field[n++], transformFld[i]); + field[n++] = transformFld[i]; + } + } + else + { + Field<point> transformFld + ( + transform(vt.R(), Field<point>(field, elems)) + ); + + forAll(transformFld, i) + { + //cop(field[n++], transformFld[i]); + field[n++] = transformFld[i]; + } + } + } +} + + +template<> +void Foam::mapDistribute::applyInverseTransforms +( + const globalIndexAndTransform& globalTransforms, + List<point>& field, + const bool isPosition +) const +{ + const List<vectorTensorTransform>& totalTransform = + globalTransforms.transformPermutations(); + + forAll(totalTransform, trafoI) + { + const vectorTensorTransform& vt = totalTransform[trafoI]; + const labelList& elems = transformElements_[trafoI]; + label n = transformStart_[trafoI]; + + // Could be optimised to avoid memory allocations + + if (isPosition) + { + Field<point> transformFld + ( + vt.invTransformPosition + ( + SubField<point>(field, elems.size(), n) + ) + ); + forAll(transformFld, i) + { + field[elems[i]] = transformFld[i]; + } + } + else + { + Field<point> transformFld(SubField<point>(field, elems.size(), n)); + transform(transformFld, vt.R().T(), transformFld); + + forAll(transformFld, i) + { + field[elems[i]] = transformFld[i]; + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +//- Construct null +Foam::mapDistribute::mapDistribute() +: + constructSize_(0), + schedulePtr_() +{} + + +//- Construct from components +Foam::mapDistribute::mapDistribute +( + const label constructSize, + const Xfer<labelListList>& subMap, + const Xfer<labelListList>& constructMap +) +: + constructSize_(constructSize), + subMap_(subMap), + constructMap_(constructMap), + schedulePtr_() +{} + + +//- Construct from components +Foam::mapDistribute::mapDistribute +( + const label constructSize, + const Xfer<labelListList>& subMap, + const Xfer<labelListList>& constructMap, + const Xfer<labelListList>& transformElements, + const Xfer<labelList>& transformStart +) +: + constructSize_(constructSize), + subMap_(subMap), + constructMap_(constructMap), + transformElements_(transformElements), + transformStart_(transformStart), + schedulePtr_() +{} + + +Foam::mapDistribute::mapDistribute +( + const labelList& sendProcs, + const labelList& recvProcs +) +: + constructSize_(0), + schedulePtr_() +{ + if (sendProcs.size() != recvProcs.size()) + { + FatalErrorIn + ( + "mapDistribute::mapDistribute(const labelList&, const labelList&)" + ) << "The send and receive data is not the same length. sendProcs:" + << sendProcs.size() << " recvProcs:" << recvProcs.size() + << abort(FatalError); + } + + // Per processor the number of samples we have to send/receive. + labelList nSend(Pstream::nProcs(), 0); + labelList nRecv(Pstream::nProcs(), 0); + + forAll(sendProcs, sampleI) + { + label sendProc = sendProcs[sampleI]; + label recvProc = recvProcs[sampleI]; + + // Note that also need to include local communication (both + // RecvProc and sendProc on local processor) + + if (Pstream::myProcNo() == sendProc) + { + // I am the sender. Count destination processor. + nSend[recvProc]++; + } + if (Pstream::myProcNo() == recvProc) + { + // I am the receiver. + nRecv[sendProc]++; + } + } + + subMap_.setSize(Pstream::nProcs()); + constructMap_.setSize(Pstream::nProcs()); + forAll(nSend, procI) + { + subMap_[procI].setSize(nSend[procI]); + constructMap_[procI].setSize(nRecv[procI]); + } + nSend = 0; + nRecv = 0; + + forAll(sendProcs, sampleI) + { + label sendProc = sendProcs[sampleI]; + label recvProc = recvProcs[sampleI]; + + if (Pstream::myProcNo() == sendProc) + { + // I am the sender. Store index I need to send. + subMap_[recvProc][nSend[recvProc]++] = sampleI; + } + if (Pstream::myProcNo() == recvProc) + { + // I am the receiver. + constructMap_[sendProc][nRecv[sendProc]++] = sampleI; + // Largest entry inside constructMap + constructSize_ = sampleI+1; + } + } +} + + +Foam::mapDistribute::mapDistribute +( + const globalIndex& globalNumbering, + labelList& elements, + List<Map<label> >& compactMap +) +: + constructSize_(0), + schedulePtr_() +{ + // Construct per processor compact addressing of the global elements + // needed. The ones from the local processor are not included since + // these are always all needed. + calcCompactAddressing + ( + globalNumbering, + elements, + compactMap + ); + + //// Sort remote elements needed (not really necessary) + //forAll(compactMap, procI) + //{ + // if (procI != Pstream::myProcNo()) + // { + // Map<label>& globalMap = compactMap[procI]; + // + // SortableList<label> sorted(globalMap.toc().xfer()); + // + // forAll(sorted, i) + // { + // Map<label>::iterator iter = globalMap.find(sorted[i]); + // iter() = i; + // } + // } + //} + + + // Exchange what I need with processor that supplies it. Renumber elements + // into compact numbering + labelList compactStart; + exchangeAddressing + ( + globalNumbering, + elements, + compactMap, + compactStart + ); + + if (debug) + { + printLayout(Pout); + } +} + + +Foam::mapDistribute::mapDistribute +( + const globalIndex& globalNumbering, + labelListList& cellCells, + List<Map<label> >& compactMap +) +: + constructSize_(0), + schedulePtr_() +{ + // Construct per processor compact addressing of the global elements + // needed. The ones from the local processor are not included since + // these are always all needed. + calcCompactAddressing + ( + globalNumbering, + cellCells, + compactMap + ); + + //// Sort remote elements needed (not really necessary) + //forAll(compactMap, procI) + //{ + // if (procI != Pstream::myProcNo()) + // { + // Map<label>& globalMap = compactMap[procI]; + // + // SortableList<label> sorted(globalMap.toc().xfer()); + // + // forAll(sorted, i) + // { + // Map<label>::iterator iter = globalMap.find(sorted[i]); + // iter() = i; + // } + // } + //} + + + // Exchange what I need with processor that supplies it. Renumber elements + // into compact numbering + labelList compactStart; + exchangeAddressing + ( + globalNumbering, + cellCells, + compactMap, + compactStart + ); + + if (debug) + { + printLayout(Pout); + } +} + + +Foam::mapDistribute::mapDistribute +( + const globalIndex& globalNumbering, + labelList& elements, + const globalIndexAndTransform& globalTransforms, + const labelPairList& transformedElements, + labelList& transformedIndices, + List<Map<label> >& compactMap +) +: + constructSize_(0), + schedulePtr_() +{ + // Construct per processor compact addressing of the global elements + // needed. The ones from the local processor are not included since + // these are always all needed. + calcCompactAddressing + ( + globalNumbering, + elements, + compactMap + ); + + // Add all (non-local) transformed elements needed. + forAll(transformedElements, i) + { + labelPair elem = transformedElements[i]; + label procI = globalIndexAndTransform::processor(elem); + if (procI != Pstream::myProcNo()) + { + label index = globalIndexAndTransform::index(elem); + label nCompact = compactMap[procI].size(); + compactMap[procI].insert(index, nCompact); + } + } + + + // Exchange what I need with processor that supplies it. Renumber elements + // into compact numbering + labelList compactStart; + exchangeAddressing + ( + globalNumbering, + elements, + compactMap, + compactStart + ); + + + // Renumber the transformed elements + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Count per transformIndex + label nTrafo = globalTransforms.transformPermutations().size(); + labelList nPerTransform(nTrafo, 0); + forAll(transformedElements, i) + { + labelPair elem = transformedElements[i]; + label trafoI = globalIndexAndTransform::transformIndex(elem); + nPerTransform[trafoI]++; + } + // Offset per transformIndex + transformStart_.setSize(nTrafo); + transformElements_.setSize(nTrafo); + forAll(transformStart_, trafoI) + { + transformStart_[trafoI] = constructSize_; + constructSize_ += nPerTransform[trafoI]; + transformElements_[trafoI].setSize(nPerTransform[trafoI]); + } + + // Sort transformed elements into their new slot. + nPerTransform = 0; + + transformedIndices.setSize(transformedElements.size()); + forAll(transformedElements, i) + { + labelPair elem = transformedElements[i]; + label procI = globalIndexAndTransform::processor(elem); + label index = globalIndexAndTransform::index(elem); + label trafoI = globalIndexAndTransform::transformIndex(elem); + + // Get compact index for untransformed element + label rawElemI = + ( + procI == Pstream::myProcNo() + ? index + : compactMap[procI][index] + ); + + label& n = nPerTransform[trafoI]; + // index of element to transform + transformElements_[trafoI][n] = rawElemI; + // destination of transformed element + transformedIndices[i] = transformStart_[trafoI]+n; + n++; + } + + if (debug) + { + printLayout(Pout); + } +} + + +Foam::mapDistribute::mapDistribute +( + const globalIndex& globalNumbering, + labelListList& cellCells, + const globalIndexAndTransform& globalTransforms, + const List<labelPairList>& transformedElements, + labelListList& transformedIndices, + List<Map<label> >& compactMap +) +: + constructSize_(0), + schedulePtr_() +{ + // Construct per processor compact addressing of the global elements + // needed. The ones from the local processor are not included since + // these are always all needed. + calcCompactAddressing + ( + globalNumbering, + cellCells, + compactMap + ); + + // Add all (non-local) transformed elements needed. + forAll(transformedElements, cellI) + { + const labelPairList& elems = transformedElements[cellI]; + + forAll(elems, i) + { + label procI = globalIndexAndTransform::processor(elems[i]); + if (procI != Pstream::myProcNo()) + { + label index = globalIndexAndTransform::index(elems[i]); + label nCompact = compactMap[procI].size(); + compactMap[procI].insert(index, nCompact); + } + } + } + + + // Exchange what I need with processor that supplies it. Renumber elements + // into compact numbering + labelList compactStart; + exchangeAddressing + ( + globalNumbering, + cellCells, + compactMap, + compactStart + ); + + + // Renumber the transformed elements + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Count per transformIndex + label nTrafo = globalTransforms.transformPermutations().size(); + labelList nPerTransform(nTrafo, 0); + forAll(transformedElements, cellI) + { + const labelPairList& elems = transformedElements[cellI]; + + forAll(elems, i) + { + label trafoI = globalIndexAndTransform::transformIndex(elems[i]); + nPerTransform[trafoI]++; + } + } + // Offset per transformIndex + transformStart_.setSize(nTrafo); + transformElements_.setSize(nTrafo); + forAll(transformStart_, trafoI) + { + transformStart_[trafoI] = constructSize_; + constructSize_ += nPerTransform[trafoI]; + transformElements_[trafoI].setSize(nPerTransform[trafoI]); + } + + // Sort transformed elements into their new slot. + nPerTransform = 0; + + transformedIndices.setSize(transformedElements.size()); + forAll(transformedElements, cellI) + { + const labelPairList& elems = transformedElements[cellI]; + transformedIndices[cellI].setSize(elems.size()); + + forAll(elems, i) + { + label procI = globalIndexAndTransform::processor(elems[i]); + label index = globalIndexAndTransform::index(elems[i]); + label trafoI = globalIndexAndTransform::transformIndex(elems[i]); + + // Get compact index for untransformed element + label rawElemI = + ( + procI == Pstream::myProcNo() + ? index + : compactMap[procI][index] + ); + + label& n = nPerTransform[trafoI]; + // index of element to transform + transformElements_[trafoI][n] = rawElemI; + // destination of transformed element + transformedIndices[cellI][i] = transformStart_[trafoI]+n; + n++; + } + } + + if (debug) + { + printLayout(Pout); + } +} + + Foam::mapDistribute::mapDistribute(const mapDistribute& map) : constructSize_(map.constructSize_), subMap_(map.subMap_), constructMap_(map.constructMap_), + transformElements_(map.transformElements_), + transformStart_(map.transformStart_), + schedulePtr_() +{} + + +Foam::mapDistribute::mapDistribute(const Xfer<mapDistribute>& map) +: + constructSize_(map().constructSize_), + subMap_(map().subMap_.xfer()), + constructMap_(map().constructMap_.xfer()), + transformElements_(map().transformElements_.xfer()), + transformStart_(map().transformStart_.xfer()), schedulePtr_() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +Foam::label Foam::mapDistribute::whichTransform(const label index) const +{ + return findLower(transformStart_, index+1); +} + + +void Foam::mapDistribute::transfer(mapDistribute& rhs) +{ + constructSize_ = rhs.constructSize_; + subMap_.transfer(rhs.subMap_); + constructMap_.transfer(rhs.constructMap_); + transformElements_.transfer(rhs.transformElements_); + transformStart_.transfer(rhs.transformStart_); + schedulePtr_.clear(); +} + + +Foam::Xfer<Foam::mapDistribute> Foam::mapDistribute::xfer() +{ + return xferMove(*this); +} + + Foam::label Foam::mapDistribute::renumber ( const globalIndex& globalNumbering, @@ -774,6 +1306,8 @@ void Foam::mapDistribute::operator=(const mapDistribute& rhs) constructSize_ = rhs.constructSize_; subMap_ = rhs.subMap_; constructMap_ = rhs.constructMap_; + transformElements_ = rhs.transformElements_; + transformStart_ = rhs.transformStart_; schedulePtr_.clear(); } diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index 11d85068834b33c46e419d051857d483f9de5c63..99a31d3d7d92a05d210bc9e2266693449a4b79ff 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -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 @@ -35,22 +35,92 @@ Note: Schedule is a list of processor pairs (one send, one receive. One of them will be myself) which forms a scheduled (i.e. non-buffered) exchange. See distribute on how to use it. - Note2: number of items send on one processor have to equal the number + Note2: number of items sent on one processor have to equal the number of items received on the other processor. - Constructors using compact numbering: all my own elements first - (whether used or not) followed by used-only remote elements. + To aid constructing these maps there are the constructors from global + numbering, either with or without transforms. + + - without transforms: + Constructors using compact numbering: layout is + - all my own elements first (whether used or not) + - followed by used-only remote elements sorted by remote processor. So e.g 4 procs and on proc 1 the compact table will first have all globalIndex.localSize() elements from proc1 followed by used-only elements of proc0, proc2, proc3. The constructed mapDistribute sends the local elements from and receives the remote elements into their compact position. compactMap[procI] is the position of elements from procI in the compact - map. compactMap[myProcNo()] is empty since trivial addressing. The indices - into compactMap[procI] are local, not global, indices. + map. compactMap[myProcNo()] is empty since trivial addressing. + + It rewrites the input global indices into indices into the constructed + data. + + + - with transforms: + This requires the precalculated set of possible transforms + (globalIndexAndTransform). These are given as permutations (+, -, or none) + of up to 3 independent transforms. + The layout of the data is + - all my own elements first (whether used or not) + - followed by used-only remote elements sorted by remote processor. + - followed by - for each transformation index - the set of local or + remote elements with that transformation. + The inputs for the constructor are + - the set of untransformed local or remote indices in globalIndex + numbering. These get rewritten to be indices into the layout of the data. + - the set of transformed local or remote indices in globalIndexAndTransform + encoding. These are labelPairs. + + Any distribute with transforms is now done as: + 1. exchange data with other processors and receive these into the + slots for that processor + 2. for all transformations transform a subset of the data according + to transformElements_[transformI] and store this starting from + transformStart_[transformI] + + In the same way a reverse distribute will + 1. apply the inverse transform to the data starting at + transformStart_[transformI] and copy the result back into the + transformElements_[transformI]. These might be local or remote slots. + 2. the data in the remote slots will now be sent back to the correct + location in the originating processor. + + E.g. a map to handle + - mesh points on a mesh with + - 1 cyclic so 3 permutations (+,-,none) will have layout + - on e.g. processor 1 out of 2: + + +------+ <- transformStart[2] + | | + | | <- transform2 applied to data in local or remote slots + | | + +------+ <- transformStart[1] + | | + | | <- transform1 applied to data in local or remote slots + | | + +------+ <- transformStart[1] + | | + | | <- transform0 applied to data in local or remote slots + | | + +------+ <- transformStart[0] + | | + | | <- data from proc2 + | | + +------+ + | | + | | <- data from proc0 + | | + +------+ <- mesh.nPoints() + | | + | | + | | + +------+ 0 + SourceFiles mapDistribute.C + mapDistributeTemplates.C \*---------------------------------------------------------------------------*/ @@ -62,6 +132,7 @@ SourceFiles #include "Pstream.H" #include "boolList.H" #include "Map.H" +#include "point.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -71,6 +142,7 @@ namespace Foam class mapPolyMesh; class globalIndex; class PstreamBuffers; +class globalIndexAndTransform; /*---------------------------------------------------------------------------*\ Class mapDistribute Declaration @@ -89,6 +161,16 @@ class mapDistribute //- Maps from subsetted data to new reconstructed data labelListList constructMap_; + // Optional transformation + + //- For every globalIndexAndTransform::transformPermutations + // gives the elements that need to be transformed + labelListList transformElements_; + + //- Destination in constructMap for transformed elements + labelList transformStart_; + + //- Schedule mutable autoPtr<List<labelPair> > schedulePtr_; @@ -102,10 +184,73 @@ class mapDistribute const label receivedSize ); + void calcCompactAddressing + ( + const globalIndex& globalNumbering, + const labelList& elements, + List<Map<label> >& compactMap + ) const; + void calcCompactAddressing + ( + const globalIndex& globalNumbering, + const labelListList& elements, + List<Map<label> >& compactMap + ) const; + + void exchangeAddressing + ( + const globalIndex& globalNumbering, + labelList& elements, + List<Map<label> >& compactMap, + labelList& compactStart + ); + void exchangeAddressing + ( + const globalIndex& globalNumbering, + labelListList& elements, + List<Map<label> >& compactMap, + labelList& compactStart + ); + + + //- Helper function: copy transformElements without transformation + template<class T> + void applyDummyTransforms(List<T>& field) const; + + template<class T> //, class CombineOp> + void applyTransforms + ( + const globalIndexAndTransform& globalTransforms, + List<T>& field, + const bool isPosition + //const CombineOp& cop + ) const; + + //- Helper function: copy transformElements without transformation + template<class T> + void applyDummyInverseTransforms(List<T>& field) const; + + template<class T> //, class CombineOp> + void applyInverseTransforms + ( + const globalIndexAndTransform& globalTransforms, + List<T>& field, + const bool isPosition + //const CombineOp& cop + ) const; + + public: + // Declare name of the class and its debug switch + ClassName("mapDistribute"); + + // Constructors + //- Construct null + mapDistribute(); + //- Construct from components mapDistribute ( @@ -114,6 +259,16 @@ public: const Xfer<labelListList>& constructMap ); + //- Construct from components + mapDistribute + ( + const label constructSize, + const Xfer<labelListList>& subMap, + const Xfer<labelListList>& constructMap, + const Xfer<labelListList>& transformElements, + const Xfer<labelList>& transformStart + ); + //- Construct from reverse addressing: per data item the send // processor and the receive processor. All processors get same data. mapDistribute @@ -143,6 +298,36 @@ public: List<Map<label> >& compactMap ); + //- Construct from list of (possibly remote) untransformed elements + // in globalIndex numbering (or -1) and (possibly remote) + // transformded elements in globalIndexAndTransform numbering. + // Determines compact numbering (see above) and + // distribute map to get data into this ordering and renumbers the + // elements to be in compact numbering. + mapDistribute + ( + const globalIndex&, + labelList& untransformedElements, + const globalIndexAndTransform&, + const labelPairList& transformedElements, + labelList& transformedIndices, + List<Map<label> >& compactMap + ); + + //- As above but with ListLists. + mapDistribute + ( + const globalIndex&, + labelListList& cellCells, + const globalIndexAndTransform&, + const List<labelPairList>& transformedElements, + labelListList& transformedIndices, + List<Map<label> >& compactMap + ); + + //- Construct by transferring parameter content + mapDistribute(const Xfer<mapDistribute>&); + //- Construct copy mapDistribute(const mapDistribute&); @@ -187,6 +372,22 @@ public: return constructMap_; } + //- For every globalIndexAndTransform::transformPermutations + // gives the elements that need to be transformed + const labelListList& transformElements() const + { + return transformElements_; + } + + //- Destination in constructMap for transformed elements + const labelList& transformStart() const + { + return transformStart_; + } + + //- Find transform from transformElements + label whichTransform(const label index) const; + //- Calculate a schedule. See above. static List<labelPair> schedule ( @@ -200,6 +401,12 @@ public: // Other + //- Transfer the contents of the argument and annul the argument. + void transfer(mapDistribute&); + + //- Transfer contents to the Xfer container + Xfer<mapDistribute> xfer(); + //- Helper for construct from globalIndex. Renumbers element // (in globalIndex numbering) into compact indices. static label renumber @@ -245,88 +452,36 @@ public: //- Distribute data using default commsType. template<class T> - void distribute(List<T>& fld) const - { - if (Pstream::defaultCommsType == Pstream::nonBlocking) - { - distribute - ( - Pstream::nonBlocking, - List<labelPair>(), - constructSize_, - subMap_, - constructMap_, - fld - ); - } - else if (Pstream::defaultCommsType == Pstream::scheduled) - { - distribute - ( - Pstream::scheduled, - schedule(), - constructSize_, - subMap_, - constructMap_, - fld - ); - } - else - { - distribute - ( - Pstream::blocking, - List<labelPair>(), - constructSize_, - subMap_, - constructMap_, - fld - ); - } - } + void distribute(List<T>& fld, const bool dummyTransform = true) + const; + + //- Same but with transforms + template<class T> + void distribute + ( + const globalIndexAndTransform&, + List<T>& fld, + const bool isPosition + ) const; //- Reverse distribute data using default commsType. template<class T> - void reverseDistribute(const label constructSize, List<T>& fld) - const - { - if (Pstream::defaultCommsType == Pstream::nonBlocking) - { - distribute - ( - Pstream::nonBlocking, - List<labelPair>(), - constructSize, - constructMap_, - subMap_, - fld - ); - } - else if (Pstream::defaultCommsType == Pstream::scheduled) - { - distribute - ( - Pstream::scheduled, - schedule(), - constructSize, - constructMap_, - subMap_, - fld - ); - } - else - { - distribute - ( - Pstream::blocking, - List<labelPair>(), - constructSize, - constructMap_, - subMap_, - fld - ); - } - } + void reverseDistribute + ( + const label constructSize, + List<T>&, + const bool dummyTransform = true + ) const; + + //- Same but with transforms + template<class T> + void reverseDistribute + ( + const globalIndexAndTransform&, + const label constructSize, + List<T>& fld, + const bool isPosition + ) const; //- Reverse distribute data using default commsType. // Since constructSize might be larger than supplied size supply @@ -336,53 +491,20 @@ public: ( const label constructSize, const T& nullValue, - List<T>& fld - ) - const - { - if (Pstream::defaultCommsType == Pstream::nonBlocking) - { - distribute - ( - Pstream::nonBlocking, - List<labelPair>(), - constructSize, - constructMap_, - subMap_, - fld, - eqOp<T>(), - nullValue - ); - } - else if (Pstream::defaultCommsType == Pstream::scheduled) - { - distribute - ( - Pstream::scheduled, - schedule(), - constructSize, - constructMap_, - subMap_, - fld, - eqOp<T>(), - nullValue - ); - } - else - { - distribute - ( - Pstream::blocking, - List<labelPair>(), - constructSize, - constructMap_, - subMap_, - fld, - eqOp<T>(), - nullValue - ); - } - } + List<T>& fld, + const bool dummyTransform = true + ) const; + + //- Same but with transforms + template<class T> + void reverseDistribute + ( + const globalIndexAndTransform&, + const label constructSize, + const T& nullValue, + List<T>& fld, + const bool isPosition + ) const; //- Do all sends using PstreamBuffers template<class T> @@ -391,6 +513,9 @@ public: template<class T> void receive(PstreamBuffers&, List<T>&) const; + //- Debug: print layout + void printLayout(Ostream& os) const; + //- Correct for topo change. void updateMesh(const mapPolyMesh&) { @@ -406,6 +531,24 @@ public: }; +//- Specialisation for transforms that can apply positional transform +template<> +void mapDistribute::applyTransforms +( + const globalIndexAndTransform& globalTransforms, + List<point>& field, + const bool isPosition + //const CombineOp& cop +) const; + +template<> //, class CombineOp> +void mapDistribute::applyInverseTransforms +( + const globalIndexAndTransform& globalTransforms, + List<point>& field, + const bool isPosition + //const CombineOp& cop +) const; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C index 5aacd4d17d66e0922053aa86e57a07f205df4f6e..f72b83dd458a96308d95e716804328e3bc9a88a8 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C @@ -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 @@ -26,6 +26,8 @@ License #include "Pstream.H" #include "PstreamBuffers.H" #include "PstreamCombineReduceOps.H" +#include "globalIndexAndTransform.H" +#include "transformField.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -774,4 +776,355 @@ void Foam::mapDistribute::receive(PstreamBuffers& pBufs, List<T>& field) const } +// In case of no transform: copy elements +template<class T> +void Foam::mapDistribute::applyDummyTransforms(List<T>& field) const +{ + forAll(transformElements_, trafoI) + { + const labelList& elems = transformElements_[trafoI]; + + label n = transformStart_[trafoI]; + + forAll(elems, i) + { + field[n++] = field[elems[i]]; + } + } +} + + +// In case of no transform: copy elements +template<class T> +void Foam::mapDistribute::applyDummyInverseTransforms(List<T>& field) const +{ + forAll(transformElements_, trafoI) + { + const labelList& elems = transformElements_[trafoI]; + label n = transformStart_[trafoI]; + + forAll(elems, i) + { + field[elems[i]] = field[n++]; + } + } +} + + +// Calculate transformed elements. +template<class T> //, class CombineOp> +void Foam::mapDistribute::applyTransforms +( + const globalIndexAndTransform& globalTransforms, + List<T>& field, + const bool isPosition + //const CombineOp& cop +) const +{ + if (isPosition) + { + FatalErrorIn + ( + "mapDistribute::applyTransforms\n" + "(\n" + " const globalIndexAndTransform&,\n" + " List<T>&,\n" + " const bool\n" + ") const\n" + ) << "It does not make sense to apply position transformation" + << " for anything else than pointFields." + << abort(FatalError); + } + + const List<vectorTensorTransform>& totalTransform = + globalTransforms.transformPermutations(); + + forAll(totalTransform, trafoI) + { + const vectorTensorTransform& vt = totalTransform[trafoI]; + const labelList& elems = transformElements_[trafoI]; + label n = transformStart_[trafoI]; + + // Could be optimised to avoid memory allocations + Field<T> transformFld(transform(vt.R(), Field<T>(field, elems))); + + forAll(transformFld, i) + { + //cop(field[n++], transformFld[i]); + field[n++] = transformFld[i]; + } + } +} + + +// Calculate transformed elements. +template<class T> //, class CombineOp> +void Foam::mapDistribute::applyInverseTransforms +( + const globalIndexAndTransform& globalTransforms, + List<T>& field, + const bool isPosition + //const CombineOp& cop +) const +{ + if (isPosition) + { + FatalErrorIn + ( + "mapDistribute::applyInverseTransforms\n" + "(\n" + " const globalIndexAndTransform&,\n" + " List<T>&,\n" + " const bool\n" + ") const\n" + ) << "It does not make sense to apply position transformation" + << " for anything else than pointFields." + << abort(FatalError); + } + + const List<vectorTensorTransform>& totalTransform = + globalTransforms.transformPermutations(); + + forAll(totalTransform, trafoI) + { + const vectorTensorTransform& vt = totalTransform[trafoI]; + const labelList& elems = transformElements_[trafoI]; + label n = transformStart_[trafoI]; + + // Could be optimised to avoid memory allocations + Field<T> transformFld(SubField<T>(field, elems.size(), n)); + transform(transformFld, vt.R().T(), transformFld); + + forAll(transformFld, i) + { + //cop(field[elems[i]], transformFld[i]); + field[elems[i]] = transformFld[i]; + } + } +} + + +//- Distribute data using default commsType. +template<class T> +void Foam::mapDistribute::distribute +( + List<T>& fld, + const bool dummyTransform +) const +{ + if (Pstream::defaultCommsType == Pstream::nonBlocking) + { + distribute + ( + Pstream::nonBlocking, + List<labelPair>(), + constructSize_, + subMap_, + constructMap_, + fld + ); + } + else if (Pstream::defaultCommsType == Pstream::scheduled) + { + distribute + ( + Pstream::scheduled, + schedule(), + constructSize_, + subMap_, + constructMap_, + fld + ); + } + else + { + distribute + ( + Pstream::blocking, + List<labelPair>(), + constructSize_, + subMap_, + constructMap_, + fld + ); + } + + //- Fill in transformed slots with copies + if (dummyTransform) + { + applyDummyTransforms(fld); + } +} + + +//- Reverse distribute data using default commsType. +template<class T> +void Foam::mapDistribute::reverseDistribute +( + const label constructSize, + List<T>& fld, + const bool dummyTransform +) const +{ + if (dummyTransform) + { + applyDummyInverseTransforms(fld); + } + + if (Pstream::defaultCommsType == Pstream::nonBlocking) + { + distribute + ( + Pstream::nonBlocking, + List<labelPair>(), + constructSize, + constructMap_, + subMap_, + fld + ); + } + else if (Pstream::defaultCommsType == Pstream::scheduled) + { + distribute + ( + Pstream::scheduled, + schedule(), + constructSize, + constructMap_, + subMap_, + fld + ); + } + else + { + distribute + ( + Pstream::blocking, + List<labelPair>(), + constructSize, + constructMap_, + subMap_, + fld + ); + } +} + + +//- Reverse distribute data using default commsType. +// Since constructSize might be larger than supplied size supply +// a nullValue +template<class T> +void Foam::mapDistribute::reverseDistribute +( + const label constructSize, + const T& nullValue, + List<T>& fld, + const bool dummyTransform +) const +{ + if (dummyTransform) + { + applyDummyInverseTransforms(fld); + } + + if (Pstream::defaultCommsType == Pstream::nonBlocking) + { + distribute + ( + Pstream::nonBlocking, + List<labelPair>(), + constructSize, + constructMap_, + subMap_, + fld, + eqOp<T>(), + nullValue + ); + } + else if (Pstream::defaultCommsType == Pstream::scheduled) + { + distribute + ( + Pstream::scheduled, + schedule(), + constructSize, + constructMap_, + subMap_, + fld, + eqOp<T>(), + nullValue + ); + } + else + { + distribute + ( + Pstream::blocking, + List<labelPair>(), + constructSize, + constructMap_, + subMap_, + fld, + eqOp<T>(), + nullValue + ); + } +} + + +//- Distribute data using default commsType. +template<class T> +void Foam::mapDistribute::distribute +( + const globalIndexAndTransform& git, + List<T>& fld, + const bool isPosition +) const +{ + // Distribute. Leave out dummy transforms since we're doing them ourselves + distribute(fld, false); + // Do transforms + applyTransforms(git, fld, isPosition); //, eqOp<T>()); +} + + +template<class T> +void Foam::mapDistribute::reverseDistribute +( + const globalIndexAndTransform& git, + const label constructSize, + List<T>& fld, + const bool isPosition +) const +{ + // Fill slots with reverse-transformed data. Note that it also copies + // back into the non-remote part of fld even though these values are not + // used. + applyInverseTransforms(git, fld, isPosition); //, eqOp<T>()); + + // And send back (the remote slots). Disable dummy transformations. + reverseDistribute(constructSize, fld, false); +} + + +template<class T> +void Foam::mapDistribute::reverseDistribute +( + const globalIndexAndTransform& git, + const label constructSize, + const T& nullValue, + List<T>& fld, + const bool isPosition +) const +{ + // Fill slots with reverse-transformed data Note that it also copies + // back into the non-remote part of fld even though these values are not + // used. + applyInverseTransforms(git, fld, isPosition); //, eqOp<T>()); + + // And send back (the remote slots) Disable dummy transformations. + reverseDistribute(constructSize, nullValue, fld, false); +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 7810d5fced04d89dc19452284ae61b5784f037ef..e26c665c639a7c84c063010968a4eb5070296d81 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -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 @@ -673,6 +673,8 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const bool hasError = false; + HashSet<word> patchNames(2*size()); + forAll(bm, patchI) { if (bm[patchI].start() != nextPatchStart && !hasError) @@ -689,6 +691,17 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const << " Suppressing future warnings." << endl; } + if (!patchNames.insert(bm[patchI].name()) && !hasError) + { + hasError = true; + + Info<< " ****Duplicate boundary patch " << patchI + << " named " << bm[patchI].name() + << " of type " << bm[patchI].type() + << "." << endl + << "Suppressing future warnings." << endl; + } + nextPatchStart += bm[patchI].size(); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index d1919e91799a0dbd194d56bff1cf372fa5b2f469..0e94bb89b3cb426f034fdce8c4fb613192fdeccd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -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 @@ -45,7 +45,6 @@ SourceFiles namespace Foam { -typedef List<labelPair> labelPairList; class polyMesh; // Forward declaration of friend functions and operators diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 8e69ff7684bc2fe4816d0d1f3b2a24a9e914d7bb..a5039132f9f47c92e7c6171e378c9445ebe02953 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -276,9 +276,16 @@ void Foam::cyclicPolyPatch::calcTransforms if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1) { - const_cast<tensorField&>(forwardT()).setSize(1); - const_cast<tensorField&>(reverseT()).setSize(1); + // Get index of maximum area face to minimise truncation errors. + label max0I = findMaxArea(half0.points(), half0); + + const tensor fwdT = forwardT()[max0I]; + const_cast<tensorField&>(forwardT()) = tensorField(1, fwdT); + const tensor revT = reverseT()[max0I]; + const_cast<tensorField&>(reverseT()) = tensorField(1, revT); + const bool coll = collocated()[max0I]; const_cast<boolList&>(collocated()).setSize(1); + const_cast<boolList&>(collocated())[0] = coll; WarningIn ( @@ -293,8 +300,9 @@ void Foam::cyclicPolyPatch::calcTransforms ) << "For patch " << name() << " calculated non-uniform transform tensor even though" << " the transform type is " << transformTypeNames[transform_] - << ". Setting the transformation tensor to be a uniform" - << " rotation." + << "." << nl + << " Setting the transformation tensor to be a uniform" + << " rotation calculated from face " << max0I << endl; } } @@ -695,9 +703,43 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch() } - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::label Foam::cyclicPolyPatch::neighbPatchID() const +{ + if (neighbPatchID_ == -1) + { + neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName_); + + if (neighbPatchID_ == -1) + { + FatalErrorIn("cyclicPolyPatch::neighbPatchID() const") + << "Illegal neighbourPatch name " << neighbPatchName_ + << endl << "Valid patch names are " + << this->boundaryMesh().names() + << exit(FatalError); + } + + // Check that it is a cyclic + const cyclicPolyPatch& nbrPatch = refCast<const cyclicPolyPatch> + ( + this->boundaryMesh()[neighbPatchID_] + ); + + if (nbrPatch.neighbPatchName() != name()) + { + WarningIn("cyclicPolyPatch::neighbPatchID() const") + << "Patch " << name() + << " specifies neighbour patch " << neighbPatchName() + << endl << " but that in return specifies " + << nbrPatch.neighbPatchName() + << endl; + } + } + return neighbPatchID_; +} + + void Foam::cyclicPolyPatch::transformPosition(pointField& l) const { if (!parallel()) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H index 71c2ecd996c9d199e3a510e600857e8b024b9ad4..dd0d14db86e6e53a3d036da906f5bcaee2ba2b34 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H @@ -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 @@ -197,6 +197,10 @@ protected: public: + //- Declare friendship with processorCyclicPolyPatch + friend class processorCyclicPolyPatch; + + //- Runtime type information TypeName("cyclic"); @@ -321,25 +325,7 @@ public: } //- Neighbour patchID. - virtual label neighbPatchID() const - { - if (neighbPatchID_ == -1) - { - neighbPatchID_ = this->boundaryMesh().findPatchID - ( - neighbPatchName_ - ); - if (neighbPatchID_ == -1) - { - FatalErrorIn("cyclicPolyPatch::neighbPatchID() const") - << "Illegal neighbourPatch name " << neighbPatchName_ - << endl << "Valid patch names are " - << this->boundaryMesh().names() - << exit(FatalError); - } - } - return neighbPatchID_; - } + virtual label neighbPatchID() const; virtual bool owner() const { diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index 33264fc0d3aefa99100c26077fd3b6b020a0950d..dddc152a7949800e48ea0f48b8774d84aa0236bd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -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 @@ -26,6 +26,7 @@ License #include "processorCyclicPolyPatch.H" #include "addToRunTimeSelectionTable.H" #include "SubField.H" +#include "cyclicPolyPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -171,9 +172,9 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) // - or do we not auto-calculate the transformation but // have option of reading it. - // Update underlying cyclic + // Update underlying cyclic halves. Need to do both since only one + // half might be present as a processorCyclic. coupledPolyPatch& pp = const_cast<coupledPolyPatch&>(referPatch()); - pp.calcGeometry ( *this, @@ -184,6 +185,21 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) neighbFaceAreas(), neighbFaceCellCentres() ); + + if (isA<cyclicPolyPatch>(pp)) + { + const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp); + const_cast<cyclicPolyPatch&>(cpp.neighbPatch()).calcGeometry + ( + *this, + neighbFaceCentres(), + neighbFaceAreas(), + neighbFaceCellCentres(), + faceCentres(), + faceAreas(), + faceCellCentres() + ); + } } } diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C index 94f9d6bbf802a011d3f2390f8d8f64bace052712..51b6ee7a642f6c3afa0d822ef449267c689e4d0d 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C @@ -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,6 @@ License \*----------------------------------------------------------------------------*/ #include "syncTools.H" -#include "polyMesh.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -99,24 +98,6 @@ void Foam::syncTools::transform::operator() // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Does anyone have couples? Since meshes might have 0 cells and 0 proc -// boundaries need to reduce this info. -bool Foam::syncTools::hasCouples(const polyBoundaryMesh& patches) -{ - bool hasAnyCouples = false; - - forAll(patches, patchI) - { - if (patches[patchI].coupled()) - { - hasAnyCouples = true; - break; - } - } - return returnReduce(hasAnyCouples, orOp<bool>()); -} - - // Determines for every point whether it is coupled and if so sets only one. Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) { @@ -125,12 +106,21 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) const globalMeshData& globalData = mesh.globalData(); const labelList& meshPoints = globalData.coupledPatch().meshPoints(); - const labelListList& pointSlaves = globalData.globalPointAllSlaves(); + const labelListList& slaves = globalData.globalPointSlaves(); + const labelListList& transformedSlaves = + globalData.globalPointTransformedSlaves(); forAll(meshPoints, coupledPointI) { label meshPointI = meshPoints[coupledPointI]; - if (pointSlaves[coupledPointI].size() > 0) + if + ( + ( + slaves[coupledPointI].size() + + transformedSlaves[coupledPointI].size() + ) + > 0 + ) { isMasterPoint[meshPointI] = true; } @@ -161,12 +151,21 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh) const globalMeshData& globalData = mesh.globalData(); const labelList& meshEdges = globalData.coupledPatchMeshEdges(); - const labelListList& edgeSlaves = globalData.globalEdgeAllSlaves(); + const labelListList& slaves = globalData.globalEdgeSlaves(); + const labelListList& transformedSlaves = + globalData.globalEdgeTransformedSlaves(); forAll(meshEdges, coupledEdgeI) { label meshEdgeI = meshEdges[coupledEdgeI]; - if (edgeSlaves[coupledEdgeI].size() > 0) + if + ( + ( + slaves[coupledEdgeI].size() + + transformedSlaves[coupledEdgeI].size() + ) + > 0 + ) { isMasterEdge[meshEdgeI] = true; } diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H index f27ba02a4780390e1c5c1714e0feec9bb999325d..f1572bd4ac7dcbe62e26ef6069c03ec3d4313526 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H @@ -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 @@ -33,12 +33,6 @@ Description - null value which gets overridden by any valid value. - transform function - note:Can apply coordinate rotation/separation on cyclics but only for faces - or if there is a single rotation/separation tensor. - note:syncPointList or syncEdgeList will visit shared points/edges - multiple times (once through patch exchange, once through shared - points reduce). Should be replaced by pointMesh functionality. - SourceFiles syncTools.C syncToolsTemplates.C @@ -48,9 +42,7 @@ SourceFiles #ifndef syncTools_H #define syncTools_H -#include "UList.H" #include "Pstream.H" -#include "Map.H" #include "EdgeMap.H" #include "PackedBoolList.H" #include "polyMesh.H" @@ -72,9 +64,6 @@ class syncTools { // Private Member Functions - //- Check whether uses couples. - static bool hasCouples(const polyBoundaryMesh&); - //- Combine value with existing value in map. template <class T, class CombineOp> static void combine @@ -174,41 +163,41 @@ public: const CombineOp& cop, const TransformOp& top ); - - //- Synchronize values on all mesh points. - template <class T, class CombineOp, class TransformOp> - static void syncPointList - ( - const polyMesh&, - UList<T>&, - const CombineOp& cop, - const T& nullValue, - const TransformOp& top - ); - - //- Synchronize values on selected mesh points. - template <class T, class CombineOp, class TransformOp> - static void syncPointList - ( - const polyMesh&, - const labelList& meshPoints, - UList<T>&, - const CombineOp& cop, - const T& nullValue, - const TransformOp& top - ); - - //- Synchronize values on all mesh edges. - template <class T, class CombineOp, class TransformOp> - static void syncEdgeList - ( - const polyMesh&, - UList<T>&, - const CombineOp& cop, - const T& nullValue, - const TransformOp& top - ); - +// +// //- Synchronize values on all mesh points. +// template <class T, class CombineOp, class TransformOp> +// static void syncPointList +// ( +// const polyMesh&, +// UList<T>&, +// const CombineOp& cop, +// const T& nullValue, +// const TransformOp& top +// ); +// +// //- Synchronize values on selected mesh points. +// template <class T, class CombineOp, class TransformOp> +// static void syncPointList +// ( +// const polyMesh&, +// const labelList& meshPoints, +// UList<T>&, +// const CombineOp& cop, +// const T& nullValue, +// const TransformOp& top +// ); +// +// //- Synchronize values on all mesh edges. +// template <class T, class CombineOp, class TransformOp> +// static void syncEdgeList +// ( +// const polyMesh&, +// UList<T>&, +// const CombineOp& cop, +// const T& nullValue, +// const TransformOp& top +// ); +// //- Synchronize values on boundary faces only. template <class T, class CombineOp, class TransformOp> static void syncBoundaryFaceList @@ -227,26 +216,20 @@ public: static void syncPointList ( const polyMesh& mesh, - UList<T>& l, + List<T>& l, const CombineOp& cop, const T& nullValue - ) - { - syncPointList(mesh, l, cop, nullValue, transform()); - } + ); //- Synchronize locations on all mesh points. template <class CombineOp> static void syncPointPositions ( const polyMesh& mesh, - UList<point>& l, + List<point>& l, const CombineOp& cop, const point& nullValue - ) - { - syncPointList(mesh, l, cop, nullValue, transformPosition()); - } + ); //- Synchronize values on selected mesh points. template <class T, class CombineOp> @@ -257,18 +240,7 @@ public: UList<T>& l, const CombineOp& cop, const T& nullValue - ) - { - syncPointList - ( - mesh, - meshPoints, - l, - cop, - nullValue, - transform() - ); - } + ); //- Synchronize locations on selected mesh points. template <class CombineOp> @@ -279,18 +251,7 @@ public: UList<point>& l, const CombineOp& cop, const point& nullValue - ) - { - syncPointList - ( - mesh, - meshPoints, - l, - cop, - nullValue, - transformPosition() - ); - } + ); // Synchronise edge-wise data @@ -303,10 +264,7 @@ public: UList<T>& l, const CombineOp& cop, const T& nullValue - ) - { - syncEdgeList(mesh, l, cop, nullValue, transform()); - } + ); //- Synchronize values on all mesh edges. template <class CombineOp> @@ -316,10 +274,7 @@ public: UList<point>& l, const CombineOp& cop, const point& nullValue - ) - { - syncEdgeList(mesh, l, cop, nullValue, transformPosition()); - } + ); // Synchronise face-wise data diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C index c941005f52343e868367ea940539914a76ab5c40..d135e2b73abe7ff21dcec8b78381ca4f9ec253fc 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C @@ -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 @@ -32,8 +32,6 @@ License #include "transform.H" #include "transformList.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Combine val with existing value at index @@ -93,11 +91,43 @@ void Foam::syncTools::syncPointMap { const polyBoundaryMesh& patches = mesh.boundaryMesh(); - if (!hasCouples(patches)) + // Synchronize multiple shared points. + const globalMeshData& pd = mesh.globalData(); + + // Values on shared points. Keyed on global shared index. + Map<T> sharedPointValues(0); + + if (pd.nGlobalPoints() > 0) { - return; + // meshPoint per local index + const labelList& sharedPtLabels = pd.sharedPointLabels(); + // global shared index per local index + const labelList& sharedPtAddr = pd.sharedPointAddr(); + + sharedPointValues.resize(sharedPtAddr.size()); + + // Fill my entries in the shared points + forAll(sharedPtLabels, i) + { + label meshPointI = sharedPtLabels[i]; + + typename Map<T>::const_iterator fnd = + pointValues.find(meshPointI); + + if (fnd != pointValues.end()) + { + combine + ( + sharedPointValues, + cop, + sharedPtAddr[i], // index + fnd() // value + ); + } + } } + if (Pstream::parRun()) { PstreamBuffers pBufs(Pstream::nonBlocking); @@ -261,8 +291,6 @@ void Foam::syncTools::syncPointMap } // Synchronize multiple shared points. - const globalMeshData& pd = mesh.globalData(); - if (pd.nGlobalPoints() > 0) { // meshPoint per local index @@ -270,30 +298,6 @@ void Foam::syncTools::syncPointMap // global shared index per local index const labelList& sharedPtAddr = pd.sharedPointAddr(); - // Values on shared points. Keyed on global shared index. - Map<T> sharedPointValues(sharedPtAddr.size()); - - - // Fill my entries in the shared points - forAll(sharedPtLabels, i) - { - label meshPointI = sharedPtLabels[i]; - - typename Map<T>::const_iterator fnd = - pointValues.find(meshPointI); - - if (fnd != pointValues.end()) - { - combine - ( - sharedPointValues, - cop, - sharedPtAddr[i], // index - fnd() // value - ); - } - } - // Reduce on master. if (Pstream::parRun()) @@ -374,13 +378,7 @@ void Foam::syncTools::syncPointMap if (sharedFnd != sharedPointValues.end()) { - combine - ( - pointValues, - cop, - iter(), // index - sharedFnd() // value - ); + pointValues.set(iter(), sharedFnd()); } } } @@ -398,11 +396,6 @@ void Foam::syncTools::syncEdgeMap { const polyBoundaryMesh& patches = mesh.boundaryMesh(); - if (!hasCouples(patches)) - { - return; - } - // Do synchronisation without constructing globalEdge addressing // (since this constructs mesh edge addressing) @@ -767,14 +760,239 @@ void Foam::syncTools::syncEdgeMap } -template <class T, class CombineOp, class TransformOp> +//template <class T, class CombineOp, class TransformOp> +//void Foam::syncTools::syncPointList +//( +// const polyMesh& mesh, +// UList<T>& pointValues, +// const CombineOp& cop, +// const T& nullValue, +// const TransformOp& top +//) +//{ +// if (pointValues.size() != mesh.nPoints()) +// { +// FatalErrorIn +// ( +// "syncTools<class T, class CombineOp>::syncPointList" +// "(const polyMesh&, UList<T>&, const CombineOp&, const T&" +// ", const bool)" +// ) << "Number of values " << pointValues.size() +// << " is not equal to the number of points in the mesh " +// << mesh.nPoints() << abort(FatalError); +// } +// +// const polyBoundaryMesh& patches = mesh.boundaryMesh(); +// +// // Synchronize multiple shared points. +// const globalMeshData& pd = mesh.globalData(); +// +// // Values on shared points. +// Field<T> sharedPts(0); +// if (pd.nGlobalPoints() > 0) +// { +// // Values on shared points. +// sharedPts.setSize(pd.nGlobalPoints(), nullValue); +// +// forAll(pd.sharedPointLabels(), i) +// { +// label meshPointI = pd.sharedPointLabels()[i]; +// // Fill my entries in the shared points +// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI]; +// } +// } +// +// if (Pstream::parRun()) +// { +// PstreamBuffers pBufs(Pstream::nonBlocking); +// +// // Send +// +// forAll(patches, patchI) +// { +// if +// ( +// isA<processorPolyPatch>(patches[patchI]) +// && patches[patchI].nPoints() > 0 +// ) +// { +// const processorPolyPatch& procPatch = +// refCast<const processorPolyPatch>(patches[patchI]); +// +// // Get data per patchPoint in neighbouring point numbers. +// Field<T> patchInfo(procPatch.nPoints()); +// +// const labelList& meshPts = procPatch.meshPoints(); +// const labelList& nbrPts = procPatch.neighbPoints(); +// +// forAll(nbrPts, pointI) +// { +// label nbrPointI = nbrPts[pointI]; +// patchInfo[nbrPointI] = pointValues[meshPts[pointI]]; +// } +// +// UOPstream toNbr(procPatch.neighbProcNo(), pBufs); +// toNbr << patchInfo; +// } +// } +// +// pBufs.finishedSends(); +// +// // Receive and combine. +// +// forAll(patches, patchI) +// { +// if +// ( +// isA<processorPolyPatch>(patches[patchI]) +// && patches[patchI].nPoints() > 0 +// ) +// { +// const processorPolyPatch& procPatch = +// refCast<const processorPolyPatch>(patches[patchI]); +// +// Field<T> nbrPatchInfo(procPatch.nPoints()); +// { +// UIPstream fromNbr(procPatch.neighbProcNo(), pBufs); +// fromNbr >> nbrPatchInfo; +// } +// +// // Transform to this side +// top(procPatch, nbrPatchInfo); +// +// const labelList& meshPts = procPatch.meshPoints(); +// +// forAll(meshPts, pointI) +// { +// label meshPointI = meshPts[pointI]; +// cop(pointValues[meshPointI], nbrPatchInfo[pointI]); +// } +// } +// } +// } +// +// // Do the cyclics. +// forAll(patches, patchI) +// { +// if (isA<cyclicPolyPatch>(patches[patchI])) +// { +// const cyclicPolyPatch& cycPatch = +// refCast<const cyclicPolyPatch>(patches[patchI]); +// +// if (cycPatch.owner()) +// { +// // Owner does all. +// +// const edgeList& coupledPoints = cycPatch.coupledPoints(); +// const labelList& meshPts = cycPatch.meshPoints(); +// const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); +// const labelList& nbrMeshPoints = nbrPatch.meshPoints(); +// +// Field<T> half0Values(coupledPoints.size()); +// Field<T> half1Values(coupledPoints.size()); +// +// forAll(coupledPoints, i) +// { +// const edge& e = coupledPoints[i]; +// half0Values[i] = pointValues[meshPts[e[0]]]; +// half1Values[i] = pointValues[nbrMeshPoints[e[1]]]; +// } +// +// //SubField<T> slice0(half0Values, half0Values.size()); +// //SubField<T> slice1(half1Values, half1Values.size()); +// //top(cycPatch, reinterpret_cast<Field<T>&>(slice1)); +// //top(nbrPatch, reinterpret_cast<Field<T>&>(slice0)); +// +// top(cycPatch, half1Values); +// top(nbrPatch, half0Values); +// +// forAll(coupledPoints, i) +// { +// const edge& e = coupledPoints[i]; +// cop(pointValues[meshPts[e[0]]], half1Values[i]); +// cop(pointValues[nbrMeshPoints[e[1]]], half0Values[i]); +// } +// } +// } +// } +// +// // Synchronize multiple shared points. +// const globalMeshData& pd = mesh.globalData(); +// +// if (pd.nGlobalPoints() > 0) +// { +// // Combine on master. +// Pstream::listCombineGather(sharedPts, cop); +// Pstream::listCombineScatter(sharedPts); +// +// // Now we will all have the same information. Merge it back with +// // my local information. +// forAll(pd.sharedPointLabels(), i) +// { +// label meshPointI = pd.sharedPointLabels()[i]; +// pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]]; +// } +// } +//} + + +//template <class T, class CombineOp, class TransformOp> +//void Foam::syncTools::syncPointList +//( +// const polyMesh& mesh, +// const labelList& meshPoints, +// UList<T>& pointValues, +// const CombineOp& cop, +// const T& nullValue, +// const TransformOp& top +//) +//{ +// if (pointValues.size() != meshPoints.size()) +// { +// FatalErrorIn +// ( +// "syncTools<class T, class CombineOp>::syncPointList" +// "(const polyMesh&, const labelList&, UList<T>&, const CombineOp&" +// ", const T&, const bool)" +// ) << "Number of values " << pointValues.size() +// << " is not equal to the number of points " +// << meshPoints.size() << abort(FatalError); +// } +// +// if (!hasCouples(mesh.boundaryMesh())) +// { +// return; +// } +// +// Field<T> meshValues(mesh.nPoints(), nullValue); +// +// forAll(meshPoints, i) +// { +// meshValues[meshPoints[i]] = pointValues[i]; +// } +// +// syncTools::syncPointList +// ( +// mesh, +// meshValues, +// cop, // combine op +// nullValue, // null value +// top // position or field +// ); +// +// forAll(meshPoints, i) +// { +// pointValues[i] = meshValues[meshPoints[i]]; +// } +//} + +template <class T, class CombineOp> void Foam::syncTools::syncPointList ( const polyMesh& mesh, - UList<T>& pointValues, + List<T>& pointValues, const CombineOp& cop, - const T& nullValue, - const TransformOp& top + const T& nullValue ) { if (pointValues.size() != mesh.nPoints()) @@ -782,223 +1000,165 @@ void Foam::syncTools::syncPointList FatalErrorIn ( "syncTools<class T, class CombineOp>::syncPointList" - "(const polyMesh&, UList<T>&, const CombineOp&, const T&" - ", const bool)" + "(const polyMesh&, UList<T>&, const CombineOp&, const T&)" ) << "Number of values " << pointValues.size() << " is not equal to the number of points in the mesh " << mesh.nPoints() << abort(FatalError); } - const polyBoundaryMesh& patches = mesh.boundaryMesh(); + mesh.globalData().syncPointData(pointValues, cop, false); +} - if (!hasCouples(patches)) - { - return; - } - if (Pstream::parRun()) +template <class CombineOp> +void Foam::syncTools::syncPointPositions +( + const polyMesh& mesh, + List<point>& pointValues, + const CombineOp& cop, + const point& nullValue +) +{ + if (pointValues.size() != mesh.nPoints()) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - // Send - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nPoints() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - // Get data per patchPoint in neighbouring point numbers. - Field<T> patchInfo(procPatch.nPoints()); - - const labelList& meshPts = procPatch.meshPoints(); - const labelList& nbrPts = procPatch.neighbPoints(); - - forAll(nbrPts, pointI) - { - label nbrPointI = nbrPts[pointI]; - patchInfo[nbrPointI] = pointValues[meshPts[pointI]]; - } - - UOPstream toNbr(procPatch.neighbProcNo(), pBufs); - toNbr << patchInfo; - } - } - - pBufs.finishedSends(); - - // Receive and combine. - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nPoints() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - Field<T> nbrPatchInfo(procPatch.nPoints()); - { - UIPstream fromNbr(procPatch.neighbProcNo(), pBufs); - fromNbr >> nbrPatchInfo; - } - - // Transform to this side - top(procPatch, nbrPatchInfo); - - const labelList& meshPts = procPatch.meshPoints(); - - forAll(meshPts, pointI) - { - label meshPointI = meshPts[pointI]; - cop(pointValues[meshPointI], nbrPatchInfo[pointI]); - } - } - } + FatalErrorIn + ( + "syncTools<class CombineOp>::syncPointPositions" + "(const polyMesh&, List<point>&, const CombineOp&, const point&)" + ) << "Number of values " << pointValues.size() + << " is not equal to the number of points in the mesh " + << mesh.nPoints() << abort(FatalError); } - // Do the cyclics. - forAll(patches, patchI) - { - if (isA<cyclicPolyPatch>(patches[patchI])) - { - const cyclicPolyPatch& cycPatch = - refCast<const cyclicPolyPatch>(patches[patchI]); - - if (cycPatch.owner()) - { - // Owner does all. - - const edgeList& coupledPoints = cycPatch.coupledPoints(); - const labelList& meshPts = cycPatch.meshPoints(); - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); - const labelList& nbrMeshPoints = nbrPatch.meshPoints(); - - Field<T> half0Values(coupledPoints.size()); - Field<T> half1Values(coupledPoints.size()); - - forAll(coupledPoints, i) - { - const edge& e = coupledPoints[i]; - half0Values[i] = pointValues[meshPts[e[0]]]; - half1Values[i] = pointValues[nbrMeshPoints[e[1]]]; - } - - //SubField<T> slice0(half0Values, half0Values.size()); - //SubField<T> slice1(half1Values, half1Values.size()); - //top(cycPatch, reinterpret_cast<Field<T>&>(slice1)); - //top(nbrPatch, reinterpret_cast<Field<T>&>(slice0)); + mesh.globalData().syncPointData(pointValues, cop, true); +} - top(cycPatch, half1Values); - top(nbrPatch, half0Values); - forAll(coupledPoints, i) - { - const edge& e = coupledPoints[i]; - cop(pointValues[meshPts[e[0]]], half1Values[i]); - cop(pointValues[nbrMeshPoints[e[1]]], half0Values[i]); - } - } - } +template <class T, class CombineOp> +void Foam::syncTools::syncPointList +( + const polyMesh& mesh, + const labelList& meshPoints, + UList<T>& pointValues, + const CombineOp& cop, + const T& nullValue +) +{ + if (pointValues.size() != meshPoints.size()) + { + FatalErrorIn + ( + "syncTools<class T, class CombineOp>::syncPointList" + "(const polyMesh&, UList<T>&, const CombineOp&, const T&)" + ) << "Number of values " << pointValues.size() + << " is not equal to the number of meshPoints " + << meshPoints.size() << abort(FatalError); } + const globalMeshData& gd = mesh.globalData(); + const indirectPrimitivePatch& cpp = gd.coupledPatch(); + const Map<label>& mpm = cpp.meshPointMap(); - // Synchronize multiple shared points. - const globalMeshData& pd = mesh.globalData(); + List<T> cppFld(cpp.nPoints(), nullValue); - if (pd.nGlobalPoints() > 0) + forAll(meshPoints, i) { - // Values on shared points. - Field<T> sharedPts(pd.nGlobalPoints(), nullValue); - - forAll(pd.sharedPointLabels(), i) + label pointI = meshPoints[i]; + Map<label>::const_iterator iter = mpm.find(pointI); + if (iter != mpm.end()) { - label meshPointI = pd.sharedPointLabels()[i]; - // Fill my entries in the shared points - sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI]; + cppFld[iter()] = pointValues[i]; } + } - // Combine on master. - Pstream::listCombineGather(sharedPts, cop); - Pstream::listCombineScatter(sharedPts); + globalMeshData::syncData + ( + cppFld, + gd.globalPointSlaves(), + gd.globalPointTransformedSlaves(), + gd.globalPointSlavesMap(), + gd.globalTransforms(), + cop, + false //position? + ); - // Now we will all have the same information. Merge it back with - // my local information. - forAll(pd.sharedPointLabels(), i) + forAll(meshPoints, i) + { + label pointI = meshPoints[i]; + Map<label>::const_iterator iter = mpm.find(pointI); + if (iter != mpm.end()) { - label meshPointI = pd.sharedPointLabels()[i]; - pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]]; + pointValues[i] = cppFld[iter()]; } } } -template <class T, class CombineOp, class TransformOp> -void Foam::syncTools::syncPointList +template <class CombineOp> +void Foam::syncTools::syncPointPositions ( const polyMesh& mesh, const labelList& meshPoints, - UList<T>& pointValues, + UList<point>& pointValues, const CombineOp& cop, - const T& nullValue, - const TransformOp& top + const point& nullValue ) { if (pointValues.size() != meshPoints.size()) { FatalErrorIn ( - "syncTools<class T, class CombineOp>::syncPointList" - "(const polyMesh&, const labelList&, UList<T>&, const CombineOp&" - ", const T&, const bool)" + "syncTools<class CombineOp>::syncPointList" + "(const polyMesh&, UList<point>&, const CombineOp&, const point&)" ) << "Number of values " << pointValues.size() - << " is not equal to the number of points " + << " is not equal to the number of meshPoints " << meshPoints.size() << abort(FatalError); } + const globalMeshData& gd = mesh.globalData(); + const indirectPrimitivePatch& cpp = gd.coupledPatch(); + const Map<label>& mpm = cpp.meshPointMap(); - if (!hasCouples(mesh.boundaryMesh())) - { - return; - } - - Field<T> meshValues(mesh.nPoints(), nullValue); + List<point> cppFld(cpp.nPoints(), nullValue); forAll(meshPoints, i) { - meshValues[meshPoints[i]] = pointValues[i]; + label pointI = meshPoints[i]; + Map<label>::const_iterator iter = mpm.find(pointI); + if (iter != mpm.end()) + { + cppFld[iter()] = pointValues[i]; + } } - syncTools::syncPointList + globalMeshData::syncData ( - mesh, - meshValues, - cop, // combine op - nullValue, // null value - top // position or field + cppFld, + gd.globalPointSlaves(), + gd.globalPointTransformedSlaves(), + gd.globalPointSlavesMap(), + gd.globalTransforms(), + cop, + true //position? ); forAll(meshPoints, i) { - pointValues[i] = meshValues[meshPoints[i]]; + label pointI = meshPoints[i]; + Map<label>::const_iterator iter = mpm.find(pointI); + if (iter != mpm.end()) + { + pointValues[i] = cppFld[iter()]; + } } } -template <class T, class CombineOp, class TransformOp> +template <class T, class CombineOp> void Foam::syncTools::syncEdgeList ( const polyMesh& mesh, UList<T>& edgeValues, const CombineOp& cop, - const T& nullValue, - const TransformOp& top + const T& nullValue ) { if (edgeValues.size() != mesh.nEdges()) @@ -1006,170 +1166,82 @@ void Foam::syncTools::syncEdgeList FatalErrorIn ( "syncTools<class T, class CombineOp>::syncEdgeList" - "(const polyMesh&, UList<T>&, const CombineOp&, const T&" - ", const bool)" + "(const polyMesh&, UList<T>&, const CombineOp&, const T&)" ) << "Number of values " << edgeValues.size() << " is not equal to the number of edges in the mesh " << mesh.nEdges() << abort(FatalError); } - const polyBoundaryMesh& patches = mesh.boundaryMesh(); + const globalMeshData& gd = mesh.globalData(); + const labelList& meshEdges = gd.coupledPatchMeshEdges(); + const globalIndexAndTransform& git = gd.globalTransforms(); + const mapDistribute& edgeMap = gd.globalEdgeSlavesMap(); + + List<T> cppFld(UIndirectList<T>(edgeValues, meshEdges)); - if (!hasCouples(patches)) + globalMeshData::syncData + ( + cppFld, + gd.globalEdgeSlaves(), + gd.globalEdgeTransformedSlaves(), + edgeMap, + git, + cop, + false //position? + ); + + // Extract back onto mesh + forAll(meshEdges, i) { - return; + edgeValues[meshEdges[i]] = cppFld[i]; } +} - if (Pstream::parRun()) - { - PstreamBuffers pBufs(Pstream::nonBlocking); - // Send +template <class CombineOp> +void Foam::syncTools::syncEdgePositions +( + const polyMesh& mesh, + UList<point>& edgeValues, + const CombineOp& cop, + const point& nullValue +) +{ + if (edgeValues.size() != mesh.nEdges()) + { + FatalErrorIn + ( + "syncTools<class CombineOp>::syncEdgePositions" + "(const polyMesh&, UList<point>&, const CombineOp&, const point&)" + ) << "Number of values " << edgeValues.size() + << " is not equal to the number of edges in the mesh " + << mesh.nEdges() << abort(FatalError); + } - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nEdges() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); + const globalMeshData& gd = mesh.globalData(); + const labelList& meshEdges = gd.coupledPatchMeshEdges(); + const globalIndexAndTransform& git = gd.globalTransforms(); + const mapDistribute& map = gd.globalEdgeSlavesMap(); - const labelList& meshEdges = procPatch.meshEdges(); - const labelList& neighbEdges = procPatch.neighbEdges(); + List<point> cppFld(UIndirectList<point>(edgeValues, meshEdges)); - // Get region per patch edge in neighbouring edge numbers. - Field<T> patchInfo(procPatch.nEdges(), nullValue); + globalMeshData::syncData + ( + cppFld, + gd.globalEdgeSlaves(), + gd.globalEdgeTransformedSlaves(), + map, + git, + cop, + true //position? + ); - forAll(neighbEdges, edgeI) - { - label nbrEdgeI = neighbEdges[edgeI]; - - patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]]; - } - - UOPstream toNbr(procPatch.neighbProcNo(), pBufs); - toNbr << patchInfo; - } - } - - pBufs.finishedSends(); - - // Receive and combine. - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nEdges() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - const labelList& meshEdges = procPatch.meshEdges(); - - // Receive from neighbour. Is per patch edge the region of the - // neighbouring patch edge. - Field<T> nbrPatchInfo(procPatch.nEdges()); - - { - UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs); - fromNeighb >> nbrPatchInfo; - } - - // Transform to this side - top(procPatch, nbrPatchInfo); - - forAll(meshEdges, edgeI) - { - label meshEdgeI = meshEdges[edgeI]; - cop(edgeValues[meshEdgeI], nbrPatchInfo[edgeI]); - } - } - } - } - - // Do the cyclics. - forAll(patches, patchI) - { - if (isA<cyclicPolyPatch>(patches[patchI])) - { - const cyclicPolyPatch& cycPatch = - refCast<const cyclicPolyPatch>(patches[patchI]); - - if (cycPatch.owner()) - { - // Owner does all. - const edgeList& coupledEdges = cycPatch.coupledEdges(); - const labelList& meshEdges = cycPatch.meshEdges(); - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); - const labelList& nbrMeshEdges = nbrPatch.meshEdges(); - - Field<T> half0Values(coupledEdges.size()); - Field<T> half1Values(coupledEdges.size()); - - forAll(coupledEdges, i) - { - const edge& e = coupledEdges[i]; - half0Values[i] = edgeValues[meshEdges[e[0]]]; - half1Values[i] = edgeValues[nbrMeshEdges[e[1]]]; - } - - //SubField<T> slice0(half0Values, half0Values.size()); - //SubField<T> slice1(half1Values, half1Values.size()); - //top(cycPatch, reinterpret_cast<Field<T>&>(slice1)); - //top(nbrPatch, reinterpret_cast<Field<T>&>(slice0)); - - top(cycPatch, half1Values); - top(nbrPatch, half0Values); - - forAll(coupledEdges, i) - { - const edge& e = coupledEdges[i]; - cop(edgeValues[meshEdges[e[0]]], half1Values[i]); - cop(edgeValues[nbrMeshEdges[e[1]]], half0Values[i]); - } - } - } - } - - //- Note: hasTransformation is only used for warning messages so - // reduction not strictly nessecary. - //reduce(hasTransformation, orOp<bool>()); - - // Do the multiple shared edges - const globalMeshData& pd = mesh.globalData(); - - if (pd.nGlobalEdges() > 0) - { - // Values on shared edges. - Field<T> sharedPts(pd.nGlobalEdges(), nullValue); - - forAll(pd.sharedEdgeLabels(), i) - { - label meshEdgeI = pd.sharedEdgeLabels()[i]; - - // Fill my entries in the shared edges - sharedPts[pd.sharedEdgeAddr()[i]] = edgeValues[meshEdgeI]; - } - - // Combine on master. - Pstream::listCombineGather(sharedPts, cop); - Pstream::listCombineScatter(sharedPts); - - // Now we will all have the same information. Merge it back with - // my local information. - forAll(pd.sharedEdgeLabels(), i) - { - label meshEdgeI = pd.sharedEdgeLabels()[i]; - edgeValues[meshEdgeI] = sharedPts[pd.sharedEdgeAddr()[i]]; - } - } -} + // Extract back onto mesh + forAll(meshEdges, i) + { + edgeValues[meshEdges[i]] = cppFld[i]; + } +} template <class T, class CombineOp, class TransformOp> @@ -1197,12 +1269,6 @@ void Foam::syncTools::syncBoundaryFaceList const polyBoundaryMesh& patches = mesh.boundaryMesh(); - if (!hasCouples(patches)) - { - return; - } - - if (Pstream::parRun()) { PstreamBuffers pBufs(Pstream::nonBlocking); @@ -1223,13 +1289,7 @@ void Foam::syncTools::syncBoundaryFaceList label patchStart = procPatch.start()-mesh.nInternalFaces(); UOPstream toNbr(procPatch.neighbProcNo(), pBufs); - toNbr << - SubField<T> - ( - faceValues, - procPatch.size(), - patchStart - ); + toNbr << SubField<T>(faceValues, procPatch.size(), patchStart); } } @@ -1331,11 +1391,6 @@ void Foam::syncTools::syncFaceList const polyBoundaryMesh& patches = mesh.boundaryMesh(); - if (!hasCouples(patches)) - { - return; - } - if (Pstream::parRun()) { PstreamBuffers pBufs(Pstream::nonBlocking); @@ -1464,145 +1519,28 @@ void Foam::syncTools::syncPointList << mesh.nPoints() << abort(FatalError); } - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - - if (!hasCouples(patches)) - { - return; - } - - if (Pstream::parRun()) - { - PstreamBuffers pBufs(Pstream::nonBlocking); - - // Send - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nPoints() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - List<unsigned int> patchInfo(procPatch.nPoints()); - - const labelList& meshPts = procPatch.meshPoints(); - const labelList& nbrPts = procPatch.neighbPoints(); - - forAll(nbrPts, pointI) - { - label nbrPointI = nbrPts[pointI]; - patchInfo[nbrPointI] = pointValues[meshPts[pointI]]; - } - - UOPstream toNbr(procPatch.neighbProcNo(), pBufs); - toNbr << patchInfo; - } - } - - - pBufs.finishedSends(); - - // Receive and combine. - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nPoints() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - List<unsigned int> nbrPatchInfo(procPatch.nPoints()); - { - // We do not know the number of points on the other side - // so cannot use Pstream::read. - UIPstream fromNbr(procPatch.neighbProcNo(), pBufs); - fromNbr >> nbrPatchInfo; - } - - const labelList& meshPts = procPatch.meshPoints(); - - forAll(meshPts, pointI) - { - label meshPointI = meshPts[pointI]; - unsigned int pointVal = pointValues[meshPointI]; - cop(pointVal, nbrPatchInfo[pointI]); - pointValues[meshPointI] = pointVal; - } - } - } - } + const globalMeshData& gd = mesh.globalData(); + const labelList& meshPoints = gd.coupledPatch().meshPoints(); - // Do the cyclics. - forAll(patches, patchI) + List<unsigned int> cppFld(gd.globalPointSlavesMap().constructSize()); + forAll(meshPoints, i) { - if (isA<cyclicPolyPatch>(patches[patchI])) - { - const cyclicPolyPatch& cycPatch = - refCast<const cyclicPolyPatch>(patches[patchI]); - - if (cycPatch.owner()) - { - // Owner does all. - - const edgeList& coupledPoints = cycPatch.coupledPoints(); - const labelList& meshPts = cycPatch.meshPoints(); - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); - const labelList& nbrMeshPts = nbrPatch.meshPoints(); - - forAll(coupledPoints, i) - { - const edge& e = coupledPoints[i]; - label meshPoint0 = meshPts[e[0]]; - label meshPoint1 = nbrMeshPts[e[1]]; - - unsigned int val0 = pointValues[meshPoint0]; - unsigned int val1 = pointValues[meshPoint1]; - unsigned int t = val0; - - cop(val0, val1); - pointValues[meshPoint0] = val0; - cop(val1, t); - pointValues[meshPoint1] = val1; - } - } - } + cppFld[i] = pointValues[meshPoints[i]]; } - // Synchronize multiple shared points. - const globalMeshData& pd = mesh.globalData(); + globalMeshData::syncData + ( + cppFld, + gd.globalPointSlaves(), + gd.globalPointTransformedSlaves(), + gd.globalPointSlavesMap(), + cop + ); - if (pd.nGlobalPoints() > 0) + // Extract back to mesh + forAll(meshPoints, i) { - // Values on shared points. Use unpacked storage for ease! - List<unsigned int> sharedPts(pd.nGlobalPoints(), nullValue); - - forAll(pd.sharedPointLabels(), i) - { - label meshPointI = pd.sharedPointLabels()[i]; - // Fill my entries in the shared points - sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI]; - } - - // Combine on master. - Pstream::listCombineGather(sharedPts, cop); - Pstream::listCombineScatter(sharedPts); - - // Now we will all have the same information. Merge it back with - // my local information. - forAll(pd.sharedPointLabels(), i) - { - label meshPointI = pd.sharedPointLabels()[i]; - pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]]; - } + pointValues[meshPoints[i]] = cppFld[i]; } } @@ -1628,145 +1566,28 @@ void Foam::syncTools::syncEdgeList << mesh.nEdges() << abort(FatalError); } - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - - if (!hasCouples(patches)) - { - return; - } - - if (Pstream::parRun()) - { - PstreamBuffers pBufs(Pstream::nonBlocking); - - // Send - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nEdges() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - List<unsigned int> patchInfo(procPatch.nEdges()); + const globalMeshData& gd = mesh.globalData(); + const labelList& meshEdges = gd.coupledPatchMeshEdges(); - const labelList& meshEdges = procPatch.meshEdges(); - const labelList& neighbEdges = procPatch.neighbEdges(); - - forAll(neighbEdges, edgeI) - { - label nbrEdgeI = neighbEdges[edgeI]; - patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]]; - } - - UOPstream toNbr(procPatch.neighbProcNo(), pBufs); - toNbr << patchInfo; - } - } - - pBufs.finishedSends(); - - // Receive and combine. - - forAll(patches, patchI) - { - if - ( - isA<processorPolyPatch>(patches[patchI]) - && patches[patchI].nEdges() > 0 - ) - { - const processorPolyPatch& procPatch = - refCast<const processorPolyPatch>(patches[patchI]); - - // Receive from neighbour. - List<unsigned int> nbrPatchInfo(procPatch.nEdges()); - - { - UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs); - fromNeighb >> nbrPatchInfo; - } - - const labelList& meshEdges = procPatch.meshEdges(); - - forAll(meshEdges, edgeI) - { - unsigned int patchVal = nbrPatchInfo[edgeI]; - label meshEdgeI = meshEdges[edgeI]; - unsigned int edgeVal = edgeValues[meshEdgeI]; - cop(edgeVal, patchVal); - edgeValues[meshEdgeI] = edgeVal; - } - } - } - } - - // Do the cyclics. - forAll(patches, patchI) + List<unsigned int> cppFld(gd.globalEdgeSlavesMap().constructSize()); + forAll(meshEdges, i) { - if (isA<cyclicPolyPatch>(patches[patchI])) - { - const cyclicPolyPatch& cycPatch = - refCast<const cyclicPolyPatch>(patches[patchI]); - - if (cycPatch.owner()) - { - // Owner does all. - const edgeList& coupledEdges = cycPatch.coupledEdges(); - const labelList& meshEdges = cycPatch.meshEdges(); - const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch(); - const labelList& nbrMeshEdges = nbrPatch.meshEdges(); - - forAll(coupledEdges, i) - { - const edge& e = coupledEdges[i]; - - label edge0 = meshEdges[e[0]]; - label edge1 = nbrMeshEdges[e[1]]; - - unsigned int val0 = edgeValues[edge0]; - unsigned int t = val0; - unsigned int val1 = edgeValues[edge1]; - - cop(t, val1); - edgeValues[edge0] = t; - cop(val1, val0); - edgeValues[edge1] = val1; - } - } - } + cppFld[i] = edgeValues[meshEdges[i]]; } - // Synchronize multiple shared edges. - const globalMeshData& pd = mesh.globalData(); + globalMeshData::syncData + ( + cppFld, + gd.globalEdgeSlaves(), + gd.globalEdgeTransformedSlaves(), + gd.globalEdgeSlavesMap(), + cop + ); - if (pd.nGlobalEdges() > 0) + // Extract back to mesh + forAll(meshEdges, i) { - // Values on shared edges. Use unpacked storage for ease! - List<unsigned int> sharedPts(pd.nGlobalEdges(), nullValue); - - forAll(pd.sharedEdgeLabels(), i) - { - label meshEdgeI = pd.sharedEdgeLabels()[i]; - // Fill my entries in the shared edges - sharedPts[pd.sharedEdgeAddr()[i]] = edgeValues[meshEdgeI]; - } - - // Combine on master. - Pstream::listCombineGather(sharedPts, cop); - Pstream::listCombineScatter(sharedPts); - - // Now we will all have the same information. Merge it back with - // my local information. - forAll(pd.sharedEdgeLabels(), i) - { - label meshEdgeI = pd.sharedEdgeLabels()[i]; - edgeValues[meshEdgeI] = sharedPts[pd.sharedEdgeAddr()[i]]; - } + edgeValues[meshEdges[i]] = cppFld[i]; } } diff --git a/src/OpenFOAM/primitives/Pair/labelPair.H b/src/OpenFOAM/primitives/Pair/labelPair.H index fb54470312eab60890053494097545b37f5073aa..300b81d0f49d75d62b77d4c5156d4f9dcbe34f9f 100644 --- a/src/OpenFOAM/primitives/Pair/labelPair.H +++ b/src/OpenFOAM/primitives/Pair/labelPair.H @@ -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,19 +27,26 @@ Typedef Description Label pair +Typedef + Foam::labelPairList + +Description + List of labelPairs + \*---------------------------------------------------------------------------*/ #ifndef labelPair_H #define labelPair_H -#include "label.H" #include "Pair.H" +#include "List.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef Pair<label> labelPair; + typedef List<labelPair> labelPairList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Lists/scalarIOList.C b/src/OpenFOAM/primitives/Scalar/lists/scalarIOList.C similarity index 95% rename from src/OpenFOAM/primitives/Lists/scalarIOList.C rename to src/OpenFOAM/primitives/Scalar/lists/scalarIOList.C index 60fd9a55d1923225ef18d6efa4f82402218af1b1..97d4d8f94d543247108a3bf8150c65b8929e0775 100644 --- a/src/OpenFOAM/primitives/Lists/scalarIOList.C +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/scalarIOList.H b/src/OpenFOAM/primitives/Scalar/lists/scalarIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/scalarIOList.H rename to src/OpenFOAM/primitives/Scalar/lists/scalarIOList.H index e27e970d3029bfd4733a440ba81512a9610d25c0..312378f8a7b66a0c87b61bc27fd9539ee2119b72 100644 --- a/src/OpenFOAM/primitives/Lists/scalarIOList.H +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/scalarList.C b/src/OpenFOAM/primitives/Scalar/lists/scalarList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/scalarList.C rename to src/OpenFOAM/primitives/Scalar/lists/scalarList.C index bf2c6d8ac9ca01f15184d45edb3d7a55df3e406a..38871e66467fb639f859726c4d76efbbd823d551 100644 --- a/src/OpenFOAM/primitives/Lists/scalarList.C +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/scalarList.H b/src/OpenFOAM/primitives/Scalar/lists/scalarList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/scalarList.H rename to src/OpenFOAM/primitives/Scalar/lists/scalarList.H index b73fb47d833b6cf45737632ddd9da8f1aae50b55..9c8c9c6a33ccc5d581039a00679bb28ac0ade331 100644 --- a/src/OpenFOAM/primitives/Lists/scalarList.H +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.C b/src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/scalarListIOList.C rename to src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.C index caf9e04b6a4853424210c2fb34e56626055d87c5..ce71f70703a3b28722a69d6151499be47a5bddd7 100644 --- a/src/OpenFOAM/primitives/Lists/scalarListIOList.C +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.H b/src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/scalarListIOList.H rename to src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.H index b06c6240e23669d5dc100fb4e387132be9c5d310..63f688fc8d1d8c2d0b61bb32a3a1a188e0237a13 100644 --- a/src/OpenFOAM/primitives/Lists/scalarListIOList.H +++ b/src/OpenFOAM/primitives/Scalar/lists/scalarListIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/sphericalTensorList.C b/src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/sphericalTensorList.C rename to src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.C index 233d0d2f091b5a5791d0cba88811c3560dc66083..083c5b4c066b47598577b90a1421aa226a5b47ab 100644 --- a/src/OpenFOAM/primitives/Lists/sphericalTensorList.C +++ b/src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/sphericalTensorList.H b/src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/sphericalTensorList.H rename to src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.H index 9182eb5fd1133d3f0333534690ab02f3f466709a..bb5a5e11b302030d34edb93b4ea345806210c97f 100644 --- a/src/OpenFOAM/primitives/Lists/sphericalTensorList.H +++ b/src/OpenFOAM/primitives/Tensor/lists/sphericalTensorList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/symmTensorList.C b/src/OpenFOAM/primitives/Tensor/lists/symmTensorList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/symmTensorList.C rename to src/OpenFOAM/primitives/Tensor/lists/symmTensorList.C index a703e3cceae3085dc140a3d417ee8d94ce850366..45b3b729b0cfe25d0f94bcb7278844e23b4903c3 100644 --- a/src/OpenFOAM/primitives/Lists/symmTensorList.C +++ b/src/OpenFOAM/primitives/Tensor/lists/symmTensorList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/symmTensorList.H b/src/OpenFOAM/primitives/Tensor/lists/symmTensorList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/symmTensorList.H rename to src/OpenFOAM/primitives/Tensor/lists/symmTensorList.H index 9691df46a904c0d7fb3a9e87990ec6a413644a69..f9b99b65f091b274bdc9921d14d51a017bfc528a 100644 --- a/src/OpenFOAM/primitives/Lists/symmTensorList.H +++ b/src/OpenFOAM/primitives/Tensor/lists/symmTensorList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/tensorList.C b/src/OpenFOAM/primitives/Tensor/lists/tensorList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/tensorList.C rename to src/OpenFOAM/primitives/Tensor/lists/tensorList.C index 6a1b65243fa073beb6c8e69f69f63f2a49ca9e93..e65571889593054b7747ca4571e1dafdee9f789b 100644 --- a/src/OpenFOAM/primitives/Lists/tensorList.C +++ b/src/OpenFOAM/primitives/Tensor/lists/tensorList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/tensorList.H b/src/OpenFOAM/primitives/Tensor/lists/tensorList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/tensorList.H rename to src/OpenFOAM/primitives/Tensor/lists/tensorList.H index 0139d9512bac869d65be98be85ade5561f69fd88..b08120f75855e7179379d1415bb12342d6db00cc 100644 --- a/src/OpenFOAM/primitives/Lists/tensorList.H +++ b/src/OpenFOAM/primitives/Tensor/lists/tensorList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorIOList.C b/src/OpenFOAM/primitives/Vector/lists/vectorIOList.C similarity index 95% rename from src/OpenFOAM/primitives/Lists/vectorIOList.C rename to src/OpenFOAM/primitives/Vector/lists/vectorIOList.C index 95c31db6d58015ed01e1c64ba7873b2e0f832f68..16b424f589f4156697037dc2d74c93f6d62b2f63 100644 --- a/src/OpenFOAM/primitives/Lists/vectorIOList.C +++ b/src/OpenFOAM/primitives/Vector/lists/vectorIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorIOList.H b/src/OpenFOAM/primitives/Vector/lists/vectorIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/vectorIOList.H rename to src/OpenFOAM/primitives/Vector/lists/vectorIOList.H index 4410bdac149ee45d206fb8d47bf5059692f693fc..1b1d43c66586f18bb9b86e704efcf62a173d5b68 100644 --- a/src/OpenFOAM/primitives/Lists/vectorIOList.H +++ b/src/OpenFOAM/primitives/Vector/lists/vectorIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorList.C b/src/OpenFOAM/primitives/Vector/lists/vectorList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/vectorList.C rename to src/OpenFOAM/primitives/Vector/lists/vectorList.C index fd4c074065dbc3576e2bbd9ed123d3fcc7bd2bdf..95c804972969d559ecfd7aee21badd70a827d9f6 100644 --- a/src/OpenFOAM/primitives/Lists/vectorList.C +++ b/src/OpenFOAM/primitives/Vector/lists/vectorList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorList.H b/src/OpenFOAM/primitives/Vector/lists/vectorList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/vectorList.H rename to src/OpenFOAM/primitives/Vector/lists/vectorList.H index a60c3a81d3b1a8e0f0a3bc9c785c663606ac6584..9b93b077b110f210a2b9835e1a4c65a173e8eb89 100644 --- a/src/OpenFOAM/primitives/Lists/vectorList.H +++ b/src/OpenFOAM/primitives/Vector/lists/vectorList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.C b/src/OpenFOAM/primitives/Vector/lists/vectorListIOList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/vectorListIOList.C rename to src/OpenFOAM/primitives/Vector/lists/vectorListIOList.C index 22e5ecc346576ba97472c688c6f2b6cd7a39f6a9..de2317e50d3e9b7c1850ea9df0ad996ec4f12e74 100644 --- a/src/OpenFOAM/primitives/Lists/vectorListIOList.C +++ b/src/OpenFOAM/primitives/Vector/lists/vectorListIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.H b/src/OpenFOAM/primitives/Vector/lists/vectorListIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/vectorListIOList.H rename to src/OpenFOAM/primitives/Vector/lists/vectorListIOList.H index 699249c1e7b6cf237f8b8af8eed95146689cc10d..c1f371c6487f420d3727b608d5ee08910dec715b 100644 --- a/src/OpenFOAM/primitives/Lists/vectorListIOList.H +++ b/src/OpenFOAM/primitives/Vector/lists/vectorListIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/boolList.C b/src/OpenFOAM/primitives/bools/lists/boolList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/boolList.C rename to src/OpenFOAM/primitives/bools/lists/boolList.C index 4663a90e1bce9d0fe0709392aea50584e869bc48..b51c228effac2ae88882612fa67ac4072c2d6a1c 100644 --- a/src/OpenFOAM/primitives/Lists/boolList.C +++ b/src/OpenFOAM/primitives/bools/lists/boolList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/boolList.H b/src/OpenFOAM/primitives/bools/lists/boolList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/boolList.H rename to src/OpenFOAM/primitives/bools/lists/boolList.H index ab48e70453db69bc3fcf5a55b3e8ae2c8616596c..a70bbc18ddb988d8a02ffe2c2aed9e4340a71ef9 100644 --- a/src/OpenFOAM/primitives/Lists/boolList.H +++ b/src/OpenFOAM/primitives/bools/lists/boolList.H @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.C b/src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.C similarity index 97% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.C rename to src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.C index 789c6a5d48d60c716b142b811181524c39677b7c..6eeafc583ba968f151193dac0200f52b97049070 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.H b/src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.H similarity index 98% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.H rename to src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.H index f58739afc75b00fd7215f67cb67b255ac6388a59..f7a1bb902e89fb57046849828cc5928bb9722d0c 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/Constant.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Constant/Constant.H @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/ConstantIO.C b/src/OpenFOAM/primitives/functions/DataEntry/Constant/ConstantIO.C similarity index 96% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/ConstantIO.C rename to src/OpenFOAM/primitives/functions/DataEntry/Constant/ConstantIO.C index de383f970716c28698d65cbd1e3d53819425ab14..eca4a677a2644867ebf52f9bc8425c20afb31259 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Constant/ConstantIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Constant/ConstantIO.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.C b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C similarity index 97% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.C rename to src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C index 7e13f4bddd16862386fecfb4f3fa483988af09d6..825d8c840031eae079a6229143223c3e66f39699 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.H b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H similarity index 98% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.H rename to src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H index 4cb66725a68b0384276fe1785f4976e18c2e7180..405b8889a40b5f2f3a4159e3aad878bcafbeecf0 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntry.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryIO.C b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryIO.C similarity index 95% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryIO.C rename to src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryIO.C index cbe3fe87cffa1849a130984597524cd5e939cd47..99a781a937cc0aab79d10343e7681a48b449c763 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryIO.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C similarity index 97% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C rename to src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C index 947d86753f9f549a1ecd48dfdd6576a66f78ccbf..fac7d6c4defc0af3922bf126e22b07e0cf04508e 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/DataEntry/DataEntryNew.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C similarity index 98% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C rename to src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C index 3e14479f35e0f3b6c92e3c0882a40c369e57ec1e..71212250ffb1a06fdd7d3d5406c4e7145ca0fe62 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H similarity index 98% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.H rename to src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H index ef58482c80c8c8d08db4f78fadd00e108928f98a..5fe73deccbf9d83859019cad01c49d9505845d66 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/TableIO.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C similarity index 96% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/Table/TableIO.C rename to src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C index c32e673f38818ef229c93f92b0ebf65e3861f087..b312469b6bb81fa5fb7df6f060b772868697a31b 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/TableIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C b/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C similarity index 96% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C rename to src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C index 39d164a68124dc81851b1fdd9ad33d6cccae333a..114658753acc4b8a0ea9f870e9a3151b19240876 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C @@ -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 diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.C b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C similarity index 68% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.C rename to src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C index f142458397568f18635e9408adf95df5df2d53a1..87d3acc8815f482763afba913cd05307ab454b79 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,13 +37,33 @@ namespace Foam Foam::polynomial::polynomial(const word& entryName, Istream& is) : DataEntry<scalar>(entryName), - coeffs_(is) + coeffs_(is), + canIntegrate_(true) { if (!coeffs_.size()) { FatalErrorIn("Foam::polynomial::polynomial(const word&, Istream&)") << "polynomial coefficients for entry " << this->name_ - << " is invalid (empty)" << nl << exit(FatalError); + << " are invalid (empty)" << nl << exit(FatalError); + } + + forAll(coeffs_, i) + { + if (mag(coeffs_[i].second() + 1) < ROOTVSMALL) + { + canIntegrate_ = false; + break; + } + } + + if (debug) + { + if (!canIntegrate_) + { + WarningIn("Foam::polynomial::polynomial(const word&, Istream&)") + << "Polynomial " << this->name_ << " cannot be integrated" + << endl; + } } } @@ -51,7 +71,8 @@ Foam::polynomial::polynomial(const word& entryName, Istream& is) Foam::polynomial::polynomial(const polynomial& poly) : DataEntry<scalar>(poly), - coeffs_(poly.coeffs_) + coeffs_(poly.coeffs_), + canIntegrate_(poly.canIntegrate_) {} @@ -65,13 +86,10 @@ Foam::polynomial::~polynomial() Foam::scalar Foam::polynomial::value(const scalar x) const { - scalar y = coeffs_[0].first(); - scalar powX = x; - - for (label i = 1; i < coeffs_.size(); i++) + scalar y = 0.0; + forAll(coeffs_, i) { - y += coeffs_[i].first()*powX; - powX *= x; + y += coeffs_[i].first()*pow(x, coeffs_[i].second()); } return y; @@ -82,14 +100,17 @@ Foam::scalar Foam::polynomial::integrate(const scalar x1, const scalar x2) const { scalar intx = 0.0; - forAll(coeffs_, i) + if (canIntegrate_) { - intx += - coeffs_[i].first()/(coeffs_[i].second() + 1) - *( - pow(x2, coeffs_[i].second() + 1) - - pow(x1, coeffs_[i].second() + 1) - ); + forAll(coeffs_, i) + { + intx += + coeffs_[i].first()/(coeffs_[i].second() + 1) + *( + pow(x2, coeffs_[i].second() + 1) + - pow(x1, coeffs_[i].second() + 1) + ); + } } return intx; diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.H b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H similarity index 95% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.H rename to src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H index 78c55c7870446b4df6cd4d7830c937a34908d245..e336068020995f8a358eb512bf9d4033b0fb957d 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomial.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,6 +76,9 @@ class polynomial //- Polynomial coefficients - list of prefactor, exponent List<Tuple2<scalar, scalar> > coeffs_; + //- Flag to indicate whether poly can be integrated + bool canIntegrate_; + // Private Member Functions diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomialIO.C b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomialIO.C similarity index 96% rename from src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomialIO.C rename to src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomialIO.C index e50f08bb1ee96d3daa1646e440768f9649a47948..ab5c0c2e9031c4ed884efd8aaa2522c5f1f759f2 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/polynomial/polynomialIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomialIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C index d8569a536c494b418614a87cf45783e97e18b667..7f9ae731f6bec8c6616e3213346855c17f6e5735 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,7 +149,7 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff() template<int PolySize> -Foam::scalar Foam::Polynomial<PolySize>::evaluate(const scalar x) const +Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const { scalar y = this->v_[0]; @@ -192,7 +192,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits intPolyType poly = this->integrate(); - return poly.evaluate(x2) - poly.evaluate(x1); + return poly.value(x2) - poly.value(x1); } diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H index ace90a0bc8d0bc7e4edc23515864aba51452d7a4..06511b0003edb911e9c7965964f2227f487d352a 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ Description where 0 \<= i \<= n - integer powers, starting at zero - - evaluate(x) to evaluate the poly for a given value + - value(x) to evaluate the poly for a given value - integrate(x1, x2) between two scalar values - integrate() to return a new, intergated coeff polynomial - increases the size (order) @@ -134,7 +134,7 @@ public: // Evaluation //- Return polynomial value - scalar evaluate(const scalar x) const; + scalar value(const scalar x) const; //- Return integrated polynomial coefficients // argument becomes zeroth element (constant of integration) diff --git a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C index f3fad20edd6e7eb6136b04b67e69a5fef7b8af08..9b99c7a483f5f912f05311f4dd74dc00c6e77ecb 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C similarity index 95% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C rename to src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C index e1328495980191aa44fba0f6512325245659d686..6bcbf3102437277ce14e7d3f76dcebc90255b338 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C @@ -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 @@ -288,6 +288,19 @@ void Foam::globalIndexAndTransform::determineTransforms() } Pstream::scatter(transforms_); + + if (transforms_.size() > 3) + { + WarningIn + ( + "void globalIndexAndTransform::determineTransforms()" + ) << "More than three independent basic " + << "transforms detected:" << nl + << transforms_ << nl + << "This is not a space filling tiling and will probably" + << " give problems for e.g. lagrangian tracking or interpolation" + << endl; + } } @@ -324,6 +337,11 @@ void Foam::globalIndexAndTransform::determineTransformPermutations() transformPermutations_[tPI] = transform; } + + + // Encode index for 0 sign + labelList permutationIndices(nIndependentTransforms(), 0); + nullTransformIndex_ = encodeTransformIndex(permutationIndices); } @@ -463,6 +481,7 @@ Foam::globalIndexAndTransform::globalIndexAndTransform determinePatchTransformSign(); } + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::globalIndexAndTransform::~globalIndexAndTransform() diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H similarity index 75% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H rename to src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H index 9b7a58a1191e625370b1f8bc90c1b8ded0d43f88..5b7d2fc238a6383c05e8673fdacee7fbfe737a0f 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H @@ -42,11 +42,9 @@ SourceFiles #ifndef globalIndexAndTransform_H #define globalIndexAndTransform_H -#include "Pstream.H" -#include "List.H" #include "labelPair.H" #include "vectorTensorTransform.H" -#include "polyMesh.H" +#include "HashSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,6 +60,24 @@ class polyMesh; class globalIndexAndTransform { +public: + + // Public classes + + //- Less function class used in sorting encoded transforms and indices + // - minimum processor + // - minimum local index + // - minimum transform + class less + { + public: + + inline bool operator()(const labelPair&, const labelPair&) const; + }; + + +private: + // Private data //- Reference to mesh @@ -82,6 +98,9 @@ class globalIndexAndTransform // transform. List<vectorTensorTransform> transformPermutations_; + //- Index of identity transform. + label nullTransformIndex_; + //- Mapping from patch index to which transform it matches (or // -1 for none) (.first()) and what sign to use for it, // i.e. +/- 1 (.second()). @@ -93,6 +112,7 @@ class globalIndexAndTransform //- Number of spaces to reserve for transform encoding static const label base_; + // Private Member Functions //- Determine all of the independent basic transforms of the @@ -118,6 +138,18 @@ class globalIndexAndTransform bool checkBothSigns ) const; + //- Encode transform index. Hardcoded to 3 independent transforms max. + inline label encodeTransformIndex + ( + const FixedList<Foam::label, 3>& permutationIndices + ) const; + + //- Decode transform index. Hardcoded to 3 independent transforms max. + inline FixedList<label, 3> decodeTransformIndex + ( + const label transformIndex + ) const; + //- Disallow default bitwise copy construct globalIndexAndTransform(const globalIndexAndTransform&); @@ -127,6 +159,10 @@ class globalIndexAndTransform public: + //- Declare friendship with the entry class for IO + friend class globalPoints; + + // Constructors //- Construct from components @@ -147,15 +183,46 @@ public: const List<label>& permutationIndices ) const; + //- Add patch transformation to transformIndex. Return new + // transformIndex. (by default the patch is the sending, not the + // receiving, patch) + inline label addToTransformIndex + ( + const label transformIndex, + const label patchI, + const bool isSendingSide = true + ) const; + + //- Combine two transformIndices + inline label mergeTransformIndex + ( + const label transformIndex0, + const label transformIndex1 + ) const; + + //- Combine two transformIndices + inline label minimumTransformIndex + ( + const label transformIndex0, + const label transformIndex1 + ) const; + + //- Subtract two transformIndices + inline label subtractTransformIndex + ( + const label transformIndex0, + const label transformIndex1 + ) const; + //- Encode index and bare index as components on own processor - inline labelPair encode + inline static labelPair encode ( const label index, const label transformIndex ); //- Encode index and bare index as components on given processor - inline labelPair encode + inline static labelPair encode ( const label procI, const label index, @@ -163,13 +230,16 @@ public: ); //- Index carried by the object - inline label index(const labelPair& globalIAndTransform); + inline static label index(const labelPair& globalIAndTransform); //- Which processor does this come from? - inline label processor(const labelPair& globalIAndTransform); + inline static label processor(const labelPair& globalIAndTransform); //- Transform carried by the object - inline label transformIndex(const labelPair& globalIAndTransform); + inline static label transformIndex + ( + const labelPair& globalIAndTransform + ); // Access @@ -183,6 +253,10 @@ public: inline const List<vectorTensorTransform>& transformPermutations() const; + //- Return the transformIndex (index in transformPermutations) + // of the identity transform + inline label nullTransformIndex() const; + //- Return access to the per-patch transform-sign pairs inline const List<Pair<label> >& patchTransformSign() const; diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H similarity index 57% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H rename to src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H index f2928899f255c1aa809f8298e9021d47f4b51fed..7de6eab86ce59ac218c9545d02e80faa096d5d1b 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H @@ -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 @@ -23,8 +23,52 @@ License \*---------------------------------------------------------------------------*/ +#include "polyMesh.H" + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +bool Foam::globalIndexAndTransform::less::operator() +( + const labelPair& a, + const labelPair& b +) const +{ + label procA = globalIndexAndTransform::processor(a); + label procB = globalIndexAndTransform::processor(b); + + if (procA < procB) + { + return true; + } + else if (procA > procB) + { + return false; + } + else + { + // Equal proc. + label indexA = globalIndexAndTransform::index(a); + label indexB = globalIndexAndTransform::index(b); + + if (indexA < indexB) + { + return true; + } + else if (indexA > indexB) + { + return false; + } + else + { + // Equal index + label transformA = globalIndexAndTransform::transformIndex(a); + label transformB = globalIndexAndTransform::transformIndex(b); + + return transformA < transformB; + } + } +} + Foam::label Foam::globalIndexAndTransform::encodeTransformIndex ( @@ -74,6 +118,255 @@ Foam::label Foam::globalIndexAndTransform::encodeTransformIndex } +Foam::label Foam::globalIndexAndTransform::encodeTransformIndex +( + const FixedList<Foam::label, 3>& permutation +) const +{ + if (nIndependentTransforms() == 0) + { + return 0; + } + if (nIndependentTransforms() == 1) + { + return permutation[0]+1; + } + else if (nIndependentTransforms() == 2) + { + return (permutation[1]+1)*3 + (permutation[0]+1); + } + else + { + return + (permutation[2]+1)*9 + + (permutation[1]+1)*3 + + (permutation[0]+1); + } +} + + +Foam::FixedList<Foam::label, 3> +Foam::globalIndexAndTransform::decodeTransformIndex +( + const label transformIndex +) const +{ + FixedList<label, 3> permutation(0); + + label t = transformIndex; + if (nIndependentTransforms() > 0) + { + permutation[0] = (t%3)-1; + if (nIndependentTransforms() > 1) + { + t /= 3; + permutation[1] = (t%3)-1; + if (nIndependentTransforms() > 2) + { + t /= 3; + permutation[2] = (t%3)-1; + } + } + } + +# ifdef FULLDEBUG + t /= 3; + if (t != 0) + { + FatalErrorIn + ( + "globalIndexAndTransform::decodeTransformIndex(const label)" + ) << "transformIndex : " << transformIndex + << " has more than 3 fields." + << abort(FatalError); + } +# endif + + return permutation; +} + + +Foam::label Foam::globalIndexAndTransform::addToTransformIndex +( + const label transformIndex, + const label patchI, + const bool isSendingSide +) const +{ + const Pair<label>& transSign = patchTransformSign_[patchI]; + + label matchTransI = transSign.first(); + + // Hardcoded for max 3 transforms only! + + if (matchTransI > -1 && matchTransI < 3) + { + FixedList<label, 3> permutation = decodeTransformIndex(transformIndex); + + + // Add patch transform + // ~~~~~~~~~~~~~~~~~~~ + + label sign = transSign.second(); + if (!isSendingSide) + { + sign = -sign; + } + + + // If this transform been found already by a patch? + if (permutation[matchTransI] != 0) + { + if (sign == 0) + { + // sent from patch without a transformation. Do nothing. + FatalErrorIn("globalIndexAndTransform::addToTransformIndex(..)") + << "patch:" << mesh_.boundaryMesh()[patchI].name() + << " transform:" << matchTransI << " sign:" << sign + << " current transforms:" << permutation + << exit(FatalError); + } + else if (sign == permutation[matchTransI]) + { + FatalErrorIn + ( + "Foam::label " + "Foam::globalIndexAndTransform::addToTransformIndex\n" + "(\n" + "const label,\n" + "const label,\n" + "const bool\n" + ") const\n" + ) << "More than one patch accessing the same transform " + << "but not of the same sign." << endl + << "patch:" << mesh_.boundaryMesh()[patchI].name() + << " transform:" << matchTransI << " sign:" << sign + << " current transforms:" << permutation + << exit(FatalError); + } + else + { + permutation[matchTransI] = 0; + } + } + else + { + permutation[matchTransI] = sign; + } + + + // Re-encode permutation + // ~~~~~~~~~~~~~~~~~~~~~ + + return encodeTransformIndex(permutation); + } + else + { + return transformIndex; + } +} + + +Foam::label Foam::globalIndexAndTransform::mergeTransformIndex +( + const label transformIndex0, + const label transformIndex1 +) const +{ + FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0); + FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1); + + forAll(permutation0, i) + { + if (permutation0[i] == 0) + { + // Take over whatever sign 1 has + permutation0[i] = permutation1[i]; + } + else if (permutation1[i] != 0 && permutation0[i] != permutation1[i]) + { + FatalErrorIn + ( + "Foam::label " + "Foam::globalIndexAndTransform::addToTransformIndex\n" + "(\n" + "const label,\n" + "const label\n" + ") const\n" + ) << "More than one patch accessing the same transform " + << "but not of the same sign." << endl + << "Trying to combine two transforms " << transformIndex0 + << " with signs " << permutation0 + << " and " << transformIndex1 + << " with signs " << permutation1 + << exit(FatalError); + } + } + return encodeTransformIndex(permutation0); +} + + +Foam::label Foam::globalIndexAndTransform::minimumTransformIndex +( + const label transformIndex0, + const label transformIndex1 +) const +{ + FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0); + FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1); + + forAll(permutation0, i) + { + if (permutation0[i] == 0) + { + // 0 wins. + } + else if (permutation1[i] == 0) + { + // 0 wins. + permutation0[i] = permutation1[i]; + } + else if (permutation0[i] != permutation1[i]) + { + FatalErrorIn + ( + "Foam::label " + "Foam::globalIndexAndTransform::minimumTransformIndex\n" + "(\n" + "const label,\n" + "const label\n" + ") const\n" + ) << "More than one patch accessing the same transform " + << "but not of the same sign." << endl + << "Trying to combine two transforms " << transformIndex0 + << " with signs " << permutation0 + << " and " << transformIndex1 + << " with signs " << permutation1 + << exit(FatalError); + } + } + return encodeTransformIndex(permutation0); +} + + +Foam::label Foam::globalIndexAndTransform::subtractTransformIndex +( + const label transformIndex0, + const label transformIndex1 +) const +{ + FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0); + FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1); + + forAll(permutation0, i) + { + permutation0[i] -= permutation1[i]; + } + + return encodeTransformIndex(permutation0); +} + + Foam::labelPair Foam::globalIndexAndTransform::encode ( const label index, @@ -133,7 +426,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode } -Foam::label Foam::globalIndexAndTransform::index +Foam::label Foam::globalIndexAndTransform::index ( const labelPair& globalIAndTransform ) @@ -180,6 +473,12 @@ Foam::globalIndexAndTransform::transformPermutations() const } +Foam::label Foam::globalIndexAndTransform::nullTransformIndex() const +{ + return nullTransformIndex_; +} + + const Foam::List<Foam::Pair<Foam::label> >& Foam::globalIndexAndTransform::patchTransformSign() const { @@ -399,7 +698,10 @@ Foam::pointField Foam::globalIndexAndTransform::transformPatches forAll(transIs, tII) { - transPts[tII] = transformPermutations_[transIs[tII]].transform(pt); + transPts[tII] = transformPermutations_[transIs[tII]].transformPosition + ( + pt + ); } return transPts; diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C similarity index 82% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C rename to src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C index 7540a7a7bb5bc9a0b6b49bd7946904e4442b8d06..0521bdd10cd7c16cc1130af4501f627e1e2ab739 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C @@ -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 @@ -56,7 +56,7 @@ Foam::vectorTensorTransform::vectorTensorTransform(Istream& is) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::word Foam::name(const vectorTensorTransform& s) { @@ -68,6 +68,32 @@ Foam::word Foam::name(const vectorTensorTransform& s) } +template<> +Foam::tmp<Foam::Field<bool> > Foam::vectorTensorTransform::transform +( + const Field<bool>& fld +) const +{ + return fld; +} +template<> +Foam::tmp<Foam::Field<Foam::label> > Foam::vectorTensorTransform::transform +( + const Field<label>& fld +) const +{ + return fld; +} +template<> +Foam::tmp<Foam::Field<Foam::scalar> > Foam::vectorTensorTransform::transform +( + const Field<scalar>& fld +) const +{ + return fld; +} + + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // Foam::Istream& Foam::operator>>(Istream& is, vectorTensorTransform& tr) diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H similarity index 84% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H rename to src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H index 251d0e5aab41574859d7faf2794283e54abb72c5..2035b1f6e3668c3a2e496eca299049948fe91a2d 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H @@ -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 @@ -31,13 +31,13 @@ Description SourceFiles vectorTensorTransformI.H vectorTensorTransform.C + vectorTensorTransformTemplates.C \*---------------------------------------------------------------------------*/ #ifndef vectorTensorTransform_H #define vectorTensorTransform_H -#include "vector.H" #include "tensor.H" #include "word.H" #include "contiguous.H" @@ -132,17 +132,21 @@ public: // Transform - //- Transform the given vector - inline vector transform(const vector& v) const; + //- Transform the given position + inline vector transformPosition(const vector& v) const; //- Transform the given pointField - inline pointField transform(const pointField& pts) const; + inline pointField transformPosition(const pointField& pts) const; - //- Inverse transform the given vector - inline vector invTransform(const vector& v) const; + //- Inverse transform the given position + inline vector invTransformPosition(const vector& v) const; //- Inverse transform the given pointField - inline pointField invTransform(const pointField& pts) const; + inline pointField invTransformPosition(const pointField& pts) const; + + //- Transform the given field + template<class Type> + tmp<Field<Type> > transform(const Field<Type>&) const; // Member operators @@ -180,6 +184,15 @@ word name(const vectorTensorTransform&); template<> inline bool contiguous<vectorTensorTransform>() {return true;} +//- Template specialisations +template<> +tmp<Field<bool> > vectorTensorTransform::transform(const Field<bool>&) const; +template<> +tmp<Field<label> > vectorTensorTransform::transform(const Field<label>&) const; +template<> +tmp<Field<scalar> > vectorTensorTransform::transform(const Field<scalar>&) +const; + // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // @@ -234,6 +247,10 @@ inline vectorTensorTransform operator& #include "vectorTensorTransformI.H" +#ifdef NoRepository +# include "vectorTensorTransformTemplates.C" +#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H similarity index 95% rename from src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H rename to src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H index b42ec621538629a00dfa2e052200588b37591219..0a7e6c11efabad6e23127c0a48674891fe8d345b 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H @@ -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 @@ -99,7 +99,7 @@ inline Foam::tensor& Foam::vectorTensorTransform::R() } -inline Foam::vector Foam::vectorTensorTransform::transform +inline Foam::vector Foam::vectorTensorTransform::transformPosition ( const vector& v ) const @@ -115,7 +115,7 @@ inline Foam::vector Foam::vectorTensorTransform::transform } -inline Foam::pointField Foam::vectorTensorTransform::transform +inline Foam::pointField Foam::vectorTensorTransform::transformPosition ( const pointField& pts ) const @@ -134,7 +134,7 @@ inline Foam::pointField Foam::vectorTensorTransform::transform } -inline Foam::vector Foam::vectorTensorTransform::invTransform +inline Foam::vector Foam::vectorTensorTransform::invTransformPosition ( const vector& v ) const @@ -150,7 +150,7 @@ inline Foam::vector Foam::vectorTensorTransform::invTransform } -inline Foam::pointField Foam::vectorTensorTransform::invTransform +inline Foam::pointField Foam::vectorTensorTransform::invTransformPosition ( const pointField& pts ) const diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformTemplates.C similarity index 69% rename from src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C rename to src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformTemplates.C index 1901acfef6888d890ac54f77e59003b847d5289a..5064dd3602d0e4c13afdf72affbe7522edf2e767 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformTemplates.C @@ -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) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,22 +23,23 @@ License \*---------------------------------------------------------------------------*/ -#include "vtkSurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::vectorTensorTransform::transform +( + const Field<Type>& fld +) const { + if (hasR_) + { + return R() & fld; + } + else + { + return fld; + } +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriterType(vtkSurfaceWriter, bool); -makeSurfaceWriters(vtkSurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C index 7b5d16d722a18a9791eb453f82de1db5408eac54..113fc5a001b4a6b2cdd74325f58b3d6cd8b602f6 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C @@ -31,8 +31,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // //! @cond fileScope -const char hexChars[] = "0123456789abcdef"; -//! @endcond fileScope +static const char hexChars[] = "0123456789abcdef"; +//! @endcond // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -87,6 +87,20 @@ void Foam::SHA1Digest::clear() } +bool Foam::SHA1Digest::empty() const +{ + for (unsigned i = 0; i < length; ++i) + { + if (v_[i]) + { + return false; + } + } + + return true; +} + + // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const @@ -103,9 +117,79 @@ bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const } +bool Foam::SHA1Digest::operator==(const std::string& hexdigits) const +{ + // null or empty string is not an error - interpret as '0000..' + if (hexdigits.empty()) + { + return empty(); + } + + // incorrect length - can never match + if (hexdigits.size() != length*2) + { + return false; + } + + for (unsigned i = 0, charI = 0; i < length; ++i, charI += 2) + { + const char c1 = hexChars[((v_[i] >> 4) & 0xF)]; + const char c2 = hexChars[(v_[i] & 0xF)]; + + if (c1 != hexdigits[charI] || c2 != hexdigits[charI+1]) + { + return false; + } + } + + return true; +} + + +bool Foam::SHA1Digest::operator==(const char* hexdigits) const +{ + // null or empty string is not an error - interpret as '0000..' + if (!hexdigits || !*hexdigits) + { + return empty(); + } + + // incorrect length - can never match + if (strlen(hexdigits) != length*2) + { + return false; + } + + for (unsigned i = 0, charI = 0; i < length; ++i, charI += 2) + { + const char c1 = hexChars[((v_[i] >> 4) & 0xF)]; + const char c2 = hexChars[(v_[i] & 0xF)]; + + if (c1 != hexdigits[charI] || c2 != hexdigits[charI+1]) + { + return false; + } + } + + return true; +} + + bool Foam::SHA1Digest::operator!=(const SHA1Digest& rhs) const { - return !this->operator==(rhs); + return !operator==(rhs); +} + + +bool Foam::SHA1Digest::operator!=(const std::string& rhs) const +{ + return !operator==(rhs); +} + + +bool Foam::SHA1Digest::operator!=(const char* rhs) const +{ + return !operator==(rhs); } diff --git a/src/OpenFOAM/primitives/Lists/labelIOList.C b/src/OpenFOAM/primitives/ints/lists/labelIOList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/labelIOList.C rename to src/OpenFOAM/primitives/ints/lists/labelIOList.C index 1f98f572971562eac46156123129cc3830b57b04..bb833f786189cc22e93a890e974cb5cf23310541 100644 --- a/src/OpenFOAM/primitives/Lists/labelIOList.C +++ b/src/OpenFOAM/primitives/ints/lists/labelIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/labelIOList.H b/src/OpenFOAM/primitives/ints/lists/labelIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/labelIOList.H rename to src/OpenFOAM/primitives/ints/lists/labelIOList.H index 56447682ebf0c0065e6dd2a82bd7d68011ec6f76..176ad339fd7581bfb0cb809c2d3662bfa08d72a6 100644 --- a/src/OpenFOAM/primitives/Lists/labelIOList.H +++ b/src/OpenFOAM/primitives/ints/lists/labelIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/labelList.H b/src/OpenFOAM/primitives/ints/lists/labelList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/labelList.H rename to src/OpenFOAM/primitives/ints/lists/labelList.H index 694b923b4b08bcabe0e5211f406ac60c6a4fba97..01d006af0f116d743580a9d0ae02d6781a7e0ead 100644 --- a/src/OpenFOAM/primitives/Lists/labelList.H +++ b/src/OpenFOAM/primitives/ints/lists/labelList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.C b/src/OpenFOAM/primitives/ints/lists/labelListIOList.C similarity index 96% rename from src/OpenFOAM/primitives/Lists/labelListIOList.C rename to src/OpenFOAM/primitives/ints/lists/labelListIOList.C index 7a06638a53fa1b0302d79494b9e3023708e8ca7e..90095022c8a2d57f59845be9a62a61b2fc666b3d 100644 --- a/src/OpenFOAM/primitives/Lists/labelListIOList.C +++ b/src/OpenFOAM/primitives/ints/lists/labelListIOList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.H b/src/OpenFOAM/primitives/ints/lists/labelListIOList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/labelListIOList.H rename to src/OpenFOAM/primitives/ints/lists/labelListIOList.H index 2ca6d5350e309851fcdcac6330b50bdfb06c6ef7..98610c5563d3a0f0b031d06e19ea728fd162cb56 100644 --- a/src/OpenFOAM/primitives/Lists/labelListIOList.H +++ b/src/OpenFOAM/primitives/ints/lists/labelListIOList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/fileNameList.H b/src/OpenFOAM/primitives/strings/lists/fileNameList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/fileNameList.H rename to src/OpenFOAM/primitives/strings/lists/fileNameList.H index a8e3d40c52bc32d06f184881227d44a6783b341b..13e77381c8072e9d9c1bdb4364f9cdfbcf3246bd 100644 --- a/src/OpenFOAM/primitives/Lists/fileNameList.H +++ b/src/OpenFOAM/primitives/strings/lists/fileNameList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/hashedWordList.C b/src/OpenFOAM/primitives/strings/lists/hashedWordList.C similarity index 98% rename from src/OpenFOAM/primitives/Lists/hashedWordList.C rename to src/OpenFOAM/primitives/strings/lists/hashedWordList.C index e9206bda8e00bf05c468a9be718c4b80664f108d..332ecbcf96ab124fa304d0a230a69e09193e74d5 100644 --- a/src/OpenFOAM/primitives/Lists/hashedWordList.C +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H similarity index 98% rename from src/OpenFOAM/primitives/Lists/hashedWordList.H rename to src/OpenFOAM/primitives/strings/lists/hashedWordList.H index f0c51da1d63db8033895043e5f3ac9fd607497a2..4c5c1c43fdb92e085c171bee5cf821c4fe979cb7 100644 --- a/src/OpenFOAM/primitives/Lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/hashedWordListI.H b/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/hashedWordListI.H rename to src/OpenFOAM/primitives/strings/lists/hashedWordListI.H index 1e736aa6c58217d95b6b56f94883b769a764bd94..e4585e85bc3360056e642e6b2b5998d6a32eb231 100644 --- a/src/OpenFOAM/primitives/Lists/hashedWordListI.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordListI.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/stringList.H b/src/OpenFOAM/primitives/strings/lists/stringList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/stringList.H rename to src/OpenFOAM/primitives/strings/lists/stringList.H index b87495911c3ea1e701c37b2581880c140f5333dd..109c526535ba5eca5cb63818bee599c745f46f7d 100644 --- a/src/OpenFOAM/primitives/Lists/stringList.H +++ b/src/OpenFOAM/primitives/strings/lists/stringList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/stringListOps.H b/src/OpenFOAM/primitives/strings/lists/stringListOps.H similarity index 99% rename from src/OpenFOAM/primitives/Lists/stringListOps.H rename to src/OpenFOAM/primitives/strings/lists/stringListOps.H index 12143b43176de2c5fd4a3912161d5c5bc6d84696..3bfbc7ade68a62b38cf3afe7fa63c26400c11928 100644 --- a/src/OpenFOAM/primitives/Lists/stringListOps.H +++ b/src/OpenFOAM/primitives/strings/lists/stringListOps.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/stringListOpsTemplates.C b/src/OpenFOAM/primitives/strings/lists/stringListOpsTemplates.C similarity index 97% rename from src/OpenFOAM/primitives/Lists/stringListOpsTemplates.C rename to src/OpenFOAM/primitives/strings/lists/stringListOpsTemplates.C index 28bd3a31a8b97bfa4e6e2e02ee395c907ced19fc..34d1268432469a6a249f3336eadbace686436439 100644 --- a/src/OpenFOAM/primitives/Lists/stringListOpsTemplates.C +++ b/src/OpenFOAM/primitives/strings/lists/stringListOpsTemplates.C @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/wordList.H b/src/OpenFOAM/primitives/strings/lists/wordList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/wordList.H rename to src/OpenFOAM/primitives/strings/lists/wordList.H index ce46a9e357345ad51e5ab5d19f77ba367423ef26..f7b7dbff4d6048288dbed9a4fd032454dba392f0 100644 --- a/src/OpenFOAM/primitives/Lists/wordList.H +++ b/src/OpenFOAM/primitives/strings/lists/wordList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/wordReList.H b/src/OpenFOAM/primitives/strings/lists/wordReList.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/wordReList.H rename to src/OpenFOAM/primitives/strings/lists/wordReList.H index 31a4793655fdc6ee359fea1be81115b5724b6c48..33b557c1266c1c0cd498859a2d5ff70919e63820 100644 --- a/src/OpenFOAM/primitives/Lists/wordReList.H +++ b/src/OpenFOAM/primitives/strings/lists/wordReList.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/wordReListMatcher.H b/src/OpenFOAM/primitives/strings/lists/wordReListMatcher.H similarity index 97% rename from src/OpenFOAM/primitives/Lists/wordReListMatcher.H rename to src/OpenFOAM/primitives/strings/lists/wordReListMatcher.H index a2afd0c2d22856b7870ae090500567015a2d3b85..580f888014457c07d17415b47da0b583d78dbfb0 100644 --- a/src/OpenFOAM/primitives/Lists/wordReListMatcher.H +++ b/src/OpenFOAM/primitives/strings/lists/wordReListMatcher.H @@ -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 diff --git a/src/OpenFOAM/primitives/Lists/wordReListMatcherI.H b/src/OpenFOAM/primitives/strings/lists/wordReListMatcherI.H similarity index 96% rename from src/OpenFOAM/primitives/Lists/wordReListMatcherI.H rename to src/OpenFOAM/primitives/strings/lists/wordReListMatcherI.H index ec41a80c35c186ad4deb568be9eeb0d5fcb42077..ae2065bc12e1dde3a662dfee34c7267ac436e19a 100644 --- a/src/OpenFOAM/primitives/Lists/wordReListMatcherI.H +++ b/src/OpenFOAM/primitives/strings/lists/wordReListMatcherI.H @@ -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 diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index cc3329e384a5e2e232764edfa637492bcecc6e82..742d3d4478eaf475cf4d7f7174a8a5cb8041a8e3 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -1,21 +1,23 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso dummy +wmake $makeOption dummy case "$WM_MPLIB" in *MPI*) set +x echo echo "Note: ignore spurious warnings about missing mpicxx.h headers" + echo set -x # force compilation into qualified directory - WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake libso mpi + WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeOption mpi ;; #GAMMA) -# wmake libso gamma +# wmake $makeOption gamma # ;; esac diff --git a/src/Pstream/gamma/Make/files b/src/Pstream/gamma/Make/files index a0374cb9c395bb3ca8473880c823774ceaeb0dae..a3a8fc6b607668fdca3b91713e97b77b488d5110 100644 --- a/src/Pstream/gamma/Make/files +++ b/src/Pstream/gamma/Make/files @@ -3,4 +3,4 @@ Pstream.C OPwrite.C IPread.C -LIB = $(FOAM_MPI_LIBBIN)/libPstream +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream diff --git a/src/Pstream/mpi/Make/files b/src/Pstream/mpi/Make/files index eccdf776646facdf15c41782c80a2eccf10f7c5f..c01382d678de41f7dcff40a1427e1a567a960e6b 100644 --- a/src/Pstream/mpi/Make/files +++ b/src/Pstream/mpi/Make/files @@ -3,4 +3,4 @@ UIPread.C UPstream.C PstreamGlobals.C -LIB = $(FOAM_MPI_LIBBIN)/libPstream +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream diff --git a/src/conversion/Allwmake b/src/conversion/Allwmake index a7168eeab1ac3959b97ef420010bdb59d397590d..444d3f654914f34ac8b85f9fb9ab7494dc57437a 100755 --- a/src/conversion/Allwmake +++ b/src/conversion/Allwmake @@ -1,7 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso +wmake $makeOption # ----------------------------------------------------------------- end-of-file diff --git a/src/conversion/Make/files b/src/conversion/Make/files index 563d177682b741fc44e7cb34b3dd3fd5db023281..7c5a0aa91c070a5903667e22ed7a76f864bfee0e 100644 --- a/src/conversion/Make/files +++ b/src/conversion/Make/files @@ -4,7 +4,6 @@ ensight/part/ensightPart.C ensight/part/ensightPartIO.C ensight/part/ensightPartCells.C ensight/part/ensightPartFaces.C -ensight/part/ensightPartNonMeshFaces.C ensight/part/ensightParts.C meshTables/boundaryRegion.C diff --git a/src/conversion/ensight/file/ensightFile.C b/src/conversion/ensight/file/ensightFile.C index e5f1b18f9c3f569bd28583ab885a459d06917ecb..23ae7a1e3733a8d457d428f08f86eeb138d09b9e 100644 --- a/src/conversion/ensight/file/ensightFile.C +++ b/src/conversion/ensight/file/ensightFile.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/conversion/ensight/file/ensightFile.H b/src/conversion/ensight/file/ensightFile.H index 46e10ce61f22c8fae687d6cf8c24dc34c4f898c6..59b28ebb9ed7c88ba33aa15df2d923689e0e79aa 100644 --- a/src/conversion/ensight/file/ensightFile.H +++ b/src/conversion/ensight/file/ensightFile.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/conversion/ensight/file/ensightGeoFile.C b/src/conversion/ensight/file/ensightGeoFile.C index f7a7adceb874630b58183705800e932cd01ee8f4..dffcd07891dc8785cc99bc1ce1567e5850620152 100644 --- a/src/conversion/ensight/file/ensightGeoFile.C +++ b/src/conversion/ensight/file/ensightGeoFile.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/conversion/ensight/file/ensightGeoFile.H b/src/conversion/ensight/file/ensightGeoFile.H index 7b59b111a95a7427b95b01ccf4388104e3dac915..eae4a0b4d5da0ef9871414bf97ee82d5cfc33234 100644 --- a/src/conversion/ensight/file/ensightGeoFile.H +++ b/src/conversion/ensight/file/ensightGeoFile.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/conversion/ensight/part/ensightPart.C b/src/conversion/ensight/part/ensightPart.C index 4c071a4220494c45957cef781bdb5750777f3c57..303c417ac753e51caabd0beefd0ee5d23c0d44eb 100644 --- a/src/conversion/ensight/part/ensightPart.C +++ b/src/conversion/ensight/part/ensightPart.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,31 +24,32 @@ License \*----------------------------------------------------------------------------*/ #include "ensightPart.H" -#include "addToRunTimeSelectionTable.H" #include "dictionary.H" #include "ListOps.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(ensightPart, 0); - defineTemplateTypeNameAndDebug(IOPtrList<ensightPart>, 0); - defineRunTimeSelectionTable(ensightPart, istream); + defineTypeNameAndDebug(ensightPart, 0); + defineTemplateTypeNameAndDebug(IOPtrList<ensightPart>, 0); + defineRunTimeSelectionTable(ensightPart, istream); } -Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0); +const Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0); -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const { forAll(elemLists_, elemI) { - const labelList& idList = elemLists_[elemI]; + const labelUList& idList = elemLists_[elemI]; forAll(idList, i) { - label id = idList[i]; + const label id = idList[i]; if (id >= field.size() || isnan(field[id])) { @@ -72,7 +73,7 @@ Foam::ensightPart::ensightPart size_(0), isCellData_(true), matId_(0), - meshPtr_(0) + points_(pointField::null()) {} @@ -89,7 +90,7 @@ Foam::ensightPart::ensightPart size_(0), isCellData_(true), matId_(0), - meshPtr_(0) + points_(pointField::null()) {} @@ -97,7 +98,7 @@ Foam::ensightPart::ensightPart ( label partNumber, const string& partDescription, - const polyMesh& pMesh + const pointField& points ) : number_(partNumber), @@ -107,7 +108,7 @@ Foam::ensightPart::ensightPart size_(0), isCellData_(true), matId_(0), - meshPtr_(&pMesh) + points_(points) {} @@ -120,7 +121,7 @@ Foam::ensightPart::ensightPart(const ensightPart& part) size_(part.size_), isCellData_(part.isCellData_), matId_(part.matId_), - meshPtr_(part.meshPtr_) + points_(part.points_) {} @@ -158,31 +159,7 @@ Foam::ensightPart::~ensightPart() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::ensightPart::reconstruct(Istream& is) -{ - dictionary dict(is); - dict.lookup("id") >> number_; - dict.lookup("name") >> name_; - dict.readIfPresent("offset", offset_); - - // populate elemLists_ - elemLists_.setSize(elementTypes().size()); - - forAll(elementTypes(), elemI) - { - word key(elementTypes()[elemI]); - - elemLists_[elemI].clear(); - dict.readIfPresent(key, elemLists_[elemI]); - - size_ += elemLists_[elemI].size(); - } - - is.check("ensightPart::reconstruct(Istream&)"); -} - - -void Foam::ensightPart::renumber(labelList const& origId) +void Foam::ensightPart::renumber(const labelUList& origId) { // transform to global values first if (offset_) diff --git a/src/conversion/ensight/part/ensightPart.H b/src/conversion/ensight/part/ensightPart.H index b335ef86324db09f41722011db2834e24b0e414c..0d1770f4126544600e71ee56de0a9480e3a49e30 100644 --- a/src/conversion/ensight/part/ensightPart.H +++ b/src/conversion/ensight/part/ensightPart.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ Description SourceFiles ensightPart.C ensightPartIO.C - ensightPartI.H + ensightPartTemplates.C \*---------------------------------------------------------------------------*/ @@ -52,7 +52,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class ensightPart Declaration + Class ensightPart Declaration \*---------------------------------------------------------------------------*/ class ensightPart @@ -60,7 +60,7 @@ class ensightPart // Private data // Static data members - static List<word> elemTypes_; + static const List<word> elemTypes_; protected: @@ -88,8 +88,8 @@ protected: //- material id (numeric) label matId_; - //- mesh reference used - const polyMesh* meshPtr_; + //- pointField referenced + const pointField& points_; // Protected Classes @@ -104,25 +104,27 @@ protected: //- map global to local indices labelList list; - // null constructor + //- null constructor localPoints() : nPoints(0), list(0) {} - // construct for mesh points - localPoints(const polyMesh& pMesh) + //- construct for mesh points + localPoints(const pointField& pts) : nPoints(0), - list(pMesh.points().size(), -1) + list(pts.size(), -1) {} }; // Protected Member Functions - //- reconstruct contents from Istream + //- Reconstruct part characteristics (eg, element types) from Istream + // A part reconstructed in this manner can be used when writing fields, + // but cannot be used to write a new geometry void reconstruct(Istream&); //- check for fully defined fields @@ -132,6 +134,7 @@ protected: void writeHeader(ensightFile&, bool withDescription=false) const; //- write a scalar field for idList + // A null reference for idList writes the perNode values void writeFieldList ( ensightFile& os, @@ -148,10 +151,10 @@ protected: //- write connectivities virtual void writeConnectivity ( - ensightGeoFile& os, + ensightGeoFile&, const word& key, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const {} @@ -170,12 +173,12 @@ public: //- Construct empty part with number and description ensightPart(label partNumber, const string& partDescription); - //- Construct empty part with number and description + //- Construct part with number, description and points reference ensightPart ( label partNumber, const string& partDescription, - const polyMesh& pMesh + const pointField& points ); //- Construct as copy @@ -202,8 +205,9 @@ public: return autoPtr<ensightPart>(new ensightPart(*this)); }; - //- Construct on freestore from Istream - static autoPtr<ensightPart> New(Istream& is); + //- Reconstruct part characteristics on freestore from Istream + // @sa reconstruct + static autoPtr<ensightPart> New(Istream&); //- Destructor @@ -212,7 +216,7 @@ public: // Static members - virtual List<word> const& elementTypes() const + virtual const List<word>& elementTypes() const { return elemTypes_; } @@ -256,12 +260,13 @@ public: return matId_; } - //- non-const access + //- non-const access to part name or description void name(const string& value) { name_ = value; } + //- non-const access to material id void materialId(const label value) { matId_ = value; @@ -283,7 +288,7 @@ public: // Edit //- renumber elements - void renumber(labelList const&); + void renumber(const labelUList&); //- write summary information about the object bool writeSummary(Ostream&) const; @@ -296,31 +301,37 @@ public: {} //- Helper: write geometry given the pointField - void writeGeometry(ensightGeoFile&, const pointField& points) const; + void writeGeometry(ensightGeoFile&, const pointField&) const; //- write scalar field + // optionally write data per node void writeScalarField ( ensightFile&, - const List<scalar>& field + const List<scalar>& field, + const bool perNode = false ) const; //- write vector field components + // optionally write data per node void writeVectorField ( ensightFile&, const List<scalar>& field0, const List<scalar>& field1, - const List<scalar>& field2 + const List<scalar>& field2, + const bool perNode = false ) const; //- write generalized field components - template <class Type> + // optionally write data per node + template<class Type> void writeField ( ensightFile&, - const Field<Type>& + const Field<Type>&, + const bool perNode = false ) const; @@ -339,11 +350,8 @@ public: friend Ostream& operator<<(Ostream&, const ensightPart&); //- write geometry - friend ensightGeoFile& operator<< - ( - ensightGeoFile&, - const ensightPart& - ); + friend ensightGeoFile& operator<<(ensightGeoFile&, const ensightPart&); + }; @@ -354,7 +362,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ensightPartI.H" +# include "ensightPartTemplates.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/conversion/ensight/part/ensightPartCells.C b/src/conversion/ensight/part/ensightPartCells.C index d00e9b6f4b868fedcb22c25196ce580f5570b856..a05b70bcef68b36fda8eacbe38bcf33f98485565 100644 --- a/src/conversion/ensight/part/ensightPartCells.C +++ b/src/conversion/ensight/part/ensightPartCells.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,22 +24,21 @@ License \*----------------------------------------------------------------------------*/ #include "ensightPartCells.H" -#include "addToRunTimeSelectionTable.H" #include "IOstream.H" #include "IStringStream.H" #include "dictionary.H" #include "cellModeller.H" - +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(ensightPartCells, 0); - addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream); + defineTypeNameAndDebug(ensightPartCells, 0); + addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream); } -Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_ +const Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_ ( IStringStream ( @@ -50,7 +49,11 @@ Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::ensightPartCells::classify(const labelList& idList) +void Foam::ensightPartCells::classify +( + const polyMesh& mesh, + const labelUList& idList +) { // References to cell shape models const cellModel& tet = *(cellModeller::lookup("tet")); @@ -58,7 +61,6 @@ void Foam::ensightPartCells::classify(const labelList& idList) const cellModel& prism = *(cellModeller::lookup("prism")); const cellModel& hex = *(cellModeller::lookup("hex")); - const polyMesh& mesh = *meshPtr_; const cellShapeList& cellShapes = mesh.cellShapes(); offset_ = 0; @@ -78,13 +80,6 @@ void Foam::ensightPartCells::classify(const labelList& idList) label nHex = 0; label nPoly = 0; - - // TODO: allow tet-decomposition of polyhedral cells -#if 0 - label nTetDecomp = 0; - label nPyrDecomp = 0; -#endif - for (label listI = 0; listI < size_; ++listI) { label cellId = listI; @@ -115,26 +110,6 @@ void Foam::ensightPartCells::classify(const labelList& idList) else { nPoly++; - - // TODO: allow tet-decomposition of polyhedral cells -#if 0 - const cell& cFaces = mesh.cells()[cellI]; - - forAll(cFaces, cFaceI) - { - const face& f = mesh.faces()[cFaces[cFaceI]]; - - label nQuads = 0; - label nTris = 0; - f.nTrianglesQuads(mesh.points(), nTris, nQuads); - - nTetDecomp += nTris; - nPyrDecomp += nQuads; - } - - nAddCells--; - nAddPoints++; -#endif } } @@ -183,29 +158,6 @@ void Foam::ensightPartCells::classify(const labelList& idList) else { polyCells[nPoly++] = cellId; - - // TODO: allow tet-decomposition of polyhedral cells -#if 0 - // Mapping from additional point to cell - addPointCellLabels_[api] = cellId; - - const cell& cFaces = mesh.cells()[cellId]; - - forAll(cFaces, cFaceI) - { - const face& f = mesh.faces()[cFaces[cFaceI]]; - - label nQuads = 0; - label nTris = 0; - f.nTrianglesQuads(mesh.points(), nTris, nQuads); - - nTetDecomp += nTris; - nPyrDecomp += nQuads; - } - - nAddCells--; - nAddPoints++; -#endif } } @@ -213,11 +165,11 @@ void Foam::ensightPartCells::classify(const labelList& idList) // MUST match with elementTypes elemLists_.setSize(elementTypes().size()); - elemLists_[tetra4Elements].transfer( tetCells ); - elemLists_[pyramid5Elements].transfer( pyramidCells ); - elemLists_[penta6Elements].transfer( prismCells ); - elemLists_[hexa8Elements].transfer( hexCells ); - elemLists_[nfacedElements].transfer( polyCells ); + elemLists_[tetra4Elements].transfer(tetCells); + elemLists_[pyramid5Elements].transfer(pyramidCells); + elemLists_[penta6Elements].transfer(prismCells); + elemLists_[hexa8Elements].transfer(hexCells); + elemLists_[nfacedElements].transfer(polyCells); } @@ -229,57 +181,63 @@ Foam::ensightPartCells::ensightPartCells const string& partDescription ) : - ensightPart(partNumber, partDescription) + ensightPart(partNumber, partDescription), + mesh_(*reinterpret_cast<polyMesh*>(0)) {} Foam::ensightPartCells::ensightPartCells ( label partNumber, - const polyMesh& pMesh + const polyMesh& mesh ) : - ensightPart(partNumber, "cells", pMesh) + ensightPart(partNumber, "cells", mesh.points()), + mesh_(mesh) { - classify(); + classify(mesh); } Foam::ensightPartCells::ensightPartCells ( label partNumber, - const polyMesh& pMesh, - const labelList& idList + const polyMesh& mesh, + const labelUList& idList ) : - ensightPart(partNumber, "cells", pMesh) + ensightPart(partNumber, "cells", mesh.points()), + mesh_(mesh) { - classify(idList); + classify(mesh, idList); } Foam::ensightPartCells::ensightPartCells ( label partNumber, - const polyMesh& pMesh, + const polyMesh& mesh, const cellZone& cZone ) : - ensightPart(partNumber, cZone.name(), pMesh) + ensightPart(partNumber, cZone.name(), mesh.points()), + mesh_(mesh) { - classify(cZone); + classify(mesh, cZone); } Foam::ensightPartCells::ensightPartCells(const ensightPartCells& part) : - ensightPart(part) + ensightPart(part), + mesh_(part.mesh_) {} Foam::ensightPartCells::ensightPartCells(Istream& is) : - ensightPart() + ensightPart(), + mesh_(*reinterpret_cast<polyMesh*>(0)) { reconstruct(is); } @@ -295,25 +253,23 @@ Foam::ensightPartCells::~ensightPartCells() Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const { - const polyMesh& mesh = *meshPtr_; - - localPoints ptList(mesh); + localPoints ptList(points_); labelList& usedPoints = ptList.list; label nPoints = 0; forAll(elemLists_, typeI) { - const labelList& idList = elemLists_[typeI]; + const labelUList& idList = elemLists_[typeI]; // add all points from cells forAll(idList, i) { - label id = idList[i] + offset_; - const labelList& cFaces = mesh.cells()[id]; + const label id = idList[i] + offset_; + const labelUList& cFaces = mesh_.cells()[id]; forAll(cFaces, cFaceI) { - const face& f = mesh.faces()[cFaces[cFaceI]]; + const face& f = mesh_.faces()[cFaces[cFaceI]]; forAll(f, fp) { @@ -345,42 +301,40 @@ void Foam::ensightPartCells::writeConnectivity ( ensightGeoFile& os, const word& key, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const { os.writeKeyword(key); os.write(idList.size()); os.newline(); - const polyMesh& mesh = *meshPtr_; - // write polyhedral if (key == "nfaced") { - const faceList& meshFaces = mesh.faces(); + const faceList& meshFaces = mesh_.faces(); // write the number of faces per element forAll(idList, i) { - label id = idList[i] + offset_; - const labelList& cFace = mesh.cells()[id]; + const label id = idList[i] + offset_; + const labelUList& cFace = mesh_.cells()[id]; - os.write( cFace.size() ); + os.write(cFace.size()); os.newline(); } // write the number of points per element face forAll(idList, i) { - label id = idList[i] + offset_; - const labelList& cFace = mesh.cells()[id]; + const label id = idList[i] + offset_; + const labelUList& cFace = mesh_.cells()[id]; forAll(cFace, faceI) { const face& cf = meshFaces[cFace[faceI]]; - os.write( cf.size() ); + os.write(cf.size()); os.newline(); } } @@ -388,8 +342,8 @@ void Foam::ensightPartCells::writeConnectivity // write the points describing each element face forAll(idList, i) { - label id = idList[i] + offset_; - const labelList& cFace = mesh.cells()[id]; + const label id = idList[i] + offset_; + const labelUList& cFace = mesh_.cells()[id]; forAll(cFace, faceI) { @@ -399,7 +353,7 @@ void Foam::ensightPartCells::writeConnectivity { // convert global -> local index // (note: Ensight indices start with 1) - os.write( pointMap[cf[ptI]] + 1); + os.write(pointMap[cf[ptI]] + 1); } os.newline(); } @@ -408,18 +362,18 @@ void Foam::ensightPartCells::writeConnectivity else { // write primitive - const cellShapeList& cellShapes = mesh.cellShapes(); + const cellShapeList& cellShapes = mesh_.cellShapes(); forAll(idList, i) { - label id = idList[i] + offset_; + const label id = idList[i] + offset_; const cellShape& cellPoints = cellShapes[id]; // convert global -> local index // (note: Ensight indices start with 1) forAll(cellPoints, ptI) { - os.write( pointMap[cellPoints[ptI]] + 1 ); + os.write(pointMap[cellPoints[ptI]] + 1); } os.newline(); } @@ -429,8 +383,7 @@ void Foam::ensightPartCells::writeConnectivity void Foam::ensightPartCells::writeGeometry(ensightGeoFile& os) const { - const polyMesh& mesh = *meshPtr_; - ensightPart::writeGeometry(os, mesh.points()); + ensightPart::writeGeometry(os, points_); } diff --git a/src/conversion/ensight/part/ensightPartCells.H b/src/conversion/ensight/part/ensightPartCells.H index 82b0f80d890cc441ad5e2340b48e99b6caf612b3..cd79c029b6ca18177cdb98354a70ad03c7392df3 100644 --- a/src/conversion/ensight/part/ensightPartCells.H +++ b/src/conversion/ensight/part/ensightPartCells.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,8 +56,12 @@ class ensightPartCells //- Disallow default bitwise assignment void operator=(const ensightPartCells&); - //- classify the cell types - void classify(const labelList& idLabels = labelList::null()); + //- Classify the cell types, set elemLists. + void classify + ( + const polyMesh&, + const labelUList& idLabels = labelUList::null() + ); //- track points used virtual localPoints calcLocalPoints() const; @@ -68,30 +72,35 @@ class ensightPartCells //- element connectivity virtual void writeConnectivity ( - ensightGeoFile& os, + ensightGeoFile&, const word& key, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const; - //- write geometry - virtual void writeGeometry(ensightGeoFile& os) const; - protected: - //- addressable Ensight element types - enum elemType - { - tetra4Elements, - pyramid5Elements, - penta6Elements, - hexa8Elements, - nfacedElements - }; + //- addressable ensight element types + enum elemType + { + tetra4Elements, + pyramid5Elements, + penta6Elements, + hexa8Elements, + nfacedElements + }; + // Static data members - static List<word> elemTypes_; + + static const List<word> elemTypes_; + + + // Protected data + + //- mesh referenced + const polyMesh& mesh_; public: @@ -112,7 +121,7 @@ public: ( label partNumber, const polyMesh&, - const labelList& + const labelUList& ); //- Construct from polyMesh and cellZone @@ -126,10 +135,13 @@ public: //- Construct as copy ensightPartCells(const ensightPartCells&); - //- Construct from Istream + //- Reconstruct part characteristics (eg, element types) from Istream + // A part reconstructed in this manner can be used when writing fields, + // but cannot be used to write a new geometry + // @sa Foam::ensightPart::reconstruct ensightPartCells(Istream&); - //- Construct on freestore from Istream + //- Reconstruct part characteristics on freestore from Istream static autoPtr<ensightPartCells> New(Istream& is) { return autoPtr<ensightPartCells>(new ensightPartCells(is)); @@ -142,8 +154,11 @@ public: // Member Functions + //- write geometry + virtual void writeGeometry(ensightGeoFile&) const; + //- static listing of the element types - virtual List<word> const& elementTypes() const + virtual const List<word>& elementTypes() const { return elemTypes_; } diff --git a/src/conversion/ensight/part/ensightPartFaces.C b/src/conversion/ensight/part/ensightPartFaces.C index 46169cd90f2e7d6adfa7387cd416c32d59a61ff2..c8bfaa00df39620f0c4c33c8a7ce486ef5004f43 100644 --- a/src/conversion/ensight/part/ensightPartFaces.C +++ b/src/conversion/ensight/part/ensightPartFaces.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,21 +24,21 @@ License \*----------------------------------------------------------------------------*/ #include "ensightPartFaces.H" -#include "addToRunTimeSelectionTable.H" #include "IOstreams.H" #include "IStringStream.H" #include "dictionary.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(ensightPartFaces, 0); - addToRunTimeSelectionTable(ensightPart, ensightPartFaces, istream); + defineTypeNameAndDebug(ensightPartFaces, 0); + addToRunTimeSelectionTable(ensightPart, ensightPartFaces, istream); } -Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_ +const Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_ ( IStringStream ( @@ -49,7 +49,7 @@ Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::ensightPartFaces::binShapes(const faceList& faces) +void Foam::ensightPartFaces::classify(const faceList& faces) { // count the shapes label nTri = 0; @@ -107,9 +107,9 @@ void Foam::ensightPartFaces::binShapes(const faceList& faces) // MUST match with elementTypes elemLists_.setSize(elementTypes().size()); - elemLists_[tria3Elements].transfer( triCells ); - elemLists_[quad4Elements].transfer( quadCells ); - elemLists_[nsidedElements].transfer( polygonCells ); + elemLists_[tria3Elements].transfer(triCells); + elemLists_[quad4Elements].transfer(quadCells); + elemLists_[nsidedElements].transfer(polygonCells); size_ = faces.size(); } @@ -123,7 +123,9 @@ Foam::ensightPartFaces::ensightPartFaces const string& partDescription ) : - ensightPart(partNumber, partDescription) + ensightPart(partNumber, partDescription), + faces_(faceList::null()), + contiguousPoints_(false) { isCellData_ = false; offset_ = 0; @@ -134,29 +136,57 @@ Foam::ensightPartFaces::ensightPartFaces Foam::ensightPartFaces::ensightPartFaces ( label partNumber, - const polyMesh& pMesh, - const polyPatch& pPatch + const string& partDescription, + const pointField& points, + const faceList& faces, + const bool contiguousPoints ) : - ensightPart(partNumber, pPatch.name(), pMesh) + ensightPart(partNumber, partDescription, points), + faces_(faces), + contiguousPoints_(contiguousPoints) { isCellData_ = false; - offset_ = pPatch.start(); + offset_ = 0; + size_ = 0; - // count the shapes - binShapes(pPatch); + // classify the face shapes + classify(faces); +} + + +Foam::ensightPartFaces::ensightPartFaces +( + label partNumber, + const polyMesh& mesh, + const polyPatch& patch +) +: + ensightPart(partNumber, patch.name(), mesh.points()), + faces_(mesh.faces()), + contiguousPoints_(false) +{ + isCellData_ = false; + offset_ = patch.start(); + + // classify the face shapes + classify(patch); } Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces& part) : - ensightPart(part) + ensightPart(part), + faces_(part.faces_), + contiguousPoints_(part.contiguousPoints_) {} Foam::ensightPartFaces::ensightPartFaces(Istream& is) : - ensightPart() + ensightPart(), + faces_(faceList::null()), + contiguousPoints_(false) { isCellData_ = false; reconstruct(is); @@ -173,21 +203,27 @@ Foam::ensightPartFaces::~ensightPartFaces() Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const { - const polyMesh& mesh = *meshPtr_; + if (contiguousPoints_) + { + localPoints ptList; + ptList.list = identity(points_.size()); + ptList.nPoints = points_.size(); + return ptList; + } - localPoints ptList(mesh); + localPoints ptList(points_); labelList& usedPoints = ptList.list; label nPoints = 0; forAll(elemLists_, typeI) { - const labelList& idList = elemLists_[typeI]; + const labelUList& idList = elemLists_[typeI]; // add all points from faces forAll(idList, i) { - label id = idList[i] + offset_; - const face& f = mesh.faces()[id]; + const label id = idList[i] + offset_; + const face& f = faces_[id]; forAll(f, fp) { @@ -219,8 +255,8 @@ void Foam::ensightPartFaces::writeConnectivity ensightGeoFile& os, const word& key, const faceList& faces, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const { os.writeKeyword(key); @@ -233,10 +269,10 @@ void Foam::ensightPartFaces::writeConnectivity // write the number of points per face forAll(idList, i) { - label id = idList[i] + offset_; + const label id = idList[i] + offset_; const face& f = faces[id]; - os.write( f.size() ); + os.write(f.size()); os.newline(); } } @@ -244,14 +280,14 @@ void Foam::ensightPartFaces::writeConnectivity // write the points describing the face forAll(idList, i) { - label id = idList[i] + offset_; + const label id = idList[i] + offset_; const face& f = faces[id]; // convert global -> local index // (note: Ensight indices start with 1) forAll(f, fp) { - os.write( pointMap[f[fp]] + 1 ); + os.write(pointMap[f[fp]] + 1); } os.newline(); } @@ -262,15 +298,15 @@ void Foam::ensightPartFaces::writeConnectivity ( ensightGeoFile& os, const word& key, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const { writeConnectivity ( os, key, - meshPtr_->faces(), + faces_, idList, pointMap ); @@ -279,9 +315,7 @@ void Foam::ensightPartFaces::writeConnectivity void Foam::ensightPartFaces::writeGeometry(ensightGeoFile& os) const { - const polyMesh& mesh = *meshPtr_; - const pointField& points = mesh.points(); - ensightPart::writeGeometry(os, points); + ensightPart::writeGeometry(os, points_); } diff --git a/src/conversion/ensight/part/ensightPartFaces.H b/src/conversion/ensight/part/ensightPartFaces.H index 3871300b5c6a464085363954d08ea92a3d6ce261..1b64688d9c56d3417b0b0dbf8450717cd06a2462 100644 --- a/src/conversion/ensight/part/ensightPartFaces.H +++ b/src/conversion/ensight/part/ensightPartFaces.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,41 +61,52 @@ class ensightPartFaces //- element connectivity virtual void writeConnectivity ( - ensightGeoFile& os, + ensightGeoFile&, const word& key, - const labelList& idList, - const labelList& pointMap + const labelUList& idList, + const labelUList& pointMap ) const; - //- write geometry - virtual void writeGeometry(ensightGeoFile& os) const; - protected: - //- addressable ensight element types - enum elemType - { - tria3Elements, - quad4Elements, - nsidedElements - }; + //- addressable ensight element types + enum elemType + { + tria3Elements, + quad4Elements, + nsidedElements + }; + // Static data members - static List<word> elemTypes_; - //- Divide the shapes, set elemLists. - void binShapes(const faceList& faces); + static const List<word> elemTypes_; + + + // Protected data - //- Helper: write connectivity - void writeConnectivity - ( - ensightGeoFile& os, - const word& key, - const faceList& faces, - const labelList& idList, - const labelList& pointMap - ) const; + //- faces referenced + const faceList& faces_; + + //- Can skip local point renumbering when points are contiguous + const bool contiguousPoints_; + + + // Protected Member Functions + + //- Classify the face shapes, set elemLists. + void classify(const faceList&); + + //- Helper: write connectivity + void writeConnectivity + ( + ensightGeoFile&, + const word& key, + const faceList&, + const labelUList& idList, + const labelUList& pointMap + ) const; public: @@ -108,6 +119,17 @@ public: //- Construct empty part with number and description ensightPartFaces(label partNumber, const string& partDescription); + //- Construct part with number, description, points and faces + // Can skip local point renumbering when points are contiguous + ensightPartFaces + ( + label partNumber, + const string& partDescription, + const pointField&, + const faceList&, + const bool contiguousPoints = false + ); + //- Construct from polyMesh and polyPatch ensightPartFaces ( @@ -119,10 +141,13 @@ public: //- Construct as copy ensightPartFaces(const ensightPartFaces&); - //- Construct from Istream + //- Reconstruct part characteristics (eg, element types) from Istream + // A part reconstructed in this manner can be used when writing fields, + // but cannot be used to write a new geometry + // @sa Foam::ensightPart::reconstruct ensightPartFaces(Istream&); - //- Construct on freestore from Istream + //- Reconstruct part characteristics on freestore from Istream static autoPtr<ensightPartFaces> New(Istream& is) { return autoPtr<ensightPartFaces>(new ensightPartFaces(is)); @@ -135,8 +160,11 @@ public: // Member Functions + //- write geometry + virtual void writeGeometry(ensightGeoFile&) const; + //- static listing of the element types - virtual List<word> const& elementTypes() const + virtual const List<word>& elementTypes() const { return elemTypes_; } diff --git a/src/conversion/ensight/part/ensightPartIO.C b/src/conversion/ensight/part/ensightPartIO.C index ac903bdf99800546e936a513924aeef51481f615..bc893b84118a16645fd26a1d43cc3f8aa3b48021 100644 --- a/src/conversion/ensight/part/ensightPartIO.C +++ b/src/conversion/ensight/part/ensightPartIO.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,24 +59,71 @@ void Foam::ensightPart::writeFieldList const labelUList& idList ) const { - forAll(idList, i) + if (&idList) { - if (idList[i] >= field.size() || isnan(field[idList[i]])) + forAll(idList, i) { - os.writeUndef(); + if (idList[i] >= field.size() || isnan(field[idList[i]])) + { + os.writeUndef(); + } + else + { + os.write(field[idList[i]]); + } + + os.newline(); } - else + } + else + { + // no idList => perNode + forAll(field, i) { - os.write(field[idList[i]]); - } + if (isnan(field[i])) + { + os.writeUndef(); + } + else + { + os.write(field[i]); + } - os.newline(); + os.newline(); + } } } + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::ensightPart::reconstruct(Istream& is) +{ + dictionary dict(is); + dict.lookup("id") >> number_; + dict.lookup("name") >> name_; + + offset_ = 0; + dict.readIfPresent("offset", offset_); + + // populate elemLists_ + elemLists_.setSize(elementTypes().size()); + + forAll(elementTypes(), elemI) + { + word key(elementTypes()[elemI]); + + elemLists_[elemI].clear(); + dict.readIfPresent(key, elemLists_[elemI]); + + size_ += elemLists_[elemI].size(); + } + + is.check("ensightPart::reconstruct(Istream&)"); +} + + bool Foam::ensightPart::writeSummary(Ostream& os) const { os << indent << type() << nl @@ -88,7 +135,7 @@ bool Foam::ensightPart::writeSummary(Ostream& os) const os.writeKeyword("offset") << offset() << token::END_STATEMENT << nl; os.writeKeyword("size") << size() << token::END_STATEMENT << nl; - os << decrIndent << indent << token::END_BLOCK << nl << endl; + os << decrIndent << indent << token::END_BLOCK << nl << endl; return true; } @@ -112,7 +159,7 @@ bool Foam::ensightPart::writeData(Ostream& os) const } } - os << decrIndent << indent << token::END_BLOCK << nl << endl; + os << decrIndent << indent << token::END_BLOCK << nl << endl; return true; } @@ -127,7 +174,7 @@ void Foam::ensightPart::writeGeometry if (size()) { const localPoints ptList = calcLocalPoints(); - const labelList& pointMap = ptList.list; + const labelUList& pointMap = ptList.list; writeHeader(os, true); @@ -136,13 +183,13 @@ void Foam::ensightPart::writeGeometry os.write(ptList.nPoints); os.newline(); - for (direction cmpt=0; cmpt < vector::nComponents; cmpt++) + for (direction cmpt=0; cmpt < point::nComponents; ++cmpt) { forAll(pointMap, ptI) { if (pointMap[ptI] > -1) { - os.write( points[ptI].component(cmpt) ); + os.write(points[ptI].component(cmpt)); os.newline(); } } @@ -169,21 +216,30 @@ void Foam::ensightPart::writeGeometry void Foam::ensightPart::writeScalarField ( ensightFile& os, - const List<scalar>& field + const List<scalar>& field, + const bool perNode ) const { if (size() && field.size() && (os.allowUndef() || isFieldDefined(field))) { writeHeader(os); - forAll(elementTypes(), elemI) + if (perNode) { - const labelList& idList = elemLists_[elemI]; - - if (idList.size()) + os.writeKeyword("coordinates"); + writeFieldList(os, field, labelUList::null()); + } + else + { + forAll(elementTypes(), elemI) { - os.writeKeyword( elementTypes()[elemI] ); - writeFieldList(os, field, idList); + const labelUList& idList = elemLists_[elemI]; + + if (idList.size()) + { + os.writeKeyword(elementTypes()[elemI]); + writeFieldList(os, field, idList); + } } } } @@ -195,23 +251,34 @@ void Foam::ensightPart::writeVectorField ensightFile& os, const List<scalar>& field0, const List<scalar>& field1, - const List<scalar>& field2 + const List<scalar>& field2, + const bool perNode ) const { if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0))) { writeHeader(os); - forAll(elementTypes(), elemI) + if (perNode) { - const labelList& idList = elemLists_[elemI]; - - if (idList.size()) + os.writeKeyword("coordinates"); + writeFieldList(os, field0, labelUList::null()); + writeFieldList(os, field1, labelUList::null()); + writeFieldList(os, field2, labelUList::null()); + } + else + { + forAll(elementTypes(), elemI) { - os.writeKeyword( elementTypes()[elemI] ); - writeFieldList(os, field0, idList); - writeFieldList(os, field1, idList); - writeFieldList(os, field2, idList); + const labelUList& idList = elemLists_[elemI]; + + if (idList.size()) + { + os.writeKeyword(elementTypes()[elemI]); + writeFieldList(os, field0, idList); + writeFieldList(os, field1, idList); + writeFieldList(os, field2, idList); + } } } } diff --git a/src/conversion/ensight/part/ensightPartNonMeshFaces.C b/src/conversion/ensight/part/ensightPartNonMeshFaces.C deleted file mode 100644 index e991844bf008f5e4248e4cf4c5d54b4ac114dfe9..0000000000000000000000000000000000000000 --- a/src/conversion/ensight/part/ensightPartNonMeshFaces.C +++ /dev/null @@ -1,122 +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 "ensightPartNonMeshFaces.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(ensightPartNonMeshFaces, 0); - addToRunTimeSelectionTable(ensightPart, ensightPartNonMeshFaces, istream); -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -Foam::ensightPart::localPoints -Foam::ensightPartNonMeshFaces::calcLocalPoints() const -{ - localPoints ptList; - ptList.list = identity(points_.size()); - ptList.nPoints = points_.size(); - return ptList; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces -( - label partNumber, - const string& partDescription, - const faceList& faces, - const pointField& points -) -: - ensightPartFaces(partNumber, partDescription), - faces_(faces), - points_(points) -{ - binShapes(faces); -} - - -//- Construct as copy -Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces -( - const ensightPartNonMeshFaces& part -) -: - ensightPartFaces(part), - faces_(part.faces_), - points_(part.points_) -{} - - -//- Construct from Istream -Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces(Istream& is) -: - ensightPartFaces(is), - faces_(is), - points_(is) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::ensightPartNonMeshFaces::~ensightPartNonMeshFaces() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::ensightPartNonMeshFaces::writeConnectivity -( - ensightGeoFile& os, - const word& key, - const labelList& idList, - const labelList& pointMap -) const -{ - ensightPartFaces::writeConnectivity - ( - os, - key, - faces_, - idList, - pointMap - ); -} - - -void Foam::ensightPartNonMeshFaces::writeGeometry(ensightGeoFile& os) const -{ - ensightPart::writeGeometry(os, points_); -} - - -// ************************************************************************* // diff --git a/src/conversion/ensight/part/ensightPartNonMeshFaces.H b/src/conversion/ensight/part/ensightPartNonMeshFaces.H deleted file mode 100644 index ab7f4a782a696085332a46ae426abe41c321b924..0000000000000000000000000000000000000000 --- a/src/conversion/ensight/part/ensightPartNonMeshFaces.H +++ /dev/null @@ -1,131 +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/>. - -Class - Foam::ensightPartNonMeshFaces - -Description - An implementation of ensightPart to work on self-contained faces and points - (without a mesh). - -SourceFiles - ensightPartNonMeshFaces.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ensightPartNonMeshFaces_H -#define ensightPartNonMeshFaces_H - -#include "ensightPartFaces.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ensightPartNonMeshFaces Declaration -\*---------------------------------------------------------------------------*/ - -class ensightPartNonMeshFaces -: - public ensightPartFaces -{ - // Private data - - //- faces (reference) - const faceList& faces_; - - //- points (reference) - const pointField& points_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const ensightPartNonMeshFaces&); - - //- track points used - virtual localPoints calcLocalPoints() const; - -public: - - //- Runtime type information - TypeName("ensightNonMeshFaces"); - - // Constructors - - //- Construct from faces and points - ensightPartNonMeshFaces - ( - label partNumber, - const string& partDescription, - const faceList& faces, - const pointField& points - ); - - //- Construct as copy - ensightPartNonMeshFaces(const ensightPartNonMeshFaces& part); - - //- Construct from Istream - ensightPartNonMeshFaces(Istream& is); - - //- Construct on freestore from Istream - static autoPtr<ensightPartNonMeshFaces> New(Istream& is) - { - return autoPtr<ensightPartNonMeshFaces> - ( - new ensightPartNonMeshFaces(is) - ); - } - - - //- Destructor - virtual ~ensightPartNonMeshFaces(); - - - // Member Functions - - //- element connectivity - virtual void writeConnectivity - ( - ensightGeoFile& os, - const word& key, - const labelList& idList, - const labelList& pointMap - ) const; - - virtual void writeGeometry(ensightGeoFile& os) const; - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/conversion/ensight/part/ensightPartI.H b/src/conversion/ensight/part/ensightPartTemplates.C similarity index 59% rename from src/conversion/ensight/part/ensightPartI.H rename to src/conversion/ensight/part/ensightPartTemplates.C index 9286273276c9b80ef23e2e3a92a8b9f251e1bfff..2f3f4a599455127a2b98fd8ba86f8da38b3d5077 100644 --- a/src/conversion/ensight/part/ensightPartI.H +++ b/src/conversion/ensight/part/ensightPartTemplates.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,33 +30,50 @@ Description // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // -template <class Type> +template<class Type> void Foam::ensightPart::writeField ( ensightFile& os, - const Field<Type>& field + const Field<Type>& field, + const bool perNode ) const { - if (size() && field.size()) + if (this->size() && field.size()) { writeHeader(os); - forAll(elementTypes(), elemI) + if (perNode) { - const labelList& idList = elemLists_[elemI]; - - if (idList.size()) + os.writeKeyword("coordinates"); + for + ( + direction cmpt=0; + cmpt < pTraits<Type>::nComponents; + ++cmpt + ) + { + writeFieldList(os, field.component(cmpt), labelUList::null()); + } + } + else + { + forAll(elementTypes(), elemI) { - os.writeKeyword( elementTypes()[elemI] ); + const labelUList& idList = elemLists_[elemI]; - for - ( - direction cmpt=0; - cmpt < pTraits<Type>::nComponents; - cmpt++ - ) + if (idList.size()) { - writeFieldList(os, field.component(cmpt), idList); + os.writeKeyword(elementTypes()[elemI]); + + for + ( + direction cmpt=0; + cmpt < pTraits<Type>::nComponents; + ++cmpt + ) + { + writeFieldList(os, field.component(cmpt), idList); + } } } } diff --git a/src/conversion/ensight/part/ensightParts.C b/src/conversion/ensight/part/ensightParts.C index 76179b4a11687de3f8e4e756ee221b0991c13a13..240b9fb859f12829b65ef2d7ce449f1d0ad0bfa4 100644 --- a/src/conversion/ensight/part/ensightParts.C +++ b/src/conversion/ensight/part/ensightParts.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,11 +27,11 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::ensightParts::ensightParts(const polyMesh& pMesh) +Foam::ensightParts::ensightParts(const polyMesh& mesh) : partsList_() { - recalculate(pMesh); + recalculate(mesh); } @@ -52,15 +52,15 @@ Foam::ensightParts::~ensightParts() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::ensightParts::recalculate(const polyMesh& pMesh) +void Foam::ensightParts::recalculate(const polyMesh& mesh) { partsList_.clear(); // extra space for unzoned cells label nPart = ( - pMesh.cellZones().size() - + pMesh.boundaryMesh().size() + mesh.cellZones().size() + + mesh.boundaryMesh().size() + 1 ); @@ -70,9 +70,9 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) label nZoneCells = 0; // do cell zones - forAll(pMesh.cellZones(), zoneI) + forAll(mesh.cellZones(), zoneI) { - const cellZone& cZone = pMesh.cellZones()[zoneI]; + const cellZone& cZone = mesh.cellZones()[zoneI]; nZoneCells += cZone.size(); if (cZone.size()) @@ -80,12 +80,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) partsList_.set ( nPart, - new ensightPartCells - ( - nPart, - pMesh, - cZone - ) + new ensightPartCells(nPart, mesh, cZone) ); nPart++; @@ -100,23 +95,19 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) partsList_.set ( nPart, - new ensightPartCells - ( - nPart, - pMesh - ) + new ensightPartCells(nPart, mesh) ); nPart++; } - else if (pMesh.nCells() > nZoneCells) + else if (mesh.nCells() > nZoneCells) { // determine which cells are not in a cellZone - labelList unzoned(pMesh.nCells(), -1); + labelList unzoned(mesh.nCells(), -1); - forAll(pMesh.cellZones(), zoneI) + forAll(mesh.cellZones(), zoneI) { - const labelList& idList = pMesh.cellZones()[zoneI]; + const labelUList& idList = mesh.cellZones()[zoneI]; forAll(idList, i) { @@ -140,12 +131,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) partsList_.set ( nPart, - new ensightPartCells - ( - nPart, - pMesh, - unzoned - ) + new ensightPartCells(nPart, mesh, unzoned) ); nPart++; @@ -154,20 +140,15 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) // do boundaries, skipping empty and processor patches - forAll(pMesh.boundaryMesh(), patchI) + forAll(mesh.boundaryMesh(), patchI) { - const polyPatch& pPatch = pMesh.boundaryMesh()[patchI]; - if (pPatch.size() && !isA<processorPolyPatch>(pPatch)) + const polyPatch& patch = mesh.boundaryMesh()[patchI]; + if (patch.size() && !isA<processorPolyPatch>(patch)) { partsList_.set ( nPart, - new ensightPartFaces - ( - nPart, - pMesh, - pPatch - ) + new ensightPartFaces(nPart, mesh, patch) ); nPart++; @@ -181,8 +162,8 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh) void Foam::ensightParts::renumber ( - const labelList& origCellId, - const labelList& origFaceId + const labelUList& origCellId, + const labelUList& origFaceId ) { forAll(partsList_, partI) @@ -199,7 +180,7 @@ void Foam::ensightParts::renumber } -void Foam::ensightParts::writeGeometry( ensightGeoFile& os) const +void Foam::ensightParts::writeGeometry(ensightGeoFile& os) const { // with some feedback Info<< "write geometry part:" << nl << flush; @@ -225,23 +206,21 @@ bool Foam::ensightParts::writeSummary(Ostream& os) const void Foam::ensightParts::writeData(Ostream& os) const { - // Write size of list - os << nl << partsList_.size(); - - // Write beginning of contents - os << nl << token::BEGIN_LIST; + // Begin write list + os << nl << partsList_.size() + << nl << token::BEGIN_LIST; // Write list contents forAll(partsList_, i) { - os << nl << partsList_[i]; + os << nl << partsList_[i]; } - // Write end of contents - os << nl << token::END_LIST << nl; + // End write list + os << nl << token::END_LIST << nl; // Check state of IOstream - os.check("Ostream& operator<<(Ostream&, const PtrList&)"); + os.check("ensightParts::writeData(Ostream&)"); } @@ -249,7 +228,8 @@ void Foam::ensightParts::writeScalarField ( ensightFile& os, const List<scalar>& field, - bool useFaceData + const bool useFaceData, + const bool perNode ) const { forAll(partsList_, partI) @@ -261,7 +241,7 @@ void Foam::ensightParts::writeScalarField : partsList_[partI].isCellData() ) { - partsList_[partI].writeScalarField(os,field); + partsList_[partI].writeScalarField(os, field, perNode); } } } @@ -273,7 +253,8 @@ void Foam::ensightParts::writeVectorField const List<scalar>& field0, const List<scalar>& field1, const List<scalar>& field2, - bool useFaceData + const bool useFaceData, + const bool perNode ) const { forAll(partsList_, partI) @@ -285,7 +266,12 @@ void Foam::ensightParts::writeVectorField : partsList_[partI].isCellData() ) { - partsList_[partI].writeVectorField(os, field0, field1, field2); + partsList_[partI].writeVectorField + ( + os, + field0, field1, field2, + perNode + ); } } } diff --git a/src/conversion/ensight/part/ensightParts.H b/src/conversion/ensight/part/ensightParts.H index 3d620192b5c67d3b0ae6a63df461cca22fece9f7..6b4f49eef9a1b79e3d19d86ae3db2dcccb9fc6e7 100644 --- a/src/conversion/ensight/part/ensightParts.H +++ b/src/conversion/ensight/part/ensightParts.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ Description SourceFiles ensightParts.C - ensightPartsI.H + ensightPartsTemplates.C \*---------------------------------------------------------------------------*/ @@ -89,8 +89,8 @@ public: //- renumber elements void renumber ( - const labelList& origCellId, - const labelList& origFaceId + const labelUList& origCellId, + const labelUList& origFaceId ); //- number of parts @@ -108,27 +108,33 @@ public: //- write the lists void writeData(Ostream&) const; - //- write scalar field + //- write (volume) scalar field + // optionally write data for face parts + // optionally write data per node void writeScalarField ( ensightFile&, const List<scalar>& field, - bool useFaceData = false + const bool useFaceData = false, + const bool perNode = false ) const; - //- write vector field components + //- write (volume) vector field components + // optionally write data for face parts + // optionally write data per node void writeVectorField ( ensightFile&, const List<scalar>& field0, const List<scalar>& field1, const List<scalar>& field2, - bool useFaceData = false + const bool useFaceData = false, + const bool perNode = false ) const; - //- write generalized field components - template <class Type> + //- write generalized volume field components + template<class Type> void writeField ( ensightFile&, @@ -138,11 +144,8 @@ public: // Friend Operators - friend ensightGeoFile& operator<< - ( - ensightGeoFile&, - const ensightParts& - ); + //- write geometry + friend ensightGeoFile& operator<<(ensightGeoFile&, const ensightParts&); }; @@ -153,7 +156,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ensightPartsI.H" +# include "ensightPartsTemplates.C" #endif #endif diff --git a/src/conversion/ensight/part/ensightPartsI.H b/src/conversion/ensight/part/ensightPartsTemplates.C similarity index 96% rename from src/conversion/ensight/part/ensightPartsI.H rename to src/conversion/ensight/part/ensightPartsTemplates.C index c4848faf2a2af3e30dd70b1a767d586130cd8506..5eb8a7aec8ca8c84c84d09915eb2b473ab8e3cf1 100644 --- a/src/conversion/ensight/part/ensightPartsI.H +++ b/src/conversion/ensight/part/ensightPartsTemplates.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template <class Type> +template<class Type> void Foam::ensightParts::writeField ( ensightFile& os, diff --git a/src/dummyThirdParty/Allwmake b/src/dummyThirdParty/Allwmake index c584d921945dde3e54ecdb2c986eb2e738b43e5c..5076d8d2b72e19cf8ef9d71a6962fc0a75db8cd0 100755 --- a/src/dummyThirdParty/Allwmake +++ b/src/dummyThirdParty/Allwmake @@ -1,11 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso scotchDecomp -wmake libso ptscotchDecomp -wmake libso metisDecomp -wmake libso MGridGen +wmake $makeOption scotchDecomp +wmake $makeOption ptscotchDecomp +wmake $makeOption metisDecomp +wmake $makeOption MGridGen # ----------------------------------------------------------------- end-of-file diff --git a/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C b/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C index 4be4cd995b80591e38f21dfaa7484ad501b7e7f9..1da6585c465ea2f69899013089def35a491cb3e3 100644 --- a/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C +++ b/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C @@ -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 @@ -33,8 +33,10 @@ static const char* notImplementedMessage = "\n" "Please install metis and make sure that libmetis.so is in your " "LD_LIBRARY_PATH.\n" -"The metisDecomp library can then be built in " -"$FOAM_SRC/parallel/decompose/decompositionMethods/metisDecomp\n"; +"The metisDecomp library can then be built from " +"$FOAM_SRC/parallel/decompose/metisDecomp and dynamically loading or linking" +" this library will add metis as a decomposition method.\n" +"Please be aware that there are license restrictions on using Metis."; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dummyThirdParty/ptscotchDecomp/dummyPtscotchDecomp.C b/src/dummyThirdParty/ptscotchDecomp/dummyPtscotchDecomp.C index d4c2802d588b7e0135d5b2b7dbaa600f52d0c9f2..90aca7c618cfcdb34b210d7f9a2a5399d16fc567 100644 --- a/src/dummyThirdParty/ptscotchDecomp/dummyPtscotchDecomp.C +++ b/src/dummyThirdParty/ptscotchDecomp/dummyPtscotchDecomp.C @@ -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 @@ -60,6 +60,7 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str) Foam::label Foam::ptscotchDecomp::decomposeZeroDomains ( + const fileName& meshPath, const List<int>& initxadj, const List<int>& initadjncy, const scalarField& initcWeights, @@ -82,6 +83,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains } Foam::label Foam::ptscotchDecomp::decompose ( + const fileName& meshPath, const List<int>& adjncy, const List<int>& xadj, const scalarField& cWeights, diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 09afd9cde398f4aa479f1e6666f3b44c6e2165db..0a906aa7bcfd22bdd707f8bca9afbf5c16f3b452 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -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 @@ -104,8 +104,7 @@ Foam::labelListList Foam::addPatchCellLayer::calcGlobalEdgeFaces mesh, globalEdgeFaces, uniqueEqOp(), - labelList(), // null value - Foam::dummyTransform() // dummy transform + labelList() // null value ); // Extract pp part diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index 618657df7c8849e5acfb44e5f5cb3270ddc37891..d4e3da12a8e23b32f78f5301ecf026a368f6d182 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -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 @@ -4394,7 +4394,7 @@ void Foam::hexRef8::distribute(const mapDistributePolyMesh& map) void Foam::hexRef8::checkMesh() const { - const scalar smallDim = 1E-6 * mesh_.globalData().bb().mag(); + const scalar smallDim = 1E-6 * mesh_.bounds().mag(); if (debug) { diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 2e4dd38bb1e14791752b1032c0495fea5e119082..1e8508d8601e2af4505a5615e9038d1358824984 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -243,13 +243,14 @@ $(schemes)/cubicUpwindFit/cubicUpwindFit.C $(schemes)/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C */ $(schemes)/linearPureUpwindFit/linearPureUpwindFit.C +$(schemes)/linearUpwind/linearUpwind.C +$(schemes)/linearUpwind/linearUpwindV.C +$(schemes)/quadraticUpwind/quadraticUpwind.C limitedSchemes = $(surfaceInterpolation)/limitedSchemes $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C $(limitedSchemes)/upwind/upwind.C $(limitedSchemes)/blended/blended.C -$(limitedSchemes)/linearUpwind/linearUpwind.C -$(limitedSchemes)/linearUpwind/linearUpwindV.C $(limitedSchemes)/Gamma/Gamma.C $(limitedSchemes)/SFCD/SFCD.C $(limitedSchemes)/Minmod/Minmod.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index 66dedbbe27228d6beb403b43f60dee7724c506df..6d3db6936f13a0a31a0f8176a18df5451e88df32 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -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 @@ -342,8 +342,6 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints() localVertices2D[i][1] = localVertices[i][1]; } - triSurface s(triSurfaceTools::delaunay2D(localVertices2D)); - tmp<pointField> localFaceCentres ( referenceCS().localPosition @@ -352,6 +350,26 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints() ) ); + if (debug) + { + OFstream str + ( + this->db().time().path()/this->patch().name() + + "_localFaceCentres.obj" + ); + Pout<< "readSamplePoints :" + << " Dumping face centres to " << str.name() << endl; + + forAll(localFaceCentres(), i) + { + const point& p = localFaceCentres()[i]; + str<< "v " << p.x() << ' ' << p.y() << ' ' << p.z() << nl; + } + } + + + triSurface s(triSurfaceTools::delaunay2D(localVertices2D)); + if (debug) { Pout<< "readSamplePoints :" diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C index f91501c27505cbe0c7dd0d946d488c39b7a367e3..e661b4df48717edee2df24f9e1d1b3aca2acbcf0 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C @@ -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 @@ -155,8 +155,8 @@ void Foam::cellPointWeight::findTriangle List<tetIndices> faceTets = polyMeshTetDecomposition::faceTetIndices ( mesh, - mesh.faceOwner()[faceI], - faceI + faceI, + mesh.faceOwner()[faceI] ); const scalar faceAreaSqr = magSqr(mesh.faceAreas()[faceI]); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C similarity index 92% rename from src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C index 7f17534c94fe610b43b0f5c94c3504fa56257bf4..77b6ae0d3b004bb4483d55af699a7f5671ca76da 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C @@ -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,6 @@ License #include "linearUpwind.H" #include "fvMesh.H" -#include "zeroGradientFvPatchField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -85,16 +84,8 @@ Foam::linearUpwind<Type>::correction forAll(faceFlux, facei) { - if (faceFlux[facei] > 0) - { - label own = owner[facei]; - sfCorr[facei] = (Cf[facei] - C[own]) & gradVf[own]; - } - else - { - label nei = neighbour[facei]; - sfCorr[facei] = (Cf[facei] - C[nei]) & gradVf[nei]; - } + label celli = (faceFlux[facei] > 0) ? owner[facei] : neighbour[facei]; + sfCorr[facei] = (Cf[facei] - C[celli]) & gradVf[celli]; } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H similarity index 96% rename from src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H index 603294c189894c5168d665642edca4ed27390a52..6c00e4deb237d75829f6f45f6c796ab649342e90 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H @@ -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 @@ -26,7 +26,8 @@ Class Description linearUpwind interpolation scheme class derived from upwind and returns - upwind weighting factors but also applies an explicit correction. + upwind weighting factors and also applies a gradient-based explicit + correction. SourceFiles linearUpwind.C diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C similarity index 98% rename from src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C index 695637e3838cc59ee896f597818de6b20fd42056..0747a3fb2b1a5c7c8709c33885d825ed5120ebe4 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C @@ -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 diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H similarity index 98% rename from src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H index 6cd31b836a144d8ee8e404302e392a6a3e719046..262d54115db81ec24feb58b905593da4d9bbe610 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H @@ -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 diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.C similarity index 59% rename from src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.C index d6a1a89cc91e72906df1c61eb463250299295d51..d0779945d330466349202bcc6b4725482aa343ee 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.C @@ -2,16 +2,16 @@ ========= | \\ / 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 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 free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -19,26 +19,20 @@ 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/>. + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ -#include "rawSurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" +#include "quadraticUpwind.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriterType(rawSurfaceWriter, bool); -makeSurfaceWriters(rawSurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + //makeSurfaceInterpolationScheme(quadraticUpwind); + makeSurfaceInterpolationTypeScheme(quadraticUpwind, scalar); + makeSurfaceInterpolationTypeScheme(quadraticUpwind, vector); +} // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.H new file mode 100644 index 0000000000000000000000000000000000000000..a2fb36f7fb227073abbb21f10153e5ecf3dea06e --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwind/quadraticUpwind.H @@ -0,0 +1,134 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2004-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 + quadraticUpwind + +Description + quadraticUpwind interpolation scheme class derived from linearUpwind and + returns blended linear/upwind weighting factors and also applies a explicit + gradient-based correction obtained from the linearUpwind scheme. + +SourceFiles + quadraticUpwind.C + +\*---------------------------------------------------------------------------*/ + +#ifndef quadraticUpwind_H +#define quadraticUpwind_H + +#include "linearUpwind.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class quadraticUpwind Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class quadraticUpwind +: + public linearUpwind<Type> +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + quadraticUpwind(const quadraticUpwind&); + + //- Disallow default bitwise assignment + void operator=(const quadraticUpwind&); + + +public: + + //- Runtime type information + TypeName("quadraticUpwind"); + + + // Constructors + + //- Construct from mesh and Istream + quadraticUpwind + ( + const fvMesh& mesh, + Istream& schemeData + ) + : + linearUpwind<Type>(mesh, schemeData) + {} + + //- Construct from mesh, faceFlux and Istream + quadraticUpwind + ( + const fvMesh& mesh, + const surfaceScalarField& faceFlux, + Istream& schemeData + ) + : + linearUpwind<Type>(mesh, faceFlux, schemeData) + {} + + + // Member Functions + + //- Return the interpolation weighting factors + virtual tmp<surfaceScalarField> weights + ( + const GeometricField<Type, fvPatchField, volMesh>& + ) const + { + return + 0.75*this->mesh().surfaceInterpolation::weights() + + 0.25*linearUpwind<Type>::weights(); + } + + //- Return true if this scheme uses an explicit correction + virtual bool corrected() const + { + return true; + } + + //- Return the explicit correction to the face-interpolate + virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > + correction + ( + const GeometricField<Type, fvPatchField, volMesh>& vf + ) const + { + return 0.25*linearUpwind<Type>::correction(vf); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 68992b0cef1f977293d5722e2be1c01761e932ef..5e7194dca8685db108016c91e6272a139e2b42a7 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -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 @@ -39,6 +39,104 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template<class Type, class CombineOp> +void volPointInterpolation::syncUntransformedData +( + List<Type>& pointData, + const CombineOp& cop +) const +{ + // Transfer onto coupled patch + const globalMeshData& gmd = mesh().globalData(); + const indirectPrimitivePatch& cpp = gmd.coupledPatch(); + const labelList& meshPoints = cpp.meshPoints(); + + const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); + const labelListList& slaves = gmd.globalPointSlaves(); + + List<Type> elems(slavesMap.constructSize()); + forAll(meshPoints, i) + { + elems[i] = pointData[meshPoints[i]]; + } + + // Pull slave data onto master. No need to update transformed slots. + slavesMap.distribute(elems, false); + + // Combine master data with slave data + forAll(slaves, i) + { + Type& elem = elems[i]; + + const labelList& slavePoints = slaves[i]; + + // Combine master with untransformed slave data + forAll(slavePoints, j) + { + cop(elem, elems[slavePoints[j]]); + } + + // Copy result back to slave slots + forAll(slavePoints, j) + { + elems[slavePoints[j]] = elem; + } + } + + // Push slave-slot data back to slaves + slavesMap.reverseDistribute(elems.size(), elems, false); + + // Extract back onto mesh + forAll(meshPoints, i) + { + pointData[meshPoints[i]] = elems[i]; + } +} + + +template<class Type> +void volPointInterpolation::pushUntransformedData +( + List<Type>& pointData +) const +{ + // Transfer onto coupled patch + const globalMeshData& gmd = mesh().globalData(); + const indirectPrimitivePatch& cpp = gmd.coupledPatch(); + const labelList& meshPoints = cpp.meshPoints(); + + const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); + const labelListList& slaves = gmd.globalPointSlaves(); + + List<Type> elems(slavesMap.constructSize()); + forAll(meshPoints, i) + { + elems[i] = pointData[meshPoints[i]]; + } + + // Combine master data with slave data + forAll(slaves, i) + { + const labelList& slavePoints = slaves[i]; + + // Copy master data to slave slots + forAll(slavePoints, j) + { + elems[slavePoints[j]] = elems[i]; + } + } + + // Push slave-slot data back to slaves + slavesMap.reverseDistribute(elems.size(), elems, false); + + // Extract back onto mesh + forAll(meshPoints, i) + { + pointData[meshPoints[i]] = elems[i]; + } +} + + template<class Type> void volPointInterpolation::addSeparated ( @@ -204,7 +302,8 @@ void volPointInterpolation::interpolateBoundaryField } // Sum collocated contributions - mesh().globalData().syncPointData(pfi, plusEqOp<Type>()); + //mesh().globalData().syncPointData(pfi, plusEqOp<Type>()); + syncUntransformedData(pfi, plusEqOp<Type>()); // And add separated contributions addSeparated(pf); @@ -213,7 +312,8 @@ void volPointInterpolation::interpolateBoundaryField // a coupled point to have its master on a different patch so // to make sure just push master data to slaves. Reuse the syncPointData // structure. - mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + //mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + pushUntransformedData(pfi); @@ -238,7 +338,8 @@ void volPointInterpolation::interpolateBoundaryField pf.correctBoundaryConditions(); // Sync any dangling points - mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + //mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + pushUntransformedData(pfi); // Apply multiple constraints on edge/corner points applyCornerConstraints(pf); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C index 38dbab79443e0ae2f3aa33bd0efa74448a990cda..72e6c5c19ddb3028e973e8038350b880166d3853 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C @@ -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 @@ -101,10 +101,11 @@ void volPointInterpolation::calcBoundaryAddressing() // no face of a certain patch still can have boundary points marked. if (debug) { - boolList oldData(isPatchPoint_); - mesh().globalData().syncPointData(isPatchPoint_, orEqOp<bool>()); + //mesh().globalData().syncPointData(isPatchPoint_, orEqOp<bool>()); + syncUntransformedData(isPatchPoint_, orEqOp<bool>()); + forAll(isPatchPoint_, pointI) { @@ -281,7 +282,8 @@ void volPointInterpolation::makeWeights() // Sum collocated contributions - mesh().globalData().syncPointData(sumWeights, plusEqOp<scalar>()); + //mesh().globalData().syncPointData(sumWeights, plusEqOp<scalar>()); + syncUntransformedData(sumWeights, plusEqOp<scalar>()); // And add separated contributions addSeparated(sumWeights); @@ -290,7 +292,8 @@ void volPointInterpolation::makeWeights() // a coupled point to have its master on a different patch so // to make sure just push master data to slaves. Reuse the syncPointData // structure. - mesh().globalData().syncPointData(sumWeights, nopEqOp<scalar>()); + //mesh().globalData().syncPointData(sumWeights, nopEqOp<scalar>()); + pushUntransformedData(sumWeights); // Normalise internal weights diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H index 2c6863f63aed5cd13480bd9531bf5b6758e40610..99ecb38641a9852ebd0df9f11bedcc1574272bf8 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H @@ -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 @@ -105,6 +105,18 @@ class volPointInterpolation //- Make patch-patch constraints void makePatchPatchAddressing(); + //- Helper: sync data on collocated points only + template<class Type, class CombineOp> + void syncUntransformedData + ( + List<Type>& pointData, + const CombineOp& cop + ) const; + + //- Helper: push master point data to collocated points + template<class Type> + void pushUntransformedData(List<Type>&) const; + //- Get boundary field in same order as boundary faces. Field is // zero on all coupled and empty patches template<class Type> diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake index 17118db81821c912197722af3720c7bba6498ddd..61d951c8c6f76481968aebcdc58dc977031103b6 100755 --- a/src/fvAgglomerationMethods/Allwmake +++ b/src/fvAgglomerationMethods/Allwmake @@ -1,7 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso MGridGenGamgAgglomeration +export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0 + +if [ -d "$ParMGridGen/MGridGen/Lib" ] +then + wmake $makeOption MGridGenGamgAgglomeration +fi # ----------------------------------------------------------------- end-of-file diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options index 80b316975051c739f21062e1a524716e274317bd..a58b65fb790b6afb05b6a09610b30a70a7c33ce7 100644 --- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options +++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options @@ -1,4 +1,4 @@ -ParMGridGen = $(WM_THIRD_PARTY_DIR)/ParMGridGen-1.0 +/* Needs ParMGridGen environment variable set. (see Allwmake script) */ TYPE_REAL= #if defined(WM_SP) diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index 92993c516ff3740ae22dd506cb43316d2f77ef19..908338e62f2a6efbcfc54eb13c3efe4e48b00466 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -1,14 +1,16 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso basic -wmake libso solidParticle -wmake libso intermediate -wmake libso dieselSpray -wmake libso dsmc -wmake libso coalCombustion +wmake $makeOption distributionModels +wmake $makeOption basic +wmake $makeOption solidParticle +wmake $makeOption intermediate +wmake $makeOption dieselSpray +wmake $makeOption dsmc +wmake $makeOption coalCombustion -molecularDynamics/Allwmake +molecularDynamics/Allwmake $* # ----------------------------------------------------------------- end-of-file diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index f344fecc2fbdc5fd710db82e3f56b6b646e41402..862665e4eead499d10a53aa21610c169e687d310 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,11 @@ License \*---------------------------------------------------------------------------*/ #include "InteractionLists.H" +#include "globalIndexAndTransform.H" +#include "indexedOctree.H" +#include "treeDataFace.H" +#include "treeDataCell.H" +#include "volFields.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -61,7 +66,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() ( procBb, allExtendedProcBbs, - globalTransforms_, + mesh_.globalData().globalTransforms(), extendedProcBbsInRange, extendedProcBbsTransformIndex, extendedProcBbsOrigProc @@ -81,6 +86,9 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() ); } + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + // Recording which cells are in range of an extended boundBox, as // only these cells will need to be tested to determine which // referred cells that they interact with. @@ -116,7 +124,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() cellIAndTToExchange.append ( - globalTransforms_.encode(cellI, transformIndex) + globalTransforms.encode(cellI, transformIndex) ); cellBbsToExchange.append(cellBb); @@ -173,14 +181,14 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() { const labelPair& ciat = cellIAndTToExchange[bbI]; - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(ciat) + globalTransforms.transformIndex(ciat) ); treeBoundBox tempTransformedBb ( - transform.invTransform(cellBbsToExchange[bbI].points()) + transform.invTransformPosition(cellBbsToExchange[bbI].points()) ); treeBoundBox extendedBb @@ -352,7 +360,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() wallFaceIAndTToExchange.append ( - globalTransforms_.encode(wallFaceI, transformIndex) + globalTransforms.encode(wallFaceI, transformIndex) ); wallFaceBbsToExchange.append(wallFaceBb); @@ -390,14 +398,14 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() { const labelPair& wfiat = wallFaceIAndTToExchange[bbI]; - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); treeBoundBox tempTransformedBb ( - transform.invTransform(wallFaceBbsToExchange[bbI].points()) + transform.invTransformPosition(wallFaceBbsToExchange[bbI].points()) ); treeBoundBox extendedBb @@ -518,11 +526,11 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() { const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWFI]; - label wallFaceIndex = globalTransforms_.index(wfiat); + label wallFaceIndex = globalTransforms.index(wfiat); - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); const face& f = mesh_.faces()[wallFaceIndex]; @@ -535,7 +543,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists() referredWallFaces_[rWFI] = referredWallFace ( face(identity(f.size())), - transform.invTransform(f.points(mesh_.points())), + transform.invTransformPosition(f.points(mesh_.points())), patchI ); } @@ -700,7 +708,7 @@ void Foam::InteractionLists<ParticleType>::findExtendedProcBbsInRange treeBoundBox extendedReferredProcBb ( - transform.transform + transform.transformPosition ( allExtendedProcBbs[procI].points() ) @@ -747,7 +755,7 @@ void Foam::InteractionLists<ParticleType>::findExtendedProcBbsInRange treeBoundBox extendedReferredProcBb ( - transform.transform + transform.transformPosition ( allExtendedProcBbs[procI].points() ) @@ -790,7 +798,7 @@ void Foam::InteractionLists<ParticleType>::findExtendedProcBbsInRange treeBoundBox extendedReferredProcBb ( - transform.transform + transform.transformPosition ( allExtendedProcBbs[procI].points() ) @@ -911,6 +919,10 @@ void Foam::InteractionLists<ParticleType>::prepareParticlesToRefer const List<DynamicList<ParticleType*> >& cellOccupancy ) { + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + + referredParticles_.setSize(cellIndexAndTransformToDistribute_.size()); // Clear all existing referred particles @@ -927,7 +939,7 @@ void Foam::InteractionLists<ParticleType>::prepareParticlesToRefer { const labelPair ciat = cellIndexAndTransformToDistribute_[i]; - label cellIndex = globalTransforms_.index(ciat); + label cellIndex = globalTransforms.index(ciat); List<ParticleType*> realParticles = cellOccupancy[cellIndex]; @@ -952,12 +964,15 @@ void Foam::InteractionLists<ParticleType>::prepareParticleToBeReferred labelPair ciat ) { - const vectorTensorTransform& transform = globalTransforms_.transform + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(ciat) + globalTransforms.transformIndex(ciat) ); - particle->position() = transform.invTransform(particle->position()); + particle->position() = transform.invTransformPosition(particle->position()); particle->transformProperties(-transform.t()); @@ -993,6 +1008,9 @@ void Foam::InteractionLists<ParticleType>::fillReferredParticleCloud() template<class ParticleType> void Foam::InteractionLists<ParticleType>::prepareWallDataToRefer() { + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + referredWallData_.setSize ( wallFaceIndexAndTransformToDistribute_.size() @@ -1004,11 +1022,11 @@ void Foam::InteractionLists<ParticleType>::prepareWallDataToRefer() { const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWVI]; - label wallFaceIndex = globalTransforms_.index(wfiat); + label wallFaceIndex = globalTransforms.index(wfiat); - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); label patchI = mesh_.boundaryMesh().patchID() @@ -1088,7 +1106,6 @@ Foam::InteractionLists<ParticleType>::InteractionLists(const polyMesh& mesh) writeCloud_(false), cellMapPtr_(), wallFaceMapPtr_(), - globalTransforms_(mesh_), maxDistance_(0.0), dil_(), dwfil_(), @@ -1117,7 +1134,6 @@ Foam::InteractionLists<ParticleType>::InteractionLists writeCloud_(writeCloud), cellMapPtr_(), wallFaceMapPtr_(), - globalTransforms_(mesh_), maxDistance_(maxDistance), dil_(), dwfil_(), diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.H b/src/lagrangian/basic/InteractionLists/InteractionLists.H index 5d9d9f811514d3bd63437e46fe38a4a586ea6d43..545bb81e111afc8fe9ea0fd1e799b9f0a75fe10b 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.H +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.H @@ -60,21 +60,17 @@ SourceFiles #define InteractionLists_H #include "polyMesh.H" -#include "globalIndexAndTransform.H" #include "referredWallFace.H" -#include "indexedOctree.H" -#include "Tuple2.H" -#include "treeDataCell.H" -#include "treeDataFace.H" -#include "mapDistribute.H" -#include "volFields.H" -#include "Random.H" +//#include "mapDistribute.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +class globalIndexAndTransform; +class mapDistribute; + /*---------------------------------------------------------------------------*\ Class InteractionLists Declaration \*---------------------------------------------------------------------------*/ @@ -100,10 +96,6 @@ class InteractionLists //- mapDistribute to exchange wall face data autoPtr<mapDistribute> wallFaceMapPtr_; - //- Storage and encoding/decoding for all possible transforms - // of the geometry - globalIndexAndTransform globalTransforms_; - //- Maximum distance over which interactions will be detected scalar maxDistance_; @@ -259,9 +251,6 @@ public: //- Return access to the wallFaceMap inline const mapDistribute& wallFaceMap() const; - //- Return access to the globalTransforms - inline const globalIndexAndTransform& globalTransforms() const; - //- Return access to the direct interaction list inline const labelListList& dil() const; diff --git a/src/lagrangian/basic/InteractionLists/InteractionListsI.H b/src/lagrangian/basic/InteractionLists/InteractionListsI.H index 1b61942f5eb671c6f97db05efbf25527b1b7b6bb..c793dc0e6369951aa9a868934d747c60f542e313 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionListsI.H +++ b/src/lagrangian/basic/InteractionLists/InteractionListsI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,14 +50,6 @@ Foam::InteractionLists<ParticleType>::wallFaceMap() const } -template<class ParticleType> -const Foam::globalIndexAndTransform& -Foam::InteractionLists<ParticleType>::globalTransforms() const -{ - return globalTransforms_; -} - - template<class ParticleType> const Foam::labelListList& Foam::InteractionLists<ParticleType>::dil() const { diff --git a/src/lagrangian/basic/Make/files b/src/lagrangian/basic/Make/files index c226859e6e093c2337ccd1f7c938ede440d80b21..cca45409c6963e9b9e4b40f5c7e8235229462a79 100644 --- a/src/lagrangian/basic/Make/files +++ b/src/lagrangian/basic/Make/files @@ -4,8 +4,6 @@ indexedParticle = indexedParticle $(passiveParticle)/passiveParticleCloud.C $(indexedParticle)/indexedParticleCloud.C -InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C -InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C InteractionLists/referredWallFace/referredWallFace.C LIB = $(FOAM_LIBBIN)/liblagrangian diff --git a/src/lagrangian/coalCombustion/Make/options b/src/lagrangian/coalCombustion/Make/options index 763b6cc2486a3d539cbce76e43fce03fbc28a74b..33cc415fdf5eabc427030b0dd4ae94b955fcfd10 100644 --- a/src/lagrangian/coalCombustion/Make/options +++ b/src/lagrangian/coalCombustion/Make/options @@ -3,16 +3,16 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ @@ -25,13 +25,13 @@ LIB_LIBS = \ -lmeshTools \ -llagrangian \ -llagrangianIntermediate \ - -lpdf \ + -ldistributionModels \ -lspecie \ -lbasicThermophysicalModels \ - -lliquids \ - -lliquidMixture \ - -lpointSolids \ - -lpointSolidMixture \ + -lliquidProperties \ + -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ -lreactionThermophysicalModels \ -lSLGThermo \ -lcompressibleRASModels \ diff --git a/src/lagrangian/dieselSpray/Make/options b/src/lagrangian/dieselSpray/Make/options index 40cb013fbb7939a2c04f5e346bd6619018400346..4d4eba8a2d56feae98e84bda81839c7e71c82a1f 100644 --- a/src/lagrangian/dieselSpray/Make/options +++ b/src/lagrangian/dieselSpray/Make/options @@ -8,12 +8,12 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/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/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude LIB_LIBS = \ -llagrangian \ @@ -22,8 +22,8 @@ LIB_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lLESdeltas \ - -lliquids \ - -lliquidMixture \ + -lliquidProperties \ + -lliquidMixtureProperties \ -lthermophysicalFunctions \ -lspecie \ - -lpdf + -ldistributionModels diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C index a8c6e028626a4ce4df7b20ad779cbc815d136699..e1c722dc09f162a43ecd2671f92743568e1fa9ac 100644 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C +++ b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C @@ -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 @@ -400,7 +400,7 @@ Foam::scalar Foam::commonRailInjector::injectedMass void Foam::commonRailInjector::correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) { diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H index e29bbfcf8b05aa24a0e60e28ab9a6b2bf74f630c..876842b7cdacf0ada60efaa1d5040f3d29a52428 100644 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H +++ b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H @@ -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 @@ -213,7 +213,7 @@ public: void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ); diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C index 27b7e4ddd7b94969395994ee53de3e38684f1cb1..c2de30e258e8952c8bc7a5902784c5a2d23cf29c 100644 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C +++ b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C @@ -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 @@ -366,7 +366,7 @@ Foam::scalar Foam::definedInjector::injectedMass void Foam::definedInjector::correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) { diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H index 529eef58f5a182fa02755035a751f22ed038224f..c436c1e4fbe3923e9ea5cd1aab9031583878c2f8 100644 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H +++ b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H @@ -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 @@ -218,7 +218,7 @@ public: void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ); diff --git a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H index aa3b30611ca9c052c161dc0e23f13f32a8d17ba7..148ca0eaf1f4acfd7014ea0580c95d9c50b38830 100644 --- a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H +++ b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H @@ -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,7 @@ SourceFiles #include "vector.H" #include "scalarField.H" #include "cachedRandom.H" -#include "liquidMixture.H" +#include "liquidMixtureProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -218,7 +218,7 @@ public: virtual void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) = 0; }; diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C index fbd957ccfb0b9047ad4e547bee6e63e4fb8b180e..760c26d118c893f496e04e775e1b36048a4a14ca 100644 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C +++ b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C @@ -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 @@ -420,7 +420,7 @@ Foam::scalar Foam::multiHoleInjector::injectedMass void Foam::multiHoleInjector::correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) { diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H index 4af479631e3bcd94f9a3aa0dff9e152f7b1957da..d0fd0a2ebba1529a6418dc40d8daa4426b5217a3 100644 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H +++ b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H @@ -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 @@ -223,7 +223,7 @@ public: void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ); diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index 795f548bc393f1ce06de5664fd4327212e60a31f..1c0607dd53717f54385ea03bd219c417de5d4764 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -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 @@ -409,7 +409,7 @@ Foam::scalar Foam::swirlInjector::injectedMass void Foam::swirlInjector::correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) { diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H index 59acf5596e5cd169f0ef4af6d7fa329995779f56..55ad8276efa5017056a24595b0ce820377fe52ef 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H @@ -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 @@ -232,7 +232,7 @@ public: void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ); diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C index 241b7cb11385961a6210e8e493ff0425d22828fb..f7c5c4214a3f1e047e5e502396b24bb71b18f357 100644 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C +++ b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C @@ -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 @@ -357,7 +357,7 @@ Foam::scalar Foam::unitInjector::injectedMass(const scalar t) const void Foam::unitInjector::correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ) { diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H index 2df163b402e362d5d69ca2985546f01b8baab215..54fab69d486c6d907222a68d3c581131e738eadd 100644 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H +++ b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H @@ -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 @@ -212,7 +212,7 @@ public: void correctProfiles ( - const liquidMixture& fuel, + const liquidMixtureProperties& fuel, const scalar referencePressure ); diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index 45f24d02769d2b61def0c74d8944e80ab1141fb9..2f2516813939e6be4402fc56756765110c929385 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -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 @@ -99,7 +99,7 @@ bool Foam::parcel::move(spray& sDB, const scalar trackTime) const polyMesh& mesh = cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); - const liquidMixture& fuels = sDB.fuels(); + const liquidMixtureProperties& fuels = sDB.fuels(); label Nf = fuels.components().size(); label Ns = sDB.composition().Y().size(); @@ -333,7 +333,7 @@ void Foam::parcel::updateParcelProperties const label faceI ) { - const liquidMixture& fuels = sDB.fuels(); + const liquidMixtureProperties& fuels = sDB.fuels(); label Nf = sDB.fuels().components().size(); label Ns = sDB.composition().Y().size(); diff --git a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C index 6a8d8c6a6ba2e76320a78f821ccea4fe6bdf44f9..c1a289c719dc03c31ab2a6729415ed30eee02dc8 100644 --- a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C +++ b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C @@ -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 @@ -51,7 +51,7 @@ void Foam::parcel::setRelaxationTimes const scalar dt ) { - const liquidMixture& fuels = sDB.fuels(); + const liquidMixtureProperties& fuels = sDB.fuels(); scalar mCell = rho*sDB.mesh().V()[cell()]; scalarField mfg(Yfg*mCell); diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index ef983481878e33b8f72688458e32b5d4159e3034..dbacb3bfa9910a4bf6bcebb31c3fdb08bfb4ce76 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -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 @@ -169,7 +169,7 @@ Foam::spray::spray fuels_ ( - liquidMixture::New + liquidMixtureProperties::New ( mesh_.lookupObject<dictionary>("thermophysicalProperties") ) diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H index 6eef87400fb08db6ccf00e44a0399a74cba813bc..9ba9375c80f8d2173e7e9354bcbb70421b173938 100644 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ b/src/lagrangian/dieselSpray/spray/spray.H @@ -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 @@ -32,13 +32,13 @@ Description #ifndef spray_H #define spray_H +#include "autoPtr.H" #include "parcel.H" #include "injector.H" #include "IOPtrList.H" #include "interpolation.H" -#include "liquid.H" -#include "autoPtr.H" -#include "liquidMixture.H" +#include "liquidProperties.H" +#include "liquidMixtureProperties.H" #include "cachedRandom.H" #include "thermoPhysicsTypes.H" @@ -115,7 +115,7 @@ class spray autoPtr<breakupModel> breakupModel_; autoPtr<collisionModel> collisionModel_; autoPtr<dispersionModel> dispersionModel_; - autoPtr<liquidMixture> fuels_; + autoPtr<liquidMixtureProperties> fuels_; autoPtr<injectorModel> injectorModel_; @@ -254,7 +254,7 @@ public: inline label subCycles() const; inline const vector& g() const; - inline const liquidMixture& fuels() const; + inline const liquidMixtureProperties& fuels() const; inline const PtrList<gasThermoPhysics>& gasProperties() const; inline const basicMultiComponentMixture& composition() const; diff --git a/src/lagrangian/dieselSpray/spray/sprayI.H b/src/lagrangian/dieselSpray/spray/sprayI.H index e11bd085327f29fe5496988c47c43d8db4c61767..740d0453c74a8efc271bdc49619cdffd749652d7 100644 --- a/src/lagrangian/dieselSpray/spray/sprayI.H +++ b/src/lagrangian/dieselSpray/spray/sprayI.H @@ -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 @@ -236,7 +236,7 @@ inline const Foam::vector& Foam::spray::g() const } -inline const Foam::liquidMixture& Foam::spray::fuels() const +inline const Foam::liquidMixtureProperties& Foam::spray::fuels() const { return fuels_(); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C index 682b2ebfafc1fbfe2a800af2bdaf11371748b663..b0bf8b74ebf5e6f3baed575d41a500c63af92a8f 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C @@ -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 @@ -74,7 +74,7 @@ void Foam::LISA::atomizeParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { const PtrList<volScalarField>& Y = spray_.composition().Y(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H index eade4f966c1b805d0d5217abdfb68b45c1533597..9668e86404f44de429dfd246b52f6e884b320cfd 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H @@ -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 @@ -97,7 +97,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H index 59b20f929fc6a019ce493eb1a25816ab3b7f82ed..55ff9dfc909d0e1253c1bb4881ef0f728535ecb2 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H @@ -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 @@ -104,7 +104,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const = 0; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C index 3e243038262cc7e1d244f20221946337c3bdb0ff..7824e726a29691ccd3010cb6f455eef26212e098 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C @@ -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 @@ -73,7 +73,7 @@ void Foam::blobsSheetAtomization::atomizeParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { const PtrList<volScalarField>& Y = spray_.composition().Y(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H index 2af3301cdbb788d28ff5672eddf541f300fbc9a6..ee2dfdac2879767df03aca4027a8a3fc34856ac9 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H @@ -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 @@ -92,7 +92,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C index 76fa010e5e6c3a744a3fbb58a978033d059119dd..68b29c9084b557c2cb5b0c3a45c56b7f8abc74d2 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C @@ -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 @@ -69,7 +69,7 @@ void Foam::noAtomization::atomizeParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { p.liquidCore() = 0.0; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H index fbbde6326f42f63b4ab93c80fc3464b4bda611c9..835a4e767f7c6b7db231297b7d61ac00c6e9df62 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H @@ -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 @@ -71,7 +71,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C index 8a16cf6cc294daed38575fa11ed27acb43cb07c4..260740dd985ac5df9966c48c065258d9ee8f64bc 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C @@ -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 @@ -79,7 +79,7 @@ void Foam::ETAB::breakupParcel parcel& p, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { scalar T = p.T(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H index 463f47f92e58e20941051316c449e3a4e58fb3d4..d1502014ba364880a28b612d5409f344aa26c3e6 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H @@ -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 @@ -111,7 +111,7 @@ public: parcel& parcel, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C index e8ac0b90796ab07370d54751e30a72c81aa1536a..7e4ba37eebef18453d5246d1c4ef1c6544ead253 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C @@ -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 @@ -98,7 +98,7 @@ void Foam::SHF::breakupParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { label cellI = p.cell(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H index af3dedaa179a2f084807b01ebfc7efbf6a8e4c0c..1f7f984a826750b5d6af0b40c0e06020253b36f7 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H @@ -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 @@ -133,7 +133,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C index 8b121c622e642fdc9e5f22cbab200f4ca16957c3..2189382e34aa389312888b0c842f36240d3b3aed 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C @@ -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 @@ -84,7 +84,7 @@ void Foam::TAB::breakupParcel parcel& p, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { scalar T = p.T(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H index f28eb559addb148c889f86ef7e47c92c50a57144..7b96b28d15baa72fc3afaee7502a920958d22e18 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H @@ -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 @@ -108,7 +108,7 @@ public: parcel& parcel, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C index 61636ad1769518d440c9da7a8c7b4111ed4f3919..78efbc2ccbba87ffa98580217858871e0e2774fe 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C @@ -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 @@ -78,7 +78,7 @@ void Foam::breakupModel::updateParcelProperties parcel& p, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { if (includeOscillation_) diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H index 6c410479f48597d6c85f4db4e260828c7239c5a4..01079023dc13e2acc2587256fac6bd9928b16c4f 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H @@ -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 @@ -126,7 +126,7 @@ public: parcel& p, const scalar deltaT, const vector& Ug, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; virtual void breakupParcel @@ -134,7 +134,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const = 0; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C index 5bd1443461ac178ed8f7ea039e4779fb1cc2603c..f4ef3324c7a44bb0f6e6880b3662fabeccb90261 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C @@ -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 diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C index 216b51d6fe149cd0b98593cea36b2308cea8bd6a..5c96b6907ee7603e6f8e60fe89d19b148a8ec227 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C @@ -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 @@ -69,7 +69,7 @@ void Foam::noBreakup::breakupParcel parcel&, const scalar, const vector&, - const liquidMixture& + const liquidMixtureProperties& ) const { // Do nothing diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H index db2b9e627ba49d84506d394e780fabc27626c724..f474d86966356c8b42fc4b23443ac6caf7beb0df 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H @@ -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 @@ -75,7 +75,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C index aefd1679bee9585d0a104234f61fb67aafc45d84..d7798cff98d0621f8309c679c32c50a6d71a5fe3 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C @@ -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 @@ -73,7 +73,7 @@ void Foam::reitzDiwakar::breakupParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { const PtrList<volScalarField>& Y = spray_.composition().Y(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H index c36e4e6916c58fcb3bd46bff18b59391b044d6b7..16459fa5227edf4874f4363cb263074803345e41 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H @@ -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 @@ -87,7 +87,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C index 7556a97b63d83e201a98f69f14c3266788092ac4..51b714f831ae5aa35e92e151499c007cef19672d 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C @@ -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 @@ -75,7 +75,7 @@ void Foam::reitzKHRT::breakupParcel parcel& p, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const { label cellI = p.cell(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H index 7895f8573a20a8785487e6890fd9339f6ceed32c..67ebff166cfaeb94e945d78eb319d9da1ccb6388 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H @@ -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 @@ -91,7 +91,7 @@ public: parcel& parcel, const scalar deltaT, const vector& vel, - const liquidMixture& fuels + const liquidMixtureProperties& fuels ) const; }; diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C index 4f80e0c57709f616aa5be0aa00246f362144d3da..9332f97b5ad1edd6be0980e0d05607e96549e5c6 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C @@ -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 @@ -52,11 +52,11 @@ Foam::ChomiakInjector::ChomiakInjector : injectorModel(dict, sm), ChomiakDict_(dict.subDict(typeName + "Coeffs")), - dropletPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - ChomiakDict_.subDict("dropletPDF"), + ChomiakDict_.subDict("sizeDistribution"), sm.rndGen() ) ), @@ -101,7 +101,7 @@ Foam::scalar Foam::ChomiakInjector::d0 const scalar ) const { - return dropletPDF_->sample(); + return sizeDistribution_->sample(); } @@ -113,8 +113,8 @@ Foam::vector Foam::ChomiakInjector::direction const scalar d ) const { - scalar dMin = dropletPDF_->minValue(); - scalar dMax = dropletPDF_->maxValue(); + scalar dMin = sizeDistribution_->minValue(); + scalar dMax = sizeDistribution_->maxValue(); scalar angle = (d - dMax)*maxSprayAngle_[n] diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H index 41ca27335d85d2a1aac4513ec4af52f91ac34da5..861b19b72c246e39da0109275f3303c88cf98300 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H @@ -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 @@ Class Description Injector model based on an idea of Jerzy Chomiak. - Given the initial droplet size pdf in an interval d = (d0, d1), + Given the initial droplet size distribution in an interval d = (d0, d1), the spray angle phi = phi(d), such that the largest droplets have zero spray angle and the smallest droplets have maximum spray angle. @@ -41,7 +41,7 @@ Description #include "injectorModel.H" #include "scalarList.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,7 +63,7 @@ private: dictionary ChomiakDict_; - autoPtr<pdfs::pdf> dropletPDF_; + autoPtr<distributionModels::distributionModel> sizeDistribution_; scalarList maxSprayAngle_; diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C index 1fc417ba6f7580035283f2e666bd0042a66527b0..4282d5ec634d549d0dc041f29c41c3771a93aa72 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C @@ -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 @@ -52,11 +52,11 @@ Foam::definedHollowConeInjector::definedHollowConeInjector : injectorModel(dict, sm), definedHollowConeDict_(dict.subDict(typeName + "Coeffs")), - dropletPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - definedHollowConeDict_.subDict("dropletPDF"), + definedHollowConeDict_.subDict("sizeDistribution"), sm.rndGen() ) ), @@ -137,8 +137,8 @@ Foam::scalar Foam::definedHollowConeInjector::d0 ) const { // swallow function arguments - not used - // return value sampled from PDF - return dropletPDF_->sample(); + // return value sampled from distribution model + return sizeDistribution_->sample(); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H index 469b0e0ae55a34de41539090f4ad28b35c93e8fe..8da81dcd2cb89982ab581e46eba3e4004d1ada46 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H @@ -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 @@ -29,7 +29,7 @@ Description - user defined: - inner/outer cone angle vs. time - - droplet PDF + - droplet distribution model \*---------------------------------------------------------------------------*/ @@ -38,7 +38,7 @@ Description #include "injectorModel.H" #include "vector.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,7 +60,7 @@ private: typedef VectorSpace<Vector<scalar>, scalar, 2> pair; dictionary definedHollowConeDict_; - autoPtr<pdfs::pdf> dropletPDF_; + autoPtr<distributionModels::distributionModel> sizeDistribution_; // inner and outer cone angle time histories // 2 column vectors = (time, coneAngle) diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C index 590637f54f6b56884776139dc6dd6927e5f76138..84e4bec6dfeac6359f85c6262f6e67516fec34ff 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C @@ -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 @@ -97,7 +97,7 @@ Foam::scalar Foam::definedPressureSwirlInjector::d0 // modifications to take account of flash boiling.... - const liquidMixture& fuels = sm_.fuels(); + const liquidMixtureProperties& fuels = sm_.fuels(); scalar chi = 0.0; scalar Tinj = it.T(t); label Nf = fuels.components().size(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C index 3be1a660f1a2b8305c64d16d750623abd931bffb..eb358ae7b4452ba1cc0afe757a31821b36345fbf 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C @@ -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 @@ -52,11 +52,11 @@ Foam::hollowConeInjector::hollowConeInjector : injectorModel(dict, sm), hollowConeDict_(dict.subDict(typeName + "Coeffs")), - dropletPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - hollowConeDict_.subDict("dropletPDF"), + hollowConeDict_.subDict("sizeDistribution"), sm.rndGen() ) ), @@ -112,7 +112,7 @@ Foam::scalar Foam::hollowConeInjector::d0 const scalar ) const { - return dropletPDF_->sample(); + return sizeDistribution_->sample(); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H index 6c956df4658a3422c56ae70b1d258bbfc62cf25c..abb59667b91636d144f2940b4f15e23acf6c1175 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H @@ -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 @@ -37,7 +37,7 @@ Description #include "injectorModel.H" #include "scalarList.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ private: dictionary hollowConeDict_; - autoPtr<pdfs::pdf> dropletPDF_; + autoPtr<distributionModels::distributionModel> sizeDistribution_; scalarList innerAngle_; scalarList outerAngle_; diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H index c0e6998eccac0c2ccf587054b2108e0c16fd5785..d17cbc3e9dd84de5e8d8935fc7dd13387cce81d9 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H @@ -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 @@ -34,7 +34,7 @@ Description #ifndef injectorModel_H #define injectorModel_H -#include "liquid.H" +#include "liquidProperties.H" #include "injector.H" #include "PtrList.H" #include "IOdictionary.H" diff --git a/src/thermophysicalModels/pdfs/Make/files b/src/lagrangian/distributionModels/Make/files similarity index 56% rename from src/thermophysicalModels/pdfs/Make/files rename to src/lagrangian/distributionModels/Make/files index e032b86bc52be99672ae84f30a90035956b266a1..c7b621cf58f61832e575a0e71ad3e27fcd990119 100644 --- a/src/thermophysicalModels/pdfs/Make/files +++ b/src/lagrangian/distributionModels/Make/files @@ -1,5 +1,5 @@ -pdf/pdf.C -pdf/pdfNew.C +distributionModel/distributionModel.C +distributionModel/distributionModelNew.C exponential/exponential.C fixedValue/fixedValue.C @@ -9,4 +9,4 @@ normal/normal.C RosinRammler/RosinRammler.C uniform/uniform.C -LIB = $(FOAM_LIBBIN)/libpdf +LIB = $(FOAM_LIBBIN)/libdistributionModels diff --git a/src/thermophysicalModels/pdfs/Make/options b/src/lagrangian/distributionModels/Make/options similarity index 100% rename from src/thermophysicalModels/pdfs/Make/options rename to src/lagrangian/distributionModels/Make/options diff --git a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C similarity index 69% rename from src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C rename to src/lagrangian/distributionModels/RosinRammler/RosinRammler.C index a39d48aa69b4c5c2dae7251a428a0b85382777ae..f3338f92efff09ab22c89769a45d7051f86da419 100644 --- a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C +++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C @@ -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 @@ -30,34 +30,34 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(RosinRammler, 0); - addToRunTimeSelectionTable(pdf, RosinRammler, dictionary); + addToRunTimeSelectionTable(distributionModel, RosinRammler, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::RosinRammler::RosinRammler +Foam::distributionModels::RosinRammler::RosinRammler ( const dictionary& dict, cachedRandom& rndGen ) : - pdf(typeName, dict, rndGen), - minValue_(readScalar(pdfDict_.lookup("minValue"))), - maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - d_(readScalar(pdfDict_.lookup("d"))), - n_(readScalar(pdfDict_.lookup("n"))) + distributionModel(typeName, dict, rndGen), + minValue_(readScalar(distributionModelDict_.lookup("minValue"))), + maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), + d_(readScalar(distributionModelDict_.lookup("d"))), + n_(readScalar(distributionModelDict_.lookup("n"))) { check(); } -Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p) +Foam::distributionModels::RosinRammler::RosinRammler(const RosinRammler& p) : - pdf(p), + distributionModel(p), minValue_(p.minValue_), maxValue_(p.maxValue_), d_(p.d_), @@ -67,13 +67,13 @@ Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::RosinRammler::~RosinRammler() +Foam::distributionModels::RosinRammler::~RosinRammler() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::RosinRammler::sample() const +Foam::scalar Foam::distributionModels::RosinRammler::sample() const { scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_)); scalar y = rndGen_.sample01<scalar>(); @@ -82,13 +82,13 @@ Foam::scalar Foam::pdfs::RosinRammler::sample() const } -Foam::scalar Foam::pdfs::RosinRammler::minValue() const +Foam::scalar Foam::distributionModels::RosinRammler::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::RosinRammler::maxValue() const +Foam::scalar Foam::distributionModels::RosinRammler::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H similarity index 86% rename from src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H rename to src/lagrangian/distributionModels/RosinRammler/RosinRammler.H index eb03127686c3aff70876fb67d2e1a75bffa8317f..8fd67cc5a4c2a2327ac5d8f1bc33d856609f799a 100644 --- a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H +++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H @@ -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,10 +25,10 @@ Class Foam::RosinRammler Description - Rosin-Rammler pdf + Rosin-Rammler distributionModel @f[ - cumulative pdf = + cumulative model = (1.0 - exp( -(( x - d0)/d)^n ) / (1.0 - exp( -((d1 - d0)/d)^n ) @f] @@ -42,13 +42,13 @@ SourceFiles #ifndef RosinRammler_H #define RosinRammler_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -57,7 +57,7 @@ namespace pdfs class RosinRammler : - public pdf + public distributionModel { // Private data @@ -88,9 +88,9 @@ public: RosinRammler(const RosinRammler& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new RosinRammler(*this)); + return autoPtr<distributionModel>(new RosinRammler(*this)); } @@ -100,7 +100,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -113,7 +113,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/pdf/pdf.C b/src/lagrangian/distributionModels/distributionModel/distributionModel.C similarity index 54% rename from src/thermophysicalModels/pdfs/pdf/pdf.C rename to src/lagrangian/distributionModels/distributionModel/distributionModel.C index 14f6d659c063cc3d36bb8ae824bc7b28f6e8b863..e2be585969b8237bd4f945c507d44e6704c017a8 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdf.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModel.C @@ -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,36 +23,36 @@ License \*---------------------------------------------------------------------------*/ -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - namespace pdfs + namespace distributionModels { - defineTypeNameAndDebug(pdf, 0); - defineRunTimeSelectionTable(pdf, dictionary); + defineTypeNameAndDebug(distributionModel, 0); + defineRunTimeSelectionTable(distributionModel, dictionary); } } // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -void Foam::pdfs::pdf::check() const +void Foam::distributionModels::distributionModel::check() const { if (minValue() < 0) { - FatalErrorIn("pdfs::pdf::check() const") - << type() << "PDF: Minimum value must be greater than zero." << nl - << "Supplied minValue = " << minValue() + FatalErrorIn("distributionModels::distributionModel::check() const") + << type() << "distribution: Minimum value must be greater than " + << "zero." << nl << "Supplied minValue = " << minValue() << abort(FatalError); } if (maxValue() < minValue()) { - FatalErrorIn("pdfs::pdf::check() const") - << type() << "PDF: Maximum value is smaller than the minimum value:" - << nl << " maxValue = " << maxValue() + FatalErrorIn("distributionModels::distributionModel::check() const") + << type() << "distribution: Maximum value is smaller than the " + << "minimum value:" << nl << " maxValue = " << maxValue() << ", minValue = " << minValue() << abort(FatalError); } @@ -61,50 +61,65 @@ void Foam::pdfs::pdf::check() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::pdf::pdf +Foam::distributionModels::distributionModel::distributionModel ( const word& name, const dictionary& dict, cachedRandom& rndGen ) : - pdfDict_(dict.subDict(name + "PDF")), + distributionModelDict_(dict.subDict(name + "Distribution")), rndGen_(rndGen) {} -Foam::pdfs::pdf::pdf(const pdf& p) +Foam::distributionModels::distributionModel::distributionModel +( + const distributionModel& p +) : - pdfDict_(p.pdfDict_), + distributionModelDict_(p.distributionModelDict_), rndGen_(p.rndGen_) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::pdf::~pdf() +Foam::distributionModels::distributionModel::~distributionModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::pdf::sample() const +Foam::scalar Foam::distributionModels::distributionModel::sample() const { - notImplemented("Foam::scalar Foam::pdfs::pdf::sample() const"); + notImplemented + ( + "Foam::scalar " + "Foam::distributionModels::distributionModel::sample() const" + ); return 0.0; } -Foam::scalar Foam::pdfs::pdf::minValue() const +Foam::scalar Foam::distributionModels::distributionModel::minValue() const { - notImplemented("Foam::scalar Foam::pdfs::pdf::minValue() const"); + notImplemented + ( + "Foam::scalar " + "Foam::distributionModels::distributionModel::minValue() const" + ); return 0.0; } -Foam::scalar Foam::pdfs::pdf::maxValue() const +Foam::scalar Foam::distributionModels::distributionModel::maxValue() const { - notImplemented("Foam::scalar Foam::pdfs::pdf::maxValue() const"); + notImplemented + ( + "Foam::scalar " + "Foam::distributionModels::distributionModel::maxValue() const" + ); return 0.0; } diff --git a/src/thermophysicalModels/pdfs/pdf/pdf.H b/src/lagrangian/distributionModels/distributionModel/distributionModel.H similarity index 68% rename from src/thermophysicalModels/pdfs/pdf/pdf.H rename to src/lagrangian/distributionModels/distributionModel/distributionModel.H index d61ace2649dd9276a320047bd9d393e45f124e32..26c6eaa5a4be1bef70971b7b0ce65c328b76e5b8 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdf.H +++ b/src/lagrangian/distributionModels/distributionModel/distributionModel.H @@ -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,14 +22,14 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::pdf + Foam::distributionModel Description - A library of runtime-selectable PDF's. + A library of runtime-selectable distribution models. Returns a sampled value given the expectation (nu) and variance (sigma^2) - Current PDF's include: + Current distribution models include: - exponential - fixedValue - general @@ -38,19 +38,19 @@ Description - Rosin-Rammler - uniform - The pdf is tabulated in equidistant nPoints, in an interval. - These values are integrated to obtain the cumulated PDF, + The distributionModel is tabulated in equidistant nPoints, in an interval. + These values are integrated to obtain the cumulated distribution model, which is then used to change the distribution from unifrom to - the actual pdf. + the actual distributionModel. SourceFiles - pdf.C - pdfNew.C + distributionModel.C + distributionModelNew.C \*---------------------------------------------------------------------------*/ -#ifndef pdf_H -#define pdf_H +#ifndef distributionModel_H +#define distributionModel_H #include "IOdictionary.H" #include "autoPtr.H" @@ -60,14 +60,14 @@ SourceFiles namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ - Class pdf Declaration + Class distributionModel Declaration \*---------------------------------------------------------------------------*/ -class pdf +class distributionModel { protected: @@ -75,7 +75,7 @@ protected: // Protected data //- Coefficients dictionary - const dictionary pdfDict_; + const dictionary distributionModelDict_; //- Reference to the random number generator cachedRandom& rndGen_; @@ -83,21 +83,21 @@ protected: // Protected Member Functions - //- Check that the PDF is valid + //- Check that the distribution model is valid virtual void check() const; public: //-Runtime type information - TypeName("pdf"); + TypeName("distributionModel"); //- Declare runtime constructor selection table declareRunTimeSelectionTable ( autoPtr, - pdf, + distributionModel, dictionary, ( const dictionary& dict, @@ -110,29 +110,38 @@ public: // Constructors //- Construct from dictionary - pdf(const word& name, const dictionary& dict, cachedRandom& rndGen); + distributionModel + ( + const word& name, + const dictionary& dict, + cachedRandom& rndGen + ); //- Construct copy - pdf(const pdf& p); + distributionModel(const distributionModel& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new pdf(*this)); + return autoPtr<distributionModel>(new distributionModel(*this)); } //- Selector - static autoPtr<pdf> New(const dictionary& dict, cachedRandom& rndGen); + static autoPtr<distributionModel> New + ( + const dictionary& dict, + cachedRandom& rndGen + ); //- Destructor - virtual ~pdf(); + virtual ~distributionModel(); // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -145,7 +154,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/pdf/pdfNew.C b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C similarity index 68% rename from src/thermophysicalModels/pdfs/pdf/pdfNew.C rename to src/lagrangian/distributionModels/distributionModel/distributionModelNew.C index 634972ceb7695d44ea84e140685816fafebd6084..7084be427565e96ef4be50bd62fdae8f90f6fc6c 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdfNew.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C @@ -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,33 +23,41 @@ License \*---------------------------------------------------------------------------*/ -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::pdfs::pdf> Foam::pdfs::pdf::New +Foam::autoPtr<Foam::distributionModels::distributionModel> +Foam::distributionModels::distributionModel::New ( const dictionary& dict, cachedRandom& rndGen ) { - const word modelType(dict.lookup("pdfType")); + const word modelType(dict.lookup("distributionModelType")); - Info<< "Selecting pdfType " << modelType << endl; + Info<< "Selecting distributionModelType " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("pdfs::pdf::New(const dictionary&, cachedRandom&)") - << "Unknown pdf type " << modelType << nl << nl - << "Valid pdf types are:" << nl + FatalErrorIn + ( + "distributionModels::distributionModel::New" + "(" + "const dictionary&, " + "cachedRandom&" + ")" + ) + << "Unknown distributionModel type " << modelType << nl << nl + << "Valid distributionModel types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<pdf>(cstrIter()(dict, rndGen)); + return autoPtr<distributionModel>(cstrIter()(dict, rndGen)); } diff --git a/src/thermophysicalModels/pdfs/exponential/exponential.C b/src/lagrangian/distributionModels/exponential/exponential.C similarity index 70% rename from src/thermophysicalModels/pdfs/exponential/exponential.C rename to src/lagrangian/distributionModels/exponential/exponential.C index 2eba8cef5c6c781c0d247ee3e271748432e22b9c..e9bc6f4edf021ae73c12017bab95c69c00a047bb 100644 --- a/src/thermophysicalModels/pdfs/exponential/exponential.C +++ b/src/lagrangian/distributionModels/exponential/exponential.C @@ -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 @@ -30,33 +30,33 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(exponential, 0); - addToRunTimeSelectionTable(pdf, exponential, dictionary); + addToRunTimeSelectionTable(distributionModel, exponential, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::exponential::exponential +Foam::distributionModels::exponential::exponential ( const dictionary& dict, cachedRandom& rndGen ) : - pdf(typeName, dict, rndGen), - minValue_(readScalar(pdfDict_.lookup("minValue"))), - maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - lambda_(readScalar(pdfDict_.lookup("lambda"))) + distributionModel(typeName, dict, rndGen), + minValue_(readScalar(distributionModelDict_.lookup("minValue"))), + maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), + lambda_(readScalar(distributionModelDict_.lookup("lambda"))) { check(); } -Foam::pdfs::exponential::exponential(const exponential& p) +Foam::distributionModels::exponential::exponential(const exponential& p) : - pdf(p), + distributionModel(p), minValue_(p.minValue_), maxValue_(p.maxValue_), lambda_(p.lambda_) @@ -65,13 +65,13 @@ Foam::pdfs::exponential::exponential(const exponential& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::exponential::~exponential() +Foam::distributionModels::exponential::~exponential() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::exponential::sample() const +Foam::scalar Foam::distributionModels::exponential::sample() const { scalar y = rndGen_.sample01<scalar>(); scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_); @@ -79,13 +79,13 @@ Foam::scalar Foam::pdfs::exponential::sample() const } -Foam::scalar Foam::pdfs::exponential::minValue() const +Foam::scalar Foam::distributionModels::exponential::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::exponential::maxValue() const +Foam::scalar Foam::distributionModels::exponential::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/exponential/exponential.H b/src/lagrangian/distributionModels/exponential/exponential.H similarity index 86% rename from src/thermophysicalModels/pdfs/exponential/exponential.H rename to src/lagrangian/distributionModels/exponential/exponential.H index 6b012c3c641fa4c098c87e4c886ce6ff6b04299d..c0211d3550067ea8961724f4861a3ed06b0654cb 100644 --- a/src/thermophysicalModels/pdfs/exponential/exponential.H +++ b/src/lagrangian/distributionModels/exponential/exponential.H @@ -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 @@ Class Foam::exponential Description - exponential pdf + exponential distribution model SourceFiles exponential.C @@ -35,13 +35,13 @@ SourceFiles #ifndef exponential_H #define exponential_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -50,7 +50,7 @@ namespace pdfs class exponential : - public pdf + public distributionModel { // Private data @@ -81,9 +81,9 @@ public: exponential(const exponential& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new exponential(*this)); + return autoPtr<distributionModel>(new exponential(*this)); } @@ -93,7 +93,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -106,7 +106,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.C b/src/lagrangian/distributionModels/fixedValue/fixedValue.C similarity index 69% rename from src/thermophysicalModels/pdfs/fixedValue/fixedValue.C rename to src/lagrangian/distributionModels/fixedValue/fixedValue.C index 5808c5dbb523a05c6101fa7922d52c5e1c5710d3..e990b1479b43c71d1502c891281dbc7aa524b1de 100644 --- a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.C +++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.C @@ -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 @@ -30,50 +30,54 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(fixedValue, 0); - addToRunTimeSelectionTable(pdf, fixedValue, dictionary); + addToRunTimeSelectionTable(distributionModel, fixedValue, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::fixedValue::fixedValue(const dictionary& dict, cachedRandom& rndGen) +Foam::distributionModels::fixedValue::fixedValue +( + const dictionary& dict, + cachedRandom& rndGen +) : - pdf(typeName, dict, rndGen), - value_(readScalar(pdfDict_.lookup("value"))) + distributionModel(typeName, dict, rndGen), + value_(readScalar(distributionModelDict_.lookup("value"))) {} -Foam::pdfs::fixedValue::fixedValue(const fixedValue& p) +Foam::distributionModels::fixedValue::fixedValue(const fixedValue& p) : - pdf(p), + distributionModel(p), value_(p.value_) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::fixedValue::~fixedValue() +Foam::distributionModels::fixedValue::~fixedValue() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::fixedValue::fixedValue::sample() const +Foam::scalar Foam::distributionModels::fixedValue::fixedValue::sample() const { return value_; } -Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const +Foam::scalar Foam::distributionModels::fixedValue::fixedValue::minValue() const { return value_; } -Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const +Foam::scalar Foam::distributionModels::fixedValue::fixedValue::maxValue() const { return value_; } diff --git a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.H b/src/lagrangian/distributionModels/fixedValue/fixedValue.H similarity index 84% rename from src/thermophysicalModels/pdfs/fixedValue/fixedValue.H rename to src/lagrangian/distributionModels/fixedValue/fixedValue.H index c2905114286ed4f61287701b1c3d8451c368eaf6..4385f96c5e8ca807ec8746932af35330c6d2abbc 100644 --- a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.H +++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.H @@ -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 @@ -32,16 +32,16 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef pdfFixedValue_H -#define pdfFixedValue_H +#ifndef distributionModelFixedValue_H +#define distributionModelFixedValue_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ Class fixedValue Declaration @@ -49,7 +49,7 @@ namespace pdfs class fixedValue : - public pdf + public distributionModel { // Private data @@ -72,9 +72,9 @@ public: fixedValue(const fixedValue& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new fixedValue(*this)); + return autoPtr<distributionModel>(new fixedValue(*this)); } @@ -84,7 +84,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -97,7 +97,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/general/general.C b/src/lagrangian/distributionModels/general/general.C similarity index 81% rename from src/thermophysicalModels/pdfs/general/general.C rename to src/lagrangian/distributionModels/general/general.C index 8f8224ed6b1969bb199d0934ad5158165a91f154..6e5aad7a7b0e3df1d109d8d345b009a675f29973 100644 --- a/src/thermophysicalModels/pdfs/general/general.C +++ b/src/lagrangian/distributionModels/general/general.C @@ -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 @@ -30,19 +30,23 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(general, 0); - addToRunTimeSelectionTable(pdf, general, dictionary); + addToRunTimeSelectionTable(distributionModel, general, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen) +Foam::distributionModels::general::general +( + const dictionary& dict, + cachedRandom& rndGen +) : - pdf(typeName, dict, rndGen), - xy_(pdfDict_.lookup("distribution")), + distributionModel(typeName, dict, rndGen), + xy_(distributionModelDict_.lookup("distribution")), nEntries_(xy_.size()), minValue_(xy_[0][0]), maxValue_(xy_[nEntries_-1][0]), @@ -50,7 +54,7 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen) { check(); - // normalize the cumulative pdf + // normalize the cumulative distributionModel integral_[0] = 0.0; for (label i=1; i<nEntries_; i++) @@ -74,9 +78,9 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen) } -Foam::pdfs::general::general(const general& p) +Foam::distributionModels::general::general(const general& p) : - pdf(p), + distributionModel(p), xy_(p.xy_), nEntries_(p.nEntries_), minValue_(p.minValue_), @@ -87,13 +91,13 @@ Foam::pdfs::general::general(const general& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::general::~general() +Foam::distributionModels::general::~general() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::general::sample() const +Foam::scalar Foam::distributionModels::general::sample() const { scalar y = rndGen_.sample01<scalar>(); @@ -137,13 +141,13 @@ Foam::scalar Foam::pdfs::general::sample() const } -Foam::scalar Foam::pdfs::general::minValue() const +Foam::scalar Foam::distributionModels::general::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::general::maxValue() const +Foam::scalar Foam::distributionModels::general::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/general/general.H b/src/lagrangian/distributionModels/general/general.H similarity index 87% rename from src/thermophysicalModels/pdfs/general/general.H rename to src/lagrangian/distributionModels/general/general.H index c212f92aea9506c4e97c18789f1f39ea2d056235..9201ec143ea18d0c68dcab9bcdb1accb69f50280 100644 --- a/src/thermophysicalModels/pdfs/general/general.H +++ b/src/lagrangian/distributionModels/general/general.H @@ -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 @@ Class Foam::general Description - general pdf + general distribution model SourceFiles general.C @@ -35,7 +35,7 @@ SourceFiles #ifndef general_H #define general_H -#include "pdf.H" +#include "distributionModel.H" #include "Vector.H" #include "VectorSpace.H" @@ -43,7 +43,7 @@ SourceFiles namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -52,7 +52,7 @@ namespace pdfs class general : - public pdf + public distributionModel { // Private data @@ -84,9 +84,9 @@ public: general(const general& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new general(*this)); + return autoPtr<distributionModel>(new general(*this)); } @@ -96,7 +96,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -109,7 +109,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/multiNormal/multiNormal.C b/src/lagrangian/distributionModels/multiNormal/multiNormal.C similarity index 76% rename from src/thermophysicalModels/pdfs/multiNormal/multiNormal.C rename to src/lagrangian/distributionModels/multiNormal/multiNormal.C index 554063bdbf2a6e889af5fa82a07a83a90b3c4184..2f06f898e32131cbc5e2b6f7489181ab3463b415 100644 --- a/src/thermophysicalModels/pdfs/multiNormal/multiNormal.C +++ b/src/lagrangian/distributionModels/multiNormal/multiNormal.C @@ -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 @@ -30,28 +30,28 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(multiNormal, 0); - addToRunTimeSelectionTable(pdf, multiNormal, dictionary); + addToRunTimeSelectionTable(distributionModel, multiNormal, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::multiNormal::multiNormal +Foam::distributionModels::multiNormal::multiNormal ( const dictionary& dict, cachedRandom& rndGen ) : - pdf(typeName, dict, rndGen), - minValue_(readScalar(pdfDict_.lookup("minValue"))), - maxValue_(readScalar(pdfDict_.lookup("maxValue"))), + distributionModel(typeName, dict, rndGen), + minValue_(readScalar(distributionModelDict_.lookup("minValue"))), + maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), range_(maxValue_ - minValue_), - expectation_(pdfDict_.lookup("expectation")), - variance_(pdfDict_.lookup("variance")), - strength_(pdfDict_.lookup("strength")) + expectation_(distributionModelDict_.lookup("expectation")), + variance_(distributionModelDict_.lookup("variance")), + strength_(distributionModelDict_.lookup("strength")) { check(); @@ -81,9 +81,9 @@ Foam::pdfs::multiNormal::multiNormal } -Foam::pdfs::multiNormal::multiNormal(const multiNormal& p) +Foam::distributionModels::multiNormal::multiNormal(const multiNormal& p) : - pdf(p), + distributionModel(p), minValue_(p.minValue_), maxValue_(p.maxValue_), range_(p.range_), @@ -95,13 +95,13 @@ Foam::pdfs::multiNormal::multiNormal(const multiNormal& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::multiNormal::~multiNormal() +Foam::distributionModels::multiNormal::~multiNormal() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::multiNormal::sample() const +Foam::scalar Foam::distributionModels::multiNormal::sample() const { scalar y = 0; scalar x = 0; @@ -133,13 +133,13 @@ Foam::scalar Foam::pdfs::multiNormal::sample() const } -Foam::scalar Foam::pdfs::multiNormal::minValue() const +Foam::scalar Foam::distributionModels::multiNormal::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::multiNormal::maxValue() const +Foam::scalar Foam::distributionModels::multiNormal::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/multiNormal/multiNormal.H b/src/lagrangian/distributionModels/multiNormal/multiNormal.H similarity index 85% rename from src/thermophysicalModels/pdfs/multiNormal/multiNormal.H rename to src/lagrangian/distributionModels/multiNormal/multiNormal.H index 4b8a9dc731b0a89873bec515197993bae6f16377..6af776a7286b82a69b4fdabfd42fc80bcb3b833b 100644 --- a/src/thermophysicalModels/pdfs/multiNormal/multiNormal.H +++ b/src/lagrangian/distributionModels/multiNormal/multiNormal.H @@ -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 @@ -25,10 +25,10 @@ Class Foam::multiNormal Description - A multiNormal pdf + A multiNormal distribution model @verbatim - pdf = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 ) + model = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 ) @endverbatim @@ -40,13 +40,13 @@ SourceFiles #ifndef multiNormal_H #define multiNormal_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -55,7 +55,7 @@ namespace pdfs class multiNormal : - public pdf + public distributionModel { // Private data @@ -91,9 +91,9 @@ public: multiNormal(const multiNormal& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new multiNormal(*this)); + return autoPtr<distributionModel>(new multiNormal(*this)); } @@ -103,7 +103,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -116,7 +116,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/normal/normal.C b/src/lagrangian/distributionModels/normal/normal.C similarity index 75% rename from src/thermophysicalModels/pdfs/normal/normal.C rename to src/lagrangian/distributionModels/normal/normal.C index f8e9f7716e43d893d1eb7b0d690f5df2fb6bea64..1a629100ac30a76363d6633f2d4659aaebde8b80 100644 --- a/src/thermophysicalModels/pdfs/normal/normal.C +++ b/src/lagrangian/distributionModels/normal/normal.C @@ -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 @@ -31,22 +31,26 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(normal, 0); - addToRunTimeSelectionTable(pdf, normal, dictionary); + addToRunTimeSelectionTable(distributionModel, normal, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen) +Foam::distributionModels::normal::normal +( + const dictionary& dict, + cachedRandom& rndGen +) : - pdf(typeName, dict, rndGen), - minValue_(readScalar(pdfDict_.lookup("minValue"))), - maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - expectation_(readScalar(pdfDict_.lookup("expectation"))), - variance_(readScalar(pdfDict_.lookup("variance"))), + distributionModel(typeName, dict, rndGen), + minValue_(readScalar(distributionModelDict_.lookup("minValue"))), + maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), + expectation_(readScalar(distributionModelDict_.lookup("expectation"))), + variance_(readScalar(distributionModelDict_.lookup("variance"))), a_(0.147) { if (minValue_ < 0) @@ -67,9 +71,9 @@ Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen) } -Foam::pdfs::normal::normal(const normal& p) +Foam::distributionModels::normal::normal(const normal& p) : - pdf(p), + distributionModel(p), minValue_(p.minValue_), maxValue_(p.maxValue_), expectation_(p.expectation_), @@ -80,13 +84,13 @@ Foam::pdfs::normal::normal(const normal& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::normal::~normal() +Foam::distributionModels::normal::~normal() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::normal::sample() const +Foam::scalar Foam::distributionModels::normal::sample() const { scalar a = erf((minValue_ - expectation_)/variance_); @@ -104,19 +108,19 @@ Foam::scalar Foam::pdfs::normal::sample() const } -Foam::scalar Foam::pdfs::normal::minValue() const +Foam::scalar Foam::distributionModels::normal::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::normal::maxValue() const +Foam::scalar Foam::distributionModels::normal::maxValue() const { return maxValue_; } -Foam::scalar Foam::pdfs::normal::erfInv(const scalar y) const +Foam::scalar Foam::distributionModels::normal::erfInv(const scalar y) const { scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y); scalar h = log(1.0 - y*y)/a_; diff --git a/src/thermophysicalModels/pdfs/normal/normal.H b/src/lagrangian/distributionModels/normal/normal.H similarity index 83% rename from src/thermophysicalModels/pdfs/normal/normal.H rename to src/lagrangian/distributionModels/normal/normal.H index 9767398cbe2dd104e5d25a66d5249698cab75a7e..60c39f105962d5faec3294cad33974bc866e6d33 100644 --- a/src/thermophysicalModels/pdfs/normal/normal.H +++ b/src/lagrangian/distributionModels/normal/normal.H @@ -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,13 +25,13 @@ Class Foam::normal Description - A normal pdf + A normal distribution model @verbatim - pdf = strength * exp(-0.5*((x - expectation)/variance)^2 ) + model = strength * exp(-0.5*((x - expectation)/variance)^2 ) @endverbatim - strength only has meaning if there's more than one pdf + strength only has meaning if there's more than one distribution model SourceFiles normal.C @@ -41,13 +41,13 @@ SourceFiles #ifndef normal_H #define normal_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -56,7 +56,7 @@ namespace pdfs class normal : - public pdf + public distributionModel { // Private data @@ -91,9 +91,9 @@ public: normal(const normal& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new normal(*this)); + return autoPtr<distributionModel>(new normal(*this)); } @@ -103,7 +103,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -118,7 +118,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/uniform/uniform.C b/src/lagrangian/distributionModels/uniform/uniform.C similarity index 70% rename from src/thermophysicalModels/pdfs/uniform/uniform.C rename to src/lagrangian/distributionModels/uniform/uniform.C index 1493fe1e6bb2892be45b268c3e8e3664ca296d01..7f00a05a9323ccc5ef1b52565263a998f5370cbd 100644 --- a/src/thermophysicalModels/pdfs/uniform/uniform.C +++ b/src/lagrangian/distributionModels/uniform/uniform.C @@ -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 @@ -30,29 +30,33 @@ License namespace Foam { - namespace pdfs + namespace distributionModels { defineTypeNameAndDebug(uniform, 0); - addToRunTimeSelectionTable(pdf, uniform, dictionary); + addToRunTimeSelectionTable(distributionModel, uniform, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdfs::uniform::uniform(const dictionary& dict, cachedRandom& rndGen) +Foam::distributionModels::uniform::uniform +( + const dictionary& dict, + cachedRandom& rndGen +) : - pdf(typeName, dict, rndGen), - minValue_(readScalar(pdfDict_.lookup("minValue"))), - maxValue_(readScalar(pdfDict_.lookup("maxValue"))), + distributionModel(typeName, dict, rndGen), + minValue_(readScalar(distributionModelDict_.lookup("minValue"))), + maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), range_(maxValue_ - minValue_) { check(); } -Foam::pdfs::uniform::uniform(const uniform& p) +Foam::distributionModels::uniform::uniform(const uniform& p) : - pdf(p), + distributionModel(p), minValue_(p.minValue_), maxValue_(p.maxValue_) {} @@ -60,25 +64,25 @@ Foam::pdfs::uniform::uniform(const uniform& p) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdfs::uniform::~uniform() +Foam::distributionModels::uniform::~uniform() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::pdfs::uniform::sample() const +Foam::scalar Foam::distributionModels::uniform::sample() const { return rndGen_.position<scalar>(minValue_, maxValue_); } -Foam::scalar Foam::pdfs::uniform::minValue() const +Foam::scalar Foam::distributionModels::uniform::minValue() const { return minValue_; } -Foam::scalar Foam::pdfs::uniform::maxValue() const +Foam::scalar Foam::distributionModels::uniform::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/uniform/uniform.H b/src/lagrangian/distributionModels/uniform/uniform.H similarity index 86% rename from src/thermophysicalModels/pdfs/uniform/uniform.H rename to src/lagrangian/distributionModels/uniform/uniform.H index db0e44ddbf64012e96ed2f53e4f9eb68266422f3..2872e88f3c4ad1dd7051e2745cf48bb2745f5210 100644 --- a/src/thermophysicalModels/pdfs/uniform/uniform.H +++ b/src/lagrangian/distributionModels/uniform/uniform.H @@ -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 @@ Class Foam::uniform Description - uniform pdf + Uniform/equally-weighted distribution model SourceFiles uniform.C @@ -35,13 +35,13 @@ SourceFiles #ifndef uniform_H #define uniform_H -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace pdfs +namespace distributionModels { /*---------------------------------------------------------------------------*\ @@ -50,7 +50,7 @@ namespace pdfs class uniform : - public pdf + public distributionModel { // Private data @@ -79,9 +79,9 @@ public: uniform(const uniform& p); //- Construct and return a clone - virtual autoPtr<pdf> clone() const + virtual autoPtr<distributionModel> clone() const { - return autoPtr<pdf>(new uniform(*this)); + return autoPtr<distributionModel>(new uniform(*this)); } @@ -91,7 +91,7 @@ public: // Member Functions - //- Sample the pdf + //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value @@ -104,7 +104,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace pdfs +} // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 068400f0d7e530d60abad932fb1c2dfa6f18f83a..63fa90db0d1b6862dbfa403e0f81128cf8690e6d 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -74,12 +74,6 @@ $(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphase $(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.C -/* data entries */ -submodels/IO/DataEntry/makeDataEntries.C -submodels/IO/DataEntry/polynomial/polynomial.C -submodels/IO/DataEntry/polynomial/polynomialIO.C - - /* integration schemes */ IntegrationScheme/makeIntegrationSchemes.C diff --git a/src/lagrangian/intermediate/Make/options b/src/lagrangian/intermediate/Make/options index db20632300d9ea4ab1e315b7156adb88da249d0b..0d45fdda60d8d9412cd913a6f19a1653c1c48d6e 100644 --- a/src/lagrangian/intermediate/Make/options +++ b/src/lagrangian/intermediate/Make/options @@ -2,16 +2,16 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ @@ -24,17 +24,17 @@ LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ -llagrangian \ - -lpdf \ - -lliquids \ - -lliquidMixture \ - -lpointSolids \ - -lpointSolidMixture \ + -ldistributionModels \ + -lliquidProperties \ + -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ -lspecie \ -lbasicThermophysicalModels \ -lreactionThermophysicalModels \ -lSLGThermo \ -lchemistryModel \ - -lradiation \ + -lradiationModels \ -lODE \ -lcompressibleRASModels \ -lcompressibleLESModels \ diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 7f368738378314c772e1d48be7df02982afa76b8..fc589f538808e79a52dbb1606aa8ad804c7c0bb9 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -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,6 +48,7 @@ void Foam::KinematicCloud<ParcelType>::cloudSolution::read() if (steadyState()) { dict_.lookup("calcFrequency") >> calcFrequency_; + dict_.lookup("maxCo") >> maxCo_; dict_.lookup("maxTrackTime") >> maxTrackTime_; dict_.subDict("sourceTerms").lookup("resetOnStartup") >> resetSourcesOnStartup_; @@ -67,12 +68,13 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution active_(dict.lookup("active")), transient_(false), calcFrequency_(1), + maxCo_(0.3), iter_(1), deltaT_(0.0), coupled_(false), cellValueSourceCorrection_(false), maxTrackTime_(0.0), - resetSourcesOnStartup_(false) + resetSourcesOnStartup_(true) { if (active_) { @@ -92,6 +94,7 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution active_(cs.active_), transient_(cs.transient_), calcFrequency_(cs.calcFrequency_), + maxCo_(cs.maxCo_), iter_(cs.iter_), deltaT_(cs.deltaT_), coupled_(cs.coupled_), @@ -112,6 +115,7 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution active_(false), transient_(false), calcFrequency_(0), + maxCo_(GREAT), iter_(0), deltaT_(0.0), coupled_(false), @@ -184,6 +188,84 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::output() const // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // +template<class ParcelType> +void Foam::KinematicCloud<ParcelType>::setModels() +{ + collisionModel_.reset + ( + CollisionModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + dispersionModel_.reset + ( + DispersionModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + dragModel_.reset + ( + DragModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + injectionModel_.reset + ( + InjectionModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + patchInteractionModel_.reset + ( + PatchInteractionModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + postProcessingModel_.reset + ( + PostProcessingModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this + ).ptr() + ); + + surfaceFilmModel_.reset + ( + SurfaceFilmModel<KinematicCloud<ParcelType> >::New + ( + subModelProperties_, + *this, + g_ + ).ptr() + ); + + UIntegrator_.reset + ( + vectorIntegrationScheme::New + ( + "U", + solution_.integrationSchemes() + ).ptr() + ); +} + + template<class ParcelType> void Foam::KinematicCloud<ParcelType>::solve ( @@ -446,8 +528,8 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud ) ), solution_(mesh_, particleProperties_.subDict("solution")), - constProps_(particleProperties_), - subModelProperties_(particleProperties_.subDict("subModels")), + constProps_(particleProperties_, solution_.active()), + subModelProperties_(particleProperties_.subOrEmptyDict("subModels")), rndGen_ ( label(0), @@ -458,72 +540,15 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud U_(U), mu_(mu), g_(g), - forces_(mesh_, particleProperties_, g_.value()), - collisionModel_ - ( - CollisionModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - dispersionModel_ - ( - DispersionModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - dragModel_ - ( - DragModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - injectionModel_ - ( - InjectionModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - patchInteractionModel_ - ( - PatchInteractionModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - postProcessingModel_ - ( - PostProcessingModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this - ) - ), - surfaceFilmModel_ - ( - SurfaceFilmModel<KinematicCloud<ParcelType> >::New - ( - subModelProperties_, - *this, - g - ) - ), - UIntegrator_ - ( - vectorIntegrationScheme::New - ( - "U", - solution_.integrationSchemes() - ) - ), + forces_(mesh_, particleProperties_, g_.value(), solution_.active()), + collisionModel_(NULL), + dispersionModel_(NULL), + dragModel_(NULL), + injectionModel_(NULL), + patchInteractionModel_(NULL), + postProcessingModel_(NULL), + surfaceFilmModel_(NULL), + UIntegrator_(NULL), UTrans_ ( new DimensionedField<vector, volMesh> @@ -557,6 +582,11 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud ) ) { + if (solution_.active()) + { + setModels(); + } + if (readFields) { ParcelType::readFields(*this); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 8e505db45ef10c73fc78d445c0db48802a722fec..dace4a65221e00f92c50acd5267d50521026a777 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -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 @@ -136,6 +136,11 @@ public: // NOTE: Steady operation only label calcFrequency_; + //- Maximum particle Courant number + // Max fraction of current cell that can be traversed in a single + // step + scalar maxCo_; + //- Current cloud iteration label iter_; @@ -218,6 +223,9 @@ public: //- Return const access to the calculation frequency inline label calcFrequency() const; + //- Return const access to the max particle Courant number + inline scalar maxCo() const; + //- Return const access to the current cloud iteration inline label iter() const; @@ -356,6 +364,12 @@ protected: autoPtr<DimensionedField<scalar, volMesh> > UCoeff_; + // Initialisation + + //- Set cloud sub-models + void setModels(); + + // Cloud evolution functions //- Solve the cloud - calls all evolution functions diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 9c39742758a24ca2178897be6b7751d975e911f9..457e39abaea74035ca1a49833280c4461eba3dd4 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -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 @@ -99,6 +99,14 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::calcFrequency() const } +template<class ParcelType> +inline Foam::scalar +Foam::KinematicCloud<ParcelType>::cloudSolution::maxCo() const +{ + return maxCo_; +} + + template<class ParcelType> inline Foam::label Foam::KinematicCloud<ParcelType>::cloudSolution::iter() const { diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index 6d32ddcd24f7a613a6836e4c9d0b3c23036c1d12..a8bb92cb5a8dc0575f555087b9bb9416b8b4f3ff 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -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 @@ -30,6 +30,29 @@ License // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // +template<class ParcelType> +void Foam::ReactingCloud<ParcelType>::setModels() +{ + compositionModel_.reset + ( + CompositionModel<ReactingCloud<ParcelType> >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); + + phaseChangeModel_.reset + ( + PhaseChangeModel<ReactingCloud<ParcelType> >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); +} + + template<class ParcelType> void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition ( @@ -85,26 +108,17 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo, false), reactingCloud(), cloudCopyPtr_(NULL), - constProps_(this->particleProperties()), - compositionModel_ - ( - CompositionModel<ReactingCloud<ParcelType> >::New - ( - this->subModelProperties(), - *this - ) - ), - phaseChangeModel_ - ( - PhaseChangeModel<ReactingCloud<ParcelType> >::New - ( - this->subModelProperties(), - *this - ) - ), + constProps_(this->particleProperties(), this->solution().active()), + compositionModel_(NULL), + phaseChangeModel_(NULL), rhoTrans_(thermo.carrier().species().size()), dMassPhaseChange_(0.0) { + if (this->solution().active()) + { + setModels(); + } + // Set storage for mass source fields and initialise to zero forAll(rhoTrans_, i) { diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 92529eddf19c700d27936c2c43cd2f93f6eb1b83..1ffbff55de7039ad45ec669fc79974183ecc2fe5 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -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 @@ -128,6 +128,12 @@ protected: ); + // Initialisation + + //- Set cloud sub-models + void setModels(); + + // Cloud evolution functions //- Reset state of cloud diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index fc33d58434a384ddf777343a6bede18b7bc17835..06dc0c339be8d383ff4de05e75ad55420c80b564 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,6 +30,29 @@ License // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // +template<class ParcelType> +void Foam::ReactingMultiphaseCloud<ParcelType>::setModels() +{ + devolatilisationModel_.reset + ( + DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); + + surfaceReactionModel_.reset + ( + SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); +} + + template<class ParcelType> void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset ( @@ -62,26 +85,17 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo, false), reactingMultiphaseCloud(), cloudCopyPtr_(NULL), - constProps_(this->particleProperties()), - devolatilisationModel_ - ( - DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New - ( - this->subModelProperties(), - *this - ) - ), - surfaceReactionModel_ - ( - SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New - ( - this->subModelProperties(), - *this - ) - ), + constProps_(this->particleProperties(), this->solution().active()), + devolatilisationModel_(NULL), + surfaceReactionModel_(NULL), dMassDevolatilisation_(0.0), dMassSurfaceReaction_(0.0) { + if (this->solution().active()) + { + setModels(); + } + if (readFields) { ParcelType::readFields(*this); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index 8226112fd78bd36ab4392df014475752d10dff17..2c71a6b4758d282b27c6cc0a6c7d442c3051cf45 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,6 +119,12 @@ protected: // Protected Member Functions + // Initialisation + + //- Set cloud sub-models + void setModels(); + + // Cloud evolution functions //- Reset state of cloud diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index d11d1fb1f4b59fa728b850f0c659ecaf1a0e8e27..ae26e7999dc90174e77fc45ff1789bd58509c369 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -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 @@ -30,6 +30,31 @@ License // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // +template<class ParcelType> +void Foam::ThermoCloud<ParcelType>::setModels() +{ + heatTransferModel_.reset + ( + HeatTransferModel<ThermoCloud<ParcelType> >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); + + TIntegrator_.reset + ( + scalarIntegrationScheme::New + ( + "T", + this->solution().integrationSchemes() + ).ptr() + ); + + this->subModelProperties().lookup("radiation") >> radiation_; +} + + template<class ParcelType> void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c) { @@ -66,27 +91,13 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud ), thermoCloud(), cloudCopyPtr_(NULL), - constProps_(this->particleProperties()), + constProps_(this->particleProperties(), this->solution().active()), thermo_(thermo), T_(thermo.thermo().T()), p_(thermo.thermo().p()), - heatTransferModel_ - ( - HeatTransferModel<ThermoCloud<ParcelType> >::New - ( - this->subModelProperties(), - *this - ) - ), - TIntegrator_ - ( - scalarIntegrationScheme::New - ( - "T", - this->solution().integrationSchemes() - ) - ), - radiation_(this->subModelProperties().lookup("radiation")), + heatTransferModel_(NULL), + TIntegrator_(NULL), + radiation_(false), hsTrans_ ( new DimensionedField<scalar, volMesh> @@ -121,6 +132,11 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud ) { + if (this->solution().active()) + { + setModels(); + } + if (readFields) { ParcelType::readFields(*this); @@ -143,7 +159,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud KinematicCloud<ParcelType>(c, name), thermoCloud(), cloudCopyPtr_(NULL), - constProps_(c.particleProperties_), + constProps_(c.constProps_), thermo_(c.thermo_), T_(c.T()), p_(c.p()), diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index d3a72fcb41bdd7649618d149f4db8c597d55fb9e..b2dc16dd672a0868abb27df73e206b2e455bafa9 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -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 @@ -128,6 +128,12 @@ protected: // Protected Member Functions + // Initialisation + + //- Set cloud sub-models + void setModels(); + + // Cloud evolution functions //- Reset state of cloud diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index a0a088cefc15e2fed0ca752a944e37b0cf110b22..c2310d345395dd7b02ba74bdc79d6bcb8788914d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -308,6 +308,7 @@ bool Foam::KinematicParcel<ParcelType>::move const polyMesh& mesh = td.cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); + const scalarField& V = mesh.cellVolumes(); switch (td.part()) { @@ -336,7 +337,7 @@ bool Foam::KinematicParcel<ParcelType>::move // Set the Lagrangian time-step scalar dt = min(dtMax, tEnd); - // Remember which cell the Parcel is in since this + // Remember which cell the parcel is in since this // will change if a face is hit const label cellI = p.cell(); @@ -344,9 +345,11 @@ bool Foam::KinematicParcel<ParcelType>::move if (p.active() && magU > ROOTVSMALL) { const scalar d = dt*magU; - const vector n = U_/magU; - const scalar dCorr = min(d, mag(n & mesh.bounds().span())); - dt *= dCorr/d*p.trackToFace(p.position() + dCorr*n, td); + const scalar maxCo = td.cloud().solution().maxCo(); + const scalar dCorr = min(d, maxCo*cbrt(V[cellI])); + dt *= + dCorr/d + *p.trackToFace(p.position() + dCorr*U_/magU, td); } tEnd -= dt; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 1517ec68052adf98df258ae1bf7666fff34faf21..003e07ee4609e4c60f548b532d941207bb74e13a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -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 @@ -98,22 +98,22 @@ public: //- Parcel type id - used for post-processing to flag the type // of parcels issued by this cloud - const label parcelTypeId_; + label parcelTypeId_; //- Minimum density [kg/m3] - const scalar rhoMin_; + scalar rhoMin_; //- Particle density [kg/m3] (constant) - const scalar rho0_; + scalar rho0_; //- Minimum particle mass [kg] - const scalar minParticleMass_; + scalar minParticleMass_; //- Young's modulus [N/m2] - const scalar youngsModulus_; + scalar youngsModulus_; //- Poisson's ratio - const scalar poissonsRatio_; + scalar poissonsRatio_; public: @@ -127,7 +127,11 @@ public: constantProperties(const constantProperties& cp); //- Constructor from dictionary - constantProperties(const dictionary& parentDict); + constantProperties + ( + const dictionary& parentDict, + const bool readFields = true + ); // Member functions diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index 80ae5886465cc16d42a75d70c9b9234ca17033ca..bdf143cbe59f27d8e38a8ce6634f70e1f8c7c3d0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -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 @@ -62,17 +62,28 @@ inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties template<class ParcelType> inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties ( - const dictionary& parentDict + const dictionary& parentDict, + const bool readFields ) : - dict_(parentDict.subDict("constantProperties")), - parcelTypeId_(readLabel(dict_.lookup("parcelTypeId"))), - rhoMin_(readScalar(dict_.lookup("rhoMin"))), - rho0_(readScalar(dict_.lookup("rho0"))), - minParticleMass_(readScalar(dict_.lookup("minParticleMass"))), - youngsModulus_(readScalar(dict_.lookup("youngsModulus"))), - poissonsRatio_(readScalar(dict_.lookup("poissonsRatio"))) -{} + dict_(parentDict.subOrEmptyDict("constantProperties")), + parcelTypeId_(-1), + rhoMin_(0.0), + rho0_(0.0), + minParticleMass_(0.0), + youngsModulus_(0.0), + poissonsRatio_(0.0) +{ + if (readFields) + { + dict_.lookup("parcelTypeId") >> parcelTypeId_; + dict_.lookup("rhoMin") >> rhoMin_; + dict_.lookup("rho0") >> rho0_; + dict_.lookup("minParticleMass") >> minParticleMass_; + dict_.lookup("youngsModulus") >> youngsModulus_; + dict_.lookup("poissonsRatio") >> poissonsRatio_; + } +} template<class ParcelType> diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 04e57d0a7ad84f402ab5c4594097a60ca670b07f..04b6525f6609c286dd233b3ca222fe4a92fe6442 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,7 @@ public: // Private data //- Latent heat of devolatilisation [J/kg] - const scalar LDevol_; + scalar LDevol_; //- Fraction of enthalpy retained by parcel due to surface // reactions @@ -100,7 +100,11 @@ public: constantProperties(const constantProperties& cp); //- Constructor from dictionary - constantProperties(const dictionary& parentDict); + constantProperties + ( + const dictionary& parentDict, + const bool readFields = true + ); // Access diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H index 0eb2f4aa7f8a20b5e22b52e12021c9e09a99407a..cc574ef5a3e1e81649b9d219f7f91e8105ddd0b4 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,24 +54,31 @@ template<class ParcelType> inline Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties:: constantProperties ( - const dictionary& parentDict + const dictionary& parentDict, + const bool readFields ) : - ReactingParcel<ParcelType>::constantProperties(parentDict), - LDevol_(readScalar(this->dict().lookup("LDevol"))), - hRetentionCoeff_(readScalar(this->dict().lookup("hRetentionCoeff"))) + ReactingParcel<ParcelType>::constantProperties(parentDict, readFields), + LDevol_(0.0), + hRetentionCoeff_(0.0) { - if ((hRetentionCoeff_ < 0) || (hRetentionCoeff_ > 1)) + if (readFields) { - FatalErrorIn - ( - "ReactingMultiphaseParcel<ParcelType>::constantProperties::" - "constantProperties" - ) << "hRetentionCoeff must be in the range 0 to 1" << nl - << exit(FatalError) << endl; + this->dict().lookup("LDevol") >> LDevol_; + this->dict().lookup("hRetentionCoeff") >> hRetentionCoeff_; + + if ((hRetentionCoeff_ < 0) || (hRetentionCoeff_ > 1)) + { + FatalErrorIn + ( + "ReactingMultiphaseParcel<ParcelType>::constantProperties::" + "constantProperties" + ) << "hRetentionCoeff must be in the range 0 to 1" << nl + << exit(FatalError) << endl; + } + + hRetentionCoeff_ = max(1e-06, hRetentionCoeff_); } - - hRetentionCoeff_ = max(1e-06, hRetentionCoeff_); } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 91f07d24db3097ffe02d0b585cc57c98d6bdbdc8..968b1cedf656eb26871d3ce0adc528ca30f8ace0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -50,16 +50,19 @@ void Foam::ReactingParcel<ParcelType>::setCellValues if (pc_ < td.cloud().constProps().pMin()) { - WarningIn - ( - "void Foam::ReactingParcel<ParcelType>::setCellValues" - "(" - "TrackData&, " - "const scalar, " - "const label" - ")" - ) << "Limiting observed pressure in cell " << cellI << " to " - << td.cloud().constProps().pMin() << nl << endl; + if (debug) + { + WarningIn + ( + "void Foam::ReactingParcel<ParcelType>::setCellValues" + "(" + "TrackData&, " + "const scalar, " + "const label" + ")" + ) << "Limiting observed pressure in cell " << cellI << " to " + << td.cloud().constProps().pMin() << nl << endl; + } pc_ = td.cloud().constProps().pMin(); } @@ -86,54 +89,50 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection return; } - scalar massCell = this->massCell(cellI); + const scalar massCell = this->massCell(cellI); - const scalar V = td.cloud().pMesh().cellVolumes()[cellI]; - this->rhoc_ += addedMass/V; + this->rhoc_ += addedMass/td.cloud().pMesh().cellVolumes()[cellI]; - scalar massCellNew = massCell + addedMass; + const scalar massCellNew = massCell + addedMass; this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew; scalar CpEff = 0.0; - scalar CsEff = 0.0; - scalar Csc = 0.0; if (addedMass > ROOTVSMALL) { forAll(td.cloud().rhoTrans(), i) { scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; CpEff += Y*td.cloud().composition().carrier().Cp(i, this->Tc_); - - scalar W = td.cloud().composition().carrier().W(i); - CsEff += td.cloud().rhoTrans(i)[cellI]/V*Y/W; - scalar Yc = td.cloud().composition().carrier().Y(i)[cellI]; - Csc += massCell/V*Yc/W; } } - CsEff = (massCell*Csc + addedMass*CsEff)/massCellNew; const scalar Cpc = td.CpInterp().psi()[cellI]; this->Cpc_ = (massCell*Cpc + addedMass*CpEff)/massCellNew; this->Tc_ += td.cloud().hsTrans()[cellI]/(this->Cpc_*massCellNew); - if (this->Tc_ < td.cloud().constProps().TMin()) + if (debug && (this->Tc_ < td.cloud().constProps().TMin())) { - WarningIn - ( - "void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection" - "(" - "TrackData&, " - "const scalar, " - "const label" - ")" - ) << "Limiting observed temperature in cell " << cellI << " to " - << td.cloud().constProps().TMin() << nl << endl; + if (debug) + { + WarningIn + ( + "void Foam::ReactingParcel<ParcelType>::" + "cellValueSourceCorrection" + "(" + "TrackData&, " + "const scalar, " + "const label" + ")" + ) << "Limiting observed temperature in cell " << cellI << " to " + << td.cloud().constProps().TMin() << nl << endl; + } this->Tc_ = td.cloud().constProps().TMin(); } - this->pc_ = CsEff*specie::RR*this->Tc_; +// constant pressure +// this->pc_ = this->pc_; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 70d0601ff03c4991ed03ff9911951fc39dd125d5..3b1769bb404f3bb49589e84e896ed38c6dc34487 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -77,16 +77,16 @@ public: // Private data //- Minimum pressure [Pa] - const scalar pMin_; + scalar pMin_; //- Constant volume flag - e.g. during mass transfer Switch constantVolume_; //- Vaporisation temperature [K] - const scalar Tvap_; + scalar Tvap_; //- Boiling point [K] - const scalar Tbp_; + scalar Tbp_; public: @@ -100,7 +100,11 @@ public: constantProperties(const constantProperties& cp); //- Constructor from dictionary - constantProperties(const dictionary& parentDict); + constantProperties + ( + const dictionary& parentDict, + const bool readFields = true + ); // Access diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H index c6c94ac118db086089e20eb6848f58b540bcfe0b..e94168189270d56b1ed31ebd21dcc02f0ab76742 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H @@ -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 @@ -54,15 +54,24 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties template<class ParcelType> inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties ( - const dictionary& parentDict + const dictionary& parentDict, + const bool readFields ) : - ThermoParcel<ParcelType>::constantProperties(parentDict), - pMin_(readScalar(this->dict().lookup("pMin"))), - constantVolume_(this->dict().lookup("constantVolume")), - Tvap_(readScalar(this->dict().lookup("Tvap"))), - Tbp_(readScalar(this->dict().lookup("Tbp"))) -{} + ThermoParcel<ParcelType>::constantProperties(parentDict, readFields), + pMin_(0.0), + constantVolume_(false), + Tvap_(0.0), + Tbp_(0.0) +{ + if (readFields) + { + this->dict().lookup("pMin") >> pMin_; + this->dict().lookup("constantVolume") >> constantVolume_; + this->dict().lookup("Tvap") >> Tvap_; + this->dict().lookup("Tbp") >> Tbp_; + } +} template<class ParcelType> diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index b95ba03f8c0042890b96cddefd5c8f69a9f0c7d7..153ac45fa62c484e888abcc010cb05db9b42e50d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -49,16 +49,19 @@ void Foam::ThermoParcel<ParcelType>::setCellValues if (Tc_ < td.cloud().constProps().TMin()) { - WarningIn - ( - "void Foam::ThermoParcel<ParcelType>::setCellValues" - "(" - "TrackData&, " - "const scalar, " - "const label" - ")" - ) << "Limiting observed temperature in cell " << cellI << " to " - << td.cloud().constProps().TMin() << nl << endl; + if (debug) + { + WarningIn + ( + "void Foam::ThermoParcel<ParcelType>::setCellValues" + "(" + "TrackData&, " + "const scalar, " + "const label" + ")" + ) << "Limiting observed temperature in cell " << cellI << " to " + << td.cloud().constProps().TMin() << nl << endl; + } Tc_ = td.cloud().constProps().TMin(); } @@ -81,16 +84,19 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection if (Tc_ < td.cloud().constProps().TMin()) { - WarningIn - ( - "void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection" - "(" - "TrackData&, " - "const scalar, " - "const label" - ")" - ) << "Limiting observed temperature in cell " << cellI << " to " - << td.cloud().constProps().TMin() << nl << endl; + if (debug) + { + WarningIn + ( + "void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection" + "(" + "TrackData&, " + "const scalar, " + "const label" + ")" + ) << "Limiting observed temperature in cell " << cellI << " to " + << td.cloud().constProps().TMin() << nl << endl; + } Tc_ = td.cloud().constProps().TMin(); } @@ -116,21 +122,24 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues if (Ts < td.cloud().constProps().TMin()) { - WarningIn - ( - "void Foam::ThermoParcel<ParcelType>::calcSurfaceValues" - "(" - "TrackData&, " - "const label, " - "const scalar, " - "scalar&, " - "scalar&, " - "scalar&, " - "scalar&, " - "scalar&" - ") const" - ) << "Limiting parcel surface temperature to " - << td.cloud().constProps().TMin() << nl << endl; + if (debug) + { + WarningIn + ( + "void Foam::ThermoParcel<ParcelType>::calcSurfaceValues" + "(" + "TrackData&, " + "const label, " + "const scalar, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&" + ") const" + ) << "Limiting parcel surface temperature to " + << td.cloud().constProps().TMin() << nl << endl; + } Ts = td.cloud().constProps().TMin(); } diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index 7163f06c4b03f2c4c29b0f72af37f692b76c504c..e455c1773e5ce041b4f03c4068b7da7982b0da59 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -77,22 +77,22 @@ public: // Private data //- Particle initial temperature [K] - const scalar T0_; + scalar T0_; //- Minimum temperature [K] - const scalar TMin_; + scalar TMin_; //- Particle specific heat capacity [J/(kg.K)] - const scalar Cp0_; + scalar Cp0_; //- Particle emissivity [] (radiation) - const scalar epsilon0_; + scalar epsilon0_; //- Particle scattering factor [] (radiation) - const scalar f0_; + scalar f0_; //- Default carrier Prandtl number [] - const scalar Pr_; + scalar Pr_; public: @@ -106,7 +106,11 @@ public: constantProperties(const constantProperties& cp); //- Constructor from dictionary - constantProperties(const dictionary& parentDict); + constantProperties + ( + const dictionary& parentDict, + const bool readFields = true + ); // Member functions diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H index f39165c5cd324bb06bfd19c2ddca1d59d774c36a..ada4b93a102104d2d8148003926e139862eb0f4f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H @@ -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,17 +57,28 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties template<class ParcelType> inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties ( - const dictionary& parentDict + const dictionary& parentDict, + const bool readFields ) : - KinematicParcel<ParcelType>::constantProperties(parentDict), - T0_(readScalar(this->dict().lookup("T0"))), - TMin_(readScalar(this->dict().lookup("TMin"))), - Cp0_(readScalar(this->dict().lookup("Cp0"))), - epsilon0_(readScalar(this->dict().lookup("epsilon0"))), - f0_(readScalar(this->dict().lookup("f0"))), - Pr_(readScalar(this->dict().lookup("Pr"))) -{} + KinematicParcel<ParcelType>::constantProperties(parentDict, readFields), + T0_(0.0), + TMin_(0.0), + Cp0_(0.0), + epsilon0_(0.0), + f0_(0.0), + Pr_(0.0) +{ + if (readFields) + { + this->dict().lookup("T0") >> T0_; + this->dict().lookup("TMin") >> TMin_; + this->dict().lookup("Cp0") >> Cp0_; + this->dict().lookup("epsilon0") >> epsilon0_; + this->dict().lookup("f0") >> f0_; + this->dict().lookup("Pr") >> Pr_; + } +} template<class ParcelType> diff --git a/src/lagrangian/intermediate/particleForces/particleForces.C b/src/lagrangian/intermediate/particleForces/particleForces.C index be189ba3e19baacde5eff31563e959d5d68ddfd4..124b21c2e19b28d0df32552cb51891e9c5df5e75 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.C +++ b/src/lagrangian/intermediate/particleForces/particleForces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,32 +74,41 @@ Foam::particleForces::particleForces ( const fvMesh& mesh, const dictionary& dict, - const vector& g + const vector& g, + const bool readFields ) : mesh_(mesh), - dict_(dict.subDict("particleForces")), + dict_(dict.subOrEmptyDict("particleForces")), g_(g), gradUPtr_(NULL), HdotGradHInterPtr_(NULL), - gravity_(dict_.lookup("gravity")), - virtualMass_(dict_.lookup("virtualMass")), + gravity_(false), + virtualMass_(false), Cvm_(0.0), - pressureGradient_(dict_.lookup("pressureGradient")), - paramagnetic_(dict_.lookup("paramagnetic")), + pressureGradient_(false), + paramagnetic_(false), magneticSusceptibility_(0.0), refFrame_(rfInertial), UName_(dict_.lookupOrDefault<word>("UName", "U")), HdotGradHName_(dict_.lookupOrDefault<word>("HdotGradHName", "HdotGradH")) { - if (virtualMass_) + if (readFields) { - dict_.lookup("Cvm") >> Cvm_; - } + dict_.lookup("gravity") >> gravity_; + dict_.lookup("virtualMass") >> virtualMass_; + dict_.lookup("pressureGradient") >> pressureGradient_; + dict_.lookup("paramagnetic") >> paramagnetic_; - if (paramagnetic_) - { - dict_.lookup("magneticSusceptibility") >> magneticSusceptibility_; + if (virtualMass_) + { + dict_.lookup("Cvm") >> Cvm_; + } + + if (paramagnetic_) + { + dict_.lookup("magneticSusceptibility") >> magneticSusceptibility_; + } } if (dict_.found("referenceFrame")) @@ -116,9 +125,10 @@ Foam::particleForces::particleForces ( "Foam::particleForces::particleForces" "(" - "const fvMesh& mesh," - "const dictionary& dict," - "const vector& g" + "const fvMesh&, " + "const dictionary&, " + "const vector&, " + "const bool" ")" ) << "Unknown referenceFrame, options are inertial and SRF." @@ -235,10 +245,8 @@ void Foam::particleForces::cacheFields if (paramagnetic_) { - const volVectorField& HdotGradH = mesh_.lookupObject<volVectorField> - ( - HdotGradHName_ - ); + const volVectorField& HdotGradH = + mesh_.lookupObject<volVectorField>(HdotGradHName_); HdotGradHInterPtr_ = interpolation<vector>::New ( @@ -329,7 +337,7 @@ Foam::vector Foam::particleForces::calcNonCoupled // *magneticSusceptibility_/(magneticSusceptibility_ + 3) // *HdotGradH[cellI]; - // which is divided by mass ((4/3)*pi*r^3*rho) to produce + // which is divided by mass (pi*d^3*rho/6) to produce // acceleration } diff --git a/src/lagrangian/intermediate/particleForces/particleForces.H b/src/lagrangian/intermediate/particleForces/particleForces.H index 5c537ff54017ff1fcfdb011607451606f3601434..feb5ea8ee4a84772e56dfaabe8320b2259853242 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.H +++ b/src/lagrangian/intermediate/particleForces/particleForces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,7 +134,8 @@ public: ( const fvMesh& mesh, const dictionary& dict, - const vector& g + const vector& g, + const bool readFields = true ); //- Construct copy diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index 53e0056739326b4df3b3f740ab1e39d81fdbb3f7..711c41e87b24ba692137e2aaf311779ea486119c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -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 @@ -95,9 +95,12 @@ Foam::ConeInjection<CloudType>::ConeInjection Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())), thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())), thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) + distributionModels::distributionModel::New + ( + this->coeffDict().subDict("sizeDistribution"), owner.rndGen() + ) ), tanVec1_(vector::zero), tanVec2_(vector::zero) @@ -153,7 +156,7 @@ Foam::ConeInjection<CloudType>::ConeInjection Umag_(im.Umag_().clone().ptr()), thetaInner_(im.thetaInner_().clone().ptr()), thetaOuter_(im.thetaOuter_().clone().ptr()), - parcelPDF_(im.parcelPDF_().clone().ptr()), + sizeDistribution_(im.sizeDistribution_().clone().ptr()), tanVec1_(im.tanVec1_), tanVec2_(im.tanVec2_) {} @@ -222,7 +225,7 @@ void Foam::ConeInjection<CloudType>::setProperties parcel.U() = Umag_().value(t)*dirVec; // set particle diameter - parcel.d() = parcelPDF_().sample(); + parcel.d() = sizeDistribution_().sample(); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H index 31768d223ff5b2a3a4fae226a60b775b2d74dca4..278b2a1bddc0fecb99ed4645d7517b2caecb38c4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H @@ -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 @@ -34,7 +34,7 @@ Description - parcel flow rate - parcel velocity - inner and outer cone angles - - Parcel diameters obtained by PDF model + - Parcel diameters obtained by distribution model model SourceFiles ConeInjection.C @@ -45,7 +45,7 @@ SourceFiles #define ConeInjection_H #include "InjectionModel.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -101,8 +101,8 @@ class ConeInjection //- Outer cone angle relative to SOI [deg] const autoPtr<DataEntry<scalar> > thetaOuter_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; // Tangential vectors to the direction vector diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C index 122ebea145336187873128016bb6fc435632c4b3..a7645b0bc2b0305240f3e4cc8ae872ef11bdd859 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,9 +126,12 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())), thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())), thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) + distributionModels::distributionModel::New + ( + this->coeffDict().subDict("sizeDistribution"), owner.rndGen() + ) ), nInjected_(this->parcelsAddedTotal()), tanVec1_(positions_.size()), @@ -193,7 +196,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP Umag_(im.Umag_().clone().ptr()), thetaInner_(im.thetaInner_().clone().ptr()), thetaOuter_(im.thetaOuter_().clone().ptr()), - parcelPDF_(im.parcelPDF_().clone().ptr()), + sizeDistribution_(im.sizeDistribution_().clone().ptr()), nInjected_(im.nInjected_), tanVec1_(im.tanVec1_), tanVec2_(im.tanVec2_) @@ -268,7 +271,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties parcel.U() = Umag_().value(t)*dirVec; // set particle diameter - parcel.d() = parcelPDF_().sample(); + parcel.d() = sizeDistribution_().sample(); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H index 47b19de6d3dc99f97993e7265db260f4d3b5a6ab..806799bb7e07539d8beb3c58376ba6a542cdb7de 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ Description - parcel flow rate - parcel velocities - inner and outer cone angles - - Parcel diameters obtained by PDF model + - Parcel diameters obtained by distribution model model SourceFiles ConeInjectionMP.C @@ -45,7 +45,7 @@ SourceFiles #define ConeInjectionMP_H #include "InjectionModel.H" -#include "pdf.H" +#include "distributionModel.H" #include "vectorList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -108,8 +108,8 @@ class ConeInjectionMP //- Outer cone angle relative to SOI [deg] const autoPtr<DataEntry<scalar> > thetaOuter_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; //- Number of parcels per injector already injected mutable label nInjected_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index 75f34af8eba6b0e9c5866a1d52e8b7a0d923167e..03fe941dab4d50019b706065a3761cc6c6aaa963 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,11 +114,11 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection nParcelsInjected_(positions_.size(), 0), U0_(this->coeffDict().lookup("U0")), diameters_(positions_.size()), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - this->coeffDict().subDict("parcelPDF"), + this->coeffDict().subDict("sizeDistribution"), owner.rndGen() ) ) @@ -126,7 +126,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection // Construct parcel diameters - one per injector cell forAll(diameters_, i) { - diameters_[i] = parcelPDF_->sample(); + diameters_[i] = sizeDistribution_->sample(); } // Determine total volume of particles to inject @@ -166,7 +166,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection nParcelsInjected_(im.nParcelsInjected_), U0_(im.U0_), diameters_(im.diameters_), - parcelPDF_(im.parcelPDF_().clone().ptr()) + sizeDistribution_(im.sizeDistribution_().clone().ptr()) {} diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H index b7d76873e0a08a1f82b7f34709540bbb898596de..cf5b0239956671abebae90fd87a56d4fd7ea31aa 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ SourceFiles #define FieldActivatedInjection_H #include "InjectionModel.H" -#include "pdf.H" +#include "distributionModel.H" #include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -110,8 +110,9 @@ class FieldActivatedInjection //- List of parcel diameters scalarList diameters_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> + sizeDistribution_; protected: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C index 3cf811416480295a24b9340dd02e68b1994a624d..8930fa85e8be3593c3becf148e6760f0d6c8ee72 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C @@ -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 @@ -90,7 +90,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject ( 1, (10*volumeAccumulator_) - /CloudType::parcelType::volume(parcelPDF_().minValue()) + /CloudType::parcelType::volume(sizeDistribution_().minValue()) ); label iterationNo = 0; @@ -128,7 +128,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject { if (selfSeed_ && !cellCentresUsed.found(cI)) { - scalar dNew = parcelPDF_().sample(); + scalar dNew = sizeDistribution_().sample(); newParticles_.append ( @@ -191,7 +191,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0)); scalar d = a/(2.0*sqrt(3.0)); - scalar dNew = parcelPDF_().sample(); + scalar dNew = sizeDistribution_().sample(); scalar volNew = CloudType::parcelType::volume(dNew); newParticles_.append @@ -204,7 +204,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject ); volumeAccumulator_ -= volNew; - dNew = parcelPDF_().sample(); + dNew = sizeDistribution_().sample(); newParticles_.append ( vectorPairScalarPair @@ -215,7 +215,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject ); volumeAccumulator_ -= volNew; - dNew = parcelPDF_().sample(); + dNew = sizeDistribution_().sample(); newParticles_.append ( vectorPairScalarPair @@ -226,7 +226,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject ); volumeAccumulator_ -= volNew; - dNew = parcelPDF_().sample(); + dNew = sizeDistribution_().sample(); newParticles_.append ( vectorPairScalarPair @@ -341,11 +341,11 @@ Foam::InflationInjection<CloudType>::InflationInjection fraction_(1.0), selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)), dSeed_(SMALL), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - this->coeffDict().subDict("parcelPDF"), + this->coeffDict().subDict("sizeDistribution"), owner.rndGen() ) ) @@ -409,7 +409,7 @@ Foam::InflationInjection<CloudType>::InflationInjection fraction_(im.fraction_), selfSeed_(im.selfSeed_), dSeed_(im.dSeed_), - parcelPDF_(im.parcelPDF_().clone().ptr()) + sizeDistribution_(im.sizeDistribution_().clone().ptr()) {} diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H index b10c8e17d9dd6fca85488a841e380ca689489543..ab3f3d182201f948ce5c81407e33aa658b7ea26f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H @@ -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 @@ -39,7 +39,7 @@ SourceFiles #define InflationInjection_H #include "InjectionModel.H" -#include "pdf.H" +#include "distributionModel.H" #include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -107,8 +107,8 @@ class InflationInjection //- Diameter with which to create new seed particles scalar dSeed_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; protected: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 40e4e3da30457a68d1541d9240bb66eccab05638..3879f09fb8cc8a7ba8937126133fdedf753cef3c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -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 @@ -34,6 +34,11 @@ using namespace Foam::constant::mathematical; template<class CloudType> void Foam::InjectionModel<CloudType>::readProps() { + if (!this->owner().solution().transient()) + { + return; + } + IOobject propsDictHeader ( "injectionProperties", @@ -60,6 +65,11 @@ void Foam::InjectionModel<CloudType>::readProps() template<class CloudType> void Foam::InjectionModel<CloudType>::writeProps() { + if (!this->owner().solution().transient()) + { + return; + } + if (this->owner().db().time().outputTime()) { IOdictionary propsDict diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index fa816d2e1779d6ca048bb4cc79808ae07ebab01b..f5255106fdf3659c5d44e395f426165a71e512d2 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -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 @@ -96,11 +96,11 @@ Foam::ManualInjection<CloudType>::ManualInjection injectorTetFaces_(positions_.size(), -1), injectorTetPts_(positions_.size(), -1), U0_(this->coeffDict().lookup("U0")), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New + distributionModels::distributionModel::New ( - this->coeffDict().subDict("parcelPDF"), + this->coeffDict().subDict("sizeDistribution"), owner.rndGen() ) ) @@ -149,7 +149,7 @@ Foam::ManualInjection<CloudType>::ManualInjection // Construct parcel diameters forAll(diameters_, i) { - diameters_[i] = parcelPDF_->sample(); + diameters_[i] = sizeDistribution_->sample(); } // Determine volume of particles to inject @@ -171,7 +171,7 @@ Foam::ManualInjection<CloudType>::ManualInjection injectorTetFaces_(im.injectorTetFaces_), injectorTetPts_(im.injectorTetPts_), U0_(im.U0_), - parcelPDF_(im.parcelPDF_().clone().ptr()) + sizeDistribution_(im.sizeDistribution_().clone().ptr()) {} diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H index bf7616b71a3642903709f62e4eff14b0ef7fa481..972995a458896f569a33503ed7f9b26f974eb255 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H @@ -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 @@ -31,7 +31,7 @@ Description - Total mass to inject - Parcel positions in file @c positionsFile - Initial parcel velocity - - Parcel diameters obtained by PDF model + - Parcel diameters obtained by distribution model model - All parcels introduced at SOI SourceFiles @@ -43,7 +43,7 @@ SourceFiles #define ManualInjection_H #include "InjectionModel.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,8 +82,8 @@ class ManualInjection //- Initial parcel velocity const vector U0_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; protected: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index c124977e5a88b4c1a89a7fc9e9dc00afd4d45db3..1f6a2750272fd8b0ce91328ae78524acf592a99f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -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 @@ -25,7 +25,7 @@ License #include "PatchInjection.H" #include "DataEntry.H" -#include "pdf.H" +#include "distributionModel.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -104,9 +104,13 @@ Foam::PatchInjection<CloudType>::PatchInjection ( DataEntry<scalar>::New("flowRateProfile", this->coeffDict()) ), - parcelPDF_ + sizeDistribution_ ( - pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) + distributionModels::distributionModel::New + ( + this->coeffDict().subDict("sizeDistribution"), + owner.rndGen() + ) ), cellOwners_(), fraction_(1.0) @@ -153,7 +157,7 @@ Foam::PatchInjection<CloudType>::PatchInjection parcelsPerSecond_(im.parcelsPerSecond_), U0_(im.U0_), flowRateProfile_(im.flowRateProfile_().clone().ptr()), - parcelPDF_(im.parcelPDF_().clone().ptr()), + sizeDistribution_(im.sizeDistribution_().clone().ptr()), cellOwners_(im.cellOwners_), fraction_(im.fraction_) {} @@ -236,7 +240,7 @@ void Foam::PatchInjection<CloudType>::setProperties parcel.U() = U0_; // set particle diameter - parcel.d() = parcelPDF_->sample(); + parcel.d() = sizeDistribution_->sample(); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H index 05b1236a8a41f2e0f6d18c9f1a30552af005b078..4ee540c7bf1ef1859f70e0f52f3216417d3c4cc5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H @@ -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 @@ -33,7 +33,7 @@ Description - Injection duration - Initial parcel velocity - Injection volume flow rate - - Parcel diameters obtained by PDF model + - Parcel diameters obtained by distribution model model - Parcels injected at cell centres adjacent to patch SourceFiles @@ -54,7 +54,7 @@ namespace Foam template<class Type> class DataEntry; -class pdf; +class distributionModel; /*---------------------------------------------------------------------------*\ Class PatchInjection Declaration @@ -85,8 +85,8 @@ class PatchInjection //- Flow rate profile relative to SOI [] const autoPtr<DataEntry<scalar> > flowRateProfile_; - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + //- Parcel size distribution model model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; //- List of cell labels corresponding to injector positions labelList cellOwners_; diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 219e691e3a7da2b721c33c50bba900c7911e002f..2815d5e3d1ab5624e685adc81be9fff9275e1773 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,14 +93,16 @@ Foam::CompositionModel<CloudType>::carrier() const template<class CloudType> -const Foam::liquidMixture& Foam::CompositionModel<CloudType>::liquids() const +const Foam::liquidMixtureProperties& +Foam::CompositionModel<CloudType>::liquids() const { return thermo_.liquids(); } template<class CloudType> -const Foam::pointSolidMixture& Foam::CompositionModel<CloudType>::solids() const +const Foam::solidMixtureProperties& +Foam::CompositionModel<CloudType>::solids() const { return thermo_.solids(); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 74a4a87a2054db38164257de93a183addb6470be..04ec177d1cb5a8320d839704e6ba1965c3103f1d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -140,10 +140,10 @@ public: const basicMultiComponentMixture& carrier() const; //- Return the global (additional) liquids - const liquidMixture& liquids() const; + const liquidMixtureProperties& liquids() const; //- Return the global (additional) solids - const pointSolidMixture& solids() const; + const solidMixtureProperties& solids() const; //- Return the list of phase properties const phasePropertiesList& phaseProps() const; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index dbae15d93d4b199afa8c007494f7294297e53bb7..8c66c4fbbd20723d111c0f0a348a9ee8ddb3414e 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -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 @@ -34,7 +34,7 @@ Description #define LiquidEvaporation_H #include "PhaseChangeModel.H" -#include "liquidMixture.H" +#include "liquidMixtureProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +54,7 @@ protected: // Protected data //- Global liquid properties data - const liquidMixture& liquids_; + const liquidMixtureProperties& liquids_; //- List of active liquid names List<word> activeLiquids_; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index c0d9f69e7703a4c115219b37c071d21cf1c89013..84dc17c90ddcd8739cd8c099c27d8321fbc519ee 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -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 @@ -230,7 +230,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl; } - const liquid& liq = thermo_.liquids().properties()[0]; + const liquidProperties& liq = thermo_.liquids().properties()[0]; // Patch face velocity and normal const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI]; @@ -286,7 +286,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl; } - const liquid& liq = thermo_.liquids().properties()[0]; + const liquidProperties& liq = thermo_.liquids().properties()[0]; // Patch face velocity and normal const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI]; diff --git a/src/lagrangian/molecularDynamics/Allwmake b/src/lagrangian/molecularDynamics/Allwmake index 3f5d397e722328b0534d20977000b334228acd94..60b24dea4dd310a0ef7cadcd5e23655dc5897234 100755 --- a/src/lagrangian/molecularDynamics/Allwmake +++ b/src/lagrangian/molecularDynamics/Allwmake @@ -1,9 +1,10 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso potential -wmake libso molecularMeasurements -wmake libso molecule +wmake $makeOption potential +wmake $makeOption molecularMeasurements +wmake $makeOption molecule # ----------------------------------------------------------------- end-of-file diff --git a/src/mesh/Allwmake b/src/mesh/Allwmake index f967335db3b92e201cc3f17fbc5053023da017c1..f980e0e73fa960191080511b80ab2d7571c5bafc 100755 --- a/src/mesh/Allwmake +++ b/src/mesh/Allwmake @@ -1,8 +1,9 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso autoMesh -wmake libso blockMesh +wmake $makeOption autoMesh +wmake $makeOption blockMesh # ----------------------------------------------------------------- end-of-file diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 941da518ea252991ac036063ccdc773cdeb6efb0..8a749cd60b6369d7a298c6d6df8f1d0ab779a18d 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -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 @@ -1791,7 +1791,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions "meshRefinement::splitMeshRegions(const point&)" ) << "Point " << keepPoint << " is not inside the mesh." << nl - << "Bounding box of the mesh:" << mesh_.globalData().bb() + << "Bounding box of the mesh:" << mesh_.bounds() << exit(FatalError); } diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 4e0aab462b75bb2bdb588246edd21e6f4498be54..c4846a02651acf0cfd54a2932748380d25d635a5 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -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 @@ -1263,7 +1263,7 @@ void Foam::meshRefinement::findCellZoneInsideWalk ", const labelList&, const labelList&)" ) << "Point " << insidePoint << " is not inside the mesh." << nl - << "Bounding box of the mesh:" << mesh_.globalData().bb() + << "Bounding box of the mesh:" << mesh_.bounds() << exit(FatalError); } @@ -1431,7 +1431,7 @@ void Foam::meshRefinement::findCellZoneTopo "(const point&, const labelList&, const labelList&, labelList&)" ) << "Point " << keepPoint << " is not inside the mesh." << nl - << "Bounding box of the mesh:" << mesh_.globalData().bb() + << "Bounding box of the mesh:" << mesh_.bounds() << exit(FatalError); } @@ -1972,7 +1972,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh "(const label, const labelList&, const point&)" ) << "Point " << keepPoint << " is not inside the mesh." << nl - << "Bounding box of the mesh:" << mesh_.globalData().bb() + << "Bounding box of the mesh:" << mesh_.bounds() << exit(FatalError); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index eca6aaec36592df58415709cd5c2b30c3f2f553d..fa7dc5c127520e70b4d5c932da4c185d11abb5da 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C @@ -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 @@ -167,6 +167,14 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New } +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::coordinateRotation::clear() +{ + this->tensor::operator=(sphericalTensor::I); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // void Foam::coordinateRotation::operator=(const dictionary& rhs) diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H index d759296afffa6f420c8747cea290aeaf023a3464..55fcd9ca16a3759f353736cc7df6ddc870079e77 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H @@ -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 @@ -165,6 +165,9 @@ public: // Member Functions + //- Reset rotation to an identity rotation + virtual void clear(); + //- Return local-to-global transformation tensor const tensor& R() const { diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index 8a97574b21580b66961558b5a0065ff597cdab92..9b43631d1f49283a1822b7099763b6f6b20a001f 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.C @@ -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 @@ -290,6 +290,15 @@ Foam::tmp<Foam::vectorField> Foam::coordinateSystem::globalToLocal } +void Foam::coordinateSystem::clear() +{ + note_.clear(); + origin_ = point::zero; + R_.clear(); + Rtr_ = sphericalTensor::I; +} + + void Foam::coordinateSystem::write(Ostream& os) const { os << type() diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H index fba2f3253fca3a1b34c5e066798ec898e82c27e4..ab673cd83b0af1d2db8c6f9a74b569abf56f26af 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.H +++ b/src/meshTools/coordinateSystems/coordinateSystem.H @@ -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 @@ -397,6 +397,10 @@ public: return origin_; } + //- Reset origin and rotation to an identity coordinateSystem + // Also resets the note + virtual void clear(); + // Write diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index 26d7ca0c9ee8a6e2ef1ad0128860ee9c910d8a1e..df489a6f951ae0bbc9a20bd29080b5e0eb72ea8a 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -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 @@ -1623,56 +1623,74 @@ void Foam::indexedOctree<Type>::traverseNode { const labelList& indices = contents_[getContent(index)]; - if (findAny) + if (indices.size()) { - // Find any intersection - - forAll(indices, elemI) + if (findAny) { - label shapeI = indices[elemI]; - - point pt; - bool hit = shapes_.intersects(shapeI, start, end, pt); + // Find any intersection - if (hit) + forAll(indices, elemI) { - // Hit so pt is nearer than nearestPoint. - // Update hit info - hitInfo.setHit(); - hitInfo.setIndex(shapeI); - hitInfo.setPoint(pt); - return; - } - } - } - else - { - // Find nearest intersection. + label shapeI = indices[elemI]; - point nearestPoint(end); + point pt; + bool hit = shapes_.intersects(shapeI, start, end, pt); - forAll(indices, elemI) + // Note that intersection of shape might actually be + // in a neighbouring box. For findAny this is not important. + if (hit) + { + // Hit so pt is nearer than nearestPoint. + // Update hit info + hitInfo.setHit(); + hitInfo.setIndex(shapeI); + hitInfo.setPoint(pt); + return; + } + } + } + else { - label shapeI = indices[elemI]; + // Find nearest intersection - point pt; - bool hit = shapes_.intersects(shapeI, start, nearestPoint, pt); + const treeBoundBox octantBb(subBbox(nodeI, octant)); - if (hit) + point nearestPoint(end); + + forAll(indices, elemI) { - // Hit so pt is nearer than nearestPoint. - nearestPoint = pt; - // Update hit info - hitInfo.setHit(); - hitInfo.setIndex(shapeI); - hitInfo.setPoint(pt); + label shapeI = indices[elemI]; + + point pt; + bool hit = shapes_.intersects + ( + shapeI, + start, + nearestPoint, + pt + ); + + // Note that intersection of shape might actually be + // in a neighbouring box. Since we need to maintain strict + // (findAny=false) ordering skip such an intersection. It + // will be found when we are doing the next box. + + if (hit && octantBb.contains(pt)) + { + // Hit so pt is nearer than nearestPoint. + nearestPoint = pt; + // Update hit info + hitInfo.setHit(); + hitInfo.setIndex(shapeI); + hitInfo.setPoint(pt); + } } - } - if (hitInfo.hit()) - { - // Found intersected shape. - return; + if (hitInfo.hit()) + { + // Found intersected shape. + return; + } } } } diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C index 4e068489f983cf01c5f472517dff7469236d091c..1a83a3720f1bf5b50e87aa524454ef6cab47c2b4 100644 --- a/src/meshTools/meshSearch/meshSearch.C +++ b/src/meshTools/meshSearch/meshSearch.C @@ -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 @@ -101,9 +101,11 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const { const indexedOctree<treeDataCell>& tree = cellTree(); - scalar span = tree.bb().mag(); - - pointIndexHit info = tree.findNearest(location, Foam::sqr(span)); + pointIndexHit info = tree.findNearest + ( + location, + magSqr(tree.bb().max()-tree.bb().min()) + ); if (!info.hit()) { @@ -178,10 +180,12 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const // Search nearest cell centre. const indexedOctree<treeDataCell>& tree = cellTree(); - scalar span = tree.bb().mag(); - // Search with decent span - pointIndexHit info = tree.findNearest(location, Foam::sqr(span)); + pointIndexHit info = tree.findNearest + ( + location, + magSqr(tree.bb().max()-tree.bb().min()) + ); if (!info.hit()) { @@ -767,12 +771,10 @@ Foam::label Foam::meshSearch::findNearestBoundaryFace { const indexedOctree<treeDataFace>& tree = boundaryTree(); - scalar span = tree.bb().mag(); - pointIndexHit info = boundaryTree().findNearest ( location, - Foam::sqr(span) + magSqr(tree.bb().max()-tree.bb().min()) ); if (!info.hit()) diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index b77081593fe17efa12c2b30dc4efc2a02fa3cb77..3b07bb284fa3423ffb489702fffeac903543b571 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -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 @@ -135,7 +135,7 @@ void Foam::regionToCell::combine(topoSet& set, const bool add) const "regionToCell::combine(topoSet&, const bool) const" ) << "Point " << insidePoint_ << " is not inside the mesh." << nl - << "Bounding box of the mesh:" << mesh_.globalData().bb() + << "Bounding box of the mesh:" << mesh_.bounds() << endl; return; } diff --git a/src/parallel/Allwmake b/src/parallel/Allwmake index 08ca4923f2dd42264233666e99987191bd57795f..d3600e13b1992a63eef07282165b8f7cbe778170 100755 --- a/src/parallel/Allwmake +++ b/src/parallel/Allwmake @@ -1,10 +1,11 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -decompose/Allwmake -reconstruct/Allwmake -wmake libso distributed +decompose/Allwmake $* +reconstruct/Allwmake $* +wmake $makeOption distributed # ----------------------------------------------------------------- end-of-file diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index cb053bcc3e811423065066a35578544f55d49fda..3848e66478cae3ba36776daf1a247ce390b1c3cc 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -1,7 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso -# get SCOTCH_VERSION, SCOTCH_ARCH_PATH, SCOTCH_MPI_INCLUDE +# get SCOTCH_VERSION, SCOTCH_ARCH_PATH settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` if [ -f "$settings" ] then @@ -16,18 +17,17 @@ set -x wmakeLnInclude decompositionMethods -wmake libso scotchDecomp -wmake libso metisDecomp +wmake $makeOption scotchDecomp -if [ -d "$FOAM_MPI_LIBBIN" ] +if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] then ( WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB - wmake libso ptscotchDecomp + wmake $makeOption ptscotchDecomp ) fi -wmake libso decompositionMethods +wmake $makeOption decompositionMethods # ----------------------------------------------------------------- end-of-file diff --git a/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C b/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C index cb9ec502c5c790fbf57bf6aaf1a63f12b842b954..14b39d96552b397aac3b33662d3ba53109377758 100644 --- a/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C +++ b/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C @@ -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 @@ -75,6 +75,14 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells labelList allDist(dist); map.distribute(allDist); + // Now we have: + // oldToNew : the locally-compact numbering of all our cellCells. -1 if + // cellCell is not in set. + // allDist : destination domain for all our cellCells + // subCellCells : indexes into oldToNew and allDist + + // Globally compact numbering for cells in set. + globalIndex globalSubCells(set.size()); // Now subCellCells contains indices into oldToNew which are the // new locations of the neighbouring cells. @@ -90,14 +98,23 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells label newI = 0; forAll(cCells, i) { - label subCellI = oldToNew[cCells[i]]; - if (subCellI == -1) + // Get locally-compact cell index of neighbouring cell + label nbrCellI = oldToNew[cCells[i]]; + if (nbrCellI == -1) { cutConnections[allDist[cCells[i]]]++; } else { - cCells[newI++] = subCellI; + // Reconvert local cell index into global one + + // Get original neighbour + label cellI = set[subCellI]; + label oldNbrCellI = cellCells[cellI][i]; + // Get processor from original neighbour + label procI = globalCells.whichProcID(oldNbrCellI); + // Convert into global compact numbering + cCells[newI++] = globalSubCells.toGlobal(procI, nbrCellI); } } cCells.setSize(newI); diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/structuredDecomp.C b/src/parallel/decompose/decompositionMethods/structuredDecomp/structuredDecomp.C index 1c1e41ca74eb725fb81d7a1c7fb80cb2a5dcd48d..b43876a2a023c2b76425559ae034974b7c2744c6 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/structuredDecomp.C +++ b/src/parallel/decompose/decompositionMethods/structuredDecomp/structuredDecomp.C @@ -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 @@ -25,7 +25,6 @@ License #include "structuredDecomp.H" #include "addToRunTimeSelectionTable.H" -#include "IFstream.H" #include "FaceCellWave.H" #include "topoDistanceData.H" #include "fvMeshSubset.H" diff --git a/src/parallel/decompose/metisDecomp/Make/files b/src/parallel/decompose/metisDecomp/Make/files index 030326722ab549d205e6020e1a2c235ae31304f5..39ee731e4d02e5c17cd2a3fb56fbe12606424ad7 100644 --- a/src/parallel/decompose/metisDecomp/Make/files +++ b/src/parallel/decompose/metisDecomp/Make/files @@ -1,3 +1,3 @@ metisDecomp.C -LIB = $(FOAM_EXT_LIBBIN)/libmetisDecomp +LIB = $(FOAM_LIBBIN)/libmetisDecomp diff --git a/src/parallel/decompose/ptscotchDecomp/Make/files b/src/parallel/decompose/ptscotchDecomp/Make/files index d2494e36bad20791ada67c423ff195048666429c..8f83423f7e95c6c02df4f3028f95235cbbd321d2 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/files +++ b/src/parallel/decompose/ptscotchDecomp/Make/files @@ -1,3 +1,3 @@ ptscotchDecomp.C -LIB = $(FOAM_MPI_LIBBIN)/libptscotchDecomp +LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libptscotchDecomp diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index d4f56eb39a42e7e3a48d3eeda17d20f2384bc525..ea5b0c3ad86980e25b0df4a363698d05c9a1fd65 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -3,9 +3,9 @@ sinclude $(RULES)/mplib$(WM_MPLIB) EXE_INC = \ $(PFLAGS) $(PINC) \ - -I$(SCOTCH_MPI_INCLUDE) \ + -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \ -I/usr/include/scotch \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -L$(FOAM_MPI_LIBBIN) -lptscotch -lptscotcherrexit -lrt + -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index c9728768ddc73939dc9cfc3d1b75fa64525b6bc1..7478de9c9a247d79cfe582d1cd36870cf0c794a9 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -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 @@ -102,6 +102,14 @@ License } + + Note: writes out .dgr files for debugging. Run with e.g. + + mpirun -np 4 dgpart 2 'processor%r.grf' + + - %r gets replaced by current processor rank + - decompose into 2 domains + \*---------------------------------------------------------------------------*/ #include "ptscotchDecomp.H" @@ -161,6 +169,7 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str) //- Does prevention of 0 cell domains and calls ptscotch. Foam::label Foam::ptscotchDecomp::decomposeZeroDomains ( + const fileName& meshPath, const List<int>& initadjncy, const List<int>& initxadj, const scalarField& initcWeights, @@ -184,6 +193,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains { return decompose ( + meshPath, initadjncy, initxadj, initcWeights, @@ -287,7 +297,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains // Do decomposition as normal. Sets finalDecomp. - label result = decompose(adjncy, xadj, cWeights, finalDecomp); + label result = decompose(meshPath, adjncy, xadj, cWeights, finalDecomp); if (debug) @@ -344,6 +354,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains // Call scotch with options from dictionary. Foam::label Foam::ptscotchDecomp::decompose ( + const fileName& meshPath, const List<int>& adjncy, const List<int>& xadj, const scalarField& cWeights, @@ -356,58 +367,82 @@ Foam::label Foam::ptscotchDecomp::decompose Pout<< "ptscotchDecomp : entering with xadj:" << xadj.size() << endl; } -// // Dump graph -// if (decompositionDict_.found("ptscotchCoeffs")) -// { -// const dictionary& scotchCoeffs = -// decompositionDict_.subDict("ptscotchCoeffs"); -// -// if (scotchCoeffs.lookupOrDefault("writeGraph", false)) -// { -// OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); -// -// Info<< "Dumping Scotch graph file to " << str.name() << endl -// << "Use this in combination with gpart." << endl; -// -// // Distributed graph file (.grf) -// label version = 2; -// str << version << nl; -// // Number of files - -// // Number of files (procglbnbr) -// str << Pstream::nProcs(); -// // My file number (procloc) -// str << ' ' << Pstream::myProcNo() << nl; -// -// // Total number of vertices (vertglbnbr) -// str << returnReduce(mesh.nCells(), sumOp<label>()); -// // Total number of connections (edgeglbnbr) -// str << ' ' << returnReduce(xadj[mesh.nCells()], sumOp<label>()) -// << nl; -// // Local number of vertices (vertlocnbr) -// str << mesh.nCells(); -// // Local number of connections (edgelocnbr) -// str << ' ' << xadj[mesh.nCells()] << nl; -// // Numbering starts from 0 -// label baseval = 0; -// // Start of my global vertices (procdsptab[proclocnum]) -// str << ' ' << globalCells.toGlobal(0); -// 100*hasVertlabels+10*hasEdgeWeights+1*hasVertWeighs -// str << ' ' << "0" << nl; -// for (label cellI = 0; cellI < xadj.size()-1; cellI++) -// { -// label start = xadj[cellI]; -// label end = xadj[cellI+1]; -// str << end-start; -// -// for (label i = start; i < end; i++) -// { -// str << ' ' << adjncy[i]; -// } -// str << nl; -// } -// } -// } + +if (debug) +{ + Pout<< "nProcessors_:" << nProcessors_ << endl; + + globalIndex globalCells(xadj.size()-1); + + Pout<< "Xadj:" << endl; + for (label cellI = 0; cellI < xadj.size()-1; cellI++) + { + Pout<< "cell:" << cellI + << " global:" << globalCells.toGlobal(cellI) + << " connected to:" << endl; + label start = xadj[cellI]; + label end = xadj[cellI+1]; + for (label i = start; i < end; i++) + { + Pout<< " cell:" << adjncy[i] << endl; + } + } + Pout<< endl; +} + + // Dump graph + if (decompositionDict_.found("ptscotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("ptscotchCoeffs"); + + if (scotchCoeffs.lookupOrDefault("writeGraph", false)) + { + OFstream str + ( + meshPath + "_" + Foam::name(Pstream::myProcNo()) + ".dgr" + ); + + Pout<< "Dumping Scotch graph file to " << str.name() << endl + << "Use this in combination with dgpart." << endl; + + globalIndex globalCells(xadj.size()-1); + + // Distributed graph file (.grf) + label version = 2; + str << version << nl; + // Number of files (procglbnbr) + str << Pstream::nProcs(); + // My file number (procloc) + str << ' ' << Pstream::myProcNo() << nl; + + // Total number of vertices (vertglbnbr) + str << globalCells.size(); + // Total number of connections (edgeglbnbr) + str << ' ' << returnReduce(xadj[xadj.size()-1], sumOp<label>()) + << nl; + // Local number of vertices (vertlocnbr) + str << xadj.size()-1; + // Local number of connections (edgelocnbr) + str << ' ' << xadj[xadj.size()-1] << nl; + // Numbering starts from 0 + label baseval = 0; + // 100*hasVertlabels+10*hasEdgeWeights+1*hasVertWeighs + str << baseval << ' ' << "000" << nl; + for (label cellI = 0; cellI < xadj.size()-1; cellI++) + { + label start = xadj[cellI]; + label end = xadj[cellI+1]; + str << end-start; + + for (label i = start; i < end; i++) + { + str << ' ' << adjncy[i]; + } + str << nl; + } + } + } // Strategy // ~~~~~~~~ @@ -487,7 +522,7 @@ Foam::label Foam::ptscotchDecomp::decompose if (debug) { Pout<< "SCOTCH_dgraphBuild with:" << nl - << "xadj.size() : " << xadj.size()-1 << nl + << "xadj.size()-1 : " << xadj.size()-1 << nl << "xadj : " << long(xadj.begin()) << nl << "velotab : " << long(velotab.begin()) << nl << "adjncy.size() : " << adjncy.size() << nl @@ -693,6 +728,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose List<int> finalDecomp; decomposeZeroDomains ( + mesh.time().path()/mesh.name(), cellCells.m(), cellCells.offsets(), pointWeights, @@ -744,6 +780,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose List<int> finalDecomp; decomposeZeroDomains ( + mesh.time().path()/mesh.name(), cellCells.m(), cellCells.offsets(), pointWeights, @@ -797,6 +834,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose List<int> finalDecomp; decomposeZeroDomains ( + "ptscotch", cellCells.m(), cellCells.offsets(), cWeights, diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H index 898a07870499b6a00cec02bddab17e1222fea73a..e1c8e6c24da26cd2d9af563d2f8426b912440eb7 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H @@ -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 @@ -63,6 +63,7 @@ class ptscotchDecomp //- Decompose with optionally zero sized domains label decomposeZeroDomains ( + const fileName& meshPath, const List<int>& initadjncy, const List<int>& initxadj, const scalarField& initcWeights, @@ -72,6 +73,7 @@ class ptscotchDecomp //- Decompose label decompose ( + const fileName& meshPath, const List<int>& adjncy, const List<int>& xadj, const scalarField& cWeights, diff --git a/src/parallel/decompose/scotchDecomp/Make/files b/src/parallel/decompose/scotchDecomp/Make/files index dbb178726c9cf9ffc7e81497d8062562e8c5fce9..59717fa15c8d33b2b3e3389075356565d2da2726 100644 --- a/src/parallel/decompose/scotchDecomp/Make/files +++ b/src/parallel/decompose/scotchDecomp/Make/files @@ -1,3 +1,3 @@ scotchDecomp.C -LIB = $(FOAM_EXT_LIBBIN)/libscotchDecomp +LIB = $(FOAM_LIBBIN)/libscotchDecomp diff --git a/src/parallel/reconstruct/Allwmake b/src/parallel/reconstruct/Allwmake index c4badc50674ba3b96bf6e7471f8a17a1e3febf0c..3d651d5a0033915818890a2779600473d095c330 100755 --- a/src/parallel/reconstruct/Allwmake +++ b/src/parallel/reconstruct/Allwmake @@ -1,8 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso reconstruct - +wmake $makeOption reconstruct # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/Allwmake b/src/postProcessing/Allwmake index 169c9c833fc09068cdd05989c6cd1119fd909c90..5a1caf16606eebdd3108560d15698654b66616ff 100755 --- a/src/postProcessing/Allwmake +++ b/src/postProcessing/Allwmake @@ -1,10 +1,11 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x wmake libo postCalc -wmake libso foamCalcFunctions +wmake $makeOption foamCalcFunctions -functionObjects/Allwmake +functionObjects/Allwmake $* # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/functionObjects/Allwmake b/src/postProcessing/functionObjects/Allwmake index d8cbe09eb9ef47957d37281e867d764d5d035e10..9ae9bd3dca12085fc47258507e4c6189b43eb81e 100755 --- a/src/postProcessing/functionObjects/Allwmake +++ b/src/postProcessing/functionObjects/Allwmake @@ -1,12 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso field -wmake libso forces -wmake libso IO -wmake libso utilities -wmake libso jobControl -wmake libso systemCall +wmake $makeOption field +wmake $makeOption forces +wmake $makeOption IO +wmake $makeOption utilities +wmake $makeOption jobControl +wmake $makeOption systemCall # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 896026c35677690b52a49d28b29ea59337e11efd..31b96f7e98fd7bd6abcd2eb747ee2789b8555642 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -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 @@ -122,7 +122,22 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict) { setCellZoneCells(); - Info<< type() << " " << name_ << ":" << nl + if (nCells_ == 0) + { + WarningIn + ( + "Foam::fieldValues::cellSource::initialise(const dictionary&)" + ) + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Source has no cells - deactivating" << endl; + + active_ = false; + return; + } + + Info<< type() << " " << name_ << ":" + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl << " total cells = " << nCells_ << nl << " total volume = " << gSum(filterField(mesh().V())) << nl << endl; diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 838658d1a26b723cf5ad363551d37f2b1888bdc6..259692c5f99517fb091b6dcc01c8303f0f4a81c6 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -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 @@ -249,6 +249,20 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) } } + if (nFaces_ == 0) + { + WarningIn + ( + "Foam::fieldValues::faceSource::initialise(const dictionary&)" + ) + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Source has no faces - deactivating" << endl; + + active_ = false; + return; + } + scalar totalArea; if (surfacePtr_.valid()) diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index d8a626f91b23167624ee16f2a7286e1251a574de..8b2127e9950ac4f61ae80d99afd785f87f45f5d0 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -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 @@ -182,7 +182,7 @@ bool Foam::streamLineParticle::move td.keepParticle = true; scalar tEnd = (1.0 - stepFraction())*trackTime; - scalar dtMax = tEnd; + scalar maxDt = cloud_.pMesh().bounds().mag(); while ( @@ -192,7 +192,7 @@ bool Foam::streamLineParticle::move ) { // set the lagrangian time-step - scalar dt = min(dtMax, tEnd); + scalar dt = maxDt; // Cross cell in steps: // - at subiter 0 calculate dt to cross cell in nSubCycle steps @@ -210,6 +210,16 @@ bool Foam::streamLineParticle::move U = -U; } + scalar magU = mag(U); + + if (magU < SMALL) + { + // Stagnant particle. Might as well stop + lifeTime_ = 0; + break; + } + + U /= magU; if (subIter == 0 && td.nSubCycle_ > 1) { @@ -219,7 +229,7 @@ bool Foam::streamLineParticle::move else if (subIter == td.nSubCycle_ - 1) { // Do full step on last subcycle - dt = min(dtMax, tEnd); + dt = maxDt; } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index 9e330e22b0572ed80506aafff1100cbfd03a3e22..412794795b2f22189c68b08ae51678f739b3701a 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -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 @@ -188,7 +188,7 @@ Foam::forces::forces fDName_(""), rhoRef_(VGREAT), pRef_(0), - CofR_(vector::zero), + coordSys_(), forcesFilePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -225,14 +225,13 @@ void Foam::forces::read(const dictionary& dict) if (active_) { log_ = dict.lookupOrDefault<Switch>("log", false); + directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); const fvMesh& mesh = refCast<const fvMesh>(obr_); patchSet_ = mesh.boundaryMesh().patchSet(wordList(dict.lookup("patches"))); - dict.readIfPresent("directForceDensity", directForceDensity_); - if (directForceDensity_) { // Optional entry for fDName @@ -245,8 +244,8 @@ void Foam::forces::read(const dictionary& dict) ) { active_ = false; - WarningIn("void forces::read(const dictionary& dict)") - << "Could not find " << fDName_ << " in database." << nl + WarningIn("void forces::read(const dictionary&)") + << "Could not find " << fDName_ << " in database." << nl << " De-activating forces." << endl; } @@ -272,7 +271,7 @@ void Foam::forces::read(const dictionary& dict) { active_ = false; - WarningIn("void forces::read(const dictionary& dict)") + WarningIn("void forces::read(const dictionary&)") << "Could not find " << UName_ << ", " << pName_; if (rhoName_ != "rhoInf") @@ -280,8 +279,8 @@ void Foam::forces::read(const dictionary& dict) Info<< " or " << rhoName_; } - Info<< " in database." << nl << " De-activating forces." - << endl; + Info<< " in database." << nl + << " De-activating forces." << endl; } // Reference density needed for incompressible calculations @@ -291,8 +290,14 @@ void Foam::forces::read(const dictionary& dict) pRef_ = dict.lookupOrDefault<scalar>("pRef", 0.0); } + coordSys_.clear(); + // Centre of rotation for moment calculations - CofR_ = dict.lookup("CofR"); + // specified directly, from coordinate system, or implicitly (0 0 0) + if (!dict.readIfPresent<point>("CofR", coordSys_.origin())) + { + coordSys_ = coordinateSystem(dict, obr_); + } } } @@ -345,6 +350,8 @@ void Foam::forces::writeFileHeader() forcesFilePtr_() << "# Time" << tab << "forces(pressure, viscous) moment(pressure, viscous)" + << tab + << "local forces(pressure, viscous) local moment(pressure, viscous)" << endl; } } @@ -373,13 +380,32 @@ void Foam::forces::write() if (Pstream::master()) { - forcesFilePtr_() << obr_.time().value() << tab << fm << endl; + forcesMoments fmLocal; + + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); + + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); + + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); + + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); + + forcesFilePtr_() << obr_.time().value() + << tab << fm + << tab << fmLocal << endl; if (log_) { Info<< "forces output:" << nl << " forces(pressure, viscous)" << fm.first() << nl << " moment(pressure, viscous)" << fm.second() << nl + << " local:" << nl + << " forces(pressure, viscous)" << fmLocal.first() << nl + << " moment(pressure, viscous)" << fmLocal.second() << nl << endl; } } @@ -408,7 +434,10 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); + vectorField Md + ( + mesh.C().boundaryField()[patchi] - coordSys_.origin() + ); scalarField sA(mag(Sfb[patchi])); @@ -452,7 +481,10 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); + vectorField Md + ( + mesh.C().boundaryField()[patchi] - coordSys_.origin() + ); vectorField pf(Sfb[patchi]*(p.boundaryField()[patchi] - pRef)); diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index 75470871abc243a29843d58d502310a787030450..dc796e4afd1dc840883e72798c11d06c7775aacb 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -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 @@ -28,11 +28,25 @@ Description Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches. - Member function calcForcesMoment()calculates and returns the forces and - moments. - - Member function forces::write() calls calcForcesMoment() and writes the - forces and moments into the file \<timeDir\>/forces.dat + Member function forces::write() calculates the forces/moments and + writes the forces/moments into the file \<timeDir\>/forces.dat + +Note + The centre of rotation for moment calculations can either be specified + by an @c CofR entry, or be taken from origin of the local coordinateSystem. + For example, + @verbatim + CofR (0 0 0); + @endverbatim + or + @verbatim + coordinateSystem + { + origin (0 0 0); + e3 (0 0 1); + e1 (1 0 0); + } + @endverbatim SourceFiles forces.C @@ -43,6 +57,8 @@ SourceFiles #ifndef forces_H #define forces_H +#include "coordinateSystem.H" +#include "coordinateSystems.H" #include "primitiveFieldsFwd.H" #include "volFieldsFwd.H" #include "HashSet.H" @@ -69,15 +85,14 @@ class forces { public: - // Tuple which holds the pressure (.first()) and viscous (.second) forces + // Tuple for pressure (.first()) and viscous (.second()) forces typedef Tuple2<vector, vector> pressureViscous; - // Tuple which holds the forces (.first()) and moment (.second) + // Tuple for forces (.first()) and moment (.second()) // pressure/viscous forces Tuples. typedef Tuple2<pressureViscous, pressureViscous> forcesMoments; - //- Sum operation class to accumulate the pressure, viscous forces - // and moments + //- Sum operation class to accumulate pressure/viscous forces and moments class sumOp { public: @@ -92,12 +107,12 @@ public: ( pressureViscous ( - fm1.first().first() + fm2.first().first(), + fm1.first().first() + fm2.first().first(), fm1.first().second() + fm2.first().second() ), pressureViscous ( - fm1.second().first() + fm2.second().first(), + fm1.second().first() + fm2.second().first(), fm1.second().second() + fm2.second().second() ) ); @@ -147,8 +162,8 @@ protected: //- Reference pressure scalar pRef_; - //- Centre of rotation - vector CofR_; + //- Coordinate system used when evaluting forces/moments + coordinateSystem coordSys_; //- Forces/moment file ptr diff --git a/src/sampling/Make/files b/src/sampling/Make/files index 3c61e371b6d9878decae938cdceb5eae091875a0..c9b26376d09db5931b086a32e7f8e0c41e76f3f5 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -46,14 +46,14 @@ sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C surfWriters = sampledSurface/writers -$(surfWriters)/surfaceWriters.C -$(surfWriters)/dx/dxSurfaceWriterRunTime.C -$(surfWriters)/ensight/ensightSurfaceWriterRunTime.C -$(surfWriters)/foamFile/foamFileSurfaceWriterRunTime.C -$(surfWriters)/null/nullSurfaceWriterRunTime.C -$(surfWriters)/proxy/proxySurfaceWriterRunTime.C -$(surfWriters)/raw/rawSurfaceWriterRunTime.C -$(surfWriters)/vtk/vtkSurfaceWriterRunTime.C +$(surfWriters)/surfaceWriter.C +$(surfWriters)/dx/dxSurfaceWriter.C +$(surfWriters)/ensight/ensightSurfaceWriter.C +$(surfWriters)/foamFile/foamFileSurfaceWriter.C +$(surfWriters)/proxy/proxySurfaceWriter.C +$(surfWriters)/raw/rawSurfaceWriter.C +$(surfWriters)/starcd/starcdSurfaceWriter.C +$(surfWriters)/vtk/vtkSurfaceWriter.C graphField/writePatchGraph.C graphField/writeCellGraph.C diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 06b32784894b476261db1e5380f133b3a9dd65cf..581b7e206bb33cd8fa44716e1fa7f0d67401ffc9 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -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 @@ -83,7 +83,7 @@ void Foam::sampledSurfaces::writeGeometry() const { if (Pstream::master() && mergeList_[surfI].faces.size()) { - genericFormatter_->write + formatter_->write ( outputDir, s.name(), @@ -94,7 +94,7 @@ void Foam::sampledSurfaces::writeGeometry() const } else if (s.faces().size()) { - genericFormatter_->write + formatter_->write ( outputDir, s.name(), @@ -123,9 +123,8 @@ Foam::sampledSurfaces::sampledSurfaces outputPath_(fileName::null), fieldSelection_(), interpolationScheme_(word::null), - writeFormat_(word::null), mergeList_(), - genericFormatter_(NULL), + formatter_(NULL), scalarFields_(), vectorFields_(), sphericalTensorFields_(), @@ -201,7 +200,7 @@ void Foam::sampledSurfaces::write() // write geometry first if required, // or when no fields would otherwise be written - if (nFields == 0 || genericFormatter_->separateFiles()) + if (nFields == 0 || formatter_->separateGeometry()) { writeGeometry(); } @@ -221,11 +220,15 @@ void Foam::sampledSurfaces::read(const dictionary& dict) clearFieldGroups(); dict.lookup("interpolationScheme") >> interpolationScheme_; - dict.lookup("surfaceFormat") >> writeFormat_; - - // define the generic (geometry) writer - genericFormatter_ = surfaceWriter<bool>::New(writeFormat_); + const word writeType(dict.lookup("surfaceFormat")); + // define the surface formatter + // optionally defined extra controls for the output formats + formatter_ = surfaceWriter::New + ( + writeType, + dict.subOrEmptyDict("formatOptions").subOrEmptyDict(writeType) + ); PtrList<sampledSurface> newList ( @@ -342,7 +345,7 @@ bool Foam::sampledSurfaces::update() } // dimension as fraction of mesh bounding box - scalar mergeDim = mergeTol_ * mesh_.globalData().bb().mag(); + scalar mergeDim = mergeTol_ * mesh_.bounds().mag(); if (Pstream::master() && debug) { diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H index 0c2084507a8dcdecaad9674c621cee1e1add3b69..4293cf9e628c4062c496f77372c4ce3ed9b35b8a 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H @@ -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 @@ -68,36 +68,11 @@ class sampledSurfaces { public: - //- The surface formatter - autoPtr< surfaceWriter<Type> > formatter; - //- Construct null fieldGroup() : - DynamicList<word>(0), - formatter(NULL) + DynamicList<word>(0) {} - - //- Construct for a particular surface format - fieldGroup(const word& writeFormat) - : - DynamicList<word>(0), - formatter(surfaceWriter<Type>::New(writeFormat)) - {} - - //- Reset format and field list - void clear() - { - DynamicList<word>::clear(); - formatter.clear(); - } - - //- Assign a new formatter - void operator=(const word& writeFormat) - { - formatter = surfaceWriter<Type>::New(writeFormat); - } - }; @@ -151,10 +126,6 @@ class sampledSurfaces //- Interpolation scheme to use word interpolationScheme_; - //- Output format to use - word writeFormat_; - - // surfaces //- Information for merging surfaces @@ -163,8 +134,8 @@ class sampledSurfaces // Calculated - //- Generic surface formatter - autoPtr< surfaceWriter<bool> > genericFormatter_; + //- Surface formatter + autoPtr<surfaceWriter> formatter_; //- Categorized scalar/vector/tensor fields fieldGroup<scalar> scalarFields_; @@ -190,14 +161,10 @@ class sampledSurfaces //- Sample and write a particular volume field template<class Type> - void sampleAndWrite - ( - const GeometricField<Type, fvPatchField, volMesh>&, - const surfaceWriter<Type>& formatter - ); + void sampleAndWrite(const GeometricField<Type, fvPatchField, volMesh>&); //- Sample and write all the fields of the given type - template <class Type> + template<class Type> void sampleAndWrite(fieldGroup<Type>&); //- Disallow default bitwise copy construct and assignment diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C index 578212ba3fe53819cc38b9a02cd556faea3d5696..13518214190bb7237dd047842d6c8cd974c3a695 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C @@ -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 @@ -32,8 +32,7 @@ License template<class Type> void Foam::sampledSurfaces::sampleAndWrite ( - const GeometricField<Type, fvPatchField, volMesh>& vField, - const surfaceWriter<Type>& formatter + const GeometricField<Type, fvPatchField, volMesh>& vField ) { // interpolator for this field @@ -96,7 +95,7 @@ void Foam::sampledSurfaces::sampleAndWrite // skip surface without faces (eg, a failed cut-plane) if (mergeList_[surfI].faces.size()) { - formatter.write + formatter_->write ( outputDir, s.name(), @@ -115,7 +114,7 @@ void Foam::sampledSurfaces::sampleAndWrite // skip surface without faces (eg, a failed cut-plane) if (s.faces().size()) { - formatter.write + formatter_->write ( outputDir, s.name(), @@ -139,12 +138,6 @@ void Foam::sampledSurfaces::sampleAndWrite { if (fields.size()) { - // create or use existing surfaceWriter - if (fields.formatter.empty()) - { - fields.formatter = surfaceWriter<Type>::New(writeFormat_); - } - forAll(fields, fieldI) { if (Pstream::master() && verbose_) @@ -168,8 +161,7 @@ void Foam::sampledSurfaces::sampleAndWrite false ), mesh_ - ), - fields.formatter() + ) ); } else @@ -190,8 +182,7 @@ void Foam::sampledSurfaces::sampleAndWrite <GeometricField<Type, fvPatchField, volMesh> > ( fields[fieldI] - ), - fields.formatter() + ) ); } } diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index 9a58dc41c266cf71ebed4371269ca7d88bd531da..3e3d56c6edec1b97a3d54fcaccfa7978ef9a05d2 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -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 @@ -28,6 +28,7 @@ License #include "Tuple2.H" #include "globalIndex.H" #include "treeDataCell.H" +#include "treeDataFace.H" #include "addToRunTimeSelectionTable.H" @@ -43,6 +44,17 @@ namespace Foam word ); + template<> + const char* NamedEnum<sampledTriSurfaceMesh::samplingSource, 2>::names[] = + { + "cells", + "boundaryFaces" + }; + + const NamedEnum<sampledTriSurfaceMesh::samplingSource, 2> + sampledTriSurfaceMesh::samplingSourceNames_; + + //- Private class for finding nearest // - global index // - sqr(distance) @@ -64,13 +76,71 @@ namespace Foam } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +const Foam::indexedOctree<Foam::treeDataFace>& +Foam::sampledTriSurfaceMesh::nonCoupledboundaryTree() const +{ + // Variant of meshSearch::boundaryTree() that only does non-coupled + // boundary faces. + + if (!boundaryTreePtr_.valid()) + { + // all non-coupled boundary faces (not just walls) + const polyBoundaryMesh& patches = mesh().boundaryMesh(); + + labelList bndFaces(mesh().nFaces()-mesh().nInternalFaces()); + label bndI = 0; + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + if (!pp.coupled()) + { + forAll(pp, i) + { + bndFaces[bndI++] = pp.start()+i; + } + } + } + bndFaces.setSize(bndI); + + + treeBoundBox overallBb(mesh().points()); + Random rndGen(123456); + overallBb = overallBb.extend(rndGen, 1E-4); + overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + + boundaryTreePtr_.reset + ( + new indexedOctree<treeDataFace> + ( + treeDataFace // all information needed to search faces + ( + false, // do not cache bb + mesh(), + bndFaces // boundary faces only + ), + overallBb, // overall search domain + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) + ); + } + + return boundaryTreePtr_(); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh ( const word& name, const polyMesh& mesh, - const word& surfaceName + const word& surfaceName, + const samplingSource sampleSource ) : sampledSurface(name, mesh), @@ -78,7 +148,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh ( IOobject ( - name, + surfaceName, mesh.time().constant(), // instance "triSurface", // local mesh, // registry @@ -87,9 +157,10 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh false ) ), + sampleSource_(sampleSource), needsUpdate_(true), - cellLabels_(0), - pointToFace_(0) + sampleElements_(0), + samplePoints_(0) {} @@ -114,9 +185,10 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh false ) ), + sampleSource_(samplingSourceNames_[dict.lookup("source")]), needsUpdate_(true), - cellLabels_(0), - pointToFace_(0) + sampleElements_(0), + samplePoints_(0) {} @@ -144,8 +216,10 @@ bool Foam::sampledTriSurfaceMesh::expire() sampledSurface::clearGeom(); MeshStorage::clear(); - cellLabels_.clear(); - pointToFace_.clear(); + + boundaryTreePtr_.clear(); + sampleElements_.clear(); + samplePoints_.clear(); needsUpdate_ = true; return true; @@ -164,43 +238,82 @@ bool Foam::sampledTriSurfaceMesh::update() // Does approximation by looking at the face centres only const pointField& fc = surface_.faceCentres(); + // Mesh search engine, no triangulation of faces. meshSearch meshSearcher(mesh(), false); - const indexedOctree<treeDataCell>& cellTree = meshSearcher.cellTree(); - - // Global numbering for cells - only used to uniquely identify local cells. - globalIndex globalCells(mesh().nCells()); List<nearInfo> nearest(fc.size()); + + // Global numbering for cells/faces - only used to uniquely identify local + // elements + globalIndex globalCells + ( + sampleSource_ == cells + ? mesh().nCells() + : mesh().nFaces() + ); + forAll(nearest, i) { nearest[i].first() = GREAT; nearest[i].second() = labelMax; } - // Search triangles using nearest on local mesh - forAll(fc, triI) + if (sampleSource_ == cells) { - pointIndexHit nearInfo = cellTree.findNearest - ( - fc[triI], - sqr(GREAT) - ); - if (nearInfo.hit()) + // Search for nearest cell + + const indexedOctree<treeDataCell>& cellTree = meshSearcher.cellTree(); + + forAll(fc, triI) + { + pointIndexHit nearInfo = cellTree.findNearest + ( + fc[triI], + sqr(GREAT) + ); + if (nearInfo.hit()) + { + nearest[triI].first() = magSqr(nearInfo.hitPoint()-fc[triI]); + nearest[triI].second() = globalCells.toGlobal(nearInfo.index()); + } + } + } + else + { + // Search for nearest boundaryFace + + ////- Search on all (including coupled) boundary faces + //const indexedOctree<treeDataFace>& bTree = meshSearcher.boundaryTree() + //- Search on all non-coupled boundary faces + const indexedOctree<treeDataFace>& bTree = nonCoupledboundaryTree(); + + forAll(fc, triI) { - nearest[triI].first() = magSqr(nearInfo.hitPoint()-fc[triI]); - nearest[triI].second() = globalCells.toGlobal(nearInfo.index()); + pointIndexHit nearInfo = bTree.findNearest + ( + fc[triI], + sqr(GREAT) + ); + if (nearInfo.hit()) + { + nearest[triI].first() = magSqr(nearInfo.hitPoint()-fc[triI]); + nearest[triI].second() = globalCells.toGlobal + ( + bTree.shapes().faceLabels()[nearInfo.index()] + ); + } } } - // See which processor has the nearest. + + // See which processor has the nearest. Mark and subset + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Pstream::listCombineGather(nearest, nearestEqOp()); Pstream::listCombineScatter(nearest); - boolList include(surface_.size(), false); - - cellLabels_.setSize(fc.size()); - cellLabels_ = -1; + labelList cellOrFaceLabels(fc.size(), -1); label nFound = 0; forAll(nearest, triI) @@ -211,9 +324,10 @@ bool Foam::sampledTriSurfaceMesh::update() } else if (globalCells.isLocal(nearest[triI].second())) { - cellLabels_[triI] = globalCells.toLocal(nearest[triI].second()); - - include[triI] = true; + cellOrFaceLabels[triI] = globalCells.toLocal + ( + nearest[triI].second() + ); nFound++; } } @@ -221,7 +335,7 @@ bool Foam::sampledTriSurfaceMesh::update() if (debug) { - Pout<< "Local out of faces:" << cellLabels_.size() + Pout<< "Local out of faces:" << cellOrFaceLabels.size() << " keeping:" << nFound << endl; } @@ -243,7 +357,7 @@ bool Foam::sampledTriSurfaceMesh::update() forAll(s, faceI) { - if (include[faceI]) + if (cellOrFaceLabels[faceI] != -1) { faceMap[newFaceI++] = faceI; @@ -262,11 +376,12 @@ bool Foam::sampledTriSurfaceMesh::update() pointMap.setSize(newPointI); } - // Subset cellLabels - cellLabels_ = UIndirectList<label>(cellLabels_, faceMap)(); - // Store any face per point - pointToFace_.setSize(pointMap.size()); + // Subset cellOrFaceLabels + cellOrFaceLabels = UIndirectList<label>(cellOrFaceLabels, faceMap)(); + + // Store any face per point (without using pointFaces()) + labelList pointToFace(pointMap.size()); // Create faces and points for subsetted surface faceList& faces = this->storedFaces(); @@ -284,7 +399,7 @@ bool Foam::sampledTriSurfaceMesh::update() forAll(newF, fp) { - pointToFace_[newF[fp]] = i; + pointToFace[newF[fp]] = i; } } @@ -296,6 +411,161 @@ bool Foam::sampledTriSurfaceMesh::update() Pout<< endl; } + + + // Collect the samplePoints and sampleElements + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + if (sampledSurface::interpolate()) + { + samplePoints_.setSize(pointMap.size()); + sampleElements_.setSize(pointMap.size(), -1); + + if (sampleSource_ == cells) + { + // samplePoints_ : per surface point a location inside the cell + // sampleElements_ : per surface point the cell + + forAll(points(), pointI) + { + const point& pt = points()[pointI]; + label cellI = cellOrFaceLabels[pointToFace[pointI]]; + sampleElements_[pointI] = cellI; + + // Check if point inside cell + if (mesh().pointInCell(pt, sampleElements_[pointI])) + { + samplePoints_[pointI] = pt; + } + else + { + // Find nearest point on faces of cell + const cell& cFaces = mesh().cells()[cellI]; + + scalar minDistSqr = VGREAT; + + forAll(cFaces, i) + { + const face& f = mesh().faces()[cFaces[i]]; + pointHit info = f.nearestPoint(pt, mesh().points()); + if (info.distance() < minDistSqr) + { + minDistSqr = info.distance(); + samplePoints_[pointI] = info.rawPoint(); + } + } + } + } + } + else + { + // samplePoints_ : per surface point a location on the boundary + // sampleElements_ : per surface point the boundary face containing + // the location + + forAll(points(), pointI) + { + const point& pt = points()[pointI]; + label faceI = cellOrFaceLabels[pointToFace[pointI]]; + sampleElements_[pointI] = faceI; + samplePoints_[pointI] = mesh().faces()[faceI].nearestPoint + ( + pt, + mesh().points() + ).rawPoint(); + } + } + } + else + { + // if sampleSource_ == cells: + // samplePoints_ : n/a + // sampleElements_ : per surface triangle the cell + // else: + // samplePoints_ : n/a + // sampleElements_ : per surface triangle the boundary face + samplePoints_.clear(); + sampleElements_.transfer(cellOrFaceLabels); + } + + + if (debug) + { + this->clearOut(); + OFstream str(mesh().time().path()/"surfaceToMesh.obj"); + Info<< "Dumping correspondence from local surface (points or faces)" + << " to mesh (cells or faces) to " << str.name() << endl; + label vertI = 0; + + if (sampledSurface::interpolate()) + { + if (sampleSource_ == cells) + { + forAll(samplePoints_, pointI) + { + meshTools::writeOBJ(str, points()[pointI]); + vertI++; + + meshTools::writeOBJ(str, samplePoints_[pointI]); + vertI++; + + label cellI = sampleElements_[pointI]; + meshTools::writeOBJ(str, mesh().cellCentres()[cellI]); + vertI++; + str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI + << nl; + } + } + else + { + forAll(samplePoints_, pointI) + { + meshTools::writeOBJ(str, points()[pointI]); + vertI++; + + meshTools::writeOBJ(str, samplePoints_[pointI]); + vertI++; + + label faceI = sampleElements_[pointI]; + meshTools::writeOBJ(str, mesh().faceCentres()[faceI]); + vertI++; + str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI + << nl; + } + } + } + else + { + if (sampleSource_ == cells) + { + forAll(sampleElements_, triI) + { + meshTools::writeOBJ(str, faceCentres()[triI]); + vertI++; + + label cellI = sampleElements_[triI]; + meshTools::writeOBJ(str, mesh().cellCentres()[cellI]); + vertI++; + str << "l " << vertI-1 << ' ' << vertI << nl; + } + } + else + { + forAll(sampleElements_, triI) + { + meshTools::writeOBJ(str, faceCentres()[triI]); + vertI++; + + label faceI = sampleElements_[triI]; + meshTools::writeOBJ(str, mesh().faceCentres()[faceI]); + vertI++; + str << "l " << vertI-1 << ' ' << vertI << nl; + } + } + } + } + + needsUpdate_ = false; return true; } diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H index 5ea423583da6ebeeb0d0e6c58f0245bd099e2967..c54bf28dc092a373976fab373ad763756616be99 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H @@ -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 @@ -28,12 +28,31 @@ Description A sampledSurface from a triSurfaceMesh. It samples on the points/triangles of the triSurface. - It samples using the cell nearest to the triangle centre so does - not check the cell the centre is actually in ... - - In parallel every processor just operates on the part of the surface - where the face centres are inside the mesh. It is then up to the - caller to stitch the partial surfaces together. + - it either samples cells or (non-coupled) boundary faces + + - 4 different modes: + - source=cells, interpolate=false: + finds per triangle centre the nearest cell centre and uses its value + - source=cells, interpolate=true + finds per triangle centre the nearest cell centre. + Per surface point checks if this nearest cell is the one containing + point; otherwise projects the point onto the nearest point on + the boundary of the cell (to make sure interpolateCellPoint + gets a valid location) + + - source=boundaryFaces, interpolate=false: + finds per triangle centre the nearest point on the boundary + (uncoupled faces only) and uses the value (or 0 if the nearest + is on an empty boundary) + - source=boundaryFaces, interpolate=true: + finds per triangle centre the nearest point on the boundary + (uncoupled faces only). + Per surface point projects the point onto this boundary face + (to make sure interpolateCellPoint gets a valid location) + + - since it finds a nearest per triangle each triangle is guaranteed + to be on one processor only. So after stitching (by sampledSurfaces) + the original surface should be complete. SourceFiles sampledTriSurfaceMesh.C @@ -52,6 +71,8 @@ SourceFiles namespace Foam { +class treeDataFace; + /*---------------------------------------------------------------------------*\ Class sampledTriSurfaceMesh Declaration \*---------------------------------------------------------------------------*/ @@ -61,26 +82,48 @@ class sampledTriSurfaceMesh public sampledSurface, public MeshedSurface<face> { +public: + //- Types of communications + enum samplingSource + { + cells, + boundaryFaces + }; + +private: + //- Private typedefs for convenience typedef MeshedSurface<face> MeshStorage; + // Private data + static const NamedEnum<samplingSource, 2> samplingSourceNames_; + //- Surface to sample on const triSurfaceMesh surface_; + //- Whether to sample internal cell values or boundary values + const samplingSource sampleSource_; + //- Track if the surface needs an update mutable bool needsUpdate_; - //- From local surface triangle to mesh cell. - labelList cellLabels_; + //- Search tree for all non-coupled boundary faces + mutable autoPtr<indexedOctree<treeDataFace> > boundaryTreePtr_; - //- From local surface back to surface_ - labelList pointToFace_; + //- From local surface triangle to mesh cell/face. + labelList sampleElements_; + + //- Local points to sample per point + pointField samplePoints_; // Private Member Functions + //- Get tree of all non-coupled boundary faces + const indexedOctree<treeDataFace>& nonCoupledboundaryTree() const; + //- sample field on faces template <class Type> tmp<Field<Type> > sampleField @@ -106,7 +149,8 @@ public: ( const word& name, const polyMesh& mesh, - const word& surfaceName + const word& surfaceName, + const samplingSource sampleSource ); //- Construct from dictionary diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C index 6226d48ac107c2d49bc90e1a6a72234529f9a27a..9e8b251f7f5093ef89a159c288f351cc4f682ce8 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C @@ -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) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,12 +35,48 @@ Foam::sampledTriSurfaceMesh::sampleField ) const { // One value per face - tmp<Field<Type> > tvalues(new Field<Type>(cellLabels_.size())); + tmp<Field<Type> > tvalues(new Field<Type>(sampleElements_.size())); Field<Type>& values = tvalues(); - forAll(cellLabels_, triI) + if (sampleSource_ == cells) { - values[triI] = vField[cellLabels_[triI]]; + // Sample cells + + forAll(sampleElements_, triI) + { + values[triI] = vField[sampleElements_[triI]]; + } + } + else + { + // Sample boundary faces + + const polyBoundaryMesh& pbm = mesh().boundaryMesh(); + label nBnd = mesh().nFaces()-mesh().nInternalFaces(); + + // Create flat boundary field + + Field<Type> bVals(nBnd, pTraits<Type>::zero); + + forAll(vField.boundaryField(), patchI) + { + label bFaceI = pbm[patchI].start() - mesh().nInternalFaces(); + + SubList<Type> + ( + bVals, + vField.boundaryField()[patchI].size(), + bFaceI + ).assign(vField.boundaryField()[patchI]); + } + + // Sample in flat boundary field + + forAll(sampleElements_, triI) + { + label faceI = sampleElements_[triI]; + values[triI] = bVals[faceI-mesh().nInternalFaces()]; + } } return tvalues; @@ -55,15 +91,37 @@ Foam::sampledTriSurfaceMesh::interpolateField ) const { // One value per vertex - tmp<Field<Type> > tvalues(new Field<Type>(pointToFace_.size())); + tmp<Field<Type> > tvalues(new Field<Type>(sampleElements_.size())); Field<Type>& values = tvalues(); - forAll(pointToFace_, pointI) + if (sampleSource_ == cells) { - label triI = pointToFace_[pointI]; - label cellI = cellLabels_[triI]; - - values[pointI] = interpolator.interpolate(points()[pointI], cellI); + // Sample cells. + + forAll(sampleElements_, pointI) + { + values[pointI] = interpolator.interpolate + ( + samplePoints_[pointI], + sampleElements_[pointI] + ); + } + } + else + { + // Sample boundary faces. + + forAll(samplePoints_, pointI) + { + label faceI = sampleElements_[pointI]; + + values[pointI] = interpolator.interpolate + ( + samplePoints_[pointI], + mesh().faceOwner()[faceI], + faceI + ); + } } return tvalues; diff --git a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C index 6bdb3e63e9b60fe64da243ba66240ba6ea61cf32..3d477daf9a9fc7fb2bf394bed60d4fa2e503bb3e 100644 --- a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C @@ -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 @@ -28,10 +28,19 @@ License #include "OFstream.H" #include "OSspecific.H" +#include "makeSurfaceWriterMethods.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + makeSurfaceWriterType(dxSurfaceWriter); +} + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template<class Type> -void Foam::dxSurfaceWriter<Type>::writeGeometry +void Foam::dxSurfaceWriter::writeGeometry ( Ostream& os, const pointField& points, @@ -54,7 +63,6 @@ void Foam::dxSurfaceWriter<Type>::writeGeometry os << nl; // Write triangles - os << "# The irregular connections (triangles)" << nl << "object 2 class array type int rank 1 shape 3 items " << faces.size() << " data follows" << nl; @@ -80,17 +88,41 @@ void Foam::dxSurfaceWriter<Type>::writeGeometry } +void Foam::dxSurfaceWriter::writeTrailer(Ostream& os, const bool isNodeValues) +{ + if (isNodeValues) + { + os << nl << "attribute \"dep\" string \"positions\"" + << nl << nl; + } + else + { + os << nl << "attribute \"dep\" string \"connections\"" + << nl << nl; + } + + os << "# the field, with three components: \"positions\"," + << " \"connections\", and \"data\"" << nl + << "object \"irregular positions irregular " + << "connections\" class field" + << nl + << "component \"positions\" value 1" << nl + << "component \"connections\" value 2" << nl + << "component \"data\" value 3" << nl; + + os << "end" << endl; +} + + namespace Foam { - // Write scalarField in DX format template<> - void Foam::dxSurfaceWriter<Foam::scalar>::writeData + void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<scalar>& values ) { - // Write data os << "object 3 class array type float rank 0 items " << values.size() << " data follows" << nl; @@ -101,15 +133,13 @@ namespace Foam } - // Write vectorField in DX format template<> - void Foam::dxSurfaceWriter<Foam::vector>::writeData + void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<vector>& values ) { - // Write data os << "object 3 class array type float rank 1 shape 3 items " << values.size() << " data follows" << nl; @@ -122,15 +152,13 @@ namespace Foam } - // Write sphericalTensorField in DX format template<> - void Foam::dxSurfaceWriter<Foam::sphericalTensor>::writeData + void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<sphericalTensor>& values ) { - // Write data os << "object 3 class array type float rank 0 items " << values.size() << " data follows" << nl; @@ -141,15 +169,13 @@ namespace Foam } - // Write symmTensorField in DX format template<> - void Foam::dxSurfaceWriter<Foam::symmTensor>::writeData + void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<symmTensor>& values ) { - // Write data os << "object 3 class array type float rank 2 shape 3 items " << values.size() << " data follows" << nl; @@ -165,15 +191,14 @@ namespace Foam } - // Write tensorField in DX format + // Write Field<tensor> in DX format template<> - void Foam::dxSurfaceWriter<Foam::tensor>::writeData + inline void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<tensor>& values ) { - // Write data os << "object 3 class array type float rank 2 shape 3 items " << values.size() << " data follows" << nl; @@ -189,15 +214,15 @@ namespace Foam } } -// Write tensorField in DX format + +// arbitrary field template<class Type> -void Foam::dxSurfaceWriter<Type>::writeData +inline void Foam::dxSurfaceWriter::writeData ( Ostream& os, const Field<Type>& values ) { - // Write data os << "object 3 class array type float rank 0 items " << values.size() << " data follows" << nl; @@ -208,41 +233,8 @@ void Foam::dxSurfaceWriter<Type>::writeData } -// Write trailer in DX format template<class Type> -void Foam::dxSurfaceWriter<Type>::writeTrailer(Ostream& os) -{ - os << "# the field, with three components: \"positions\"," - << " \"connections\", and \"data\"" << nl - << "object \"irregular positions irregular " - << "connections\" class field" - << nl - << "component \"positions\" value 1" << nl - << "component \"connections\" value 2" << nl - << "component \"data\" value 3" << nl; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::dxSurfaceWriter<Type>::dxSurfaceWriter() -: - surfaceWriter<Type>() -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class Type> -Foam::dxSurfaceWriter<Type>::~dxSurfaceWriter() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void Foam::dxSurfaceWriter<Type>::write +void Foam::dxSurfaceWriter::writeTemplate ( const fileName& outputDir, const fileName& surfaceName, @@ -270,24 +262,29 @@ void Foam::dxSurfaceWriter<Type>::write } writeGeometry(os, points, faces); - writeData(os, values); + writeTrailer(os, isNodeValues); +} - if (isNodeValues) - { - os << nl << "attribute \"dep\" string \"positions\"" - << nl << nl; - } - else - { - os << nl << "attribute \"dep\" string \"connections\"" - << nl << nl; - } - writeTrailer(os); +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - os << "end" << nl; -} +Foam::dxSurfaceWriter::dxSurfaceWriter() +: + surfaceWriter() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dxSurfaceWriter::~dxSurfaceWriter() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +// create write methods +defineSurfaceWriterWriteFields(Foam::dxSurfaceWriter); // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H index feccf33be1df14b85609038e2acdc055c8001965..e4e3af67e6bd4e6082b683b096e3bca26ab12dc5 100644 --- a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H @@ -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,6 +25,7 @@ Class Foam::dxSurfaceWriter Description + A surfaceWriter for OpenDX format. SourceFiles dxSurfaceWriter.C @@ -42,22 +43,36 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class dxSurfaceWriter Declaration + Class dxSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class dxSurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { // Private Member Functions static void writeGeometry(Ostream&, const pointField&, const faceList&); + static void writeTrailer(Ostream&, const bool isNodeValues); - static void writeData(Ostream&, const Field<Type>& values); + template<class Type> + static void writeData(Ostream&, const Field<Type>&); + + //- Templated write operation + template<class Type> + void writeTemplate + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose + ) const; - static void writeTrailer(Ostream&); public: @@ -77,32 +92,82 @@ public: // Member Functions - // Write + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<scalar>& values, + const bool isNodeValues, + const bool verbose = false + ) const; - //- Writes single surface to file. + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( - const fileName& outputDir, - const fileName& surfaceName, + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, const bool isNodeValues, const bool verbose = false ) const; -}; + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "dxSurfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C index cde2d597a839a8a951554539f700afb481a4990c..d83ec611a1015be98df590641daabff6d1582449 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C @@ -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 @@ -28,120 +28,71 @@ License #include "OFstream.H" #include "OSspecific.H" #include "IOmanip.H" -#include "ensightGeoFile.H" -#include "ensightPartNonMeshFaces.H" +#include "ensightPartFaces.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -namespace Foam -{ +#include "makeSurfaceWriterMethods.H" - // Write scalarField in ensight format - template<> - void Foam::ensightSurfaceWriter<Foam::scalar>::writeData - ( - Ostream& os, - const Field<Foam::scalar>& values - ) - { - forAll(values, i) - { - os << values[i] << nl; - } - } - - - // Write booField in ensight format - template<> - void Foam::ensightSurfaceWriter<bool>::writeData - ( - Ostream& os, - const Field<bool>& values - ) - { - forAll(values, i) - { - os << values[i] << nl; - } - } -} +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -// Write generic field in ensight format -template<class Type> -void Foam::ensightSurfaceWriter<Type>::writeData -( - Ostream& os, - const Field<Type>& values -) +namespace Foam { - for (direction cmpt = 0; cmpt < vector::nComponents; cmpt++) - { - scalarField v(values.component(cmpt)); - forAll(v, i) - { - os << v[i] << nl; - } - } + makeSurfaceWriterType(ensightSurfaceWriter); + addToRunTimeSelectionTable(surfaceWriter, ensightSurfaceWriter, wordDict); } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from components -template<class Type> -Foam::ensightSurfaceWriter<Type>::ensightSurfaceWriter() -: - surfaceWriter<Type>() -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class Type> -Foam::ensightSurfaceWriter<Type>::~ensightSurfaceWriter() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type> -void Foam::ensightSurfaceWriter<Type>::write +void Foam::ensightSurfaceWriter::writeTemplate ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, const bool verbose ) const { - if (!isDir(outputDir)) + if (!isDir(outputDir/fieldName)) { - mkDir(outputDir); + mkDir(outputDir/fieldName); } - //const scalar timeValue = Foam::name(this->mesh().time().timeValue()); + // const scalar timeValue = Foam::name(this->mesh().time().timeValue()); const scalar timeValue = 0.0; - - OFstream caseStr(outputDir/surfaceName + ".case"); - ensightGeoFile geomStr + OFstream osCase(outputDir/fieldName/surfaceName + ".case"); + ensightGeoFile osGeom ( - outputDir/surfaceName + ".000.mesh", - IOstream::ASCII + outputDir/fieldName/surfaceName + ".000.mesh", + writeFormat_ + ); + ensightFile osField + ( + outputDir/fieldName/surfaceName + ".000." + fieldName, + writeFormat_ ); if (verbose) { - Info<< "Writing case file to " << caseStr.name() << endl; + Info<< "Writing case file to " << osCase.name() << endl; } - caseStr + osCase << "FORMAT" << nl << "type: ensight gold" << nl << nl << "GEOMETRY" << nl - << "model: 1 " << geomStr.name().name() << nl + << "model: 1 " << osGeom.name().name() << nl + << nl + << "VARIABLE" << nl + << pTraits<Type>::typeName << " per " + << word(isNodeValues ? "node:" : "element:") << setw(10) << 1 + << " " << fieldName + << " " << surfaceName.c_str() << ".***." << fieldName << nl << nl << "TIME" << nl << "time set: 1" << nl @@ -152,74 +103,80 @@ void Foam::ensightSurfaceWriter<Type>::write << timeValue << nl << nl; - ensightPartNonMeshFaces faceWriter(0, geomStr.name().name(), faces, points); - faceWriter.writeGeometry(geomStr); + ensightPartFaces ensPart(0, osGeom.name().name(), points, faces, true); + osGeom << ensPart; + + // Write field + osField.writeKeyword(pTraits<Type>::typeName); + ensPart.writeField(osField, values, isNodeValues); } -template<class Type> -void Foam::ensightSurfaceWriter<Type>::write +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::ensightSurfaceWriter::ensightSurfaceWriter() +: + surfaceWriter(), + writeFormat_(IOstream::ASCII) +{} + + +Foam::ensightSurfaceWriter::ensightSurfaceWriter(const dictionary& options) +: + surfaceWriter(), + writeFormat_(IOstream::ASCII) +{ + // choose ascii or binary format + if (options.found("format")) + { + writeFormat_ = IOstream::formatEnum(options.lookup("format")); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::ensightSurfaceWriter::~ensightSurfaceWriter() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::ensightSurfaceWriter::write ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, const bool verbose ) const { - if (!isDir(outputDir/fieldName)) + if (!isDir(outputDir)) { - mkDir(outputDir/fieldName); + mkDir(outputDir); } - //const scalar timeValue = Foam::name(this->mesh().time().timeValue()); + // const scalar timeValue = Foam::name(this->mesh().time().timeValue()); const scalar timeValue = 0.0; - - OFstream caseStr(outputDir/fieldName/surfaceName + ".case"); - ensightGeoFile geomStr + OFstream osCase(outputDir/surfaceName + ".case"); + ensightGeoFile osGeom ( - outputDir/fieldName/surfaceName + ".000.mesh", - IOstream::ASCII - ); - ensightFile fieldStr - ( - outputDir/fieldName/surfaceName + ".000." + fieldName, - IOstream::ASCII + outputDir/surfaceName + ".000.mesh", + writeFormat_ ); if (verbose) { - Info<< "Writing case file to " << caseStr.name() << endl; + Info<< "Writing case file to " << osCase.name() << endl; } - caseStr + osCase << "FORMAT" << nl << "type: ensight gold" << nl << nl << "GEOMETRY" << nl - << "model: 1 " << geomStr.name().name() << nl - << nl - << "VARIABLE" << nl; - if (isNodeValues) - { - caseStr - << pTraits<Type>::typeName << " per node:" << setw(10) << 1 - << " " << fieldName - << " " << surfaceName.c_str() << ".***." << fieldName << nl; - } - else - { - caseStr - << pTraits<Type>::typeName << " per element:" << setw(10) << 1 - << " " << fieldName - << " " << surfaceName.c_str() << ".***." << fieldName << nl; - } - - caseStr + << "model: 1 " << osGeom.name().name() << nl << nl << "TIME" << nl << "time set: 1" << nl @@ -230,41 +187,13 @@ void Foam::ensightSurfaceWriter<Type>::write << timeValue << nl << nl; - ensightPartNonMeshFaces faceWriter(0, geomStr.name().name(), faces, points); - faceWriter.writeGeometry(geomStr); + ensightPartFaces ensPart(0, osGeom.name().name(), points, faces, true); + osGeom << ensPart; +} - // Write field - fieldStr - << pTraits<Type>::typeName << nl - << "part" << nl - << setw(10) << 1 << nl; - if (isNodeValues) - { - fieldStr << "coordinates" << nl; - writeData(fieldStr, values); - } - else - { - //faceWriter.writeField(fieldStr, values); - forAll(faceWriter.elementTypes(), elemI) - { - if (faceWriter.elemLists()[elemI].size()) - { - fieldStr.writeKeyword(faceWriter.elementTypes()[elemI]); - writeData - ( - fieldStr, - Field<Type> - ( - values, - faceWriter.elemLists()[elemI] - ) - ); - } - } - } -} +// create write methods +defineSurfaceWriterWriteFields(Foam::ensightSurfaceWriter); // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H index d2f01c6479be562a6b2c5a6f7cca41952b4067d7..628c178d4e6f5b7db109af0d2faeee32530a8ccf 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H @@ -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 @@ -25,6 +25,7 @@ Class Foam::ensightSurfaceWriter Description + A surfaceWriter for Ensight format. SourceFiles ensightSurfaceWriter.C @@ -41,29 +42,35 @@ SourceFiles namespace Foam { -class ensightGeoFile; - /*---------------------------------------------------------------------------*\ Class ensightSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class ensightSurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { // Private data - fileName caseFileName_; - fileName surfaceName_; - fileName geomName_; - DynamicList<word> varNames_; - DynamicList<fileName> varFileNames_; + //- Write option (default is IOstream::ASCII + IOstream::streamFormat writeFormat_; // Private Member Functions - static void writeData(Ostream&, const Field<Type>& values); + //- Templated write operation + template<class Type> + void writeTemplate + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose + ) const; public: @@ -77,6 +84,9 @@ public: //- Construct null ensightSurfaceWriter(); + //- Construct with some output options + ensightSurfaceWriter(const dictionary& options); + //- Destructor virtual ~ensightSurfaceWriter(); @@ -84,9 +94,15 @@ public: // Member Functions - // Write + //- True if the surface format supports geometry in a separate file. + // False if geometry and field must be in a single file + virtual bool separateGeometry() + { + return true; + } - //- Write geometry to file. + + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, @@ -97,30 +113,82 @@ public: ) const; - //- Writes single surface to file. + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( - const fileName& outputDir, - const fileName& surfaceName, + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, + const word& fieldName, // name of field + const Field<scalar>& values, const bool isNodeValues, const bool verbose = false ) const; -}; + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "ensightSurfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterRunTime.C deleted file mode 100644 index 8355a6d991b5bbcf791a5214271fb9d706eca17f..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterRunTime.C +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-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 "ensightSurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriterType(ensightSurfaceWriter, bool); -makeSurfaceWriters(ensightSurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C index 747a79f39a959f2a848bb31a8d9f40c72ef0bc52..06005b5c0aea7af1c4fd914a7126b9bd76ba6c62 100644 --- a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,31 +28,28 @@ License #include "OFstream.H" #include "OSspecific.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::foamFileSurfaceWriter<Type>::foamFileSurfaceWriter() -: - surfaceWriter<Type>() -{} +#include "makeSurfaceWriterMethods.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class Type> -Foam::foamFileSurfaceWriter<Type>::~foamFileSurfaceWriter() -{} +namespace Foam +{ + makeSurfaceWriterType(foamFileSurfaceWriter); +} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type> -void Foam::foamFileSurfaceWriter<Type>::write +void Foam::foamFileSurfaceWriter::writeTemplate ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, const bool verbose ) const { @@ -65,38 +62,47 @@ void Foam::foamFileSurfaceWriter<Type>::write if (verbose) { - Info<< "Writing geometry to " << surfaceDir << endl; + Info<< "Writing field " << fieldName << " to " << surfaceDir << endl; } - // Points - OFstream(surfaceDir/"points")() << points; - - // Faces - OFstream(surfaceDir/"faces")() << faces; + // geometry should already have been written + // Values to separate directory (e.g. "scalarField/p") - // Face centers. Not really necessary but very handy when reusing as inputs - // for e.g. timeVaryingMapped bc. - pointField faceCentres(faces.size(),point::zero); + fileName foamName(pTraits<Type>::typeName); + fileName valuesDir(surfaceDir / (foamName + Field<Type>::typeName)); - forAll (faces, faceI) + if (!isDir(valuesDir)) { - faceCentres[faceI] = faces[faceI].centre(points); + mkDir(valuesDir); } - OFstream(surfaceDir/"faceCentres")() << faceCentres; + // values + OFstream(valuesDir/fieldName)() << values; } -template<class Type> -void Foam::foamFileSurfaceWriter<Type>::write +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::foamFileSurfaceWriter::foamFileSurfaceWriter() +: + surfaceWriter() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::foamFileSurfaceWriter::~foamFileSurfaceWriter() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::foamFileSurfaceWriter::write ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, const bool verbose ) const { @@ -109,24 +115,31 @@ void Foam::foamFileSurfaceWriter<Type>::write if (verbose) { - Info<< "Writing field " << fieldName << " to " << surfaceDir << endl; + Info<< "Writing geometry to " << surfaceDir << endl; } - // geometry should already have been written - // Values to separate directory (e.g. "scalarField/p") + // Points + OFstream(surfaceDir/"points")() << points; - fileName foamName(pTraits<Type>::typeName); - fileName valuesDir(surfaceDir / (foamName + Field<Type>::typeName)); + // Faces + OFstream(surfaceDir/"faces")() << faces; - if (!isDir(valuesDir)) + // Face centers. Not really necessary but very handy when reusing as inputs + // for e.g. timeVaryingMapped bc. + pointField faceCentres(faces.size(),point::zero); + + forAll(faces, faceI) { - mkDir(valuesDir); + faceCentres[faceI] = faces[faceI].centre(points); } - // values - OFstream(valuesDir/fieldName)() << values; + OFstream(surfaceDir/"faceCentres")() << faceCentres; } +// create write methods +defineSurfaceWriterWriteFields(Foam::foamFileSurfaceWriter); + + // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H index 0076abdc88a27d51a1602f76d44a711bcecb9516..ce19c21455acb7364db57c1ae82a601067716f3a 100644 --- a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,14 +43,29 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class foamFileSurfaceWriter Declaration + Class foamFileSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class foamFileSurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { + // Private Member Functions + + //- Templated write operation + template<class Type> + void writeTemplate + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose + ) const; + public: @@ -70,13 +85,14 @@ public: // Member Functions - //- Return true if the surface format supports separate files - virtual bool separateFiles() + //- True if the surface format supports geometry in a separate file. + // False if geometry and field must be in a single file + virtual bool separateGeometry() { return true; } - //- Write geometry to file. + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, @@ -86,30 +102,83 @@ public: const bool verbose = false ) const; - //- Writes single surface to file. + + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( - const fileName& outputDir, - const fileName& surfaceName, + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, + const word& fieldName, // name of field + const Field<scalar>& values, const bool isNodeValues, const bool verbose = false ) const; -}; + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "foamFileSurfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C deleted file mode 100644 index c8a40e736ca8b92073280defdaae88d6baa5cc83..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C +++ /dev/null @@ -1,44 +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 "foamFileSurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriterType(foamFileSurfaceWriter, bool); -makeSurfaceWriters(foamFileSurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/makeSurfaceWriterMethods.H b/src/sampling/sampledSurface/writers/makeSurfaceWriterMethods.H new file mode 100644 index 0000000000000000000000000000000000000000..b748a32c6c06992454102c4debd6a05b017db555 --- /dev/null +++ b/src/sampling/sampledSurface/writers/makeSurfaceWriterMethods.H @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-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/>. + +InClass + Foam::makeSurfaceWriterMethods + +Description + Convenience macros for instantiating writer methods for surfaceWriter + classes. + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSurfaceWriterMethods_H +#define makeSurfaceWriterMethods_H + +#include "surfaceWriter.H" +#include "addToRunTimeSelectionTable.H" + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSurfaceWriterType(ThisClass) \ + defineTypeNameAndDebug(ThisClass, 0); \ + addToRunTimeSelectionTable(surfaceWriter, ThisClass, word) + + +#define defineSurfaceWriterWriteField(ThisClass, FieldType) \ + void ThisClass::write \ + ( \ + const fileName& outputDir, \ + const fileName& surfaceName, \ + const pointField& points, \ + const faceList& faces, \ + const word& fieldName, \ + const Field<FieldType>& values, \ + const bool isNodeValues, \ + const bool verbose \ + ) const \ + { \ + writeTemplate \ + ( \ + outputDir, \ + surfaceName, \ + points, \ + faces, \ + fieldName, \ + values, \ + isNodeValues, \ + verbose \ + ); \ + } + + +#define defineSurfaceWriterWriteFields(ThisClass) \ + defineSurfaceWriterWriteField(ThisClass, scalar); \ + defineSurfaceWriterWriteField(ThisClass, vector); \ + defineSurfaceWriterWriteField(ThisClass, sphericalTensor); \ + defineSurfaceWriterWriteField(ThisClass, symmTensor); \ + defineSurfaceWriterWriteField(ThisClass, tensor) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C deleted file mode 100644 index 85d4fcbb62c0b6d7c91823417062e6b41af6ccbe..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C +++ /dev/null @@ -1,63 +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 "nullSurfaceWriter.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::nullSurfaceWriter<Type>::nullSurfaceWriter() -: - surfaceWriter<Type>() -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class Type> -Foam::nullSurfaceWriter<Type>::~nullSurfaceWriter() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void Foam::nullSurfaceWriter<Type>::write -( - const fileName& outputDir, - const fileName& surfaceName, - const pointField& points, - const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, - const bool verbose -) const -{} - - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H deleted file mode 100644 index aef12a76cea9eaa828b87bab7e2aa9565e8fb72a..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H +++ /dev/null @@ -1,103 +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/>. - -Class - Foam::nullSurfaceWriter - -Description - -SourceFiles - nullSurfaceWriter.C - -\*---------------------------------------------------------------------------*/ - -#ifndef nullSurfaceWriter_H -#define nullSurfaceWriter_H - -#include "surfaceWriter.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class nullSurfaceWriter Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class nullSurfaceWriter -: - public surfaceWriter<Type> -{ - -public: - - //- Runtime type information - TypeName("null"); - - - // Constructors - - //- Construct null - nullSurfaceWriter(); - - - //- Destructor - virtual ~nullSurfaceWriter(); - - - // Member Functions - - // Write - - //- Writes single surface to file. - virtual void write - ( - const fileName& outputDir, - const fileName& surfaceName, - const pointField& points, - const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, - const bool verbose = false - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "nullSurfaceWriter.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C deleted file mode 100644 index c9fd6af9d948714df95609742ffafdf87ac203ee..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C +++ /dev/null @@ -1,44 +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 "nullSurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriterType(nullSurfaceWriter, bool); -makeSurfaceWriters(nullSurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.C b/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.C index 11990cfd83a72e2ef9ebe2cce37cd229354fd876..d598754b3846dc617e13383c2d45423f3a472fcd 100644 --- a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.C @@ -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 @@ -29,27 +29,34 @@ License #include "OFstream.H" #include "OSspecific.H" +#include "makeSurfaceWriterMethods.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(proxySurfaceWriter, 0); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class Type> -Foam::proxySurfaceWriter<Type>::proxySurfaceWriter(const word& ext) +Foam::proxySurfaceWriter::proxySurfaceWriter(const word& ext) : - surfaceWriter<Type>(), + surfaceWriter(), ext_(ext) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class Type> -Foam::proxySurfaceWriter<Type>::~proxySurfaceWriter() +Foam::proxySurfaceWriter::~proxySurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class Type> -void Foam::proxySurfaceWriter<Type>::write +void Foam::proxySurfaceWriter::write ( const fileName& outputDir, const fileName& surfaceName, @@ -69,19 +76,14 @@ void Foam::proxySurfaceWriter<Type>::write mkDir(outputDir); } - fileName fName(outputDir/surfaceName + "." + ext_); + fileName outName(outputDir/surfaceName + "." + ext_); if (verbose) { - Info<< "Writing geometry to " << fName << endl; + Info<< "Writing geometry to " << outName << endl; } - MeshedSurfaceProxy<face> - ( - points, - faces - ).write(fName); - + MeshedSurfaceProxy<face>(points, faces).write(outName); } diff --git a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.H b/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.H index 2cbc6c30ac27042b39841f4271f4558580c01dea..ad134b7b6e54a1353867380ee610ac7591987fdd 100644 --- a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriter.H @@ -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 @@ -25,6 +25,8 @@ Class Foam::proxySurfaceWriter Description + A surfaceWriter that writes the geometry via the MeshedSurfaceProxy, but + which does not support any fields. SourceFiles proxySurfaceWriter.C @@ -42,13 +44,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class proxySurfaceWriter Declaration + Class proxySurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class proxySurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { // Private data @@ -74,15 +75,16 @@ public: // Member Functions - //- Always write separate geometry file - virtual bool separateFiles() + + //- True if the surface format supports geometry in a separate file. + // False if geometry and field must be in a single file + virtual bool separateGeometry() { return true; } - // Write - //- Write geometry to file. + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, @@ -92,20 +94,6 @@ public: const bool verbose = false ) const; - - //- Writes single surface to file. - virtual void write - ( - const fileName& outputDir, - const fileName& surfaceName, - const pointField& points, - const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, - const bool verbose = false - ) const - {} }; @@ -115,12 +103,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "proxySurfaceWriter.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriterRunTime.C deleted file mode 100644 index 508b41c1b60b56b092eacfe90abc3a0ab78a35f8..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/proxy/proxySurfaceWriterRunTime.C +++ /dev/null @@ -1,45 +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 "proxySurfaceWriter.H" -#include "surfaceWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -// create type names, but do not register with run-time tables -makeTypeSurfaceWritersTypeName(proxySurfaceWriter, bool); -makeSurfaceWritersTypeName(proxySurfaceWriter); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C index 46b8a188eccd1eb7addb9cd9f0e749c9945d45ef..90e42c0c074602a645416315bf730c7c8852e0fe 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,274 +29,262 @@ License #include "OSspecific.H" #include "IOmanip.H" +#include "makeSurfaceWriterMethods.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + makeSurfaceWriterType(rawSurfaceWriter); +} + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeGeometry +inline void Foam::rawSurfaceWriter::writeLocation ( + Ostream& os, const pointField& points, - const label pointI, - Ostream& os + const label pointI ) { const point& pt = points[pointI]; - - os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << ' '; + os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << ' '; } -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeGeometry +inline void Foam::rawSurfaceWriter::writeLocation ( + Ostream& os, const pointField& points, const faceList& faces, - const label faceI, - Ostream& os + const label faceI ) { const point& ct = faces[faceI].centre(points); - - os << ct.x() << ' ' << ct.y() << ' ' << ct.z() << ' '; + os << ct.x() << ' ' << ct.y() << ' ' << ct.z() << ' '; } -// Write scalarField in raw format -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeData -( - const word& fieldName, - const pointField& points, - const faceList& faces, - const scalarField& values, - const bool isNodeValues, - Ostream& os -) +namespace Foam { - // header - os << "# x y z " << fieldName << endl; - - // Write data - if (isNodeValues) + template<> + void Foam::rawSurfaceWriter::writeHeader + ( + Ostream& os, + const word& fieldName, + const Field<scalar>& values + ) { - forAll(values, elemI) - { - writeGeometry(points, elemI, os); - os << values[elemI] << nl; - } + os << values.size() << nl + << "# x y z " << fieldName << nl; } - else + + + template<> + void Foam::rawSurfaceWriter::writeHeader + ( + Ostream& os, + const word& fieldName, + const Field<vector>& values + ) { - forAll(values, elemI) - { - writeGeometry(points, faces, elemI, os); - os << values[elemI] << nl; - } + os << values.size() << nl + << "# x y z " + << fieldName << "_x " + << fieldName << "_y " + << fieldName << "_z " + << endl; } - os << nl; -} + template<> + void Foam::rawSurfaceWriter::writeHeader + ( + Ostream& os, + const word& fieldName, + const Field<sphericalTensor>& values + ) + { + os << values.size() << nl + << "# ii " + << fieldName << "_ii" << nl; + } -// Write vectorField in raw format -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeData -( - const word& fieldName, - const pointField& points, - const faceList& faces, - const vectorField& values, - const bool isNodeValues, - Ostream& os -) -{ - // header - os << "# x y z " - << fieldName << "_x " - << fieldName << "_y " - << fieldName << "_z " - << endl; - // Write data - if (isNodeValues) + template<> + void Foam::rawSurfaceWriter::writeHeader + ( + Ostream& os, + const word& fieldName, + const Field<symmTensor>& values + ) { - forAll(values, elemI) + os << values.size() << nl + << "# xx xy xz yy yz "; + for (int i=0; i<6; ++i) { - writeGeometry(points, elemI, os); - - const vector& v = values[elemI]; - os << v[0] << ' ' << v[1] << ' ' << v[2] << nl; + os << fieldName << "_" << i << " "; } + os << endl; } - else + + + template<> + void Foam::rawSurfaceWriter::writeHeader + ( + Ostream& os, + const word& fieldName, + const Field<tensor>& values + ) { - forAll(values, elemI) + os << values.size() << nl + << "# xx xy xz yx yy yz zx zy zz"; + for (int i=0; i<9; ++i) { - writeGeometry(points, faces, elemI, os); - - const vector& v = values[elemI]; - os << v[0] << ' ' << v[1] << ' ' << v[2] << nl; + os << fieldName << "_" << i << " "; } + os << nl; } -} + template<> + inline void Foam::rawSurfaceWriter::writeData + ( + Ostream& os, + const scalar& v + ) + { + os << v << nl; + } -// Write sphericalTensorField in raw format -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeData -( - const word& fieldName, - const pointField& points, - const faceList& faces, - const sphericalTensorField& values, - const bool isNodeValues, - Ostream& os -) -{ - // header - os << "# ii "; - os << fieldName << "_ii" << endl; - // Write data - if (isNodeValues) + template<> + inline void Foam::rawSurfaceWriter::writeData + ( + Ostream& os, + const vector& v + ) { - forAll(values, elemI) - { - writeGeometry(points, elemI, os); + os << v[0] << ' ' << v[1] << ' ' << v[2] << nl; + } - const sphericalTensor& v = values[elemI]; - os << v[0] << nl; - } + + template<> + inline void Foam::rawSurfaceWriter::writeData + ( + Ostream& os, + const sphericalTensor& v + ) + { + os << v[0] << nl; } - else + + + template<> + inline void Foam::rawSurfaceWriter::writeData + ( + Ostream& os, + const symmTensor& v + ) { - forAll(values, elemI) - { - writeGeometry(points, faces, elemI, os); + os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' + << v[3] << ' ' << v[4] << ' ' << v[5] << nl; + } - const sphericalTensor& v = values[elemI]; - os << v[0] << nl; - } + + template<> + inline void Foam::rawSurfaceWriter::writeData + ( + Ostream& os, + const tensor& v + ) + { + os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' + << v[3] << ' ' << v[4] << ' ' << v[5] << ' ' + << v[6] << ' ' << v[7] << ' ' << v[8] << nl; } + } -// Write symmTensorField in raw format template<class Type> -void Foam::rawSurfaceWriter<Type>::writeData +void Foam::rawSurfaceWriter::writeTemplate ( - const word& fieldName, + const fileName& outputDir, + const fileName& surfaceName, const pointField& points, const faceList& faces, - const symmTensorField& values, + const word& fieldName, + const Field<Type>& values, const bool isNodeValues, - Ostream& os -) + const bool verbose +) const { - // header - os << "# xx xy xz yy yz "; - for (int i=0; i<6; i++) + if (!isDir(outputDir)) { - os << fieldName << "_" << i << " "; + mkDir(outputDir); } - os << endl; - // Write data - if (isNodeValues) - { - forAll(values, elemI) - { - writeGeometry(points, elemI, os); + OFstream os(outputDir/fieldName + '_' + surfaceName + ".raw"); - const symmTensor& v = values[elemI]; + if (verbose) + { + Info<< "Writing field " << fieldName << " to " << os.name() << endl; + } - os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' - << v[3] << ' ' << v[4] << ' ' << v[5] << nl; - } + // header + os << "# " << fieldName; + if (isNodeValues) + { + os << " POINT_DATA "; } else { - forAll(values, elemI) - { - writeGeometry(points, faces, elemI, os); - - const symmTensor& v = values[elemI]; - - os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' - << v[3] << ' ' << v[4] << ' ' << v[5] << nl; - } + os << " FACE_DATA "; } -} - -// Write tensorField in raw format -template<class Type> -void Foam::rawSurfaceWriter<Type>::writeData -( - const word& fieldName, - const pointField& points, - const faceList& faces, - const tensorField& values, - const bool isNodeValues, - Ostream& os -) -{ // header - os << "# xx xy xz yx yy yz zx zy zz"; - for (int i=0; i<9; ++i) - { - os << fieldName << "_" << i << " "; - } - os << endl; + writeHeader(os, fieldName, values); - // Write data + // values if (isNodeValues) { forAll(values, elemI) { - writeGeometry(points, elemI, os); - - const tensor& v = values[elemI]; - os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' - << v[3] << ' ' << v[4] << ' ' << v[5] << ' ' - << v[6] << ' ' << v[7] << ' ' << v[8] << nl; + writeLocation(os, points, elemI); + writeData(os, values[elemI]); } } else { forAll(values, elemI) { - writeGeometry(points, faces, elemI, os); - - const tensor& v = values[elemI]; - os << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' - << v[3] << ' ' << v[4] << ' ' << v[5] << ' ' - << v[6] << ' ' << v[7] << ' ' << v[8] << nl; + writeLocation(os, points, faces, elemI); + writeData(os, values[elemI]); } } } + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class Type> -Foam::rawSurfaceWriter<Type>::rawSurfaceWriter() +Foam::rawSurfaceWriter::rawSurfaceWriter() : - surfaceWriter<Type>() + surfaceWriter() {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class Type> -Foam::rawSurfaceWriter<Type>::~rawSurfaceWriter() +Foam::rawSurfaceWriter::~rawSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class Type> -void Foam::rawSurfaceWriter<Type>::write +void Foam::rawSurfaceWriter::write ( const fileName& outputDir, const fileName& surfaceName, @@ -310,10 +298,7 @@ void Foam::rawSurfaceWriter<Type>::write mkDir(outputDir); } - OFstream os - ( - outputDir/surfaceName + ".raw" - ); + OFstream os(outputDir/surfaceName + ".raw"); if (verbose) { @@ -323,82 +308,21 @@ void Foam::rawSurfaceWriter<Type>::write // header os << "# geometry NO_DATA " << faces.size() << nl - << "# x y z" << endl; + << "# x y z" << nl; - // Write faces + // Write faces centres forAll(faces, elemI) { - writeGeometry(points, faces, elemI, os); - os << nl; + writeLocation(os, points, faces, elemI); + os << nl; } - os << nl; + os << nl; } -namespace Foam -{ - // bool fields aren't supported - template<> - void Foam::rawSurfaceWriter<bool>::write - ( - const fileName& outputDir, - const fileName& surfaceName, - const pointField& points, - const faceList& faces, - const word& fieldName, - const Field<bool>& values, - const bool isNodeValues, - const bool verbose - ) const - {} -} - - -template<class Type> -void Foam::rawSurfaceWriter<Type>::write -( - const fileName& outputDir, - const fileName& surfaceName, - const pointField& points, - const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, - const bool verbose -) const -{ - if (!isDir(outputDir)) - { - mkDir(outputDir); - } - - OFstream os - ( - outputDir/fieldName + '_' + surfaceName + ".raw" - ); - - if (verbose) - { - Info<< "Writing field " << fieldName << " to " << os.name() << endl; - } - - - // header - os << "# " << fieldName; - if (isNodeValues) - { - os << " POINT_DATA "; - } - else - { - os << " FACE_DATA "; - } - - os << values.size() << nl; - - writeData(fieldName, points, faces, values, isNodeValues, os); -} +// create write methods +defineSurfaceWriterWriteFields(Foam::rawSurfaceWriter); // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.H b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.H index 771824bd89391af49fc1253d90db1a016ab8503b..5ec4d1ac3054b20973eb04d235cb29b21035e39f 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::rawSurfaceWriter Description + A surfaceWriter for raw output. SourceFiles rawSurfaceWriter.C @@ -36,86 +37,62 @@ SourceFiles #include "surfaceWriter.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ - Class raw Declaration + Class rawSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class rawSurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { // Private Member Functions - static void writeGeometry + static inline void writeLocation ( - const pointField& points, - const label pointI, - Ostream& os + Ostream&, + const pointField&, + const label pointI ); - static void writeGeometry + static inline void writeLocation ( - const pointField& points, - const faceList& faces, - const label faceI, - Ostream& os + Ostream&, + const pointField&, + const faceList&, + const label faceI ); - static void writeData + template<class Type> + static void writeHeader ( + Ostream&, const word& fieldName, - const pointField& points, - const faceList& faces, - const scalarField& values, - const bool isNodeValues, - Ostream& os + const Field<Type>& ); - static void writeData - ( - const word& fieldName, - const pointField& points, - const faceList& faces, - const vectorField& values, - const bool isNodeValues, - Ostream& os - ); + template<class Type> + static inline void writeData(Ostream&, const Type&); - static void writeData - ( - const word& fieldName, - const pointField& points, - const faceList& faces, - const sphericalTensorField& values, - const bool isNodeValues, - Ostream& os - ); - static void writeData + //- Templated write operation + template<class Type> + void writeTemplate ( - const word& fieldName, + const fileName& outputDir, + const fileName& surfaceName, const pointField& points, const faceList& faces, - const symmTensorField& values, - const bool isNodeValues, - Ostream& os - ); - - static void writeData - ( const word& fieldName, - const pointField& points, - const faceList& faces, - const tensorField& values, + const Field<Type>& values, const bool isNodeValues, - Ostream& os - ); + const bool verbose + ) const; public: @@ -136,9 +113,7 @@ public: // Member Functions - // Write - - //- Write geometry to file. + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, @@ -148,30 +123,83 @@ public: const bool verbose = false ) const; - //- Writes single surface to file. + + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( - const fileName& outputDir, - const fileName& surfaceName, + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, + const word& fieldName, // name of field + const Field<scalar>& values, const bool isNodeValues, const bool verbose = false ) const; -}; + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "rawSurfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.C b/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.C new file mode 100644 index 0000000000000000000000000000000000000000..5ab7290218d6595474675da463d8dbe00adef679 --- /dev/null +++ b/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.C @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-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 "starcdSurfaceWriter.H" + +#include "MeshedSurfaceProxy.H" +#include "OFstream.H" +#include "OSspecific.H" + +#include "makeSurfaceWriterMethods.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + makeSurfaceWriterType(starcdSurfaceWriter); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +namespace Foam +{ + template<> + inline void Foam::starcdSurfaceWriter::writeData + ( + Ostream& os, + const scalar& v + ) + { + os << v << nl; + } + + + template<> + inline void Foam::starcdSurfaceWriter::writeData + ( + Ostream& os, + const vector& v + ) + { + os << v[0] << ' ' << v[1] << ' ' << v[2] << nl; + } + + + template<> + inline void Foam::starcdSurfaceWriter::writeData + ( + Ostream& os, + const sphericalTensor& v + ) + { + os << v[0] << nl; + } + +} + + +template<class Type> +inline void Foam::starcdSurfaceWriter::writeData +( + Ostream& os, + const Type& v +) +{} + + +template<class Type> +void Foam::starcdSurfaceWriter::writeTemplate +( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose +) const +{ + if (!isDir(outputDir)) + { + mkDir(outputDir); + } + + OFstream os(outputDir/fieldName + '_' + surfaceName + ".usr"); + + if (verbose) + { + Info<< "Writing field " << fieldName << " to " << os.name() << endl; + } + + // no header, just write values + forAll(values, elemI) + { + os << elemI+1 << ' '; + writeData(os, values[elemI]); + } +} + + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::starcdSurfaceWriter::starcdSurfaceWriter() +: + surfaceWriter() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::starcdSurfaceWriter::~starcdSurfaceWriter() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::starcdSurfaceWriter::write +( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const bool verbose +) const +{ + if (!isDir(outputDir)) + { + mkDir(outputDir); + } + + fileName outName(outputDir/surfaceName + ".inp"); + + if (verbose) + { + Info<< "Writing geometry to " << outName << endl; + } + + MeshedSurfaceProxy<face>(points, faces).write(outName); +} + + +// create write methods +defineSurfaceWriterWriteField(Foam::starcdSurfaceWriter, scalar); +defineSurfaceWriterWriteField(Foam::starcdSurfaceWriter, vector); +defineSurfaceWriterWriteField(Foam::starcdSurfaceWriter, sphericalTensor); + + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.H b/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.H new file mode 100644 index 0000000000000000000000000000000000000000..bf0a0eb82454585182535772d479364f00b704c9 --- /dev/null +++ b/src/sampling/sampledSurface/writers/starcd/starcdSurfaceWriter.H @@ -0,0 +1,181 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::starcdSurfaceWriter + +Description + A surfaceWriter for STARCD files. + + The geometry is written via the MeshedSurfaceProxy, the fields + are written in a trivial ASCII format with ID and VALUE as + so-called user data. These @c .usr files can be read into proSTAR + with these types of commands. For element data: + @verbatim + getuser FILENAME.usr cell scalar free + getuser FILENAME.usr cell vector free + @endverbatim + and for vertex data: + @verbatim + getuser FILENAME.usr vertex scalar free + getuser FILENAME.usr vertex vector free + @endverbatim + +Note + Only scalar and vector fields are supported directly. + A sphericalTensor is written as a scalar. + Other field types are not written. + +SourceFiles + starcdSurfaceWriter.C + +\*---------------------------------------------------------------------------*/ + +#ifndef starcdSurfaceWriter_H +#define starcdSurfaceWriter_H + +#include "surfaceWriter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class starcdSurfaceWriter Declaration +\*---------------------------------------------------------------------------*/ + +class starcdSurfaceWriter +: + public surfaceWriter +{ + // Private Member Functions + + template<class Type> + static inline void writeData(Ostream&, const Type&); + + + //- Templated write operation + template<class Type> + void writeTemplate + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose + ) const; + + +public: + + //- Runtime type information + TypeName("starcd"); + + + // Constructors + + //- Construct null + starcdSurfaceWriter(); + + + //- Destructor + virtual ~starcdSurfaceWriter(); + + + // Member Functions + + //- True if the surface format supports geometry in a separate file. + // False if geometry and field must be in a single file + virtual bool separateGeometry() + { + return true; + } + + //- Write single surface geometry to file. + virtual void write + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const bool verbose = false + ) const; + + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<scalar>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/surfaceWriter.C b/src/sampling/sampledSurface/writers/surfaceWriter.C index d4ebc9c2222ca06addfcb38a94ecfd909bc0c8f1..f297e0934fa86ab1cb07a247688722c48a1495c6 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriter.C +++ b/src/sampling/sampledSurface/writers/surfaceWriter.C @@ -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 @@ -26,47 +26,44 @@ License #include "surfaceWriter.H" #include "MeshedSurfaceProxy.H" -#include "nullSurfaceWriter.H" #include "proxySurfaceWriter.H" #include "HashTable.H" #include "word.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<class Type> -Foam::autoPtr< Foam::surfaceWriter<Type> > -Foam::surfaceWriter<Type>::New(const word& writeType) +namespace Foam { - typename wordConstructorTable::iterator cstrIter = + defineTypeNameAndDebug(surfaceWriter, 0); + defineRunTimeSelectionTable(surfaceWriter, word); + defineRunTimeSelectionTable(surfaceWriter, wordDict); + addNamedToRunTimeSelectionTable + ( + surfaceWriter, + surfaceWriter, + word, + null + ); +} + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +Foam::autoPtr<Foam::surfaceWriter> +Foam::surfaceWriter::New(const word& writeType) +{ + wordConstructorTable::iterator cstrIter = wordConstructorTablePtr_->find(writeType); if (cstrIter == wordConstructorTablePtr_->end()) { - // not supported for this data type, but it generally does work - // (it handles the 'bool' specialization - ie, geometry write) - if - ( - Foam::surfaceWriter<bool>::wordConstructorTablePtr_->found - ( - writeType - ) - ) - { - // use 'null' handler instead - return autoPtr< surfaceWriter<Type> > - ( - new nullSurfaceWriter<Type>() - ); - } - else if (MeshedSurfaceProxy<face>::canWriteType(writeType)) + if (MeshedSurfaceProxy<face>::canWriteType(writeType)) { // generally unknown, but can be written via MeshedSurfaceProxy // use 'proxy' handler instead - return autoPtr< surfaceWriter<Type> > - ( - new proxySurfaceWriter<Type>(writeType) - ); + return autoPtr<surfaceWriter>(new proxySurfaceWriter(writeType)); } if (cstrIter == wordConstructorTablePtr_->end()) @@ -83,24 +80,37 @@ Foam::surfaceWriter<Type>::New(const word& writeType) } } - return autoPtr< surfaceWriter<Type> >(cstrIter()()); + return autoPtr<surfaceWriter>(cstrIter()()); +} + + +Foam::autoPtr<Foam::surfaceWriter> +Foam::surfaceWriter::New(const word& writeType, const dictionary& optDict) +{ + // find constructors with dictionary options + wordDictConstructorTable::iterator cstrIter = + wordDictConstructorTablePtr_->find(writeType); + + if (cstrIter == wordDictConstructorTablePtr_->end()) + { + // revert to versions without options + return Foam::surfaceWriter::New(writeType); + } + + return autoPtr<surfaceWriter>(cstrIter()(optDict)); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class Type> -Foam::surfaceWriter<Type>::surfaceWriter() +Foam::surfaceWriter::surfaceWriter() {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class Type> -Foam::surfaceWriter<Type>::~surfaceWriter() +Foam::surfaceWriter::~surfaceWriter() {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/surfaceWriter.H b/src/sampling/sampledSurface/writers/surfaceWriter.H index d17db7a3f3a2bcfbf867ce6a8c5a5bb149f7b69a..be265178499d6905c47b45409f1963841106c9ce 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriter.H +++ b/src/sampling/sampledSurface/writers/surfaceWriter.H @@ -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 @@ -34,7 +34,7 @@ SourceFiles #ifndef surfaceWriter_H #define surfaceWriter_H -#include "Field.H" +#include "volFields.H" #include "typeInfo.H" #include "autoPtr.H" #include "pointField.H" @@ -48,22 +48,12 @@ SourceFiles namespace Foam { -// Forward declaration of friend functions and operators - -template<class Type> class surfaceWriter; -template<class Type> class nullSurfaceWriter; -template<class Type> class proxySurfaceWriter; - /*---------------------------------------------------------------------------*\ Class surfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class surfaceWriter { - //- friendship between writer data types - template<class Type2> friend class surfaceWriter; - public: //- Runtime type information @@ -80,11 +70,30 @@ public: () ); + declareRunTimeSelectionTable + ( + autoPtr, + surfaceWriter, + wordDict, + ( + const dictionary& optDict + ), + (optDict) + ); + // Selectors //- Return a reference to the selected surfaceWriter - static autoPtr<surfaceWriter> New(const word& writeFormat); + static autoPtr<surfaceWriter> New(const word& writeType); + + //- Return a reference to the selected surfaceWriter + // Select with extra write option + static autoPtr<surfaceWriter> New + ( + const word& writeType, + const dictionary& writeOptions + ); // Constructors @@ -99,14 +108,15 @@ public: // Member Functions - //- Return true if the surface format supports separate files - virtual bool separateFiles() + //- True if the surface format supports geometry in a separate file. + // False if geometry and field must be in a single file + virtual bool separateGeometry() { return false; } - //- Writes single surface geometry to file. + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, // <root>/<case>/surface/TIME @@ -118,8 +128,8 @@ public: {} - //- Writes single surface to file. Either one value per vertex or - // one value per face (isNodeValues = false) + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( const fileName& outputDir, // <root>/<case>/surface/TIME @@ -127,22 +137,79 @@ public: const pointField& points, const faceList& faces, const word& fieldName, // name of field - const Field<Type>& values, + const Field<scalar>& values, const bool isNodeValues, const bool verbose = false - ) const = 0; -}; + ) const + {} + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const + {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const + {} + + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const + {} + + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const + {} + + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "surfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/surfaceWriters.C b/src/sampling/sampledSurface/writers/surfaceWriters.C deleted file mode 100644 index 5a677c793ee281d2d4f04ad048da406636351f14..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/surfaceWriters.C +++ /dev/null @@ -1,50 +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 "surfaceWriters.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define defineSurfaceWriterType(dataType) \ - defineNamedTemplateTypeNameAndDebug(surfaceWriter< dataType >, 0); \ - defineTemplatedRunTimeSelectionTable(surfaceWriter, word, dataType) - -defineSurfaceWriterType(bool); - -defineSurfaceWriterType(scalar); -defineSurfaceWriterType(vector); -defineSurfaceWriterType(sphericalTensor); -defineSurfaceWriterType(symmTensor); -defineSurfaceWriterType(tensor); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/surfaceWriters.H b/src/sampling/sampledSurface/writers/surfaceWriters.H deleted file mode 100644 index 0369d2e993748ef5d968cd215ff3e87714e83b20..0000000000000000000000000000000000000000 --- a/src/sampling/sampledSurface/writers/surfaceWriters.H +++ /dev/null @@ -1,76 +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/>. - -InClass - Foam::surfaceWriters - -Description - -\*---------------------------------------------------------------------------*/ - -#ifndef surfaceWriters_H -#define surfaceWriters_H - -#include "surfaceWriter.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Only used internally -#define makeTypeSurfaceWritersTypeName(typeWriter, dataType) \ - \ - defineNamedTemplateTypeNameAndDebug(typeWriter< dataType >, 0) - -// Sometimes used externally -#define makeSurfaceWritersTypeName(typeWriter) \ - \ - makeTypeSurfaceWritersTypeName(typeWriter, scalar); \ - makeTypeSurfaceWritersTypeName(typeWriter, vector); \ - makeTypeSurfaceWritersTypeName(typeWriter, sphericalTensor); \ - makeTypeSurfaceWritersTypeName(typeWriter, symmTensor); \ - makeTypeSurfaceWritersTypeName(typeWriter, tensor) - -// Define type info for single dataType template instantiation (eg, vector) -#define makeSurfaceWriterType(typeWriter, dataType) \ - \ - defineNamedTemplateTypeNameAndDebug(typeWriter< dataType >, 0); \ - addTemplatedToRunTimeSelectionTable \ - ( \ - surfaceWriter, typeWriter, dataType, word \ - ) - - -// Define type info for scalar, vector etc. instantiations -#define makeSurfaceWriters(typeWriter) \ - \ - makeSurfaceWriterType(typeWriter, scalar); \ - makeSurfaceWriterType(typeWriter, vector); \ - makeSurfaceWriterType(typeWriter, sphericalTensor); \ - makeSurfaceWriterType(typeWriter, symmTensor); \ - makeSurfaceWriterType(typeWriter, tensor) - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C index 085dbd67d09e749297719392b23f026005472f92..2f333a95158cf489397383d1e046c26395bd30ed 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,10 +28,19 @@ License #include "OFstream.H" #include "OSspecific.H" +#include "makeSurfaceWriterMethods.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + makeSurfaceWriterType(vtkSurfaceWriter); +} + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template<class Type> -void Foam::vtkSurfaceWriter<Type>::writeGeometry +void Foam::vtkSurfaceWriter::writeGeometry ( Ostream& os, const pointField& points, @@ -71,12 +80,12 @@ void Foam::vtkSurfaceWriter<Type>::writeGeometry { const face& f = faces[faceI]; - os << f.size(); + os << f.size(); forAll(f, fp) { - os << ' ' << f[fp]; + os << ' ' << f[fp]; } - os << nl; + os << nl; } } @@ -84,15 +93,14 @@ void Foam::vtkSurfaceWriter<Type>::writeGeometry namespace Foam { - // Write scalarField in vtk format template<> - void Foam::vtkSurfaceWriter<Foam::scalar>::writeData + void Foam::vtkSurfaceWriter::writeData ( Ostream& os, - const Field<Foam::scalar>& values + const Field<scalar>& values ) { - os << "1 " << values.size() << " float" << nl; + os << "1 " << values.size() << " float" << nl; forAll(values, elemI) { @@ -100,29 +108,28 @@ namespace Foam { if (elemI % 10) { - os << ' '; + os << ' '; } else { - os << nl; + os << nl; } } - const scalar v = values[elemI]; - os << float(v); + os << float(values[elemI]); } - os << nl; + os << nl; } - // Write vectorField in vtk format + template<> - void Foam::vtkSurfaceWriter<Foam::vector>::writeData + void Foam::vtkSurfaceWriter::writeData ( Ostream& os, - const Field<Foam::vector>& values + const Field<vector>& values ) { - os << "3 " << values.size() << " float" << nl; + os << "3 " << values.size() << " float" << nl; forAll(values, elemI) { @@ -133,33 +140,31 @@ namespace Foam } - // Write sphericalTensorField in vtk format template<> - void Foam::vtkSurfaceWriter<Foam::sphericalTensor>::writeData + void Foam::vtkSurfaceWriter::writeData ( Ostream& os, const Field<sphericalTensor>& values ) { - os << "1 " << values.size() << " float" << nl; + os << "1 " << values.size() << " float" << nl; forAll(values, elemI) { const sphericalTensor& v = values[elemI]; - os << float(v[0]) << nl; + os << float(v[0]) << nl; } } - // Write symmTensorField in vtk format template<> - void Foam::vtkSurfaceWriter<Foam::symmTensor>::writeData + void Foam::vtkSurfaceWriter::writeData ( Ostream& os, const Field<symmTensor>& values ) { - os << "6 " << values.size() << " float" << nl; + os << "6 " << values.size() << " float" << nl; forAll(values, elemI) { @@ -172,15 +177,14 @@ namespace Foam } - // Write tensorField in vtk format template<> - void Foam::vtkSurfaceWriter<Foam::tensor>::writeData + void Foam::vtkSurfaceWriter::writeData ( Ostream& os, const Field<tensor>& values ) { - os << "9 " << values.size() << " float" << nl; + os << "9 " << values.size() << " float" << nl; forAll(values, elemI) { @@ -197,47 +201,31 @@ namespace Foam // Write generic field in vtk format template<class Type> -void Foam::vtkSurfaceWriter<Type>::writeData +void Foam::vtkSurfaceWriter::writeData ( Ostream& os, const Field<Type>& values ) { - os << "1 " << values.size() << " float" << nl; + os << "1 " << values.size() << " float" << nl; forAll(values, elemI) { - os << float(0) << nl; + os << float(0) << nl; } } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from components template<class Type> -Foam::vtkSurfaceWriter<Type>::vtkSurfaceWriter() -: - surfaceWriter<Type>() -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class Type> -Foam::vtkSurfaceWriter<Type>::~vtkSurfaceWriter() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void Foam::vtkSurfaceWriter<Type>::write +void Foam::vtkSurfaceWriter::writeTemplate ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, const bool verbose ) const { @@ -246,28 +234,56 @@ void Foam::vtkSurfaceWriter<Type>::write mkDir(outputDir); } - fileName fName(outputDir/surfaceName + ".vtk"); + OFstream os(outputDir/fieldName + '_' + surfaceName + ".vtk"); if (verbose) { - Info<< "Writing geometry to " << fName << endl; + Info<< "Writing field " << fieldName << " to " << os.name() << endl; } - OFstream os(fName); writeGeometry(os, points, faces); + + // start writing data + if (isNodeValues) + { + os << "POINT_DATA "; + } + else + { + os << "CELL_DATA "; + } + + os << values.size() << nl + << "FIELD attributes 1" << nl + << fieldName << " "; + + // Write data + writeData(os, values); } -template<class Type> -void Foam::vtkSurfaceWriter<Type>::write +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::vtkSurfaceWriter::vtkSurfaceWriter() +: + surfaceWriter() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::vtkSurfaceWriter::~vtkSurfaceWriter() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::vtkSurfaceWriter::write ( const fileName& outputDir, const fileName& surfaceName, const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, - const bool isNodeValues, const bool verbose ) const { @@ -276,36 +292,19 @@ void Foam::vtkSurfaceWriter<Type>::write mkDir(outputDir); } - OFstream os - ( - outputDir/fieldName + '_' + surfaceName + ".vtk" - ); + OFstream os(outputDir/surfaceName + ".vtk"); if (verbose) { - Info<< "Writing field " << fieldName << " to " << os.name() << endl; + Info<< "Writing geometry to " << os.name() << endl; } writeGeometry(os, points, faces); +} - // start writing data - if (isNodeValues) - { - os << "POINT_DATA "; - } - else - { - os << "CELL_DATA "; - } - - os << values.size() << nl - << "FIELD attributes 1" << nl - << fieldName << " "; - - // Write data - writeData(os, values); -} +// create write methods +defineSurfaceWriterWriteFields(Foam::vtkSurfaceWriter); // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H index bc13be23c2a29c46706d44e849dad190d32a345d..322159094b7ff918e376888b6bb4891cc6b76d4e 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::vtkSurfaceWriter Description + A surfaceWriter for VTK legacy format. SourceFiles vtkSurfaceWriter.C @@ -42,21 +43,35 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class vtkSurfaceWriter Declaration + Class vtkSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ -template<class Type> class vtkSurfaceWriter : - public surfaceWriter<Type> + public surfaceWriter { // Private Member Functions static void writeGeometry(Ostream&, const pointField&, const faceList&); - static void writeData(Ostream&, const Field<Type>& values); + template<class Type> + static void writeData(Ostream&, const Field<Type>&); + //- Templated write operation + template<class Type> + void writeTemplate + ( + const fileName& outputDir, + const fileName& surfaceName, + const pointField& points, + const faceList& faces, + const word& fieldName, + const Field<Type>& values, + const bool isNodeValues, + const bool verbose + ) const; + public: //- Runtime type information @@ -75,9 +90,7 @@ public: // Member Functions - // Write - - //- Write geometry to file. + //- Write single surface geometry to file. virtual void write ( const fileName& outputDir, @@ -88,30 +101,82 @@ public: ) const; - //- Writes single surface to file. + //- Write scalarField for a single surface to file. + // One value per face or vertex (isNodeValues = true) virtual void write ( - const fileName& outputDir, - const fileName& surfaceName, + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface const pointField& points, const faceList& faces, - const word& fieldName, - const Field<Type>& values, + const word& fieldName, // name of field + const Field<scalar>& values, const bool isNodeValues, const bool verbose = false ) const; -}; + //- Write vectorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<vector>& values, + const bool isNodeValues, + const bool verbose = false + ) const; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Write sphericalTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<sphericalTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write symmTensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<symmTensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + + //- Write tensorField for a single surface to file. + // One value per face or vertex (isNodeValues = true) + virtual void write + ( + const fileName& outputDir, // <root>/<case>/surface/TIME + const fileName& surfaceName, // name of surface + const pointField& points, + const faceList& faces, + const word& fieldName, // name of field + const Field<tensor>& values, + const bool isNodeValues, + const bool verbose = false + ) const; + +}; -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "vtkSurfaceWriter.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/Make/options b/src/surfaceFilmModels/Make/options index 3b0199a09b5a9b3694ce73c9c915977c0441bb2a..9863502e9c5dbfb150c6bef0d83e9ea9d8f45470 100644 --- a/src/surfaceFilmModels/Make/options +++ b/src/surfaceFilmModels/Make/options @@ -3,13 +3,13 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude @@ -18,6 +18,6 @@ EXE_LIBS = \ -lSLGThermo \ -lfiniteVolume \ -lmeshTools \ - -lpdf \ + -ldistributionModels \ -lcompressibleRASModels \ -lcompressibleLESModels diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C index 9102720a4023734b3ebf8286a945125189513c3a..213405957a6d1126d18053ae91e808833dc70f3d 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C @@ -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 @@ -53,12 +53,19 @@ Foam::surfaceFilmModels::cloudInjection::cloudInjection injectionModel(type(), owner, dict), particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))), rndGen_(label(0), -1), - parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)), + parcelDistribution_ + ( + distributionModels::distributionModel::New + ( + coeffs_.subDict("parcelDistribution"), + rndGen_ + ) + ), diameter_(owner.film().nCells(), 0.0) { forAll(diameter_, faceI) { - diameter_[faceI] = parcelPDF_->sample(); + diameter_[faceI] = parcelDistribution_->sample(); } } @@ -95,7 +102,7 @@ void Foam::surfaceFilmModels::cloudInjection::inject diameterToInject[cellI] = diameter_[cellI]; // Retrieve new particle diameter sample - diameter_[cellI] = parcelPDF_->sample(); + diameter_[cellI] = parcelDistribution_->sample(); } else { diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H index 4f9aa08fc6770f6ad513b04f300ce5e58dda7596..d2484f742230982cd46292d306caf163fbc507be 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H @@ -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 @@ -36,7 +36,7 @@ SourceFiles #define cloudInjection_H #include "injectionModel.H" -#include "pdf.H" +#include "distributionModel.H" #include "cachedRandom.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -76,7 +76,8 @@ protected: cachedRandom rndGen_; //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; + const autoPtr<distributionModels::distributionModel> + parcelDistribution_; //- Diameters of particles to inject into the cloud scalarList diameter_; diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C index 29ae7ce8ea6a90f6496b68d3d791bf41a4efb133..375f0e22fd057c12a6cf7aee2ee464bb956d76d6 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C @@ -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 @@ -106,7 +106,7 @@ void Foam::surfaceFilmModels::standardPhaseChange::correct // set local thermo properties const SLGThermo& thermo = film.thermo(); const label liqId = film.liquidId(); - const liquid& liq = thermo.liquids().properties()[liqId]; + const liquidProperties& liq = thermo.liquids().properties()[liqId]; const label vapId = thermo.carrierId(thermo.liquids().components()[liqId]); // retrieve fields from film model diff --git a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C index 1723c09f711ba96227ad2697675eb9f5de3572c9..c6a7e254f8e143bae9ea7e0b956f846663e600cd 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C +++ b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C @@ -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 @@ -81,7 +81,8 @@ void Foam::surfaceFilmModels::thermoSingleLayer::correctThermoFields() } case tmSingleComponent: { - const liquid& liq = thermo_.liquids().properties()[liquidId_]; + const liquidProperties& liq = + thermo_.liquids().properties()[liquidId_]; forAll(rho_, cellI) { const scalar T = T_[cellI]; diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake index 7b1b586b563a2dc06a69717456e86b29d69a22fc..a3cb03d44c2ee2ca44481aa5af759be1cdc3bed5 100755 --- a/src/thermophysicalModels/Allwmake +++ b/src/thermophysicalModels/Allwmake @@ -1,28 +1,25 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso specie -wmake libso solid -wmake libso thermophysicalFunctions -wmake libso liquids -wmake libso liquidMixture -wmake libso pointSolids -wmake libso pointSolidMixture +wmake $makeOption specie +wmake $makeOption solid +wmake $makeOption thermophysicalFunctions +./properties/Allwmake $* -wmake libso basic -wmake libso reactionThermo -wmake libso laminarFlameSpeed -wmake libso chemistryModel -wmake libso pdfs -wmake libso radiation -wmake libso barotropicCompressibilityModel -wmake libso thermalPorousZone +wmake $makeOption basic +wmake $makeOption reactionThermo +wmake $makeOption laminarFlameSpeed +wmake $makeOption chemistryModel +wmake $makeOption radiationModels +wmake $makeOption barotropicCompressibilityModel +wmake $makeOption thermalPorousZone -wmake libso SLGThermo +wmake $makeOption SLGThermo # Should be combined with solids&solidMixture -wmake libso basicSolidThermo +wmake $makeOption basicSolidThermo # ----------------------------------------------------------------- end-of-file diff --git a/src/thermophysicalModels/SLGThermo/Make/options b/src/thermophysicalModels/SLGThermo/Make/options index 6121f1c83e0c1000ca1448cc65e8f3d6974caaab..7102ea2c618d733fa43147a16fdb8e4392b11409 100644 --- a/src/thermophysicalModels/SLGThermo/Make/options +++ b/src/thermophysicalModels/SLGThermo/Make/options @@ -2,10 +2,10 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/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/reactionThermo/lnInclude LIB_LIBS = \ diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C index ce9048a5ac6793f24bc48a5fcd9decbcc00d6991..711dd174c76e5603d2492eb865bc6a6bf0634a08 100644 --- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C @@ -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 @@ -61,7 +61,7 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo) if (thermo.found("liquids")) { - liquids_ = liquidMixture::New(thermo.subDict("liquids")); + liquids_ = liquidMixtureProperties::New(thermo.subDict("liquids")); Info<< " liquids - " << liquids_->components().size() << " components" << endl; } @@ -72,7 +72,7 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo) if (thermo.found("solids")) { - solids_ = pointSolidMixture::New(thermo.subDict("solids")); + solids_ = solidMixtureProperties::New(thermo.subDict("solids")); Info<< " solids - " << solids_->components().size() << " components" << endl; } @@ -113,13 +113,14 @@ const Foam::basicMultiComponentMixture& Foam::SLGThermo::carrier() const } -const Foam::liquidMixture& Foam::SLGThermo::liquids() const +const Foam::liquidMixtureProperties& Foam::SLGThermo::liquids() const { if (!liquids_.valid()) { FatalErrorIn ( - "const Foam::liquidMixture& Foam::SLGThermo::liquids() const" + "const Foam::liquidMixtureProperties& " + "Foam::SLGThermo::liquids() const" ) << "liquids requested, but object is not allocated" << abort(FatalError); } @@ -128,13 +129,14 @@ const Foam::liquidMixture& Foam::SLGThermo::liquids() const } -const Foam::pointSolidMixture& Foam::SLGThermo::solids() const +const Foam::solidMixtureProperties& Foam::SLGThermo::solids() const { if (!solids_.valid()) { FatalErrorIn ( - "const Foam::pointSolidtMixture& Foam::SLGThermo::solids() const" + "const Foam::solidMixtureProperties& " + "Foam::SLGThermo::solids() const" ) << "solids requested, but object is not allocated" << abort(FatalError); } diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H index f4ba8299a83f6516fcd91a45a840c18e129f6a92..751a39416448f500d95aafa4cd3f740898ec590f 100644 --- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H @@ -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 @@ -48,8 +48,8 @@ SourceFiles #include "MeshObject.H" #include "basicThermo.H" #include "basicMultiComponentMixture.H" -#include "liquidMixture.H" -#include "pointSolidMixture.H" +#include "liquidMixtureProperties.H" +#include "solidMixtureProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,10 +73,10 @@ class SLGThermo basicMultiComponentMixture* carrier_; //- Additional liquid properties data - autoPtr<liquidMixture> liquids_; + autoPtr<liquidMixtureProperties> liquids_; //- Additional solid properties data - autoPtr<pointSolidMixture> solids_; + autoPtr<solidMixtureProperties> solids_; public: @@ -105,10 +105,10 @@ public: const basicMultiComponentMixture& carrier() const; //- Return reference to the global (additional) liquids - const liquidMixture& liquids() const; + const liquidMixtureProperties& liquids() const; //- Return reference to the global (additional) solids - const pointSolidMixture& solids() const; + const solidMixtureProperties& solids() const; // Index retrieval diff --git a/src/thermophysicalModels/liquidMixture/Make/files b/src/thermophysicalModels/liquidMixture/Make/files deleted file mode 100644 index 5d205229ef99e59deda6fa1e414efd428d8dc52b..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/liquidMixture/Make/files +++ /dev/null @@ -1,6 +0,0 @@ -liquidMixture = liquidMixture - -$(liquidMixture)/liquidMixture.C -$(liquidMixture)/liquidMixtureIO.C - -LIB = $(FOAM_LIBBIN)/libliquidMixture diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixtureIO.C b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixtureIO.C deleted file mode 100644 index 6d4c2eb7658fcd2a315953f35c3a1c5b2fc61388..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixtureIO.C +++ /dev/null @@ -1,60 +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 "liquidMixture.H" -//#include "IOstreams.H" - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // -/* -Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::liquidMixture& l) -{ - is >> l.x_; - - // Check state of Istream - is.check - ( - "Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::liquidMixture&)" - ); - - return is; -} - -Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::liquidMixture& l) -{ - - os << l.x_; - - // Check state of Ostream - os.check - ( - "Foam::Ostream& Foam::operator<<(Foam::Ostream&, " - "const Foam::liquidMixture&)" - ); - - return os; -} - */ - -// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/liquid/liquid.C b/src/thermophysicalModels/liquids/liquid/liquid.C deleted file mode 100644 index 45da23e3f652cca5bd181380b7c3ded7a89100c3..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/liquids/liquid/liquid.C +++ /dev/null @@ -1,340 +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 "liquid.H" -#include "HashTable.H" -#include "Switch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(liquid, 0); - defineRunTimeSelectionTable(liquid,); - defineRunTimeSelectionTable(liquid, Istream); - defineRunTimeSelectionTable(liquid, dictionary); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::liquid::liquid -( - scalar W, - scalar Tc, - scalar Pc, - scalar Vc, - scalar Zc, - scalar Tt, - scalar Pt, - scalar Tb, - scalar dipm, - scalar omega, - scalar delta -) -: - W_(W), - Tc_(Tc), - Pc_(Pc), - Vc_(Vc), - Zc_(Zc), - Tt_(Tt), - Pt_(Pt), - Tb_(Tb), - dipm_(dipm), - omega_(omega), - delta_(delta) -{} - - -Foam::liquid::liquid(Istream& is) -: - W_(readScalar(is)), - Tc_(readScalar(is)), - Pc_(readScalar(is)), - Vc_(readScalar(is)), - Zc_(readScalar(is)), - Tt_(readScalar(is)), - Pt_(readScalar(is)), - Tb_(readScalar(is)), - dipm_(readScalar(is)), - omega_(readScalar(is)), - delta_(readScalar(is)) -{} - - -Foam::liquid::liquid(const dictionary& dict) -: - W_(readScalar(dict.lookup("W"))), - Tc_(readScalar(dict.lookup("Tc"))), - Pc_(readScalar(dict.lookup("Pc"))), - Vc_(readScalar(dict.lookup("Vc"))), - Zc_(readScalar(dict.lookup("Zc"))), - Tt_(readScalar(dict.lookup("Tt"))), - Pt_(readScalar(dict.lookup("Pt"))), - Tb_(readScalar(dict.lookup("Tb"))), - dipm_(readScalar(dict.lookup("dipm"))), - omega_(readScalar(dict.lookup("omega"))), - delta_(readScalar(dict.lookup("delta"))) -{} - - -Foam::liquid::liquid(const liquid& liq) -: - W_(liq.W_), - Tc_(liq.Tc_), - Pc_(liq.Pc_), - Vc_(liq.Vc_), - Zc_(liq.Zc_), - Tt_(liq.Tt_), - Pt_(liq.Pt_), - Tb_(liq.Tb_), - dipm_(liq.dipm_), - omega_(liq.omega_), - delta_(liq.delta_) -{} - - -// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::liquid> Foam::liquid::New(Istream& is) -{ - if (debug) - { - Info<< "liquid::New(Istream&) : " << "constructing liquid" << endl; - } - - const word liquidType(is); - const word coeffs(is); - - if (coeffs == "defaultCoeffs") - { - ConstructorTable::iterator cstrIter = - ConstructorTablePtr_->find(liquidType); - - if (cstrIter == ConstructorTablePtr_->end()) - { - FatalErrorIn("liquid::New(Istream&)") - << "Unknown liquid type " - << liquidType << nl << nl - << "Valid liquid types are:" << nl - << ConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<liquid>(cstrIter()()); - } - else if (coeffs == "coeffs") - { - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(liquidType); - - if (cstrIter == IstreamConstructorTablePtr_->end()) - { - FatalErrorIn("liquid::New(Istream&)") - << "Unknown liquid type " - << liquidType << nl << nl - << "Valid liquid types are:" << nl - << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<liquid>(cstrIter()(is)); - } - else - { - FatalErrorIn("liquid::New(Istream&)") - << "liquid type " << liquidType - << ", option " << coeffs << " given" - << ", should be coeffs or defaultCoeffs" - << abort(FatalError); - - return autoPtr<liquid>(NULL); - } -} - - -Foam::autoPtr<Foam::liquid> Foam::liquid::New(const dictionary& dict) -{ - if (debug) - { - Info<< "liquid::New(const dictionary&) : " << "constructing liquid" - << endl; - } - - const word& liquidTypeName = dict.dictName(); - - const Switch defaultCoeffs(dict.lookup("defaultCoeffs")); - - if (defaultCoeffs) - { - ConstructorTable::iterator cstrIter = - ConstructorTablePtr_->find(liquidTypeName); - - if (cstrIter == ConstructorTablePtr_->end()) - { - FatalErrorIn("liquid::New(const dictionary&, const word&)") - << "Unknown liquid type " - << liquidTypeName << nl << nl - << "Valid liquid types are:" << nl - << ConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<liquid>(cstrIter()()); - } - else - { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liquidTypeName); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("liquid::New(const dictionary&, const word&)") - << "Unknown liquid type " - << liquidTypeName << nl << nl - << "Valid liquid types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<liquid> - ( - cstrIter()(dict.subDict(liquidTypeName + "Coeffs")) - ); - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::liquid::rho(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::rho(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::pv(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::pv(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::hl(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::hl(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::Cp(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::Cp(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::h(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::h(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::Cpg(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::Cpg(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::mu(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::mu(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::mug(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::mug(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::K(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::K(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::Kg(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::Kg(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::sigma(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::sigms(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::D(scalar p, scalar T) const -{ - notImplemented("Foam::scalar Foam::liquid::D(scalar, scalar) const"); - return 0.0; -} - - -Foam::scalar Foam::liquid::D(scalar p, scalar T, scalar Wb) const -{ - notImplemented("Foam::scalar Foam::liquid::D(scalar, scalar) const"); - return 0.0; -} - - -void Foam::liquid::writeData(Ostream& os) const -{ - - os << W_ << token::SPACE - << Tc_ << token::SPACE - << Pc_ << token::SPACE - << Vc_ << token::SPACE - << Zc_ << token::SPACE - << Tt_ << token::SPACE - << Pt_ << token::SPACE - << Tb_ << token::SPACE - << dipm_ << token::SPACE - << omega_<< token::SPACE - << delta_; -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/pointSolidMixture/Make/files b/src/thermophysicalModels/pointSolidMixture/Make/files deleted file mode 100644 index 17cad4937b86dc11b47f20e871508956d700061d..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/pointSolidMixture/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -pointSolidMixture/pointSolidMixture.C - -LIB = $(FOAM_LIBBIN)/libpointSolidMixture diff --git a/src/thermophysicalModels/pointSolidMixture/Make/options b/src/thermophysicalModels/pointSolidMixture/Make/options deleted file mode 100644 index db6f1fe9211e1bd64242a1995d4699c31ac3e06a..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/pointSolidMixture/Make/options +++ /dev/null @@ -1,3 +0,0 @@ -EXE_INC = \ - -I${LIB_SRC}/thermophysicalModels/pointSolids/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude diff --git a/src/thermophysicalModels/pointSolids/Make/files b/src/thermophysicalModels/pointSolids/Make/files deleted file mode 100644 index 526d2519705c1bdccc31fd7f94dc5b26ebe71b94..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/pointSolids/Make/files +++ /dev/null @@ -1,8 +0,0 @@ -pointSolid/pointSolid.C -pointSolid/pointSolidNew.C - -ash/ash.C -C/C.C -CaCO3/CaCO3.C - -LIB = $(FOAM_LIBBIN)/libpointSolids diff --git a/src/thermophysicalModels/properties/Allwmake b/src/thermophysicalModels/properties/Allwmake new file mode 100755 index 0000000000000000000000000000000000000000..da66ba8d47604562dc3be53b5e6bb0893b4c5250 --- /dev/null +++ b/src/thermophysicalModels/properties/Allwmake @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso +set -x + +wmake $makeOption liquidProperties +wmake $makeOption liquidMixtureProperties +wmake $makeOption solidProperties +wmake $makeOption solidMixtureProperties + + +# ----------------------------------------------------------------- end-of-file diff --git a/src/thermophysicalModels/properties/liquidMixtureProperties/Make/files b/src/thermophysicalModels/properties/liquidMixtureProperties/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..4f0959cfc7767d4395fd472df37af09a6c3ecdf6 --- /dev/null +++ b/src/thermophysicalModels/properties/liquidMixtureProperties/Make/files @@ -0,0 +1,3 @@ +liquidMixtureProperties/liquidMixtureProperties.C + +LIB = $(FOAM_LIBBIN)/libliquidMixtureProperties diff --git a/src/thermophysicalModels/liquidMixture/Make/options b/src/thermophysicalModels/properties/liquidMixtureProperties/Make/options similarity index 74% rename from src/thermophysicalModels/liquidMixture/Make/options rename to src/thermophysicalModels/properties/liquidMixtureProperties/Make/options index bfa6b569ba77177a6a88d674a674ce257c84e2fd..138f439935dc242e7002b938b31644854d43b28b 100644 --- a/src/thermophysicalModels/liquidMixture/Make/options +++ b/src/thermophysicalModels/properties/liquidMixtureProperties/Make/options @@ -1,11 +1,11 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude LIB_LIBS = \ - -lliquids \ + -lliquidProperties \ -lthermophysicalFunctions diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C b/src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.C similarity index 82% rename from src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C rename to src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.C index aa573eb1ad94419244a5167214bd0d4af80cef22..a28d214d99c9c503cc95a80c7db025ef41486d00 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C +++ b/src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.C @@ -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,18 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "liquidMixture.H" +#include "liquidMixtureProperties.H" #include "dictionary.H" #include "specie.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::scalar Foam::liquidMixture::TrMax = 0.999; +const Foam::scalar Foam::liquidMixtureProperties::TrMax = 0.999; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::liquidMixture::liquidMixture +Foam::liquidMixtureProperties::liquidMixtureProperties ( const dictionary& thermophysicalProperties ) @@ -57,12 +57,19 @@ Foam::liquidMixture::liquidMixture forAll(components_, i) { - properties_.set(i, liquid::New(props.subDict(components_[i]))); + properties_.set + ( + i, + liquidProperties::New(props.subDict(components_[i])) + ); } } -Foam::liquidMixture::liquidMixture(const liquidMixture& lm) +Foam::liquidMixtureProperties::liquidMixtureProperties +( + const liquidMixtureProperties& lm +) : components_(lm.components_), properties_(lm.properties_.size()) @@ -76,18 +83,21 @@ Foam::liquidMixture::liquidMixture(const liquidMixture& lm) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::liquidMixture> Foam::liquidMixture::New +Foam::autoPtr<Foam::liquidMixtureProperties> Foam::liquidMixtureProperties::New ( const dictionary& thermophysicalProperties ) { - return autoPtr<liquidMixture>(new liquidMixture(thermophysicalProperties)); + return autoPtr<liquidMixtureProperties> + ( + new liquidMixtureProperties(thermophysicalProperties) + ); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::liquidMixture::Tc(const scalarField& x) const +Foam::scalar Foam::liquidMixtureProperties::Tc(const scalarField& x) const { scalar vTc = 0.0; scalar vc = 0.0; @@ -103,7 +113,7 @@ Foam::scalar Foam::liquidMixture::Tc(const scalarField& x) const } -Foam::scalar Foam::liquidMixture::Tpc(const scalarField& x) const +Foam::scalar Foam::liquidMixtureProperties::Tpc(const scalarField& x) const { scalar Tpc = 0.0; forAll(properties_, i) @@ -115,7 +125,7 @@ Foam::scalar Foam::liquidMixture::Tpc(const scalarField& x) const } -Foam::scalar Foam::liquidMixture::Ppc(const scalarField& x) const +Foam::scalar Foam::liquidMixtureProperties::Ppc(const scalarField& x) const { scalar Vc = 0.0; scalar Zc = 0.0; @@ -129,7 +139,7 @@ Foam::scalar Foam::liquidMixture::Ppc(const scalarField& x) const } -Foam::scalar Foam::liquidMixture::omega(const scalarField& x) const +Foam::scalar Foam::liquidMixtureProperties::omega(const scalarField& x) const { scalar omega = 0.0; forAll(properties_, i) @@ -141,7 +151,7 @@ Foam::scalar Foam::liquidMixture::omega(const scalarField& x) const } -Foam::scalarField Foam::liquidMixture::Xs +Foam::scalarField Foam::liquidMixtureProperties::Xs ( const scalar p, const scalar Tg, @@ -162,7 +172,7 @@ Foam::scalarField Foam::liquidMixture::Xs } -Foam::scalar Foam::liquidMixture::W(const scalarField& x) const +Foam::scalar Foam::liquidMixtureProperties::W(const scalarField& x) const { scalar W = 0.0; forAll(properties_, i) @@ -174,7 +184,7 @@ Foam::scalar Foam::liquidMixture::W(const scalarField& x) const } -Foam::scalarField Foam::liquidMixture::Y(const scalarField& X) const +Foam::scalarField Foam::liquidMixtureProperties::Y(const scalarField& X) const { scalarField Y(X/W(X)); @@ -187,7 +197,7 @@ Foam::scalarField Foam::liquidMixture::Y(const scalarField& X) const } -Foam::scalarField Foam::liquidMixture::X(const scalarField& Y) const +Foam::scalarField Foam::liquidMixtureProperties::X(const scalarField& Y) const { scalarField X(Y.size()); scalar Winv = 0.0; @@ -202,7 +212,7 @@ Foam::scalarField Foam::liquidMixture::X(const scalarField& Y) const } -Foam::scalar Foam::liquidMixture::rho +Foam::scalar Foam::liquidMixtureProperties::rho ( const scalar p, const scalar T, @@ -225,7 +235,7 @@ Foam::scalar Foam::liquidMixture::rho } -Foam::scalar Foam::liquidMixture::pv +Foam::scalar Foam::liquidMixtureProperties::pv ( const scalar p, const scalar T, @@ -247,7 +257,7 @@ Foam::scalar Foam::liquidMixture::pv } -Foam::scalar Foam::liquidMixture::hl +Foam::scalar Foam::liquidMixtureProperties::hl ( const scalar p, const scalar T, @@ -269,7 +279,7 @@ Foam::scalar Foam::liquidMixture::hl } -Foam::scalar Foam::liquidMixture::Cp +Foam::scalar Foam::liquidMixtureProperties::Cp ( const scalar p, const scalar T, @@ -291,7 +301,7 @@ Foam::scalar Foam::liquidMixture::Cp } -Foam::scalar Foam::liquidMixture::sigma +Foam::scalar Foam::liquidMixtureProperties::sigma ( const scalar p, const scalar T, @@ -325,7 +335,7 @@ Foam::scalar Foam::liquidMixture::sigma } -Foam::scalar Foam::liquidMixture::mu +Foam::scalar Foam::liquidMixtureProperties::mu ( const scalar p, const scalar T, @@ -347,7 +357,7 @@ Foam::scalar Foam::liquidMixture::mu } -Foam::scalar Foam::liquidMixture::K +Foam::scalar Foam::liquidMixtureProperties::K ( const scalar p, const scalar T, @@ -396,7 +406,7 @@ Foam::scalar Foam::liquidMixture::K } -Foam::scalar Foam::liquidMixture::D +Foam::scalar Foam::liquidMixtureProperties::D ( const scalar p, const scalar T, diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H b/src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.H similarity index 88% rename from src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H rename to src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.H index 186d19e64ce88b17122f076334250786523784af..d127478cacbdf23c1ef9694703193690fffa37ef 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H +++ b/src/thermophysicalModels/properties/liquidMixtureProperties/liquidMixtureProperties/liquidMixtureProperties.H @@ -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,7 +22,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::liquidMixture + Foam::liquidMixtureProperties Description A mixture of liquids. @@ -40,7 +40,7 @@ Description The @c liquidProperties sub-dictionary entry should be used when possible to avoid conflicts with identically named gas-phase entries. - A simple example of a single-component liquidMixture: + A simple example of a single-component liquidMixtureProperties: @verbatim liquidComponents ( @@ -81,13 +81,13 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef liquidMixture_H -#define liquidMixture_H +#ifndef liquidMixtureProperties_H +#define liquidMixtureProperties_H #include "word.H" #include "scalarField.H" #include "PtrList.H" -#include "liquid.H" +#include "liquidProperties.H" #include "autoPtr.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -96,10 +96,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class liquidMixture Declaration + Class liquidMixtureProperties Declaration \*---------------------------------------------------------------------------*/ -class liquidMixture +class liquidMixtureProperties { // Private data @@ -110,7 +110,7 @@ class liquidMixture List<word> components_; //- The liquid properties - PtrList<liquid> properties_; + PtrList<liquidProperties> properties_; public: @@ -119,27 +119,30 @@ public: // Constructors //- Construct from dictionary - liquidMixture(const dictionary& dict); + liquidMixtureProperties(const dictionary& dict); //- Construct copy - liquidMixture(const liquidMixture& lm); + liquidMixtureProperties(const liquidMixtureProperties& lm); //- Construct and return a clone - virtual autoPtr<liquidMixture> clone() const + virtual autoPtr<liquidMixtureProperties> clone() const { - return autoPtr<liquidMixture>(new liquidMixture(*this)); + return autoPtr<liquidMixtureProperties> + ( + new liquidMixtureProperties(*this) + ); } //- Destructor - virtual ~liquidMixture() + virtual ~liquidMixtureProperties() {} // Selectors //- Select construct from dictionary - static autoPtr<liquidMixture> New(const dictionary&); + static autoPtr<liquidMixtureProperties> New(const dictionary&); // Member Functions @@ -151,7 +154,7 @@ public: } //- Return the liquid properties - inline const PtrList<liquid>& properties() const + inline const PtrList<liquidProperties>& properties() const { return properties_; } diff --git a/src/thermophysicalModels/liquids/Ar/Ar.C b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C similarity index 91% rename from src/thermophysicalModels/liquids/Ar/Ar.C rename to src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C index 113c62d200767c9382ab680bfaa7191a860ae660..167b0d229ba5ec1fdeca03820a8f914833f32f03 100644 --- a/src/thermophysicalModels/liquids/Ar/Ar.C +++ b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(Ar, 0); - addToRunTimeSelectionTable(liquid, Ar,); - addToRunTimeSelectionTable(liquid, Ar, Istream); - addToRunTimeSelectionTable(liquid, Ar, dictionary); + addToRunTimeSelectionTable(liquidProperties, Ar,); + addToRunTimeSelectionTable(liquidProperties, Ar, Istream); + addToRunTimeSelectionTable(liquidProperties, Ar, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::Ar::Ar() : - liquid + liquidProperties ( 39.948, 150.86, @@ -87,7 +87,7 @@ Foam::Ar::Ar() Foam::Ar::Ar ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -103,7 +103,7 @@ Foam::Ar::Ar const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -122,7 +122,7 @@ Foam::Ar::Ar Foam::Ar::Ar(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -141,7 +141,7 @@ Foam::Ar::Ar(Istream& is) Foam::Ar::Ar(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -160,7 +160,7 @@ Foam::Ar::Ar(const dictionary& dict) Foam::Ar::Ar(const Ar& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/Ar/Ar.H b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H similarity index 94% rename from src/thermophysicalModels/liquids/Ar/Ar.H rename to src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H index b5a80e0c5f213a6acd65128e60e46f4e3f442cdc..dbcce489ceb9605d359434b419b572a6ab728ec4 100644 --- a/src/thermophysicalModels/liquids/Ar/Ar.H +++ b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef Ar_H #define Ar_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class Ar : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components Ar ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: Ar(const Ar& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new Ar(*this)); + return autoPtr<liquidProperties>(new Ar(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/Ar/ArI.H b/src/thermophysicalModels/properties/liquidProperties/Ar/ArI.H similarity index 97% rename from src/thermophysicalModels/liquids/Ar/ArI.H rename to src/thermophysicalModels/properties/liquidProperties/Ar/ArI.H index 4c0325833e59478c191e079c4a2346306e95083c..43f02099d97a5a99db4d09e5923199746253111b 100644 --- a/src/thermophysicalModels/liquids/Ar/ArI.H +++ b/src/thermophysicalModels/properties/liquidProperties/Ar/ArI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22.C b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C similarity index 91% rename from src/thermophysicalModels/liquids/C10H22/C10H22.C rename to src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C index 9b0fd047c1dfb4f94fa484585dcecdd6f0947d06..c2f153d98929c8acdf30dcfdb055c9af439d41e3 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22.C +++ b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C10H22, 0); - addToRunTimeSelectionTable(liquid, C10H22,); - addToRunTimeSelectionTable(liquid, C10H22, Istream); - addToRunTimeSelectionTable(liquid, C10H22, dictionary); + addToRunTimeSelectionTable(liquidProperties, C10H22,); + addToRunTimeSelectionTable(liquidProperties, C10H22, Istream); + addToRunTimeSelectionTable(liquidProperties, C10H22, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C10H22::C10H22() : - liquid + liquidProperties ( 142.285, 617.70, @@ -95,7 +95,7 @@ Foam::C10H22::C10H22() Foam::C10H22::C10H22 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C10H22::C10H22 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C10H22::C10H22 Foam::C10H22::C10H22(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C10H22::C10H22(Istream& is) Foam::C10H22::C10H22(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C10H22::C10H22(const dictionary& dict) Foam::C10H22::C10H22(const C10H22& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22.H b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H similarity index 94% rename from src/thermophysicalModels/liquids/C10H22/C10H22.H rename to src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H index 328355329521acfcea26818668b675c18875a007..91abdc41ee0d29448b4e03d036f51c1a1c97cf0a 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22.H +++ b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C10H22_H #define C10H22_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C10H22 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C10H22 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C10H22(const C10H22& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C10H22(*this)); + return autoPtr<liquidProperties>(new C10H22(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22I.H b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22I.H similarity index 97% rename from src/thermophysicalModels/liquids/C10H22/C10H22I.H rename to src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22I.H index 7fad8fdd259413c7e0c12d0b4f3d3eccaf2574e1..0cb8e4def56ee5e17a7fa3708d6a617b49ce3b15 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26.C b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C similarity index 91% rename from src/thermophysicalModels/liquids/C12H26/C12H26.C rename to src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C index cc4880bd7e9626f368fca7cf0b134fb61a834265..a35c62cbf000b40600bd87f0b91104ef5b1891af 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26.C +++ b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C12H26, 0); - addToRunTimeSelectionTable(liquid, C12H26,); - addToRunTimeSelectionTable(liquid, C12H26, Istream); - addToRunTimeSelectionTable(liquid, C12H26, dictionary); + addToRunTimeSelectionTable(liquidProperties, C12H26,); + addToRunTimeSelectionTable(liquidProperties, C12H26, Istream); + addToRunTimeSelectionTable(liquidProperties, C12H26, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C12H26::C12H26() : - liquid + liquidProperties ( 170.338, 658.0, @@ -87,7 +87,7 @@ Foam::C12H26::C12H26() Foam::C12H26::C12H26 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -103,7 +103,7 @@ Foam::C12H26::C12H26 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -122,7 +122,7 @@ Foam::C12H26::C12H26 Foam::C12H26::C12H26(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -141,7 +141,7 @@ Foam::C12H26::C12H26(Istream& is) Foam::C12H26::C12H26(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -160,7 +160,7 @@ Foam::C12H26::C12H26(const dictionary& dict) Foam::C12H26::C12H26(const C12H26& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26.H b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H similarity index 94% rename from src/thermophysicalModels/liquids/C12H26/C12H26.H rename to src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H index 023c8864953f761c6e67711a3611da1b7e5918a4..1651d288d4cf91ea7450b419a356cc5501db6f3e 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26.H +++ b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C12H26_H #define C12H26_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C12H26 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from conponents C12H26 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C12H26(const C12H26& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C12H26(*this)); + return autoPtr<liquidProperties>(new C12H26(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26I.H b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26I.H similarity index 97% rename from src/thermophysicalModels/liquids/C12H26/C12H26I.H rename to src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26I.H index 24bec218b7bf0d6a73aaf8b5c3a0fcc0b2ac97c3..b53f6fe8ec8be71379eb3c173f1b820baabcfe34 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28.C b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C similarity index 91% rename from src/thermophysicalModels/liquids/C13H28/C13H28.C rename to src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C index 12884c7efbca96f35286d3c3ad41c842f18bf8e8..4278f2bf330ece370696ab881649dd5f200fe73c 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28.C +++ b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C13H28, 0); - addToRunTimeSelectionTable(liquid, C13H28,); - addToRunTimeSelectionTable(liquid, C13H28, Istream); - addToRunTimeSelectionTable(liquid, C13H28, dictionary); + addToRunTimeSelectionTable(liquidProperties, C13H28,); + addToRunTimeSelectionTable(liquidProperties, C13H28, Istream); + addToRunTimeSelectionTable(liquidProperties, C13H28, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C13H28::C13H28() : - liquid + liquidProperties ( 184.365, 675.80, @@ -95,7 +95,7 @@ Foam::C13H28::C13H28() Foam::C13H28::C13H28 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C13H28::C13H28 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C13H28::C13H28 Foam::C13H28::C13H28(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C13H28::C13H28(Istream& is) Foam::C13H28::C13H28(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C13H28::C13H28(const dictionary& dict) Foam::C13H28::C13H28(const C13H28& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28.H b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H similarity index 94% rename from src/thermophysicalModels/liquids/C13H28/C13H28.H rename to src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H index 1c2e6d3fc43d11966d1dad7ad80f872656cdb889..346a9ef48085448d7a090e337c70605df83efe0d 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28.H +++ b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C13H28_H #define C13H28_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C13H28 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C13H28 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C13H28(const C13H28& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C13H28(*this)); + return autoPtr<liquidProperties>(new C13H28(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28I.H b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28I.H similarity index 97% rename from src/thermophysicalModels/liquids/C13H28/C13H28I.H rename to src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28I.H index cb6912e51baf644eedd7ea86db1ce88248493f93..3ce3352b161653f558aba34a4ace9561036d6518 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30.C b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C similarity index 91% rename from src/thermophysicalModels/liquids/C14H30/C14H30.C rename to src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C index a50eb7f4f53a799e2d2653a13c47a814c7e39ac4..434c5c47001a62b2584878d7922ba17543f8e36e 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30.C +++ b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C14H30, 0); - addToRunTimeSelectionTable(liquid, C14H30,); - addToRunTimeSelectionTable(liquid, C14H30, Istream); - addToRunTimeSelectionTable(liquid, C14H30, dictionary); + addToRunTimeSelectionTable(liquidProperties, C14H30,); + addToRunTimeSelectionTable(liquidProperties, C14H30, Istream); + addToRunTimeSelectionTable(liquidProperties, C14H30, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C14H30::C14H30() : - liquid + liquidProperties ( 198.392, 692.40, @@ -95,7 +95,7 @@ Foam::C14H30::C14H30() Foam::C14H30::C14H30 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C14H30::C14H30 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C14H30::C14H30 Foam::C14H30::C14H30(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C14H30::C14H30(Istream& is) Foam::C14H30::C14H30(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C14H30::C14H30(const dictionary& dict) Foam::C14H30::C14H30(const C14H30& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30.H b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H similarity index 94% rename from src/thermophysicalModels/liquids/C14H30/C14H30.H rename to src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H index ec98406e3f1bcc5312c9257f961b95a07299e4c7..ba8033499f5c7e31842f4e4304ca194c1af2af89 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30.H +++ b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C14H30_H #define C14H30_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C14H30 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C14H30 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C14H30(const C14H30& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C14H30(*this)); + return autoPtr<liquidProperties>(new C14H30(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30I.H b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30I.H similarity index 97% rename from src/thermophysicalModels/liquids/C14H30/C14H30I.H rename to src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30I.H index 165c345fc572ce305114d9724d0bdc4f2dd27ba3..fcce331f7cc71997e01c7f0a246a902df8c2f15f 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34.C b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C similarity index 91% rename from src/thermophysicalModels/liquids/C16H34/C16H34.C rename to src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C index be9df8a31036f594a6028b98c5a922c5b1adf14b..33c5a7dba33f088dea11ce3e5b312dcfbf4388a7 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34.C +++ b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C16H34, 0); - addToRunTimeSelectionTable(liquid, C16H34,); - addToRunTimeSelectionTable(liquid, C16H34, Istream); - addToRunTimeSelectionTable(liquid, C16H34, dictionary); + addToRunTimeSelectionTable(liquidProperties, C16H34,); + addToRunTimeSelectionTable(liquidProperties, C16H34, Istream); + addToRunTimeSelectionTable(liquidProperties, C16H34, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C16H34::C16H34() : - liquid + liquidProperties ( 226.446, 720.60, @@ -95,7 +95,7 @@ Foam::C16H34::C16H34() Foam::C16H34::C16H34 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C16H34::C16H34 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C16H34::C16H34 Foam::C16H34::C16H34(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C16H34::C16H34(Istream& is) Foam::C16H34::C16H34(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C16H34::C16H34(const dictionary& dict) Foam::C16H34::C16H34(const C16H34& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34.H b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H similarity index 94% rename from src/thermophysicalModels/liquids/C16H34/C16H34.H rename to src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H index 3d14007cf4f130a44a360b0ddfd9fe98e0f92b31..de16ec9db63d97d0cdcfea72767905145b6e9b37 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34.H +++ b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C16H34_H #define C16H34_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C16H34 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C16H34 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C16H34(const C16H34& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C16H34(*this)); + return autoPtr<liquidProperties>(new C16H34(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34I.H b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34I.H similarity index 97% rename from src/thermophysicalModels/liquids/C16H34/C16H34I.H rename to src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34I.H index 7b0997a339906596da46b10570aa7b9dc736b956..5b95693571908de5d64aa119fed0d0f8b9379d8e 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C similarity index 91% rename from src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C rename to src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C index 2b86f7363087b795568452625a2f7887957bc637..5509b6b6a637dd95caef22f80182307d1f111283 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C2H5OH, 0); - addToRunTimeSelectionTable(liquid, C2H5OH,); - addToRunTimeSelectionTable(liquid, C2H5OH, Istream); - addToRunTimeSelectionTable(liquid, C2H5OH, dictionary); + addToRunTimeSelectionTable(liquidProperties, C2H5OH,); + addToRunTimeSelectionTable(liquidProperties, C2H5OH, Istream); + addToRunTimeSelectionTable(liquidProperties, C2H5OH, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C2H5OH::C2H5OH() : - liquid + liquidProperties ( 46.069, 516.25, @@ -95,7 +95,7 @@ Foam::C2H5OH::C2H5OH() Foam::C2H5OH::C2H5OH ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C2H5OH::C2H5OH const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C2H5OH::C2H5OH Foam::C2H5OH::C2H5OH(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C2H5OH::C2H5OH(Istream& is) Foam::C2H5OH::C2H5OH(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C2H5OH::C2H5OH(const dictionary& dict) Foam::C2H5OH::C2H5OH(const C2H5OH& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H similarity index 94% rename from src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H rename to src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H index 7eaf9679cf5e6c497fb900f3d6af0472a8c51193..4c282b4ca4b7c7cbaf6170863a3a9235386893c6 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C2H5OH_H #define C2H5OH_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C2H5OH : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C2H5OH ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C2H5OH(const C2H5OH& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C2H5OH(*this)); + return autoPtr<liquidProperties>(new C2H5OH(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OHI.H similarity index 97% rename from src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H rename to src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OHI.H index cd802142857fe163fe097b6cfab79c07920051a2..993251b8a21064c5bf4cf59d44e14d16dd72cfe9 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OHI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6.C b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C similarity index 91% rename from src/thermophysicalModels/liquids/C2H6/C2H6.C rename to src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C index f648ba7792e6a1c496450a7950936fbb9aa63284..ce2c710da312acd2e244366dd4b3bfff012cc9ff 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C2H6, 0); - addToRunTimeSelectionTable(liquid, C2H6,); - addToRunTimeSelectionTable(liquid, C2H6, Istream); - addToRunTimeSelectionTable(liquid, C2H6, dictionary); + addToRunTimeSelectionTable(liquidProperties, C2H6,); + addToRunTimeSelectionTable(liquidProperties, C2H6, Istream); + addToRunTimeSelectionTable(liquidProperties, C2H6, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C2H6::C2H6() : - liquid + liquidProperties ( 30.070, 305.32, @@ -86,7 +86,7 @@ Foam::C2H6::C2H6() Foam::C2H6::C2H6 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -102,7 +102,7 @@ Foam::C2H6::C2H6 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -121,7 +121,7 @@ Foam::C2H6::C2H6 Foam::C2H6::C2H6(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -140,7 +140,7 @@ Foam::C2H6::C2H6(Istream& is) Foam::C2H6::C2H6(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -159,7 +159,7 @@ Foam::C2H6::C2H6(const dictionary& dict) Foam::C2H6::C2H6(const C2H6& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6.H b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H similarity index 94% rename from src/thermophysicalModels/liquids/C2H6/C2H6.H rename to src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H index ff4e527253f8eaff2bba889ab3a70842b3f90f75..fe5e7b9e5229d0f289dcfa808ffa9632d2d09a9a 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C2H6_H #define C2H6_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C2H6 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C2H6 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C2H6(const C2H6& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C2H6(*this)); + return autoPtr<liquidProperties>(new C2H6(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6I.H b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6I.H similarity index 97% rename from src/thermophysicalModels/liquids/C2H6/C2H6I.H rename to src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6I.H index 75e10ddb995d80e58ff7a3fea5edad7cfe555d49..83c83845bf91e11405c510aecdb9ece3fc9b6849 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6O.C b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C similarity index 91% rename from src/thermophysicalModels/liquids/C2H6O/C2H6O.C rename to src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C index 38e3f06797271c1d2ec63026a3aa92c4006eabdd..9d978cbf97b503704e66189cb452e64ec4f4298e 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C2H6O, 0); - addToRunTimeSelectionTable(liquid, C2H6O,); - addToRunTimeSelectionTable(liquid, C2H6O, Istream); - addToRunTimeSelectionTable(liquid, C2H6O, dictionary); + addToRunTimeSelectionTable(liquidProperties, C2H6O,); + addToRunTimeSelectionTable(liquidProperties, C2H6O, Istream); + addToRunTimeSelectionTable(liquidProperties, C2H6O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C2H6O::C2H6O() : - liquid + liquidProperties ( 46.069, 400.10, @@ -95,7 +95,7 @@ Foam::C2H6O::C2H6O() Foam::C2H6O::C2H6O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C2H6O::C2H6O const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C2H6O::C2H6O Foam::C2H6O::C2H6O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C2H6O::C2H6O(Istream& is) Foam::C2H6O::C2H6O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C2H6O::C2H6O(const dictionary& dict) Foam::C2H6O::C2H6O(const C2H6O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H similarity index 94% rename from src/thermophysicalModels/liquids/C2H6O/C2H6O.H rename to src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H index 3fea9b5061f2143dfbe871fdf20ff577966a447b..380bdd6dce4c639f73ce8a5b2c5479afcf1b59ee 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C2H6O_H #define C2H6O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C2H6O : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C2H6O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C2H6O(const C2H6O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C2H6O(*this)); + return autoPtr<liquidProperties>(new C2H6O(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6OI.H similarity index 97% rename from src/thermophysicalModels/liquids/C2H6O/C2H6OI.H rename to src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6OI.H index bd085b1becf07edd91146b441b98e269c99f7cc8..b59c6ec3e3c2c65652c19ec1e679064bfe5b424c 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6OI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6O.C b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C similarity index 91% rename from src/thermophysicalModels/liquids/C3H6O/C3H6O.C rename to src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C index 307d72b704ec8a97c06beb2cf5c3a8e6a0348951..c4b8254bb5150fb76e0bd4a22a5109063d0ee043 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C3H6O, 0); - addToRunTimeSelectionTable(liquid, C3H6O,); - addToRunTimeSelectionTable(liquid, C3H6O, Istream); - addToRunTimeSelectionTable(liquid, C3H6O, dictionary); + addToRunTimeSelectionTable(liquidProperties, C3H6O,); + addToRunTimeSelectionTable(liquidProperties, C3H6O, Istream); + addToRunTimeSelectionTable(liquidProperties, C3H6O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C3H6O::C3H6O() : - liquid + liquidProperties ( 58.08, 508.20, @@ -95,7 +95,7 @@ Foam::C3H6O::C3H6O() Foam::C3H6O::C3H6O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C3H6O::C3H6O const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C3H6O::C3H6O Foam::C3H6O::C3H6O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C3H6O::C3H6O(Istream& is) Foam::C3H6O::C3H6O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C3H6O::C3H6O(const dictionary& dict) Foam::C3H6O::C3H6O(const C3H6O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H similarity index 94% rename from src/thermophysicalModels/liquids/C3H6O/C3H6O.H rename to src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H index 1ae3a34d0e871eb57c77ce507786759f141f53db..88e6edcdac7cbaf55022cf0448c62e978aafb68d 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C3H6O_H #define C3H6O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C3H6O : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from compoents C3H6O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C3H6O(const C3H6O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C3H6O(*this)); + return autoPtr<liquidProperties>(new C3H6O(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6OI.H similarity index 97% rename from src/thermophysicalModels/liquids/C3H6O/C3H6OI.H rename to src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6OI.H index 40a455ecb2b10ad528eec9b78f1b3675c656657b..6a5ac9303650308c67e2e054368156aa96a5c17e 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6OI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8.C b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C similarity index 91% rename from src/thermophysicalModels/liquids/C3H8/C3H8.C rename to src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C index 27bcd05e731ec5e2ae625f9acda745e6d7f71a8e..7fa59aa1baaa08fb3b860012fbce6de7ca46a45d 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8.C +++ b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C3H8, 0); - addToRunTimeSelectionTable(liquid, C3H8,); - addToRunTimeSelectionTable(liquid, C3H8, Istream); - addToRunTimeSelectionTable(liquid, C3H8, dictionary); + addToRunTimeSelectionTable(liquidProperties, C3H8,); + addToRunTimeSelectionTable(liquidProperties, C3H8, Istream); + addToRunTimeSelectionTable(liquidProperties, C3H8, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C3H8::C3H8() : - liquid + liquidProperties ( 44.096, 369.83, @@ -85,7 +85,7 @@ Foam::C3H8::C3H8() Foam::C3H8::C3H8 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -101,7 +101,7 @@ Foam::C3H8::C3H8 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -120,7 +120,7 @@ Foam::C3H8::C3H8 Foam::C3H8::C3H8(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -139,7 +139,7 @@ Foam::C3H8::C3H8(Istream& is) Foam::C3H8::C3H8(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -158,7 +158,7 @@ Foam::C3H8::C3H8(const dictionary& dict) Foam::C3H8::C3H8(const C3H8& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8.H b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H similarity index 94% rename from src/thermophysicalModels/liquids/C3H8/C3H8.H rename to src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H index bb25111b67ceb4d87b3dcb30bf776582e9ffdfd9..b539f4b504189fb815827ab2f0d30d552e5bd1d1 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C3H8_H #define C3H8_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C3H8 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C3H8 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C3H8(const C3H8& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C3H8(*this)); + return autoPtr<liquidProperties>(new C3H8(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8I.H b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8I.H similarity index 97% rename from src/thermophysicalModels/liquids/C3H8/C3H8I.H rename to src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8I.H index e298bae4c98392b5a935e05c99a76679776fe95c..677d96bfa2615565f1c630be50b018db7b3179f3 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10O.C b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C similarity index 91% rename from src/thermophysicalModels/liquids/C4H10O/C4H10O.C rename to src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C index c2ce36e90ca2e17aac517536915db6bd366352db..34237ac91b4ef1a62db9a17b2dc8671e8839562c 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C4H10O, 0); - addToRunTimeSelectionTable(liquid, C4H10O,); - addToRunTimeSelectionTable(liquid, C4H10O, Istream); - addToRunTimeSelectionTable(liquid, C4H10O, dictionary); + addToRunTimeSelectionTable(liquidProperties, C4H10O,); + addToRunTimeSelectionTable(liquidProperties, C4H10O, Istream); + addToRunTimeSelectionTable(liquidProperties, C4H10O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C4H10O::C4H10O() : - liquid + liquidProperties ( 74.123, 466.70, @@ -95,7 +95,7 @@ Foam::C4H10O::C4H10O() Foam::C4H10O::C4H10O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C4H10O::C4H10O const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C4H10O::C4H10O Foam::C4H10O::C4H10O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C4H10O::C4H10O(Istream& is) Foam::C4H10O::C4H10O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C4H10O::C4H10O(const dictionary& dict) Foam::C4H10O::C4H10O(const C4H10O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H similarity index 94% rename from src/thermophysicalModels/liquids/C4H10O/C4H10O.H rename to src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H index f07cdbc8d49339a194068ece6e54ab948e7efd04..9a1ab395c4d42ba43226094e7e5f1ba5d8f6ed20 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C4H10O_H #define C4H10O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C4H10O : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C4H10O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C4H10O(const C4H10O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C4H10O(*this)); + return autoPtr<liquidProperties>(new C4H10O(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10OI.H similarity index 97% rename from src/thermophysicalModels/liquids/C4H10O/C4H10OI.H rename to src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10OI.H index e3737774a15e3dffeb5ac85cfcfa48f8782023d4..e594fbc55017b03e9611e655753bb5f02920762e 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10OI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14.C b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C similarity index 91% rename from src/thermophysicalModels/liquids/C6H14/C6H14.C rename to src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C index 810ddfa781ae4a81957b30337d98eb56078903ea..7bb4e2cb68d3227dcaca554a63a93507cdcce032 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14.C +++ b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C6H14, 0); - addToRunTimeSelectionTable(liquid, C6H14,); - addToRunTimeSelectionTable(liquid, C6H14, Istream); - addToRunTimeSelectionTable(liquid, C6H14, dictionary); + addToRunTimeSelectionTable(liquidProperties, C6H14,); + addToRunTimeSelectionTable(liquidProperties, C6H14, Istream); + addToRunTimeSelectionTable(liquidProperties, C6H14, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C6H14::C6H14() : - liquid + liquidProperties ( 86.177, 507.60, @@ -95,7 +95,7 @@ Foam::C6H14::C6H14() Foam::C6H14::C6H14 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C6H14::C6H14 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C6H14::C6H14 Foam::C6H14::C6H14(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C6H14::C6H14(Istream& is) Foam::C6H14::C6H14(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C6H14::C6H14(const dictionary& dict) Foam::C6H14::C6H14(const C6H14& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14.H b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H similarity index 94% rename from src/thermophysicalModels/liquids/C6H14/C6H14.H rename to src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H index 339a7d5e2874362533ca06f42f5cfc36e741b790..3734d712dca669e53d4c2b4ae2e0862026f4cd62 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C6H14_H #define C6H14_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C6H14 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C6H14 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C6H14(const C6H14& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C6H14(*this)); + return autoPtr<liquidProperties>(new C6H14(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14I.H b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14I.H similarity index 97% rename from src/thermophysicalModels/liquids/C6H14/C6H14I.H rename to src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14I.H index 66f3bfe53e7be3739218db494a983758117eada3..db5ef7878f76d45c645af189e14311d86f8f3427 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6.C b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C similarity index 91% rename from src/thermophysicalModels/liquids/C6H6/C6H6.C rename to src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C index bb340e8223d17fb18cd4ac6246888597153fa499..2285c1fa7dc9ee506144d759d74a5bfab3d77dda 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6.C +++ b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C6H6, 0); - addToRunTimeSelectionTable(liquid, C6H6,); - addToRunTimeSelectionTable(liquid, C6H6, Istream); - addToRunTimeSelectionTable(liquid, C6H6, dictionary); + addToRunTimeSelectionTable(liquidProperties, C6H6,); + addToRunTimeSelectionTable(liquidProperties, C6H6, Istream); + addToRunTimeSelectionTable(liquidProperties, C6H6, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C6H6::C6H6() : - liquid + liquidProperties ( 78.114, 562.16, @@ -95,7 +95,7 @@ Foam::C6H6::C6H6() Foam::C6H6::C6H6 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C6H6::C6H6 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C6H6::C6H6 Foam::C6H6::C6H6(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C6H6::C6H6(Istream& is) Foam::C6H6::C6H6(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C6H6::C6H6(const dictionary& dict) Foam::C6H6::C6H6(const C6H6& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6.H b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H similarity index 94% rename from src/thermophysicalModels/liquids/C6H6/C6H6.H rename to src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H index 8364eeb7726767f429b6d2aa0c0086dd8fa25696..0eb4935bf5d38c23b77c1db97afb247697da53e0 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C6H6_H #define C6H6_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C6H6 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Comstruct from components C6H6 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C6H6(const C6H6& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C6H6(*this)); + return autoPtr<liquidProperties>(new C6H6(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6I.H b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6I.H similarity index 97% rename from src/thermophysicalModels/liquids/C6H6/C6H6I.H rename to src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6I.H index e304faf9c9bd6e78b577a3f094cce4a23a4f95d4..90eb54e1a1de9b0328c2f63419dc3960e86e3291 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16.C b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C similarity index 91% rename from src/thermophysicalModels/liquids/C7H16/C7H16.C rename to src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C index 996a6e8bcb91832088da1b82a8ebb5ee56158efe..8a316775bc40dbedea59bf08ffe5957ec59639c5 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16.C +++ b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C7H16, 0); - addToRunTimeSelectionTable(liquid, C7H16,); - addToRunTimeSelectionTable(liquid, C7H16, Istream); - addToRunTimeSelectionTable(liquid, C7H16, dictionary); + addToRunTimeSelectionTable(liquidProperties, C7H16,); + addToRunTimeSelectionTable(liquidProperties, C7H16, Istream); + addToRunTimeSelectionTable(liquidProperties, C7H16, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C7H16::C7H16() : - liquid + liquidProperties ( 100.204, 540.20, @@ -94,7 +94,7 @@ Foam::C7H16::C7H16() Foam::C7H16::C7H16 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -110,7 +110,7 @@ Foam::C7H16::C7H16 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -129,7 +129,7 @@ Foam::C7H16::C7H16 Foam::C7H16::C7H16(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -148,7 +148,7 @@ Foam::C7H16::C7H16(Istream& is) Foam::C7H16::C7H16(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -167,7 +167,7 @@ Foam::C7H16::C7H16(const dictionary& dict) Foam::C7H16::C7H16(const C7H16& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16.H b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H similarity index 94% rename from src/thermophysicalModels/liquids/C7H16/C7H16.H rename to src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H index bee4f0d3ca5292a72bea72844bbd2dc3266cd565..00a0b8a3a229c211dc3ffb7a790bdcadcc458ecb 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C7H16_H #define C7H16_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C7H16 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C7H16 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C7H16(const C7H16& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C7H16(*this)); + return autoPtr<liquidProperties>(new C7H16(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16I.H b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16I.H similarity index 97% rename from src/thermophysicalModels/liquids/C7H16/C7H16I.H rename to src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16I.H index a6fb5425058f46eb7fbf02777bb2cae059858b23..e258a4595b83e812a25abae1915247560c4c8be3 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8.C b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C similarity index 91% rename from src/thermophysicalModels/liquids/C7H8/C7H8.C rename to src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C index 7bdfe8a6e614e09cd074bb9dfd9b924bc905ad78..86f38fc2ca049b3e87554e74fd7f7f37310ddec4 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8.C +++ b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C7H8, 0); - addToRunTimeSelectionTable(liquid, C7H8,); - addToRunTimeSelectionTable(liquid, C7H8, Istream); - addToRunTimeSelectionTable(liquid, C7H8, dictionary); + addToRunTimeSelectionTable(liquidProperties, C7H8,); + addToRunTimeSelectionTable(liquidProperties, C7H8, Istream); + addToRunTimeSelectionTable(liquidProperties, C7H8, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C7H8::C7H8() : - liquid + liquidProperties ( 92.141, 591.79, @@ -95,7 +95,7 @@ Foam::C7H8::C7H8() Foam::C7H8::C7H8 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C7H8::C7H8 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C7H8::C7H8 Foam::C7H8::C7H8(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C7H8::C7H8(Istream& is) Foam::C7H8::C7H8(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C7H8::C7H8(const dictionary& dict) Foam::C7H8::C7H8(const C7H8& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8.H b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H similarity index 94% rename from src/thermophysicalModels/liquids/C7H8/C7H8.H rename to src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H index 67602dc2c8983c5be250bf4b74636e900424d32b..6e8541115df37392a3d5fbb8d871c367db148c48 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C7H8_H #define C7H8_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C7H8 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C7H8 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C7H8(const C7H8& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C7H8(*this)); + return autoPtr<liquidProperties>(new C7H8(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8I.H b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8I.H similarity index 97% rename from src/thermophysicalModels/liquids/C7H8/C7H8I.H rename to src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8I.H index 0f22c1bdbdbda2613f1dd90a3b211eb0c15f933b..0ca76b67a7a40caf78f7cafe3ef9264df7407fac 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10.C b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C similarity index 91% rename from src/thermophysicalModels/liquids/C8H10/C8H10.C rename to src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C index 056d1e3b29e435314a1ebb3ca24e72db4455ca8d..409e3690a93a97c9df1563f1b024d62866a78f39 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10.C +++ b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C8H10, 0); - addToRunTimeSelectionTable(liquid, C8H10,); - addToRunTimeSelectionTable(liquid, C8H10, Istream); - addToRunTimeSelectionTable(liquid, C8H10, dictionary); + addToRunTimeSelectionTable(liquidProperties, C8H10,); + addToRunTimeSelectionTable(liquidProperties, C8H10, Istream); + addToRunTimeSelectionTable(liquidProperties, C8H10, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C8H10::C8H10() : - liquid + liquidProperties ( 106.167, 617.17, @@ -95,7 +95,7 @@ Foam::C8H10::C8H10() Foam::C8H10::C8H10 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C8H10::C8H10 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C8H10::C8H10 Foam::C8H10::C8H10(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C8H10::C8H10(Istream& is) Foam::C8H10::C8H10(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C8H10::C8H10(const dictionary& dict) Foam::C8H10::C8H10(const C8H10& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10.H b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H similarity index 94% rename from src/thermophysicalModels/liquids/C8H10/C8H10.H rename to src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H index 985171794eaa720cb980027cd85dfc59d0b9bda8..1c2b0bc5dbff1e41e96eacd741ad9fa05d28bc6e 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C8H10_H #define C8H10_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -57,7 +57,7 @@ namespace Foam class C8H10 : - public liquid + public liquidProperties { // Private data @@ -90,7 +90,7 @@ public: // Construct from components C8H10 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -116,9 +116,9 @@ public: C8H10(const C8H10& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C8H10(*this)); + return autoPtr<liquidProperties>(new C8H10(*this)); } @@ -172,7 +172,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10I.H b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10I.H similarity index 97% rename from src/thermophysicalModels/liquids/C8H10/C8H10I.H rename to src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10I.H index 7f1efbb3d285a56edf3f7350da2336d85a5996bc..46eaca6e871ff199009f7f33a97da63f8dace929 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18.C b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C similarity index 91% rename from src/thermophysicalModels/liquids/C8H18/C8H18.C rename to src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C index 3a51caf792ad8ef709dc6c3df5d6eba5a4e0ba82..414bea27f6e4344143652ee94a5ec4ffb3ef44a3 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18.C +++ b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C8H18, 0); - addToRunTimeSelectionTable(liquid, C8H18,); - addToRunTimeSelectionTable(liquid, C8H18, Istream); - addToRunTimeSelectionTable(liquid, C8H18, dictionary); + addToRunTimeSelectionTable(liquidProperties, C8H18,); + addToRunTimeSelectionTable(liquidProperties, C8H18, Istream); + addToRunTimeSelectionTable(liquidProperties, C8H18, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C8H18::C8H18() : - liquid + liquidProperties ( 114.231, 568.70, @@ -95,7 +95,7 @@ Foam::C8H18::C8H18() Foam::C8H18::C8H18 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C8H18::C8H18 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C8H18::C8H18 Foam::C8H18::C8H18(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C8H18::C8H18(Istream& is) Foam::C8H18::C8H18(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C8H18::C8H18(const dictionary& dict) Foam::C8H18::C8H18(const C8H18& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18.H b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H similarity index 94% rename from src/thermophysicalModels/liquids/C8H18/C8H18.H rename to src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H index 2be91bf4d5a737a3624bae644dbf4ab36b1a9f9e..5b841caa28ba95dc67012412ea5b99c5807bdf4b 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C8H18_H #define C8H18_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C8H18 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C8H18 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C8H18(const C8H18& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C8H18(*this)); + return autoPtr<liquidProperties>(new C8H18(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18I.H b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18I.H similarity index 97% rename from src/thermophysicalModels/liquids/C8H18/C8H18I.H rename to src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18I.H index 5be416de6840f15fd56e7a354c68f126b2ef64da..ebbb6b78bdb2c9143bc7b5c4d49f5ddffb67dd0d 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20.C b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C similarity index 91% rename from src/thermophysicalModels/liquids/C9H20/C9H20.C rename to src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C index 2e321ded79abfa7883ec6b1547f63547765e5f8a..5090f573b4914290c46a88e3c0a5651224e967f2 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20.C +++ b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C9H20, 0); - addToRunTimeSelectionTable(liquid, C9H20,); - addToRunTimeSelectionTable(liquid, C9H20, Istream); - addToRunTimeSelectionTable(liquid, C9H20, dictionary); + addToRunTimeSelectionTable(liquidProperties, C9H20,); + addToRunTimeSelectionTable(liquidProperties, C9H20, Istream); + addToRunTimeSelectionTable(liquidProperties, C9H20, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C9H20::C9H20() : - liquid + liquidProperties ( 128.258, 594.60, @@ -95,7 +95,7 @@ Foam::C9H20::C9H20() Foam::C9H20::C9H20 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::C9H20::C9H20 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::C9H20::C9H20 Foam::C9H20::C9H20(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::C9H20::C9H20(Istream& is) Foam::C9H20::C9H20(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::C9H20::C9H20(const dictionary& dict) Foam::C9H20::C9H20(const C9H20& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20.H b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H similarity index 94% rename from src/thermophysicalModels/liquids/C9H20/C9H20.H rename to src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H index 5f4f17fd89aa7ce89070c6dc9b6e6a3d76d7cf62..9d03c03970c9deee089130bc59aa9ca9b76b108b 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20.H +++ b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef C9H20_H #define C9H20_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class C9H20 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components C9H20 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: C9H20(const C9H20& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new C9H20(*this)); + return autoPtr<liquidProperties>(new C9H20(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20I.H b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20I.H similarity index 97% rename from src/thermophysicalModels/liquids/C9H20/C9H20I.H rename to src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20I.H index dce3a0f9ebd2a5d7ae270718fee3546fdb999fc0..7c7c63c864df01ac1beca1bfc693315544ee1da6 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20I.H +++ b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OH.C b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C similarity index 91% rename from src/thermophysicalModels/liquids/CH3OH/CH3OH.C rename to src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C index 594a867e73c1b82fb9125e456640b6bd8fb3993b..3859bed3ec2b7e36f19f73078e96a892c0347a3e 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OH.C +++ b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(CH3OH, 0); - addToRunTimeSelectionTable(liquid, CH3OH,); - addToRunTimeSelectionTable(liquid, CH3OH, Istream); - addToRunTimeSelectionTable(liquid, CH3OH, dictionary); + addToRunTimeSelectionTable(liquidProperties, CH3OH,); + addToRunTimeSelectionTable(liquidProperties, CH3OH, Istream); + addToRunTimeSelectionTable(liquidProperties, CH3OH, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::CH3OH::CH3OH() : - liquid + liquidProperties ( 32.042, 512.58, @@ -95,7 +95,7 @@ Foam::CH3OH::CH3OH() Foam::CH3OH::CH3OH ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::CH3OH::CH3OH const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::CH3OH::CH3OH Foam::CH3OH::CH3OH(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::CH3OH::CH3OH(Istream& is) Foam::CH3OH::CH3OH(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::CH3OH::CH3OH(const dictionary& dict) Foam::CH3OH::CH3OH(const CH3OH& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H similarity index 94% rename from src/thermophysicalModels/liquids/CH3OH/CH3OH.H rename to src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H index 3ba851ba788a677b6a6d668ef0861f698f8500da..d334e240b6622ffb8e17b66edf48168c7c8a1347 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef CH3OH_H #define CH3OH_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class CH3OH : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components CH3OH ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: CH3OH(const CH3OH& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new CH3OH(*this)); + return autoPtr<liquidProperties>(new CH3OH(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OHI.H similarity index 97% rename from src/thermophysicalModels/liquids/CH3OH/CH3OHI.H rename to src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OHI.H index 0a3bf14e9eb74b20e029e2fe830dbe6805e5f7cf..aece4b536b0a30d91aaf5169496aab5451a1ce14 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OHI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C similarity index 91% rename from src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C rename to src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C index b40f001006d2b102c810ce161354fd8ddd89a5c4..8d0b407cef2a8c3bddab41c61b7f290b98a7af7f 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C +++ b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C @@ -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 @@ -32,16 +32,16 @@ License namespace Foam { defineTypeNameAndDebug(CH4N2O, 0); - addToRunTimeSelectionTable(liquid, CH4N2O,); - addToRunTimeSelectionTable(liquid, CH4N2O, Istream); - addToRunTimeSelectionTable(liquid, CH4N2O, dictionary); + addToRunTimeSelectionTable(liquidProperties, CH4N2O,); + addToRunTimeSelectionTable(liquidProperties, CH4N2O, Istream); + addToRunTimeSelectionTable(liquidProperties, CH4N2O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::CH4N2O::CH4N2O() : - liquid + liquidProperties ( 60.056, 705.0, @@ -80,7 +80,7 @@ Foam::CH4N2O::CH4N2O() Foam::CH4N2O::CH4N2O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc0& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -96,7 +96,7 @@ Foam::CH4N2O::CH4N2O const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -115,7 +115,7 @@ Foam::CH4N2O::CH4N2O Foam::CH4N2O::CH4N2O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -134,7 +134,7 @@ Foam::CH4N2O::CH4N2O(Istream& is) Foam::CH4N2O::CH4N2O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -153,7 +153,7 @@ Foam::CH4N2O::CH4N2O(const dictionary& dict) Foam::CH4N2O::CH4N2O(const CH4N2O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H similarity index 94% rename from src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H rename to src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H index 84bfd189547b3bfb674cddc0bd1ee7845f51fcdd..62d5c8b7eb35eab8e85cf4b753609db9c329435d 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H @@ -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 @@ -36,7 +36,7 @@ SourceFiles #ifndef CH4N2O_H #define CH4N2O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -59,7 +59,7 @@ namespace Foam class CH4N2O : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components CH4N2O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc0& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: CH4N2O(const CH4N2O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new CH4N2O(*this)); + return autoPtr<liquidProperties>(new CH4N2O(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; @@ -210,4 +210,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2OI.H similarity index 97% rename from src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H rename to src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2OI.H index 82b06c85865cbb33e1e0fd090d4e8bc61c195a93..439644a4ec331d815fd40582f55617871e2bae3e 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2OI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/H2O/H2O.C b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C similarity index 91% rename from src/thermophysicalModels/liquids/H2O/H2O.C rename to src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C index 0f1b2824bbd7d35d4853c78c9ee28b2ea3e28de3..9edb17df630e563d1ac1ed3d55f8961fd6e3dbd2 100644 --- a/src/thermophysicalModels/liquids/H2O/H2O.C +++ b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(H2O, 0); - addToRunTimeSelectionTable(liquid, H2O,); - addToRunTimeSelectionTable(liquid, H2O, Istream); - addToRunTimeSelectionTable(liquid, H2O, dictionary); + addToRunTimeSelectionTable(liquidProperties, H2O,); + addToRunTimeSelectionTable(liquidProperties, H2O, Istream); + addToRunTimeSelectionTable(liquidProperties, H2O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::H2O::H2O() : - liquid + liquidProperties ( 18.015, 647.13, @@ -102,7 +102,7 @@ Foam::H2O::H2O() Foam::H2O::H2O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -118,7 +118,7 @@ Foam::H2O::H2O const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -137,7 +137,7 @@ Foam::H2O::H2O Foam::H2O::H2O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -156,7 +156,7 @@ Foam::H2O::H2O(Istream& is) Foam::H2O::H2O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -175,7 +175,7 @@ Foam::H2O::H2O(const dictionary& dict) Foam::H2O::H2O(const H2O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/H2O/H2O.H b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H similarity index 94% rename from src/thermophysicalModels/liquids/H2O/H2O.H rename to src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H index 66ab3d33c61ab06b12b4aaeddaf01b69bc19101b..4925bdc819f009f3289a1b941a6e709776397e3f 100644 --- a/src/thermophysicalModels/liquids/H2O/H2O.H +++ b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef H2O_H #define H2O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -57,7 +57,7 @@ namespace Foam class H2O : - public liquid + public liquidProperties { // Private data @@ -90,7 +90,7 @@ public: //- Construct from components H2O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -116,9 +116,9 @@ public: H2O(const H2O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new H2O(*this)); + return autoPtr<liquidProperties>(new H2O(*this)); } @@ -172,7 +172,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/H2O/H2OI.H b/src/thermophysicalModels/properties/liquidProperties/H2O/H2OI.H similarity index 97% rename from src/thermophysicalModels/liquids/H2O/H2OI.H rename to src/thermophysicalModels/properties/liquidProperties/H2O/H2OI.H index dc9346da3f5e0db5565143e1f117f817ec93ae91..1b450b62892ac29c2e1ccb9b8849fdf26b337836 100644 --- a/src/thermophysicalModels/liquids/H2O/H2OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/H2O/H2OI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18.C b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C similarity index 91% rename from src/thermophysicalModels/liquids/IC8H18/IC8H18.C rename to src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C index 223d1e4538ca06ac5167aac43c8d403a44f246f0..137605942201d13f1aa97ffa450719ba86cf7bf5 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18.C +++ b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(IC8H18, 0); - addToRunTimeSelectionTable(liquid, IC8H18,); - addToRunTimeSelectionTable(liquid, IC8H18, Istream); - addToRunTimeSelectionTable(liquid, IC8H18, dictionary); + addToRunTimeSelectionTable(liquidProperties, IC8H18,); + addToRunTimeSelectionTable(liquidProperties, IC8H18, Istream); + addToRunTimeSelectionTable(liquidProperties, IC8H18, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::IC8H18::IC8H18() : - liquid + liquidProperties ( 114.231, 543.96, @@ -95,7 +95,7 @@ Foam::IC8H18::IC8H18() Foam::IC8H18::IC8H18 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::IC8H18::IC8H18 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::IC8H18::IC8H18 Foam::IC8H18::IC8H18(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::IC8H18::IC8H18(Istream& is) Foam::IC8H18::IC8H18(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::IC8H18::IC8H18(const dictionary& dict) Foam::IC8H18::IC8H18(const IC8H18& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H similarity index 94% rename from src/thermophysicalModels/liquids/IC8H18/IC8H18.H rename to src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H index 33d67a06ef4e9fba9b2cb9a2599e5771abbb7046..500fd6c1172b1eadb11491c8c719c700ba6e7a3f 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef IC8H18_H #define IC8H18_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class IC8H18 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components IC8H18 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: IC8H18(const IC8H18& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new IC8H18(*this)); + return autoPtr<liquidProperties>(new IC8H18(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18I.H similarity index 97% rename from src/thermophysicalModels/liquids/IC8H18/IC8H18I.H rename to src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18I.H index 12b722922d16f68e633b71642d09809347471104..806afaf6dc557972fa972fc9e403965efdff3d69 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H +++ b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.C b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C similarity index 92% rename from src/thermophysicalModels/liquids/IDEA/IDEA.C rename to src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C index 49470621e8cc14361c728ccbf2df55be9aa653fd..3752a3e76f6a7d7a33cf6db5880a5c72f4b8ae2d 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEA.C +++ b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(IDEA, 0); - addToRunTimeSelectionTable(liquid, IDEA,); - addToRunTimeSelectionTable(liquid, IDEA, Istream); - addToRunTimeSelectionTable(liquid, IDEA, dictionary); + addToRunTimeSelectionTable(liquidProperties, IDEA,); + addToRunTimeSelectionTable(liquidProperties, IDEA, Istream); + addToRunTimeSelectionTable(liquidProperties, IDEA, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::IDEA::IDEA() : - liquid + liquidProperties ( 142.26, 618.074, @@ -115,7 +115,7 @@ Foam::IDEA::IDEA() Foam::IDEA::IDEA ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -131,7 +131,7 @@ Foam::IDEA::IDEA const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -150,7 +150,7 @@ Foam::IDEA::IDEA Foam::IDEA::IDEA(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -169,7 +169,7 @@ Foam::IDEA::IDEA(Istream& is) Foam::IDEA::IDEA(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -188,7 +188,7 @@ Foam::IDEA::IDEA(const dictionary& dict) Foam::IDEA::IDEA(const IDEA& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.H b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H similarity index 95% rename from src/thermophysicalModels/liquids/IDEA/IDEA.H rename to src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H index 476c7b8478acfa22d9346e022b997bec499192a2..e3a0ff4c1c61b00a38e8fee603dd7ba921134da1 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEA.H +++ b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H @@ -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,7 +58,7 @@ SourceFiles #ifndef IDEA_H #define IDEA_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -80,7 +80,7 @@ namespace Foam class IDEA : - public liquid + public liquidProperties { // Private data @@ -113,7 +113,7 @@ public: // Construct from components IDEA ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -139,9 +139,9 @@ public: IDEA(const IDEA& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new IDEA(*this)); + return autoPtr<liquidProperties>(new IDEA(*this)); } @@ -195,7 +195,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.thermo b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.thermo similarity index 100% rename from src/thermophysicalModels/liquids/IDEA/IDEA.thermo rename to src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.thermo diff --git a/src/thermophysicalModels/liquids/IDEA/IDEAI.H b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEAI.H similarity index 97% rename from src/thermophysicalModels/liquids/IDEA/IDEAI.H rename to src/thermophysicalModels/properties/liquidProperties/IDEA/IDEAI.H index eb593b097a104405bab80a5eb178317d4364fa02..b99d39bab2066b2fa8c682a63080634d703d275d 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEAI.H +++ b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEAI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/MB/MB.C b/src/thermophysicalModels/properties/liquidProperties/MB/MB.C similarity index 91% rename from src/thermophysicalModels/liquids/MB/MB.C rename to src/thermophysicalModels/properties/liquidProperties/MB/MB.C index e519492bda8d824a8bd6e90bbd4fb7df5df29588..d5a39b1a4c8311b5fed4377cb20f062d3159691e 100644 --- a/src/thermophysicalModels/liquids/MB/MB.C +++ b/src/thermophysicalModels/properties/liquidProperties/MB/MB.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(MB, 0); - addToRunTimeSelectionTable(liquid, MB,); - addToRunTimeSelectionTable(liquid, MB, Istream); - addToRunTimeSelectionTable(liquid, MB, dictionary); + addToRunTimeSelectionTable(liquidProperties, MB,); + addToRunTimeSelectionTable(liquidProperties, MB, Istream); + addToRunTimeSelectionTable(liquidProperties, MB, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::MB::MB() : - liquid + liquidProperties ( 102.133, 554.5, @@ -79,7 +79,7 @@ Foam::MB::MB() Foam::MB::MB ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -95,7 +95,7 @@ Foam::MB::MB const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -114,7 +114,7 @@ Foam::MB::MB Foam::MB::MB(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -133,7 +133,7 @@ Foam::MB::MB(Istream& is) Foam::MB::MB(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -152,7 +152,7 @@ Foam::MB::MB(const dictionary& dict) Foam::MB::MB(const MB& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/MB/MB.H b/src/thermophysicalModels/properties/liquidProperties/MB/MB.H similarity index 94% rename from src/thermophysicalModels/liquids/MB/MB.H rename to src/thermophysicalModels/properties/liquidProperties/MB/MB.H index bcea55a03b6ebe7d8efec9519c25ef5f00898a69..fa91d57f39c41e739e26c8a5932817e5d3ced4e6 100644 --- a/src/thermophysicalModels/liquids/MB/MB.H +++ b/src/thermophysicalModels/properties/liquidProperties/MB/MB.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef MB_H #define MB_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class MB : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components MB ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: MB(const MB& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new MB(*this)); + return autoPtr<liquidProperties>(new MB(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/MB/MBI.H b/src/thermophysicalModels/properties/liquidProperties/MB/MBI.H similarity index 97% rename from src/thermophysicalModels/liquids/MB/MBI.H rename to src/thermophysicalModels/properties/liquidProperties/MB/MBI.H index 0ad21a6942cfa94bb7eabac770236ccc2a64d643..c7333766ad95db8139c5a38700090119ff407942 100644 --- a/src/thermophysicalModels/liquids/MB/MBI.H +++ b/src/thermophysicalModels/properties/liquidProperties/MB/MBI.H @@ -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 diff --git a/src/thermophysicalModels/liquids/Make/files b/src/thermophysicalModels/properties/liquidProperties/Make/files similarity index 84% rename from src/thermophysicalModels/liquids/Make/files rename to src/thermophysicalModels/properties/liquidProperties/Make/files index e2f27128d520e81ed9e7d4e8b9dee691724f1483..9b6347d83efb26c91b368be21674673287ec972e 100644 --- a/src/thermophysicalModels/liquids/Make/files +++ b/src/thermophysicalModels/properties/liquidProperties/Make/files @@ -1,4 +1,4 @@ -liquid/liquid.C +liquidProperties/liquidProperties.C H2O/H2O.C C7H16/C7H16.C C12H26/C12H26.C @@ -30,4 +30,4 @@ CH4N2O/CH4N2O.C nC3H8O/nC3H8O.C iC3H8O/iC3H8O.C -LIB = $(FOAM_LIBBIN)/libliquids +LIB = $(FOAM_LIBBIN)/libliquidProperties diff --git a/src/thermophysicalModels/liquids/Make/options b/src/thermophysicalModels/properties/liquidProperties/Make/options similarity index 100% rename from src/thermophysicalModels/liquids/Make/options rename to src/thermophysicalModels/properties/liquidProperties/Make/options diff --git a/src/thermophysicalModels/liquids/N2/N2.C b/src/thermophysicalModels/properties/liquidProperties/N2/N2.C similarity index 91% rename from src/thermophysicalModels/liquids/N2/N2.C rename to src/thermophysicalModels/properties/liquidProperties/N2/N2.C index dd7f6648df5c975dd81a7fa3a3b575f8d8bfa120..c6d36feddf5770d7fbf188bfdb47842e206dc20b 100644 --- a/src/thermophysicalModels/liquids/N2/N2.C +++ b/src/thermophysicalModels/properties/liquidProperties/N2/N2.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(N2, 0); - addToRunTimeSelectionTable(liquid, N2,); - addToRunTimeSelectionTable(liquid, N2, Istream); - addToRunTimeSelectionTable(liquid, N2, dictionary); + addToRunTimeSelectionTable(liquidProperties, N2,); + addToRunTimeSelectionTable(liquidProperties, N2, Istream); + addToRunTimeSelectionTable(liquidProperties, N2, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::N2::N2() : - liquid + liquidProperties ( 28.014, 126.10, @@ -95,7 +95,7 @@ Foam::N2::N2() Foam::N2::N2 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::N2::N2 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::N2::N2 Foam::N2::N2(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::N2::N2(Istream& is) Foam::N2::N2(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::N2::N2(const dictionary& dict) Foam::N2::N2(const N2& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/N2/N2.H b/src/thermophysicalModels/properties/liquidProperties/N2/N2.H similarity index 94% rename from src/thermophysicalModels/liquids/N2/N2.H rename to src/thermophysicalModels/properties/liquidProperties/N2/N2.H index f8a199661e182225abe58c21bd42c8031f61fce5..94412e3beb0fbfd2ee5fc53e6de0ce45fdc94fb5 100644 --- a/src/thermophysicalModels/liquids/N2/N2.H +++ b/src/thermophysicalModels/properties/liquidProperties/N2/N2.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef N2_H #define N2_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class N2 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components N2 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: N2(const N2& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new N2(*this)); + return autoPtr<liquidProperties>(new N2(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/N2/N2I.H b/src/thermophysicalModels/properties/liquidProperties/N2/N2I.H similarity index 97% rename from src/thermophysicalModels/liquids/N2/N2I.H rename to src/thermophysicalModels/properties/liquidProperties/N2/N2I.H index 5258c41bdf47b9792d3ebae26aa2568e76b37388..14b00cc77533e1bf8ff9b01424f8ac728f23791d 100644 --- a/src/thermophysicalModels/liquids/N2/N2I.H +++ b/src/thermophysicalModels/properties/liquidProperties/N2/N2I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C similarity index 91% rename from src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C rename to src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C index ac355d3c006e3d877c4ed562762d1cf468fde121..8297a842abc6a704eba9cb840acd024961c002c5 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C +++ b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(aC10H7CH3, 0); - addToRunTimeSelectionTable(liquid, aC10H7CH3,); - addToRunTimeSelectionTable(liquid, aC10H7CH3, Istream); - addToRunTimeSelectionTable(liquid, aC10H7CH3, dictionary); + addToRunTimeSelectionTable(liquidProperties, aC10H7CH3,); + addToRunTimeSelectionTable(liquidProperties, aC10H7CH3, Istream); + addToRunTimeSelectionTable(liquidProperties, aC10H7CH3, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::aC10H7CH3::aC10H7CH3() : - liquid + liquidProperties ( 142.2, 772.04, @@ -87,7 +87,7 @@ Foam::aC10H7CH3::aC10H7CH3() Foam::aC10H7CH3::aC10H7CH3 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -103,7 +103,7 @@ Foam::aC10H7CH3::aC10H7CH3 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -122,7 +122,7 @@ Foam::aC10H7CH3::aC10H7CH3 Foam::aC10H7CH3::aC10H7CH3(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -141,7 +141,7 @@ Foam::aC10H7CH3::aC10H7CH3(Istream& is) Foam::aC10H7CH3::aC10H7CH3(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -160,7 +160,7 @@ Foam::aC10H7CH3::aC10H7CH3(const dictionary& dict) Foam::aC10H7CH3::aC10H7CH3(const aC10H7CH3& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H similarity index 94% rename from src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H rename to src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H index f53343aec05b7df8186cd95bec1929a5e5ec3ddf..3f93f4509b331009632a7da354feb0196a3b6e92 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef aC10H7CH3_H #define aC10H7CH3_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class aC10H7CH3 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Constrcut from components aC10H7CH3 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: aC10H7CH3(const aC10H7CH3& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new aC10H7CH3(*this)); + return autoPtr<liquidProperties>(new aC10H7CH3(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3I.H similarity index 97% rename from src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H rename to src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3I.H index 9ed32f011d57373063662dd034263612c97efa26..1c858c47c07578cbf67089d32a845ed0b471136e 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H +++ b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C similarity index 91% rename from src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C rename to src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C index b0b5d82cc747711340a42bb9781d5ede1507ca2c..285633e339932491166c82c66ff4dc5d859b52d3 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C +++ b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(bC10H7CH3, 0); - addToRunTimeSelectionTable(liquid, bC10H7CH3,); - addToRunTimeSelectionTable(liquid, bC10H7CH3, Istream); - addToRunTimeSelectionTable(liquid, bC10H7CH3, dictionary); + addToRunTimeSelectionTable(liquidProperties, bC10H7CH3,); + addToRunTimeSelectionTable(liquidProperties, bC10H7CH3, Istream); + addToRunTimeSelectionTable(liquidProperties, bC10H7CH3, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::bC10H7CH3::bC10H7CH3() : - liquid + liquidProperties ( 142.2, 761.0, @@ -87,7 +87,7 @@ Foam::bC10H7CH3::bC10H7CH3() Foam::bC10H7CH3::bC10H7CH3 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -103,7 +103,7 @@ Foam::bC10H7CH3::bC10H7CH3 const APIdiffCoefFunc& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -122,7 +122,7 @@ Foam::bC10H7CH3::bC10H7CH3 Foam::bC10H7CH3::bC10H7CH3(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -141,7 +141,7 @@ Foam::bC10H7CH3::bC10H7CH3(Istream& is) Foam::bC10H7CH3::bC10H7CH3(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -160,7 +160,7 @@ Foam::bC10H7CH3::bC10H7CH3(const dictionary& dict) Foam::bC10H7CH3::bC10H7CH3(const bC10H7CH3& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H similarity index 94% rename from src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H rename to src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H index 6a0c08814c742dd17b948a5ae081d5b8e0eab9e3..74989233e825a6250092b951c95c9c5c5e7a76bd 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef bC10H7CH3_H #define bC10H7CH3_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -58,7 +58,7 @@ namespace Foam class bC10H7CH3 : - public liquid + public liquidProperties { // Private data @@ -91,7 +91,7 @@ public: //- Construct from components bC10H7CH3 ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -117,9 +117,9 @@ public: bC10H7CH3(const bC10H7CH3& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new bC10H7CH3(*this)); + return autoPtr<liquidProperties>(new bC10H7CH3(*this)); } @@ -173,7 +173,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3I.H similarity index 97% rename from src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H rename to src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3I.H index bbe0558393b9548409f8689d4d424f0bcba9d21c..7308518f99525863b2eea094b183f64f1e66fee2 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H +++ b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3I.H @@ -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 diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C similarity index 91% rename from src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C rename to src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C index 83572b233f71f9921aa0adeaa88e1166ce396664..cb6f946aea8a17f843c60cf6ce3f67c032f26ffe 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C +++ b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(iC3H8O, 0); - addToRunTimeSelectionTable(liquid, iC3H8O,); - addToRunTimeSelectionTable(liquid, iC3H8O, Istream); - addToRunTimeSelectionTable(liquid, iC3H8O, dictionary); + addToRunTimeSelectionTable(liquidProperties, iC3H8O,); + addToRunTimeSelectionTable(liquidProperties, iC3H8O, Istream); + addToRunTimeSelectionTable(liquidProperties, iC3H8O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::iC3H8O::iC3H8O() : - liquid + liquidProperties ( 60.096, 508.31, @@ -95,7 +95,7 @@ Foam::iC3H8O::iC3H8O() Foam::iC3H8O::iC3H8O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::iC3H8O::iC3H8O const NSRDSfunc1& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::iC3H8O::iC3H8O Foam::iC3H8O::iC3H8O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::iC3H8O::iC3H8O(Istream& is) Foam::iC3H8O::iC3H8O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::iC3H8O::iC3H8O(const dictionary& dict) Foam::iC3H8O::iC3H8O(const iC3H8O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H similarity index 94% rename from src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H rename to src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H index 0f3e1b414d496e85e9c00568b751e26f3d724792..d1dbf718ca75537a51d66e3fd9a49f21dc660368 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef iC3H8O_H #define iC3H8O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -57,7 +57,7 @@ namespace Foam class iC3H8O : - public liquid + public liquidProperties { // Private data @@ -89,7 +89,7 @@ public: //- Constrcut from components iC3H8O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -115,9 +115,9 @@ public: iC3H8O(const iC3H8O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new iC3H8O(*this)); + return autoPtr<liquidProperties>(new iC3H8O(*this)); } @@ -172,7 +172,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8OI.H similarity index 97% rename from src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H rename to src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8OI.H index 256ba7db2c14a8ebf1ef1867fddcfc7ec2f721c7..81e4d1c20fcfa4796ddb2166d0dd28d66292a795 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8OI.H @@ -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 diff --git a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C new file mode 100644 index 0000000000000000000000000000000000000000..5806013778fcfd8db302a34936ddd9a104a83e12 --- /dev/null +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C @@ -0,0 +1,387 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2004-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 "liquidProperties.H" +#include "HashTable.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(liquidProperties, 0); + defineRunTimeSelectionTable(liquidProperties,); + defineRunTimeSelectionTable(liquidProperties, Istream); + defineRunTimeSelectionTable(liquidProperties, dictionary); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::liquidProperties::liquidProperties +( + scalar W, + scalar Tc, + scalar Pc, + scalar Vc, + scalar Zc, + scalar Tt, + scalar Pt, + scalar Tb, + scalar dipm, + scalar omega, + scalar delta +) +: + W_(W), + Tc_(Tc), + Pc_(Pc), + Vc_(Vc), + Zc_(Zc), + Tt_(Tt), + Pt_(Pt), + Tb_(Tb), + dipm_(dipm), + omega_(omega), + delta_(delta) +{} + + +Foam::liquidProperties::liquidProperties(Istream& is) +: + W_(readScalar(is)), + Tc_(readScalar(is)), + Pc_(readScalar(is)), + Vc_(readScalar(is)), + Zc_(readScalar(is)), + Tt_(readScalar(is)), + Pt_(readScalar(is)), + Tb_(readScalar(is)), + dipm_(readScalar(is)), + omega_(readScalar(is)), + delta_(readScalar(is)) +{} + + +Foam::liquidProperties::liquidProperties(const dictionary& dict) +: + W_(readScalar(dict.lookup("W"))), + Tc_(readScalar(dict.lookup("Tc"))), + Pc_(readScalar(dict.lookup("Pc"))), + Vc_(readScalar(dict.lookup("Vc"))), + Zc_(readScalar(dict.lookup("Zc"))), + Tt_(readScalar(dict.lookup("Tt"))), + Pt_(readScalar(dict.lookup("Pt"))), + Tb_(readScalar(dict.lookup("Tb"))), + dipm_(readScalar(dict.lookup("dipm"))), + omega_(readScalar(dict.lookup("omega"))), + delta_(readScalar(dict.lookup("delta"))) +{} + + +Foam::liquidProperties::liquidProperties(const liquidProperties& liq) +: + W_(liq.W_), + Tc_(liq.Tc_), + Pc_(liq.Pc_), + Vc_(liq.Vc_), + Zc_(liq.Zc_), + Tt_(liq.Tt_), + Pt_(liq.Pt_), + Tb_(liq.Tb_), + dipm_(liq.dipm_), + omega_(liq.omega_), + delta_(liq.delta_) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New(Istream& is) +{ + if (debug) + { + Info<< "liquidProperties::New(Istream&): " + << "constructing liquidProperties" << endl; + } + + const word liquidPropertiesType(is); + const word coeffs(is); + + if (coeffs == "defaultCoeffs") + { + ConstructorTable::iterator cstrIter = + ConstructorTablePtr_->find(liquidPropertiesType); + + if (cstrIter == ConstructorTablePtr_->end()) + { + FatalErrorIn("liquidProperties::New(Istream&)") + << "Unknown liquidProperties type " + << liquidPropertiesType << nl << nl + << "Valid liquidProperties types are:" << nl + << ConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr<liquidProperties>(cstrIter()()); + } + else if (coeffs == "coeffs") + { + IstreamConstructorTable::iterator cstrIter = + IstreamConstructorTablePtr_->find(liquidPropertiesType); + + if (cstrIter == IstreamConstructorTablePtr_->end()) + { + FatalErrorIn("liquidProperties::New(Istream&)") + << "Unknown liquidProperties type " + << liquidPropertiesType << nl << nl + << "Valid liquidProperties types are:" << nl + << IstreamConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr<liquidProperties>(cstrIter()(is)); + } + else + { + FatalErrorIn("liquidProperties::New(Istream&)") + << "liquidProperties type " << liquidPropertiesType + << ", option " << coeffs << " given" + << ", should be coeffs or defaultCoeffs" + << abort(FatalError); + + return autoPtr<liquidProperties>(NULL); + } +} + + +Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New +( + const dictionary& dict +) +{ + if (debug) + { + Info<< "liquidProperties::New(const dictionary&):" + << "constructing liquidProperties" << endl; + } + + const word& liquidPropertiesTypeName = dict.dictName(); + + const Switch defaultCoeffs(dict.lookup("defaultCoeffs")); + + if (defaultCoeffs) + { + ConstructorTable::iterator cstrIter = + ConstructorTablePtr_->find(liquidPropertiesTypeName); + + if (cstrIter == ConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "liquidProperties::New(const dictionary&, const word&)" + ) << "Unknown liquidProperties type " + << liquidPropertiesTypeName << nl << nl + << "Valid liquidProperties types are:" << nl + << ConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr<liquidProperties>(cstrIter()()); + } + else + { + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(liquidPropertiesTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "liquidProperties::New(const dictionary&, const word&)" + ) << "Unknown liquidProperties type " + << liquidPropertiesTypeName << nl << nl + << "Valid liquidProperties types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr<liquidProperties> + ( + cstrIter()(dict.subDict(liquidPropertiesTypeName + "Coeffs")) + ); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::scalar Foam::liquidProperties::rho(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::rho(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::pv(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::pv(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::hl(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::hl(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::Cp(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::Cp(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::h(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::h(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::Cpg(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::Cpg(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::mu(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::mu(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::mug(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::mug(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::K(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::K(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::Kg(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::Kg(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::sigma(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::sigms(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::D(scalar p, scalar T) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::D(scalar, scalar) const" + ); + return 0.0; +} + + +Foam::scalar Foam::liquidProperties::D(scalar p, scalar T, scalar Wb) const +{ + notImplemented + ( + "Foam::scalar Foam::liquidProperties::D(scalar, scalar) const" + ); + return 0.0; +} + + +void Foam::liquidProperties::writeData(Ostream& os) const +{ + + os << W_ << token::SPACE + << Tc_ << token::SPACE + << Pc_ << token::SPACE + << Vc_ << token::SPACE + << Zc_ << token::SPACE + << Tt_ << token::SPACE + << Pt_ << token::SPACE + << Tb_ << token::SPACE + << dipm_ << token::SPACE + << omega_<< token::SPACE + << delta_; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/liquid/liquid.H b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H similarity index 84% rename from src/thermophysicalModels/liquids/liquid/liquid.H rename to src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H index aeaf885d4470a91fb90c44fabee6d184efe421da..3d8062a7e53cec66dc7674ad10d6628de1c31133 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.H +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H @@ -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,18 +22,18 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::liquid + Foam::liquidProperties Description - The thermophysical properties of a liquid + The thermophysical properties of a liquidProperties SourceFiles - liquid.C + liquidProperties.C \*---------------------------------------------------------------------------*/ -#ifndef liquid_H -#define liquid_H +#ifndef liquidProperties_H +#define liquidProperties_H #include "scalar.H" #include "IOstreams.H" @@ -48,10 +48,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class liquid Declaration + Class liquidProperties Declaration \*---------------------------------------------------------------------------*/ -class liquid +class liquidProperties { // Private data @@ -91,7 +91,7 @@ class liquid public: - TypeName("liquid"); + TypeName("liquidProperties"); // Declare run-time constructor selection tables @@ -99,7 +99,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - liquid, + liquidProperties, , (), () @@ -108,7 +108,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - liquid, + liquidProperties, Istream, (Istream& is), (is) @@ -117,7 +117,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - liquid, + liquidProperties, dictionary, (const dictionary& dict), (dict) @@ -127,7 +127,7 @@ public: // Constructors //- Construct from components - liquid + liquidProperties ( scalar W, scalar Tc, @@ -143,32 +143,32 @@ public: ); //- Construct from Istream - liquid(Istream& is); + liquidProperties(Istream& is); //- Construct from dictionary - liquid(const dictionary& dict); + liquidProperties(const dictionary& dict); //- Construct copy - liquid(const liquid& liq); + liquidProperties(const liquidProperties& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new liquid(*this)); + return autoPtr<liquidProperties>(new liquidProperties(*this)); } // Selectors - //- Return a pointer to a new liquid created from input - static autoPtr<liquid> New(Istream& is); + //- Return a pointer to a new liquidProperties created from input + static autoPtr<liquidProperties> New(Istream& is); - //- Return a pointer to a new liquid created from dictionary - static autoPtr<liquid> New(const dictionary& dict); + //- Return a pointer to a new liquidProperties created from dictionary + static autoPtr<liquidProperties> New(const dictionary& dict); //- Destructor - virtual ~liquid() + virtual ~liquidProperties() {} @@ -258,7 +258,7 @@ public: virtual void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const liquid& l) + friend Ostream& operator<<(Ostream& os, const liquidProperties& l) { l.writeData(os); return os; @@ -272,7 +272,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "liquidI.H" +#include "liquidPropertiesI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/liquids/liquid/liquidI.H b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H similarity index 67% rename from src/thermophysicalModels/liquids/liquid/liquidI.H rename to src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H index fa86dd41f0582a3d33c6ac31dd71b81b0a533f34..3cb5990fa48335d756cd7b0db3d554a66646ed91 100644 --- a/src/thermophysicalModels/liquids/liquid/liquidI.H +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H @@ -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,67 +23,67 @@ License \*---------------------------------------------------------------------------*/ -inline Foam::scalar Foam::liquid::W() const +inline Foam::scalar Foam::liquidProperties::W() const { return W_; } -inline Foam::scalar Foam::liquid::Tc() const +inline Foam::scalar Foam::liquidProperties::Tc() const { return Tc_; } -inline Foam::scalar Foam::liquid::Pc() const +inline Foam::scalar Foam::liquidProperties::Pc() const { return Pc_; } -inline Foam::scalar Foam::liquid::Vc() const +inline Foam::scalar Foam::liquidProperties::Vc() const { return Vc_; } -inline Foam::scalar Foam::liquid::Zc() const +inline Foam::scalar Foam::liquidProperties::Zc() const { return Zc_; } -inline Foam::scalar Foam::liquid::Tt() const +inline Foam::scalar Foam::liquidProperties::Tt() const { return Tt_; } -inline Foam::scalar Foam::liquid::Pt() const +inline Foam::scalar Foam::liquidProperties::Pt() const { return Pt_; } -inline Foam::scalar Foam::liquid::Tb() const +inline Foam::scalar Foam::liquidProperties::Tb() const { return Tb_; } -inline Foam::scalar Foam::liquid::dipm() const +inline Foam::scalar Foam::liquidProperties::dipm() const { return dipm_; } -inline Foam::scalar Foam::liquid::omega() const +inline Foam::scalar Foam::liquidProperties::omega() const { return omega_; } -inline Foam::scalar Foam::liquid::delta() const +inline Foam::scalar Foam::liquidProperties::delta() const { return delta_; } diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C similarity index 91% rename from src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C rename to src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C index 9aa51834fb1ca45642421e4436ce7ddebd6a1d3d..a06493c13729581c054f3ca8c3459da310a27a1c 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C +++ b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(nC3H8O, 0); - addToRunTimeSelectionTable(liquid, nC3H8O,); - addToRunTimeSelectionTable(liquid, nC3H8O, Istream); - addToRunTimeSelectionTable(liquid, nC3H8O, dictionary); + addToRunTimeSelectionTable(liquidProperties, nC3H8O,); + addToRunTimeSelectionTable(liquidProperties, nC3H8O, Istream); + addToRunTimeSelectionTable(liquidProperties, nC3H8O, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::nC3H8O::nC3H8O() : - liquid + liquidProperties ( 60.096, 536.71, @@ -95,7 +95,7 @@ Foam::nC3H8O::nC3H8O() Foam::nC3H8O::nC3H8O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -111,7 +111,7 @@ Foam::nC3H8O::nC3H8O const NSRDSfunc1& vapourDiffussivity ) : - liquid(l), + liquidProperties(l), rho_(density), pv_(vapourPressure), hl_(heatOfVapourisation), @@ -130,7 +130,7 @@ Foam::nC3H8O::nC3H8O Foam::nC3H8O::nC3H8O(Istream& is) : - liquid(is), + liquidProperties(is), rho_(is), pv_(is), hl_(is), @@ -149,7 +149,7 @@ Foam::nC3H8O::nC3H8O(Istream& is) Foam::nC3H8O::nC3H8O(const dictionary& dict) : - liquid(dict), + liquidProperties(dict), rho_(dict.subDict("rho")), pv_(dict.subDict("pv")), hl_(dict.subDict("hl")), @@ -168,7 +168,7 @@ Foam::nC3H8O::nC3H8O(const dictionary& dict) Foam::nC3H8O::nC3H8O(const nC3H8O& liq) : - liquid(liq), + liquidProperties(liq), rho_(liq.rho_), pv_(liq.pv_), hl_(liq.hl_), diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H similarity index 94% rename from src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H rename to src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H index e4a9dee2148d1021dcbfa47d758a5987d4906866..69c0e66a6f4fa5e2d37e5f15efb35cdf15e86c46 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef nC3H8O_H #define nC3H8O_H -#include "liquid.H" +#include "liquidProperties.H" #include "NSRDSfunc0.H" #include "NSRDSfunc1.H" #include "NSRDSfunc2.H" @@ -57,7 +57,7 @@ namespace Foam class nC3H8O : - public liquid + public liquidProperties { // Private data @@ -89,7 +89,7 @@ public: //- Construct from components nC3H8O ( - const liquid& l, + const liquidProperties& l, const NSRDSfunc5& density, const NSRDSfunc1& vapourPressure, const NSRDSfunc6& heatOfVapourisation, @@ -115,9 +115,9 @@ public: nC3H8O(const nC3H8O& liq); //- Construct and return clone - virtual autoPtr<liquid> clone() const + virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquid>(new nC3H8O(*this)); + return autoPtr<liquidProperties>(new nC3H8O(*this)); } @@ -172,7 +172,7 @@ public: //- Write the function coefficients void writeData(Ostream& os) const { - liquid::writeData(os); os << nl; + liquidProperties::writeData(os); os << nl; rho_.writeData(os); os << nl; pv_.writeData(os); os << nl; hl_.writeData(os); os << nl; diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8OI.H similarity index 97% rename from src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H rename to src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8OI.H index f7d788e23e984fe6637d618163ed9ecc6b23e0e0..cd02f67f8c48b64d3b77eb7748ed26aa0e48368c 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H +++ b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8OI.H @@ -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 diff --git a/src/thermophysicalModels/properties/solidMixtureProperties/Make/files b/src/thermophysicalModels/properties/solidMixtureProperties/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..e31412ed1dda107e56f16c363c48a61f2db5fa3b --- /dev/null +++ b/src/thermophysicalModels/properties/solidMixtureProperties/Make/files @@ -0,0 +1,3 @@ +solidMixtureProperties/solidMixtureProperties.C + +LIB = $(FOAM_LIBBIN)/libsolidMixtureProperties diff --git a/src/thermophysicalModels/properties/solidMixtureProperties/Make/options b/src/thermophysicalModels/properties/solidMixtureProperties/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..f2d8f809d5d12dac81a95c25e5a85a21cc9adac1 --- /dev/null +++ b/src/thermophysicalModels/properties/solidMixtureProperties/Make/options @@ -0,0 +1,3 @@ +EXE_INC = \ + -I${LIB_SRC}/thermophysicalModels/properties/solidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude diff --git a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C b/src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.C similarity index 77% rename from src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C rename to src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.C index 3eb1d15b2e5932635252d9023abdb2c2dfd0921e..1d4afd216237d908beedc653c270d0cdab3e281f 100644 --- a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C +++ b/src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.C @@ -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,11 +23,11 @@ License \*---------------------------------------------------------------------------*/ -#include "pointSolidMixture.H" +#include "solidMixtureProperties.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pointSolidMixture::pointSolidMixture +Foam::solidMixtureProperties::solidMixtureProperties ( const dictionary& thermophysicalProperties ) @@ -49,12 +49,15 @@ Foam::pointSolidMixture::pointSolidMixture forAll(components_, i) { - properties_.set(i, pointSolid::New(props.subDict(components_[i]))); + properties_.set(i, solidProperties::New(props.subDict(components_[i]))); } } -Foam::pointSolidMixture::pointSolidMixture(const pointSolidMixture& s) +Foam::solidMixtureProperties::solidMixtureProperties +( + const solidMixtureProperties& s +) : components_(s.components_), properties_(s.properties_.size()) @@ -68,21 +71,21 @@ Foam::pointSolidMixture::pointSolidMixture(const pointSolidMixture& s) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::pointSolidMixture> Foam::pointSolidMixture::New +Foam::autoPtr<Foam::solidMixtureProperties> Foam::solidMixtureProperties::New ( const dictionary& thermophysicalProperties ) { - return autoPtr<pointSolidMixture> + return autoPtr<solidMixtureProperties> ( - new pointSolidMixture(thermophysicalProperties) + new solidMixtureProperties(thermophysicalProperties) ); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalarField Foam::pointSolidMixture::X(const scalarField& Y) const +Foam::scalarField Foam::solidMixtureProperties::X(const scalarField& Y) const { scalarField X(Y.size()); scalar rhoInv = 0.0; @@ -92,12 +95,12 @@ Foam::scalarField Foam::pointSolidMixture::X(const scalarField& Y) const X[i] = Y[i]/properties_[i].rho(); } - tmp<scalarField> tfld = X/rhoInv; + tmp<scalarField> tfld(X/rhoInv); return tfld(); } -Foam::scalar Foam::pointSolidMixture::rho(const scalarField& X) const +Foam::scalar Foam::solidMixtureProperties::rho(const scalarField& X) const { scalar val = 0.0; forAll(properties_, i) @@ -108,7 +111,7 @@ Foam::scalar Foam::pointSolidMixture::rho(const scalarField& X) const } -Foam::scalar Foam::pointSolidMixture::Cp(const scalarField& Y) const +Foam::scalar Foam::solidMixtureProperties::Cp(const scalarField& Y) const { scalar val = 0.0; forAll(properties_, i) diff --git a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.H b/src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.H similarity index 75% rename from src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.H rename to src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.H index 0f6b749e86f824fa7d66c30ed2f774299802e741..d84449414cfa9d39143b371301749a080dce9b35 100644 --- a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.H +++ b/src/thermophysicalModels/properties/solidMixtureProperties/solidMixtureProperties/solidMixtureProperties.H @@ -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,30 +22,30 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::pointSolidMixture + Foam::solidMixtureProperties Description A mixture of solids. Note The dictionary constructor searches for the entry @c solidComponents, - which is a wordList. The pointSolid properties of each component can either + which is a wordList. The solid properties of each component can either be contained within a @c solidProperties sub-dictionary or (for legacy purposes) can be found directly in the dictionary. The @c solidProperties sub-dictionary entry should be used when possible to avoid conflicts with identically named gas-phase entries. SeeAlso - Foam::pointSolidMixture + Foam::solidMixtureProperties \*---------------------------------------------------------------------------*/ -#ifndef pointSolidMixture_H -#define pointSolidMixture_H +#ifndef solidMixtureProperties_H +#define solidMixtureProperties_H #include "scalarField.H" #include "PtrList.H" -#include "pointSolid.H" +#include "solidProperties.H" #include "autoPtr.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,18 +54,18 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class pointSolidMixture Declaration + Class solidMixtureProperties Declaration \*---------------------------------------------------------------------------*/ -class pointSolidMixture +class solidMixtureProperties { // Private data //- The names of the solids List<word> components_; - //- The pointSolid properties - PtrList<pointSolid> properties_; + //- The solidProperties properties + PtrList<solidProperties> properties_; public: @@ -73,39 +73,42 @@ public: // Constructors //- Construct from dictionary - pointSolidMixture(const dictionary&); + solidMixtureProperties(const dictionary&); //- Construct copy - pointSolidMixture(const pointSolidMixture& lm); + solidMixtureProperties(const solidMixtureProperties& lm); //- Construct and return a clone - virtual autoPtr<pointSolidMixture> clone() const + virtual autoPtr<solidMixtureProperties> clone() const { - return autoPtr<pointSolidMixture>(new pointSolidMixture(*this)); + return autoPtr<solidMixtureProperties> + ( + new solidMixtureProperties(*this) + ); } //- Destructor - virtual ~pointSolidMixture() + virtual ~solidMixtureProperties() {} // Selectors //- Select construct from dictionary - static autoPtr<pointSolidMixture> New(const dictionary&); + static autoPtr<solidMixtureProperties> New(const dictionary&); // Member Functions - //- Return the pointSolid names + //- Return the solidProperties names inline const List<word>& components() const { return components_; } - //- Return the pointSolid properties - inline const PtrList<pointSolid>& properties() const + //- Return the solidProperties properties + inline const PtrList<solidProperties>& properties() const { return properties_; } diff --git a/src/thermophysicalModels/pointSolids/C/C.C b/src/thermophysicalModels/properties/solidProperties/C/C.C similarity index 81% rename from src/thermophysicalModels/pointSolids/C/C.C rename to src/thermophysicalModels/properties/solidProperties/C/C.C index 1e178dfc440205b18ecff1fe58920a0684f89903..7a6b3137920dae394439033f9ff3400e32a86f7e 100644 --- a/src/thermophysicalModels/pointSolids/C/C.C +++ b/src/thermophysicalModels/properties/solidProperties/C/C.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(C, 0); - addToRunTimeSelectionTable(pointSolid, C,); - addToRunTimeSelectionTable(pointSolid, C, Istream); - addToRunTimeSelectionTable(pointSolid, C, dictionary); + addToRunTimeSelectionTable(solidProperties, C,); + addToRunTimeSelectionTable(solidProperties, C, Istream); + addToRunTimeSelectionTable(solidProperties, C, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::C::C() : - pointSolid(2010, 710, 0.04, 0.0, 1.0) + solidProperties(2010, 710, 0.04, 0.0, 1.0) { if (debug) { @@ -51,27 +51,27 @@ Foam::C::C() } -Foam::C::C(const pointSolid& s) +Foam::C::C(const solidProperties& s) : - pointSolid(s) + solidProperties(s) {} Foam::C::C(Istream& is) : - pointSolid(is) + solidProperties(is) {} Foam::C::C(const dictionary& dict) : - pointSolid(dict) + solidProperties(dict) {} Foam::C::C(const C& s) : - pointSolid(s) + solidProperties(s) {} @@ -79,7 +79,7 @@ Foam::C::C(const C& s) void Foam::C::writeData(Ostream& os) const { - pointSolid::writeData(os); + solidProperties::writeData(os); } diff --git a/src/thermophysicalModels/pointSolids/C/C.H b/src/thermophysicalModels/properties/solidProperties/C/C.H similarity index 87% rename from src/thermophysicalModels/pointSolids/C/C.H rename to src/thermophysicalModels/properties/solidProperties/C/C.H index 614a1532060a91a4c09e628158e73ee614872a03..bd4b4364bcc3d2cc84e18bde999873dc5da51e28 100644 --- a/src/thermophysicalModels/pointSolids/C/C.H +++ b/src/thermophysicalModels/properties/solidProperties/C/C.H @@ -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 @@ Class Foam::C Description - Graphite + Graphite solid properties SourceFiles C.C @@ -35,7 +35,7 @@ SourceFiles #ifndef solid_C_H #define solid_C_H -#include "pointSolid.H" +#include "solidProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ Ostream& operator<< class C : - public pointSolid + public solidProperties { public: @@ -70,8 +70,8 @@ public: //- Construct null C(); - //- Construct from pointSolid - C(const pointSolid& s); + //- Construct from solidProperties + C(const solidProperties& s); //- Construct from Istream C(Istream& is); @@ -83,9 +83,9 @@ public: C(const C& s); //- Construct and return clone - virtual autoPtr<pointSolid> clone() const + virtual autoPtr<solidProperties> clone() const { - return autoPtr<pointSolid>(new C(*this)); + return autoPtr<solidProperties>(new C(*this)); } diff --git a/src/thermophysicalModels/pointSolids/CaCO3/CaCO3.C b/src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.C similarity index 81% rename from src/thermophysicalModels/pointSolids/CaCO3/CaCO3.C rename to src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.C index d15029f65a116fa958a2822ae6c8b355941835cf..f199c4e0e1314aa80f869e94fd41d82f3b1c3f7d 100644 --- a/src/thermophysicalModels/pointSolids/CaCO3/CaCO3.C +++ b/src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(CaCO3, 0); - addToRunTimeSelectionTable(pointSolid, CaCO3,); - addToRunTimeSelectionTable(pointSolid, CaCO3, Istream); - addToRunTimeSelectionTable(pointSolid, CaCO3, dictionary); + addToRunTimeSelectionTable(solidProperties, CaCO3,); + addToRunTimeSelectionTable(solidProperties, CaCO3, Istream); + addToRunTimeSelectionTable(solidProperties, CaCO3, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::CaCO3::CaCO3() : - pointSolid(2710, 850, 1.3, 0.0, 1.0) + solidProperties(2710, 850, 1.3, 0.0, 1.0) { if (debug) { @@ -51,27 +51,27 @@ Foam::CaCO3::CaCO3() } -Foam::CaCO3::CaCO3(const pointSolid& s) +Foam::CaCO3::CaCO3(const solidProperties& s) : - pointSolid(s) + solidProperties(s) {} Foam::CaCO3::CaCO3(Istream& is) : - pointSolid(is) + solidProperties(is) {} Foam::CaCO3::CaCO3(const dictionary& dict) : - pointSolid(dict) + solidProperties(dict) {} Foam::CaCO3::CaCO3(const CaCO3& s) : - pointSolid(s) + solidProperties(s) {} @@ -79,7 +79,7 @@ Foam::CaCO3::CaCO3(const CaCO3& s) void Foam::CaCO3::writeData(Ostream& os) const { - pointSolid::writeData(os); + solidProperties::writeData(os); } diff --git a/src/thermophysicalModels/pointSolids/CaCO3/CaCO3.H b/src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.H similarity index 86% rename from src/thermophysicalModels/pointSolids/CaCO3/CaCO3.H rename to src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.H index d5559500b8f09d809d7f6cd7400baa606c52e633..fc47cd1d953f60ec348d8b35eed11e3dac5c1b0b 100644 --- a/src/thermophysicalModels/pointSolids/CaCO3/CaCO3.H +++ b/src/thermophysicalModels/properties/solidProperties/CaCO3/CaCO3.H @@ -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 @@ -35,7 +35,7 @@ SourceFiles #ifndef solid_CaCO3_H #define solid_CaCO3_H -#include "pointSolid.H" +#include "solidProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,12 +52,12 @@ Ostream& operator<< /*---------------------------------------------------------------------------*\ - Class CaCO3 Declaration + Class CaCO3 Declaration \*---------------------------------------------------------------------------*/ class CaCO3 : - public pointSolid + public solidProperties { public: @@ -71,8 +71,8 @@ public: //- Construct null CaCO3(); - //- Construct from pointSolid - CaCO3(const pointSolid& s); + //- Construct from solidProperties + CaCO3(const solidProperties& s); //- Construct from Istream CaCO3(Istream& is); @@ -84,9 +84,9 @@ public: CaCO3(const CaCO3& s); //- Construct and return clone - virtual autoPtr<pointSolid> clone() const + virtual autoPtr<solidProperties> clone() const { - return autoPtr<pointSolid>(new CaCO3(*this)); + return autoPtr<solidProperties>(new CaCO3(*this)); } diff --git a/src/thermophysicalModels/properties/solidProperties/Make/files b/src/thermophysicalModels/properties/solidProperties/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..694c379453f81cd4a51e3cdd09c0af6b88da57b8 --- /dev/null +++ b/src/thermophysicalModels/properties/solidProperties/Make/files @@ -0,0 +1,8 @@ +solidProperties/solidProperties.C +solidProperties/solidPropertiesNew.C + +ash/ash.C +C/C.C +CaCO3/CaCO3.C + +LIB = $(FOAM_LIBBIN)/libsolidProperties diff --git a/src/thermophysicalModels/pointSolids/Make/options b/src/thermophysicalModels/properties/solidProperties/Make/options similarity index 100% rename from src/thermophysicalModels/pointSolids/Make/options rename to src/thermophysicalModels/properties/solidProperties/Make/options diff --git a/src/thermophysicalModels/pointSolids/ash/ash.C b/src/thermophysicalModels/properties/solidProperties/ash/ash.C similarity index 81% rename from src/thermophysicalModels/pointSolids/ash/ash.C rename to src/thermophysicalModels/properties/solidProperties/ash/ash.C index b9672f5bd03e6e31e98bb099dc1f6e263017c2b2..2ab7370ff713c5b816377417c7876b6c57aa9dde 100644 --- a/src/thermophysicalModels/pointSolids/ash/ash.C +++ b/src/thermophysicalModels/properties/solidProperties/ash/ash.C @@ -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 @@ -31,16 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(ash, 0); - addToRunTimeSelectionTable(pointSolid, ash,); - addToRunTimeSelectionTable(pointSolid, ash, Istream); - addToRunTimeSelectionTable(pointSolid, ash, dictionary); + addToRunTimeSelectionTable(solidProperties, ash,); + addToRunTimeSelectionTable(solidProperties, ash, Istream); + addToRunTimeSelectionTable(solidProperties, ash, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::ash::ash() : - pointSolid(2010, 710, 0.04, 0.0, 1.0) + solidProperties(2010, 710, 0.04, 0.0, 1.0) { if (debug) { @@ -51,27 +51,27 @@ Foam::ash::ash() } -Foam::ash::ash(const pointSolid& s) +Foam::ash::ash(const solidProperties& s) : - pointSolid(s) + solidProperties(s) {} Foam::ash::ash(Istream& is) : - pointSolid(is) + solidProperties(is) {} Foam::ash::ash(const dictionary& dict) : - pointSolid(dict) + solidProperties(dict) {} Foam::ash::ash(const ash& s) : - pointSolid(s) + solidProperties(s) {} @@ -79,7 +79,7 @@ Foam::ash::ash(const ash& s) void Foam::ash::writeData(Ostream& os) const { - pointSolid::writeData(os); + solidProperties::writeData(os); } diff --git a/src/thermophysicalModels/pointSolids/ash/ash.H b/src/thermophysicalModels/properties/solidProperties/ash/ash.H similarity index 87% rename from src/thermophysicalModels/pointSolids/ash/ash.H rename to src/thermophysicalModels/properties/solidProperties/ash/ash.H index fcbfbdeeb94c0400c4d18dba2cfe53f60a33ec60..796cc3b3d85b47159aafa2910259ce5956c26fe7 100644 --- a/src/thermophysicalModels/pointSolids/ash/ash.H +++ b/src/thermophysicalModels/properties/solidProperties/ash/ash.H @@ -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 @@ Class Foam::ash Description - Coal ash + Coal ash solid properties SourceFiles ash.C @@ -35,7 +35,7 @@ SourceFiles #ifndef solid_ash_H #define solid_ash_H -#include "pointSolid.H" +#include "solidProperties.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ Ostream& operator<< class ash : - public pointSolid + public solidProperties { public: @@ -71,8 +71,8 @@ public: //- Construct null ash(); - //- Construct from pointSolid - ash(const pointSolid& s); + //- Construct from solidProperties + ash(const solidProperties& s); //- Construct from Istream ash(Istream& is); @@ -84,9 +84,9 @@ public: ash(const ash& s); //- Construct and return clone - virtual autoPtr<pointSolid> clone() const + virtual autoPtr<solidProperties> clone() const { - return autoPtr<pointSolid>(new ash(*this)); + return autoPtr<solidProperties>(new ash(*this)); } diff --git a/src/thermophysicalModels/pointSolids/pointSolid/pointSolid.C b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.C similarity index 78% rename from src/thermophysicalModels/pointSolids/pointSolid/pointSolid.C rename to src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.C index 6c53900fc09752032f01a0ca7cebbf7eb1c3f066..e3c0f8ed0eee10cf8452849336b0189c4d6e862d 100644 --- a/src/thermophysicalModels/pointSolids/pointSolid/pointSolid.C +++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.C @@ -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,21 +23,21 @@ License \*---------------------------------------------------------------------------*/ -#include "pointSolid.H" +#include "solidProperties.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(pointSolid, 0); - defineRunTimeSelectionTable(pointSolid,); - defineRunTimeSelectionTable(pointSolid, Istream); - defineRunTimeSelectionTable(pointSolid, dictionary); + defineTypeNameAndDebug(solidProperties, 0); + defineRunTimeSelectionTable(solidProperties,); + defineRunTimeSelectionTable(solidProperties, Istream); + defineRunTimeSelectionTable(solidProperties, dictionary); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pointSolid::pointSolid +Foam::solidProperties::solidProperties ( scalar rho, scalar Cp, @@ -54,7 +54,7 @@ Foam::pointSolid::pointSolid {} -Foam::pointSolid::pointSolid(Istream& is) +Foam::solidProperties::solidProperties(Istream& is) : rho_(readScalar(is)), Cp_(readScalar(is)), @@ -64,7 +64,7 @@ Foam::pointSolid::pointSolid(Istream& is) {} -Foam::pointSolid::pointSolid(const dictionary& dict) +Foam::solidProperties::solidProperties(const dictionary& dict) : rho_(readScalar(dict.lookup("rho"))), Cp_(readScalar(dict.lookup("Cp"))), @@ -74,7 +74,7 @@ Foam::pointSolid::pointSolid(const dictionary& dict) {} -Foam::pointSolid::pointSolid(const pointSolid& s) +Foam::solidProperties::solidProperties(const solidProperties& s) : rho_(s.rho_), Cp_(s.Cp_), @@ -86,7 +86,7 @@ Foam::pointSolid::pointSolid(const pointSolid& s) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pointSolid::writeData(Ostream& os) const +void Foam::solidProperties::writeData(Ostream& os) const { os << rho_ << token::SPACE << Cp_ << token::SPACE @@ -98,7 +98,7 @@ void Foam::pointSolid::writeData(Ostream& os) const // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const pointSolid& s) +Foam::Ostream& Foam::operator<<(Ostream& os, const solidProperties& s) { s.writeData(os); return os; diff --git a/src/thermophysicalModels/pointSolids/pointSolid/pointSolid.H b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.H similarity index 75% rename from src/thermophysicalModels/pointSolids/pointSolid/pointSolid.H rename to src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.H index 2b660c95375e0e7bc06f4ff672bad86c9a694540..7ed4e03f145f05338105551dd9a7174f917dfbc1 100644 --- a/src/thermophysicalModels/pointSolids/pointSolid/pointSolid.H +++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidProperties.H @@ -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,18 +22,18 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::pointSolid + Foam::solidProperties Description - The thermophysical properties of a pointSolid + The thermophysical properties of a solid SourceFiles - pointSolid.C + solidProperties.C \*---------------------------------------------------------------------------*/ -#ifndef pointSolid_H -#define pointSolid_H +#ifndef solidProperties_H +#define solidProperties_H #include "typeInfo.H" #include "autoPtr.H" @@ -45,20 +45,20 @@ SourceFiles namespace Foam { -class pointSolid; +class solidProperties; Ostream& operator<< ( Ostream&, - const pointSolid& + const solidProperties& ); /*---------------------------------------------------------------------------*\ - Class pointSolid Declaration + Class solidProperties Declaration \*---------------------------------------------------------------------------*/ -class pointSolid +class solidProperties { // Private data @@ -82,7 +82,7 @@ class pointSolid public: //- Runtime type information - TypeName("pointSolid"); + TypeName("solidProperties"); // Declare run-time constructor selection tables @@ -90,7 +90,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - pointSolid, + solidProperties, , (), () @@ -99,7 +99,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - pointSolid, + solidProperties, Istream, (Istream& is), (is) @@ -108,7 +108,7 @@ public: declareRunTimeSelectionTable ( autoPtr, - pointSolid, + solidProperties, dictionary, (const dictionary& dict), (dict) @@ -118,7 +118,7 @@ public: // Constructors //- Construct from components - pointSolid + solidProperties ( scalar rho, scalar Cp, @@ -128,38 +128,38 @@ public: ); //- Construct from Istream - pointSolid(Istream& is); + solidProperties(Istream& is); //- Construct from dictionary - pointSolid(const dictionary& dict); + solidProperties(const dictionary& dict); //- Construct copy - pointSolid(const pointSolid& s); + solidProperties(const solidProperties& s); //- Construct and return clone - virtual autoPtr<pointSolid> clone() const + virtual autoPtr<solidProperties> clone() const { - return autoPtr<pointSolid>(new pointSolid(*this)); + return autoPtr<solidProperties>(new solidProperties(*this)); } // Selectors - //- Return a pointer to a new pointSolid created from input - static autoPtr<pointSolid> New(Istream& is); + //- Return a pointer to a new solidProperties created from input + static autoPtr<solidProperties> New(Istream& is); - //- Return a pointer to a new pointSolid created from dictionary - static autoPtr<pointSolid> New(const dictionary& dict); + //- Return a pointer to a new solidProperties created from dictionary + static autoPtr<solidProperties> New(const dictionary& dict); //- Destructor - virtual ~pointSolid() + virtual ~solidProperties() {} // Member Functions - // Physical constants which define the pointSolid + // Physical constants which define the solidProperties //- Density [kg/m3] inline scalar rho() const; @@ -185,13 +185,13 @@ public: // I-O - //- Write the pointSolid properties + //- Write the solidProperties properties virtual void writeData(Ostream& os) const; // Ostream Operator - friend Ostream& operator<<(Ostream& os, const pointSolid& s); + friend Ostream& operator<<(Ostream& os, const solidProperties& s); }; @@ -201,7 +201,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "pointSolidI.H" +#include "solidPropertiesI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pointSolids/pointSolid/pointSolidI.H b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesI.H similarity index 75% rename from src/thermophysicalModels/pointSolids/pointSolid/pointSolidI.H rename to src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesI.H index 6aa0aab563ad5c7726307b38d27aa763d11cd711..252977569df167f12a3175a6b4c22107daa6f0ca 100644 --- a/src/thermophysicalModels/pointSolids/pointSolid/pointSolidI.H +++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesI.H @@ -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,43 +27,43 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -inline Foam::scalar Foam::pointSolid::rho() const +inline Foam::scalar Foam::solidProperties::rho() const { return rho_; } -inline Foam::scalar Foam::pointSolid::Cp() const +inline Foam::scalar Foam::solidProperties::Cp() const { return Cp_; } -inline Foam::scalar Foam::pointSolid::K() const +inline Foam::scalar Foam::solidProperties::K() const { return K_; } -inline Foam::scalar Foam::pointSolid::Hf() const +inline Foam::scalar Foam::solidProperties::Hf() const { return Hf_; } -inline Foam::scalar Foam::pointSolid::H(const scalar T) const +inline Foam::scalar Foam::solidProperties::H(const scalar T) const { return Hs(T) + Hf_; } -inline Foam::scalar Foam::pointSolid::Hs(const scalar T) const +inline Foam::scalar Foam::solidProperties::Hs(const scalar T) const { return Cp_*(T - specie::Tstd); } -inline Foam::scalar Foam::pointSolid::emissivity() const +inline Foam::scalar Foam::solidProperties::emissivity() const { return emissivity_; } diff --git a/src/thermophysicalModels/pointSolids/pointSolid/pointSolidNew.C b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C similarity index 64% rename from src/thermophysicalModels/pointSolids/pointSolid/pointSolidNew.C rename to src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C index f93ededc4597b8717fb5ae5e8d890c7b133e5c11..9e2e0d675d3f1592bdebaa601e0b3cf82ec2745f 100644 --- a/src/thermophysicalModels/pointSolids/pointSolid/pointSolidNew.C +++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C @@ -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,16 +23,17 @@ License \*---------------------------------------------------------------------------*/ -#include "pointSolid.H" +#include "solidProperties.H" #include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(Istream& is) +Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New(Istream& is) { if (debug) { - Info<< "pointSolid::New(Istream&): constructing pointSolid" << endl; + Info<< "solidProperties::New(Istream&): constructing solid" + << endl; } const word solidType(is); @@ -45,14 +46,14 @@ Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(Istream& is) if (cstrIter == ConstructorTablePtr_->end()) { - FatalErrorIn("pointSolid::New(Istream&)") - << "Unknown pointSolid type " << solidType << nl << nl - << "Valid pointSolid types are :" << endl + FatalErrorIn("solidProperties::New(Istream&)") + << "Unknown solidProperties type " << solidType << nl << nl + << "Valid solidProperties types are :" << endl << ConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<pointSolid>(cstrIter()()); + return autoPtr<solidProperties>(cstrIter()()); } else if (coeffs == "coeffs") { @@ -61,33 +62,36 @@ Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(Istream& is) if (cstrIter == IstreamConstructorTablePtr_->end()) { - FatalErrorIn("pointSolid::New(Istream&)") - << "Unknown pointSolid type " << solidType << nl << nl - << "Valid pointSolid types are :" << endl + FatalErrorIn("solidProperties::New(Istream&)") + << "Unknown solidProperties type " << solidType << nl << nl + << "Valid solidProperties types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<pointSolid>(cstrIter()(is)); + return autoPtr<solidProperties>(cstrIter()(is)); } else { - FatalErrorIn("pointSolid::New(Istream&)") - << "pointSolid type " << solidType + FatalErrorIn("solidProperties::New(Istream&)") + << "solidProperties type " << solidType << ", option " << coeffs << " given" << ", should be coeffs or defaultCoeffs" << exit(FatalError); - return autoPtr<pointSolid>(NULL); + return autoPtr<solidProperties>(NULL); } } -Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(const dictionary& dict) +Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New +( + const dictionary& dict +) { if (debug) { - Info<< "pointSolid::New(const dictionary&): constructing pointSolid" + Info<< "solidProperties::New(const dictionary&): constructing solid" << endl; } @@ -101,14 +105,14 @@ Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(const dictionary& dict) if (cstrIter == ConstructorTablePtr_->end()) { - FatalErrorIn("pointSolid::New(const dictionary&)") - << "Unknown pointSolid type " << solidType << nl << nl - << "Valid pointSolid types are :" << endl + FatalErrorIn("solidProperties::New(const dictionary&)") + << "Unknown solidProperties type " << solidType << nl << nl + << "Valid solidProperties types are :" << endl << ConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<pointSolid>(cstrIter()()); + return autoPtr<solidProperties>(cstrIter()()); } else { @@ -117,14 +121,14 @@ Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(const dictionary& dict) if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("pointSolid::New(const dictionary&)") - << "Unknown pointSolid type " << solidType << nl << nl - << "Valid pointSolid types are :" << endl + FatalErrorIn("solidProperties::New(const dictionary&)") + << "Unknown solidProperties type " << solidType << nl << nl + << "Valid solidProperties types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<pointSolid>(cstrIter()(dict)); + return autoPtr<solidProperties>(cstrIter()(dict)); } } diff --git a/src/thermophysicalModels/radiation/Make/files b/src/thermophysicalModels/radiationModels/Make/files similarity index 97% rename from src/thermophysicalModels/radiation/Make/files rename to src/thermophysicalModels/radiationModels/Make/files index 5c77d42f128bb03128b0e05d241d419aec27beb5..2a8b05a84d1fb267321fad19742240b3b2b76604 100644 --- a/src/thermophysicalModels/radiation/Make/files +++ b/src/thermophysicalModels/radiationModels/Make/files @@ -30,4 +30,4 @@ derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchSc derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C -LIB = $(FOAM_LIBBIN)/libradiation +LIB = $(FOAM_LIBBIN)/libradiationModels diff --git a/src/thermophysicalModels/radiation/Make/options b/src/thermophysicalModels/radiationModels/Make/options similarity index 100% rename from src/thermophysicalModels/radiation/Make/options rename to src/thermophysicalModels/radiationModels/Make/options diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index e972def14db9db3cced9e1b4c6d4a0c870971780..5ef5f62f864ef7a9bedb4dd1288b576ea9a6a600 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -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 diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H index e770b20fd65b5c2d8d541cd04bdaa67ae1c23b85..9a5f880042f71c3ace771c8f5a9cc40879ec03de 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H @@ -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 diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C index 5b2bca8e9372ea801657a4a480df561d30b5dd09..d5bc52360a73d0b1e222d90559542aca396f1512 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C @@ -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 diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H index 2fa538af915a64a97837fe41e7034d967284e73d..5a77b6f246e7d021dfc38a24ad56f4385daea6f5 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H @@ -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 diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C similarity index 99% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 766f01cce394428c73c40a2d5d07d252bf128b5e..850ea09543e04d1570ccf911b8f18138feb03e42 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index a951362c840583e7c4bc5737ead07ba479f97ad0..1cf290ec79993c20001c9dd93b17cf81483ca646 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C similarity index 99% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 77d88498320dfb957e2e45459a559b49daf65b7d..efe439d69bb4a186737470463bbfa72b009ef251 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 8f5db7f851083d3472c9c16cc25eebd4be3a4522..87048d767ad6ebc43e349cb141e7c5eb7d96b1c8 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/include/createRadiationModel.H b/src/thermophysicalModels/radiationModels/include/createRadiationModel.H similarity index 100% rename from src/thermophysicalModels/radiation/include/createRadiationModel.H rename to src/thermophysicalModels/radiationModels/include/createRadiationModel.H diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/P1/P1.C rename to src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C index 55390c5238b2691d6984efcc08e04efabdfb1f4e..f59b5632f4468fc80e8b9db8e475efe7563ec8e5 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/P1/P1.H rename to src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H index 39da278e1d4424f1a1d67b0d3567d22163102c5b..d06fb70b2f33f43ed58d21b6d4cb06467d685124 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C similarity index 97% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C index 4b62fd554a5b3dc3fa5094ea745ba0d51d61da2f..76361fa861cfc19526e1d875be19106d193fde4e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H index 378dda514a07f4159172c4b3f19e14ffccc23251..f5279d54b9ce5b6274e912a7967650f51c8892c2 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H similarity index 96% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H index d971dda8d536f8671f5f3fe9f178d6930b2e66a3..3fbce17326a33bdac8aac6c0302e5bab08eb7390 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C similarity index 99% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C index d10678a6c8781f202eff24217280efbb037a08e4..2ab677fbf18cfa34f2b400f26da028c4900a08b5 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H index 93d39bfa7132b3b806264b29336164dff9f445d3..58b0db59ed42f0cd36aa1131f6641e4f56d6ede3 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C similarity index 100% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.H similarity index 99% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.H index 1ae3a4c4b48e521bc0c15164f11b1cede7326f73..9c2ba167a8e2e8de4233a68f30aab8f92c396771 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOMI.H similarity index 97% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOMI.H index ae28b450a6c6f4a965e89f725ea9dd5fd5d9583a..844f93ae033a08568c135e775527e3fc41dfbd70 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOMI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C similarity index 100% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H similarity index 100% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H similarity index 97% rename from src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H rename to src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H index 3891ae9a7defd584d629f0b1afbbcde548cc4c41..0ef6cf36c941d27040b0886da4e0f8024c157d6a 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C rename to src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C index 8bbd4ad5c4b50ecb642d1015888125fa7fabb4ae..045a420611bb80bc3fa25e8c5ecb4df0dca82f4b 100644 --- a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.H similarity index 97% rename from src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H rename to src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.H index c9a75b8a61fbc7d73890815bda07da2dfa62147f..f383a9912275edfcc5a6c2b34bdf9b0885f0a632 100644 --- a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.H @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C rename to src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C index 95e37a5a6293163d0b622a4f058ecf87eaaa768d..13fefd9bc9426cf2f0498ec2e44ec4ba67387ea6 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H similarity index 98% rename from src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H rename to src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H index ddbdcad59092eeae754f1b565112e49c2c0c52f4..5af7733d16444d8c1307f5669c642275645afa57 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H @@ -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 diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C similarity index 97% rename from src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C rename to src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C index fcc34c566ac0a6a79b2e19d3cb3ad45b83d4c79c..3c551651576b034d074dd182d4052ddb90567329 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C index 0db3555988b9e9075135376b5c181782af5e0ed8..6f95a84b2f6569e04076084daaff996dd4c0566f 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H index 317772cb07f365dcbb18e358b29bf3982a50fd38..d515c63d0fc71e7dae3694d6335835e34002eb71 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModel.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C similarity index 97% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C index 5d7bf5880865911941323274f429b879ed4513af..92a4f876a2b7c86b2f35e0feb8b43ca47c7406d0 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C index e15c6e67eb3b5f6cf23081a865beed96289e1721..3ee2c15be359737a34ae37c0d4009f61ec56370d 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H index 6d350b04d7f72bd6f266260157816f3b0d2b5128..9d2d437746c37e33527cc2de300505991e9e2474 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmission.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C index bc29d02cb254a4f320968259780231cdd5d7151a..1ecc37d589c11e3ea7e2a4043da7e5e92b36a48e 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H index 89bc9d14ef791c2aed01d01810c15d627ee5e21a..34460e491ae2fa83aad6d8ae1d1ed7bdc16f18d2 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C similarity index 99% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C index 04ad376ee63bf64fd2b9bb62863f4c911838c012..62c491b1040ba058435aa4df53857ff117d78deb 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H similarity index 98% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H index 0ac653c9c032ff54c4ddd4feee21e994a9d4b610..7f72d79a02c839e48ea5b2ec593f17ed3a0d6ca2 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C similarity index 96% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C index 4eef20f86c63e63e14a1edb687e875d2848911f9..eeb2dff45f2a322310afa365a7a3b6ff4245f847 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H similarity index 97% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H index dbcef424e138d750a38900da7b53e42de18674e1..1eacbda555e92331c6be2aad481a2b3e34e152b5 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/noAbsorptionEmission/noAbsorptionEmission.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C similarity index 99% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C index 0620ba27a9c3688215316742eb42b0a5b56606b3..474d8df17e19182295585c5a1cadda47b5961560 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H similarity index 99% rename from src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H rename to src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H index 1283eb8b5c2b2f389d024f7363edab2bd24210de..053928f7621eb472930ab7f03d9048e62399ea0d 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H +++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C b/src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.C similarity index 97% rename from src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C rename to src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.C index 712c6ef1f030054a776e611e7fc4a0c4e6bc53b9..f2ed95e128417da612a5869b625c9630799f437d 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C +++ b/src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H b/src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.H similarity index 97% rename from src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H rename to src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.H index 429fd3dd37ea0694c366132e754ff1ed0df55197..f508a979ab4e0ddb558bf5e81ae97adebbb272ce 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H +++ b/src/thermophysicalModels/radiationModels/submodels/scatterModel/constantScatter/constantScatter.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.C b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.C similarity index 96% rename from src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.C rename to src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.C index e35bd321caea11380e18247c3f83f0fce3a96f17..76641957ed1838631052c56c068c23067d740eb9 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.C +++ b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.C @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.H b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.H similarity index 97% rename from src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.H rename to src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.H index f37744bfe67cf3efe730e8b9a79f03264312f132..128b68a45fb427ba81563e0b51a74c058017d744 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModel.H +++ b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModel.H @@ -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 diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModelNew.C similarity index 97% rename from src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C rename to src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModelNew.C index f03469bafd244d11aa8f71de4869bb92fac88326..8d10e0d07e2ef53c17de24b65d580bd3a9aaf2ca 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C +++ b/src/thermophysicalModels/radiationModels/submodels/scatterModel/scatterModel/scatterModelNew.C @@ -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 diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H index f1eeacef9eccb973971bf9273d80c2e2fc89b429..b81ab6f80d1d2cbb82da8097fac4cdc09cd3d2b5 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ Foam::icoPolynomial<PolySize>::New(const dictionary& dict) template<int PolySize> inline Foam::scalar Foam::icoPolynomial<PolySize>::rho(scalar, scalar T) const { - return rhoCoeffs_.evaluate(T)/this->W(); + return rhoCoeffs_.value(T)/this->W(); } diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C index 1b04a9d47c1b0a6bb71979b959590f6afff0acd6..15269f6ce2c7c625819006e7dbff30f6ccf1665d 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,10 +49,10 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo sCoeffs_ = CpCoeffs_.integrateMinus1(); // Offset h poly so that it is relative to the enthalpy at Tstd - hCoeffs_[0] += Hf_ - hCoeffs_.evaluate(specie::Tstd); + hCoeffs_[0] += Hf_ - hCoeffs_.value(specie::Tstd); // Offset s poly so that it is relative to the entropy at Tstd - sCoeffs_[0] += Sf_ - sCoeffs_.evaluate(specie::Tstd); + sCoeffs_[0] += Sf_ - sCoeffs_.value(specie::Tstd); } @@ -77,10 +77,10 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo sCoeffs_ = CpCoeffs_.integrateMinus1(); // Offset h poly so that it is relative to the enthalpy at Tstd - hCoeffs_[0] += Hf_ - hCoeffs_.evaluate(specie::Tstd); + hCoeffs_[0] += Hf_ - hCoeffs_.value(specie::Tstd); // Offset s poly so that it is relative to the entropy at Tstd - sCoeffs_[0] += Sf_ - sCoeffs_.evaluate(specie::Tstd); + sCoeffs_[0] += Sf_ - sCoeffs_.value(specie::Tstd); } diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 1576c646d0b7318514b04826fb246e6e7ad69a72..b41de9b877f04ddb5caeae7ebc2f9e4bc25b5c3c 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::cp const scalar T ) const { - return CpCoeffs_.evaluate(T); + return CpCoeffs_.value(T); } @@ -98,7 +98,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::h const scalar T ) const { - return hCoeffs_.evaluate(T); + return hCoeffs_.value(T); } @@ -126,7 +126,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s const scalar T ) const { - return sCoeffs_.evaluate(T); + return sCoeffs_.value(T); } diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H index 52094247fb7f7b531cd7d47fedeb8a1fb0dc37a1..d87dcd5657e2a2330dedc99dd009f422d980071c 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::mu const scalar T ) const { - return muCoeffs_.evaluate(T)/this->W(); + return muCoeffs_.value(T)/this->W(); } @@ -117,7 +117,7 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::kappa const scalar T ) const { - return kappaCoeffs_.evaluate(T)/this->W(); + return kappaCoeffs_.value(T)/this->W(); } diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake index 138f265357ee6d27655f1140e247ccb3f7c7b5d1..f0eba94263ea1be6267d34f1dc7781621c5466e9 100755 --- a/src/transportModels/Allwmake +++ b/src/transportModels/Allwmake @@ -1,10 +1,11 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso incompressible -wmake libso interfaceProperties -wmake libso twoPhaseInterfaceProperties -# wmake libso compressible +wmake $makeOption incompressible +wmake $makeOption interfaceProperties +wmake $makeOption twoPhaseInterfaceProperties +# wmake $makeOption compressible # ----------------------------------------------------------------- end-of-file diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H index 13a7c47f88cd16ccc6cbd4d841f609eb28e32f66..732225f5e61f6ffbfe9e7b97e3132a21818c268f 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H @@ -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 @@ -146,7 +146,7 @@ public: return nu_; } - //- Return the face-interpolated dynamic laminar viscosity + //- Return the face-interpolated kinematic laminar viscosity tmp<surfaceScalarField> nuf() const; //- Correct the laminar viscosity diff --git a/src/triSurface/triSurface/interfaces/AC3D/readAC.C b/src/triSurface/triSurface/interfaces/AC3D/readAC.C index d4e8b0a752f0a58490ea903906ea7e832f6b3d46..dfe4ae09048baa6d0fb59e63a0ec9f2b5c471227 100644 --- a/src/triSurface/triSurface/interfaces/AC3D/readAC.C +++ b/src/triSurface/triSurface/interfaces/AC3D/readAC.C @@ -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 @@ -331,7 +331,7 @@ bool triSurface::readAC(const fileName& ACfileName) *this = triSurface(faces, patches, allPoints, true); - stitchTriangles(allPoints); + stitchTriangles(); return true; } diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L index 4b33f27f5729a0aafac062001cf039312f28d5a5..9cb9f1d3d190db2237667d896c684f3e8ae07904 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L +++ b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L @@ -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 @@ -422,6 +422,7 @@ bool triSurface::readSTLASCII(const fileName& STLfileName) setSize(lexer.nTriangles()); DynamicList<label>& STLlabels = lexer.STLlabels(); + // Assign triangles label pointi = 0; forAll(*this, i) { @@ -433,8 +434,11 @@ bool triSurface::readSTLASCII(const fileName& STLfileName) STLlabels.clear(); + // Assign coordinates + storedPoints().transfer(rawPoints); + // Stitch all points within SMALL meters. - stitchTriangles(rawPoints); + stitchTriangles(); // Convert solidNames into regionNames patches_.setSize(lexer.STLsolidNames().size()); diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C b/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C index a0b5b10e03bf635ad118f7a9cb127c1df152c247..bfecd779ac7e7fa408b6daf094f07e8a0ff12a80 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C +++ b/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C @@ -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 @@ -123,7 +123,11 @@ bool Foam::triSurface::readSTLBINARY(const fileName& STLfileName) //STLfile.close(); - stitchTriangles(rawPoints); + // Assign coordinates + storedPoints().transfer(rawPoints); + + // Stitch all points within SMALL meters. + stitchTriangles(); return true; } diff --git a/src/triSurface/triSurface/interfaces/TRI/readTRI.C b/src/triSurface/triSurface/interfaces/TRI/readTRI.C index 8b7feddb6ae32702be0dc3f60a55803c3ff30310..0c699563eab19783a993b7be81f25ed58f4d6304 100644 --- a/src/triSurface/triSurface/interfaces/TRI/readTRI.C +++ b/src/triSurface/triSurface/interfaces/TRI/readTRI.C @@ -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 @@ -138,6 +138,7 @@ bool Foam::triSurface::readTRI(const fileName& TRIfileName) setSize(STLlabels.size()); + // Assign triangles pointI = 0; SLList<label>::const_iterator iter = STLlabels.begin(); forAll(*this, i) @@ -149,7 +150,10 @@ bool Foam::triSurface::readTRI(const fileName& TRIfileName) ++iter; } - stitchTriangles(rawPoints); + // Assign coordinates + storedPoints().transfer(rawPoints); + // Merge duplicate points + stitchTriangles(); // Convert solidNames into regionNames stringList names(STLsolidNames.toc()); diff --git a/src/triSurface/triSurface/stitchTriangles.C b/src/triSurface/triSurface/stitchTriangles.C index 9979f07cfe96198ee9042322e86402bb7754acb5..041d680d9ed5d85e8cd868076523a21055e2a71f 100644 --- a/src/triSurface/triSurface/stitchTriangles.C +++ b/src/triSurface/triSurface/stitchTriangles.C @@ -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 @@ -31,30 +31,28 @@ License bool Foam::triSurface::stitchTriangles ( - const pointField& rawPoints, const scalar tol, bool verbose ) { + pointField& ps = storedPoints(); + // Merge points labelList pointMap; pointField newPoints; - bool hasMerged = mergePoints(rawPoints, tol, verbose, pointMap, newPoints); + bool hasMerged = mergePoints(ps, tol, verbose, pointMap, newPoints); if (hasMerged) { - pointField& ps = storedPoints(); - - // Set the coordinates to the merged ones - ps.transfer(newPoints); - - if (verbose) { - Pout<< "stitchTriangles : Merged from " << rawPoints.size() - << " points down to " << ps.size() << endl; + Pout<< "stitchTriangles : Merged from " << ps.size() + << " points down to " << newPoints.size() << endl; } + // Set the coordinates to the merged ones + ps.transfer(newPoints); + // Reset the triangle point labels to the unique points array label newTriangleI = 0; forAll(*this, i) diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index 0075bf9b51119b53764019c97503ebfc580219e9..538d10c0eb9b6868784852b29f2b5ca804ea6c45 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -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 @@ -809,7 +809,7 @@ void Foam::triSurface::scalePoints(const scalar scaleFactor) void Foam::triSurface::cleanup(const bool verbose) { // Merge points (already done for STL, TRI) - stitchTriangles(points(), SMALL, verbose); + stitchTriangles(SMALL, verbose); // Merging points might have changed geometric factors clearOut(); diff --git a/src/triSurface/triSurface/triSurface.H b/src/triSurface/triSurface/triSurface.H index b889449e44165df102a48aeded234fc6aaa2036f..0cb3cb33a59a042dbb96d1187f3884ac2828a0fc 100644 --- a/src/triSurface/triSurface/triSurface.H +++ b/src/triSurface/triSurface/triSurface.H @@ -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 @@ -112,7 +112,6 @@ class triSurface // Returns true if any points merged bool stitchTriangles ( - const pointField& rawPoints, const scalar tol = SMALL, const bool verbose = false ); @@ -223,9 +222,6 @@ public: // Public typedefs - //- Face type used - typedef labelledTri FaceType; - //- Placeholder only, but do not remove - it is needed for GeoMesh typedef bool BoundaryMesh; diff --git a/src/turbulenceModels/Allwmake b/src/turbulenceModels/Allwmake index 80dc9dc1ee0053a356519db504dcc8514e6a86a5..e78f0c30dd59f9f2711d25386d9d338fcac2485c 100755 --- a/src/turbulenceModels/Allwmake +++ b/src/turbulenceModels/Allwmake @@ -2,8 +2,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x -LES/Allwmake -incompressible/Allwmake -compressible/Allwmake +LES/Allwmake $* +incompressible/Allwmake $* +compressible/Allwmake $* # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/LES/Allwmake b/src/turbulenceModels/LES/Allwmake index 00f3bf3adaa119ab2761a77aeb7b81e710795308..d24309692e25aa1d0b6b6489dfc5d1bd8c18608f 100755 --- a/src/turbulenceModels/LES/Allwmake +++ b/src/turbulenceModels/LES/Allwmake @@ -1,10 +1,11 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x wmakeLnInclude ../incompressible/LES -wmake libso LESfilters -wmake libso LESdeltas +wmake $makeOption LESfilters +wmake $makeOption LESdeltas # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/compressible/Allwmake b/src/turbulenceModels/compressible/Allwmake index ddff4170182e9c3f52fe2291bbebe0b912eca766..60605f926d6781f193ed657f261c8a3f7838a271 100755 --- a/src/turbulenceModels/compressible/Allwmake +++ b/src/turbulenceModels/compressible/Allwmake @@ -1,9 +1,10 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso turbulenceModel -wmake libso RAS -wmake libso LES +wmake $makeOption turbulenceModel +wmake $makeOption RAS +wmake $makeOption LES # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C index 68b7988e9c3e78eb711ca27dfeeabcdae5044927..8e566c6269567d073f02345c88be89976461be62 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C @@ -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 @@ -73,19 +73,6 @@ GenEddyVisc::GenEddyVisc ) ), - k_ - ( - IOobject - ( - "k", - runTime_.timeName(), - mesh_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh_ - ), - muSgs_ ( IOobject @@ -112,7 +99,7 @@ GenEddyVisc::GenEddyVisc mesh_ ) { - bound(k_, kMin_); +// printCoeffs(); } @@ -120,7 +107,7 @@ GenEddyVisc::GenEddyVisc tmp<volSymmTensorField> GenEddyVisc::B() const { - return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); + return ((2.0/3.0)*I)*k() - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); } diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H index c3569153ffa91be713e493e51b89b36b083a4f83..094dd03ae00a487e1716bd3266f5187de91ec663 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -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 @@ -75,7 +75,6 @@ protected: // Fields - volScalarField k_; volScalarField muSgs_; volScalarField alphaSgs_; @@ -106,16 +105,10 @@ public: // Member Functions - //- Return SGS kinetic energy - virtual tmp<volScalarField> k() const - { - return k_; - } - //- Return sub-grid disipation rate virtual tmp<volScalarField> epsilon() const { - return ce_*k_*sqrt(k_)/delta(); + return ce_*k()*sqrt(k())/delta(); } //- Return viscosity diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C index 35ccce1519bf88c192871485b788ca26623c73fb..12dae220d8046e73b180f51e26004d13d47833f8 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C @@ -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 @@ -51,9 +51,9 @@ void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU) volScalarField b((2.0/3.0)*tr(D)); volScalarField c(2*ck_*delta()*(dev(D) && D)); - k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a)); + volScalarField k(sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a))); - muSgs_ = ck_*rho()*delta()*sqrt(k_); + muSgs_ = ck_*rho()*delta()*sqrt(k); muSgs_.correctBoundaryConditions(); alphaSgs_ = muSgs_/Prt_; diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H index 283f53a8709c40cd42c35df6186163e36561f1bc..01c5aa00bd2c600ff389ceb91de26855e4391395 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H @@ -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 @@ -109,6 +109,20 @@ public: // Member Functions + //- Return SGS kinetic energy + // calculated from the given velocity gradient + tmp<volScalarField> k(const tmp<volTensorField>& gradU) const + { + return (2.0*ck_/ce_)*sqr(delta())*magSqr(dev(symm(gradU))); + } + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k(fvc::grad(U())); + } + + //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>& gradU); diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C index 888e55261a2fe8f8740b722023c8b2fdc76554f3..56df500db1d00883fdfe66642c7b9cd0b5af35fe 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -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 @@ -104,6 +104,19 @@ dynOneEqEddy::dynOneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filter_(filterPtr_()) { diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H index d06578e1720e3c396ee74459f4f59a9f8c93f7a9..4a304dfaddd26dc3a0be0af29eafa6fee653a9ed 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H @@ -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 @@ -75,6 +75,8 @@ class dynOneEqEddy { // Private data + volScalarField k_; + autoPtr<LESfilter> filterPtr_; LESfilter& filter_; @@ -120,6 +122,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp<volScalarField> DkEff() const { diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C index 3dd1efeec8b90dcb414f2d518581a855066fcc52..d47c51f451936786839db8b69a0aa3a8cbc5ed39 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C @@ -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 @@ -71,6 +71,19 @@ lowReOneEqEddy::lowReOneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + ck_ ( dimensioned<scalar>::lookupOrAddToDict diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H index 405fa67cf33a8a0ca1090be85b1c0392a91c9d03..2a205bd578b39583028fe8433cd413a125ffefe1 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H @@ -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 @@ -71,6 +71,8 @@ class lowReOneEqEddy { // Private data + volScalarField k_; + dimensionedScalar ck_; dimensionedScalar beta_; @@ -111,6 +113,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp<volScalarField> DkEff() const { diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C index abbd0de29e3ebb8fbf80774571dc0f621e58258d..11cd9bd414dbdb000f2cd504b2605c882cb88269 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C @@ -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 @@ -67,6 +67,19 @@ oneEqEddy::oneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + ck_ ( dimensioned<scalar>::lookupOrAddToDict diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H index 50c35fee8c90f8b8a9e128e7bcb9e794c965648e..59219b764329d18ba06fe4544f3fdd16a13f2917 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H @@ -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 @@ -74,6 +74,8 @@ class oneEqEddy { // Private data + volScalarField k_; + dimensionedScalar ck_; @@ -114,6 +116,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp<volScalarField> DkEff() const { diff --git a/src/turbulenceModels/incompressible/Allwmake b/src/turbulenceModels/incompressible/Allwmake index ddff4170182e9c3f52fe2291bbebe0b912eca766..60605f926d6781f193ed657f261c8a3f7838a271 100755 --- a/src/turbulenceModels/incompressible/Allwmake +++ b/src/turbulenceModels/incompressible/Allwmake @@ -1,9 +1,10 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +[ $# -ge 1 ] && makeOption=$1 || makeOption=libso set -x -wmake libso turbulenceModel -wmake libso RAS -wmake libso LES +wmake $makeOption turbulenceModel +wmake $makeOption RAS +wmake $makeOption LES # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H index 5dabf6a947b0fcc631a5923eee56f702c3a11ec5..69dcd5e159281b4a6699b1d70b5afebd6eff9bbb 100644 --- a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H @@ -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 @@ -67,8 +67,12 @@ class GenEddyVisc protected: + // Model coefficients + dimensionedScalar ce_; + // Fields + volScalarField nuSgs_; diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 8e6fb5827e96f9f230013733a19d48461678e6f3..6d10a3718eac7ca36db54a734320298c5b15ad0f 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -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 diff --git a/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes b/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes index 82dbe158e81aefa422bf9425ba060c5b4d22decd..762b06bf0a7c532c7302b874bc5da9ec6a36f09c 100644 --- a/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes +++ b/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes @@ -50,7 +50,7 @@ divSchemes div(U) Gauss linear; div((Su*grad(b))) Gauss linear; div((U+((Su*Xi)*grad(b)))) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/combustion/chemFoam/gri/chemkin/chem.inp b/tutorials/combustion/chemFoam/gri/chemkin/chem.inp index 6c9e031c4ccb92b333b6fe48662e17dcf7f6aaf8..eb5d63d38899bbb60f405329113e6b7414406ca6 100644 --- a/tutorials/combustion/chemFoam/gri/chemkin/chem.inp +++ b/tutorials/combustion/chemFoam/gri/chemkin/chem.inp @@ -7,7 +7,7 @@ ELEMENTS O H C N AR END SPECIES -CH CH2O CH3O H O2 H2 O OH H2O HO2 H2O2 +CH4 CH2O CH3O H O2 H2 O OH H2O HO2 H2O2 C CH CH2 CH2(S) CH3 CO CO2 HCO CH2OH CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH N NH diff --git a/tutorials/combustion/chemFoam/gri/validation/createGraph b/tutorials/combustion/chemFoam/gri/validation/createGraph index 7f16367984818649d49314e604b08f17317e34d6..3cf81886237c0cde7efe5da64c7f636efdd08572 100755 --- a/tutorials/combustion/chemFoam/gri/validation/createGraph +++ b/tutorials/combustion/chemFoam/gri/validation/createGraph @@ -1,16 +1,17 @@ #!/bin/sh gnuplot<<EOF - set terminal postscript eps color enhanced + set terminal postscript eps color enhanced "Helveicta,20" set output "OF_vs_CHEMKINII.eps" - set xlabel "Time / [s]" - set ylabel "Temperature / [K]" + set xlabel "Time / [s]" font "Helveicta,24" + set ylabel "Temperature / [K]" font "Helveicta,24" set grid set key left top set xrange [0:0.07] - set yrange [1000:2700] + set yrange [750:2750] + set ytic 250 plot \ - "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6,\ + "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6 ps 1.5,\ "chemkinII" with lines title "Chemkin II" lt -1 EOF diff --git a/tutorials/combustion/chemFoam/h2/system/controlDict b/tutorials/combustion/chemFoam/h2/system/controlDict index 6d9df8d24fcf7657b8d517bd6b5e1514999077d1..f56ce79ba6f5f6d39bf12c3b4b9885c7cbf99327 100644 --- a/tutorials/combustion/chemFoam/h2/system/controlDict +++ b/tutorials/combustion/chemFoam/h2/system/controlDict @@ -47,5 +47,7 @@ timePrecision 6; runTimeModifiable yes; +suppressSolverInfo yes; + // ************************************************************************* // diff --git a/tutorials/combustion/chemFoam/h2/validation/createGraph b/tutorials/combustion/chemFoam/h2/validation/createGraph index 129bf2167534dc78737c471fd91b1e1ffeb6e8a7..c77d3e76a813f9b4361a9ea2ef20f41eb204f008 100755 --- a/tutorials/combustion/chemFoam/h2/validation/createGraph +++ b/tutorials/combustion/chemFoam/h2/validation/createGraph @@ -1,16 +1,17 @@ #!/bin/sh gnuplot<<EOF - set terminal postscript eps color enhanced + set terminal postscript eps color enhanced "Helvetica,20" set output "OF_vs_CHEMKINII.eps" - set xlabel "Time / [s]" - set ylabel "Temperature / [K]" + set xlabel "Time / [s]" font "Helvetica,24" + set ylabel "Temperature / [K]" font "Helvetica,24" set grid set key left top set xrange [0:0.001] - set yrange [1000:2400] + set yrange [750:2750] + set ytic 250 plot \ - "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6,\ + "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6 ps 1.5,\ "chemkinII" with lines title "Chemkin II" lt -1 EOF diff --git a/tutorials/combustion/chemFoam/ic8h18/validation/createGraph b/tutorials/combustion/chemFoam/ic8h18/validation/createGraph index 1b171625f339160abb674e15884575d1cfc962f0..31313b7d105f3865372832e288f8872c66e351f4 100755 --- a/tutorials/combustion/chemFoam/ic8h18/validation/createGraph +++ b/tutorials/combustion/chemFoam/ic8h18/validation/createGraph @@ -1,16 +1,17 @@ #!/bin/sh gnuplot<<EOF - set terminal postscript eps color enhanced + set terminal postscript eps color enhanced "Helvetica,20" set output "OF_vs_CHEMKINII.eps" - set xlabel "Time / [s]" - set ylabel "Temperature / [K]" + set xlabel "Time / [s]" font "Helvetica,24" + set ylabel "Temperature / [K]" font "Helvetica,24" set grid set key left top set xrange [0:0.01] -# set yrange [800:2800] + set yrange [750:2750] + set ytic 250 plot \ - "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6,\ + "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6 ps 1.5,\ "chemkinII" with lines title "Chemkin II" lt -1 EOF diff --git a/tutorials/combustion/chemFoam/nc7h16/validation/createGraph b/tutorials/combustion/chemFoam/nc7h16/validation/createGraph index c47bd41a2d7a7ba766d284861574f4ea1eb5ea7f..33f6dcd9bb3d6762ef26d7e98050e077c27fe430 100755 --- a/tutorials/combustion/chemFoam/nc7h16/validation/createGraph +++ b/tutorials/combustion/chemFoam/nc7h16/validation/createGraph @@ -1,16 +1,17 @@ #!/bin/sh gnuplot<<EOF - set terminal postscript eps color enhanced + set terminal postscript eps color enhanced "Helvetica,20" set output "OF_vs_CHEMKINII.eps" - set xlabel "Time / [s]" - set ylabel "Temperature / [K]" + set xlabel "Time / [s]" font "Helvetica,24" + set ylabel "Temperature / [K]" font "Helvetica,24" set grid - set key left top + set key left top set xrange [0:0.001] - set yrange [800:2800] + set yrange [750:2750] + set ytics 250 plot \ - "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6,\ + "../chemFoam.out" u 1:2 t "OpenFOAM" with points lt 1 pt 6 ps 1.5,\ "chemkinII" with lines title "Chemkin II" lt -1 EOF diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties index c8cfa62f0baba43e7f4be54d912d246d17fac9db..f9c1ae9b096ae50cdece834a391bd955c654682a 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties +++ b/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties @@ -120,10 +120,10 @@ RanzMarshallCoeffs hollowConeInjectorCoeffs { - dropletPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 1e-06; maxValue 0.00015; @@ -131,7 +131,7 @@ hollowConeInjectorCoeffs n 3; } - exponentialPDF + exponentialDistribution { minValue 0.0001; maxValue 0.001; diff --git a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes b/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes index 00078e4bd66ccd9864c35de98052e1c31b5c2324..2edee7ae63fc755647d2528357522dd655b3e880 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes +++ b/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes @@ -41,7 +41,7 @@ divSchemes ft limitedLinear 1; hs limitedLinear 1; }; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes b/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes index a9b3b73d605a1a226b7d351464a1c5f3ff27c46e..07509e5225942fb9b95f6ce72a1281b55da319a2 100644 --- a/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes +++ b/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes @@ -43,7 +43,7 @@ divSchemes div(U) Gauss linear; div((Su*grad(b))) Gauss linear; div((U+((Su*Xi)*grad(b)))) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSchemes b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSchemes index b52f49447a2f8e656535a1d643ff3d735fb3b369..4402f372524239fd37cf34718cfb27eff9b5beb2 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSchemes +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSchemes @@ -37,7 +37,7 @@ divSchemes ft limitedLinear01 1; hs limitedLinear 1; }; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phiU,p) Gauss linear; div(Ji,Ii_h) Gauss upwind; } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSchemes b/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSchemes index da8d7f4f3af2cc1a5027c247253bc11e0281da94..b768086c9176a3ca4af9e5d4e3f22d90a5ba8b84 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSchemes +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSchemes @@ -37,7 +37,7 @@ divSchemes ft limitedLinear01 1; hs limitedLinear 1; }; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phiU,p) Gauss linear; div(Ji,Ii_h) Gauss upwind; } diff --git a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions index 478bb46642ee40fb1806e867cfb509c43f0fde3a..5f5ae52ee2c8012316d1b5b0d59fa90077e2959c 100644 --- a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions +++ b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions @@ -17,4 +17,3 @@ reactions Ta 14906; } } - diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes index 2d89da21edf1e6383adfe972469984401ee00e7d..0aeae805886ba3f5dd5ec70db588714b2a2bb11c 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,B) Gauss limitedLinear 1; div(phi,muTilda) Gauss limitedLinear 1; div(B) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes index 52924d11d517a9116021d1e2d91dd23aa70b81a3..aba872d5c4e555ea1520a17db1c2e6b522e9e82e 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes @@ -40,7 +40,7 @@ divSchemes div((rho*R)) Gauss linear; div(R) Gauss linear; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes index 407e634952aac100d0c69cde2b6633a501eed073..4b7f014e6b4374c5e424a761065b9a8730d1dab8 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes @@ -40,7 +40,7 @@ divSchemes div((rho*R)) Gauss linear; div(R) Gauss linear; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes index 6f296ff054fdf4b75e4fbcad4d6bfbf65f565ac3..27dbefea1b115f9edee4b9fede358690aaeb5fdd 100644 --- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes @@ -32,7 +32,7 @@ divSchemes div(phi,h) Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phiU,p) Gauss linear; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes index 4d843cfccb5a33ef16177fcd18cf6cefdce4c68a..184f6b4d1b28b46389552c5643da817b67e2abb5 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes @@ -30,7 +30,7 @@ gradSchemes divSchemes { div(phi,U) Gauss upwind; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,h) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,k) Gauss upwind; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes index a4326243601846ebb7ff3decb7cbeb4187551d46..92ad9e0855944ca9448da16d0a2687ed192ae659 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes @@ -30,7 +30,7 @@ gradSchemes divSchemes { div(phi,U) Gauss upwind; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,h) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,k) Gauss upwind; diff --git a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes index a4cf57c889e68e7e4122e3c40c88a6d2e08e0114..4cb9503a5b08fd28849afe9b8ebc16b5110f40b2 100644 --- a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes +++ b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes default none; div(phi,U) Gauss upwind; //limitedLinearV 1; //upwind; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,h) Gauss upwind; //limitedLinear 1; //upwind; div(phi,epsilon) Gauss upwind; div(phi,k) Gauss upwind; diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes index 2cf15dc1c87009466c1ccb8e62c1997f7a164e0c..c6e4f33e5a843ca6754a33cd0b5df3c85acb5be6 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phid,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear 1; + div((muEff*dev2(T(grad(U))))) Gauss linear 1; } laplacianSchemes diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes index 2cf15dc1c87009466c1ccb8e62c1997f7a164e0c..c6e4f33e5a843ca6754a33cd0b5df3c85acb5be6 100644 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phid,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear 1; + div((muEff*dev2(T(grad(U))))) Gauss linear 1; } laplacianSchemes diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes index 280225951e8889387eb0a78169c0fa5feedc2470..54299496aee0023322e2754b93c097161cc423f6 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes index 38f90b7f70e9a83ccaa61c8ff601d4057d8ab719..bc78c8b4f5f2bf6cbc1731586ef3bb85148b8abc 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes index b238c08e08add804d21bb294586ad8a118c9cd8d..251d7a83283ca4cf71d6bfd44fac8f886b09f60a 100644 --- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,R) Gauss upwind; div(phiU,p) Gauss linear; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes index 8dbb4a29c4255586fb3df50baab98cf6ad20b972..3e67c328bdf7dd05102ce1d75d29da5240696c28 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes @@ -32,7 +32,7 @@ divSchemes div(phi,k) Gauss limitedLinear 0.2; div(phi,epsilon) Gauss limitedLinear 0.2; div(phi,omega) Gauss limitedLinear 0.2; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes index ab84aca2c4ab2ac7d880eefbb91b2ebf1b99d40a..2570c7f80d4ec43ab4fe18cee64e4a7f8ecba78e 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes index 2dfb6798b87c78561c73b8f93271895718f7403b..87716123324063dc51ab411c526bad4f395c1732 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes index c9900e695fcb668a7fd7f64cc89c1d7c3080aedf..641e6fd3be40cecf656c784660dcf46cb5d8f539 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,R) Gauss upwind; div(R) Gauss linear; div(Ji,Ii_h) Gauss linearUpwind Gauss linear; //Gauss upwind; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes index 7d3e57864ac0660fb7bd646e2850a67eafb1d49d..4711f69200c65602f0c51b245e35d417ecdcfe35 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes index c136ffea3116ad29d3f67eb00de18abd99b3ef5b..c1288dc317a4866d396151b7e2ac787a66f835b2 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes index c136ffea3116ad29d3f67eb00de18abd99b3ef5b..c1288dc317a4866d396151b7e2ac787a66f835b2 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes index 95136217a38bdcd72658bbaa9da3bee0c7aef66c..ebe08e5c7672d205cf6de496e4556daedb78cb7c 100644 --- a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes +++ b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes @@ -38,7 +38,7 @@ divSchemes div((nuEff*dev(T(grad(U))))) Gauss linear; div(-phi,Ua) Gauss upwind; - div((nuEff*dev(grad(Ua).T()))) Gauss linear; + div((nuEff*dev(T(grad(Ua))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes index 280225951e8889387eb0a78169c0fa5feedc2470..54299496aee0023322e2754b93c097161cc423f6 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/system/fvSchemes b/tutorials/incompressible/simpleSRFFoam/mixer/system/fvSchemes index 8f75a86de5c0d33adfa289e14dac843fbe6c754b..2beef7a6c5ff36e075c152cda4508b20abf89987 100644 --- a/tutorials/incompressible/simpleSRFFoam/mixer/system/fvSchemes +++ b/tutorials/incompressible/simpleSRFFoam/mixer/system/fvSchemes @@ -37,7 +37,7 @@ divSchemes div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; - div((nuEff*dev(grad(Urel).T()))) Gauss linear; + div((nuEff*dev(T(grad(Urel))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index b831323c0cd2e310af68b13df3eac3f28b3a1e02..cd5f1054015aadcef898cff90df72cb035243ae7 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -131,10 +131,10 @@ subModels SOI 0; positionsFile "coalCloud1Positions"; U0 ( 0 -10 0 ); - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-06; maxValue 0.0005; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 84ddb4faa39ba4d449f2f8a4796a9eb25117001e..699ce6d46bec35da59157182e49ae7c625dd54af 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -107,10 +107,10 @@ subModels SOI 0; positionsFile "limestonePositions"; U0 ( 0 0 0 ); - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-06; maxValue 0.000565; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes index f3e423d4000d10e9ab618c99d0b725c0bee3c8b8..6c5f4f9422d34484d90295bc77bca7b61bcfcd23 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes index f3e423d4000d10e9ab618c99d0b725c0bee3c8b8..6c5f4f9422d34484d90295bc77bca7b61bcfcd23 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties index 37dc1c89171d573120cca38b531909cd0ddd7c35..60b93e7d13cfce997e0838e53425955154a6af6a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties @@ -130,10 +130,10 @@ subModels SOI 0; positionsFile "reactingCloud1Positions"; U0 (0 0 0); - parcelPDF + sizeDistribution { pdfType uniform; - uniformPDF + uniformDistribution { minValue 100e-06; maxValue 100e-06; diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index e2532ac3654238fd080474c137c6ce4035cea893..e28b21992b5297e596939d684d4b83ebf4d79997 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -133,10 +133,10 @@ subModels parcelsPerSecond 1e5; U0 (40 0 0); flowRateProfile constant 1; - parcelPDF + sizeDistribution { pdfType general; - generalPDF + generalDistribution { distribution ( diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSchemes b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSchemes index 0f15bfe0e72cfa6478eb86644a7a561623fbdde7..454c1ac65ec8eca0ed274fef3983074bd5c66d87 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSchemes +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSchemes @@ -38,7 +38,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,omega) Gauss upwind; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/Allrun.pre index a3c9718bf68071a89e78f1392c3291254a6e272e..a6e2612512d76e8ff7c91ff8eae5f1ec7eedd456 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/Allrun.pre @@ -11,5 +11,5 @@ mv log.setSet log.wallFilmRegion.setSet runApplication setsToZones -noFlipMap mv log.setsToZones log.setsToZones.primaryRegion -runApplication extrudeToRegionMesh wallFilmRegion '(wallFilmFaces)' 0.01 -overwrite +runApplication extrudeToRegionMesh -overwrite diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/reactingCloud1Properties index 6279e46c30f1290359cdc3aa800827ed0de53762..1f9b1416c03c428f2434299c3a24f10c5cc39997 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/reactingCloud1Properties @@ -18,70 +18,6 @@ FoamFile solution { active false; - - integrationSchemes - { - U Euler; - T Analytical; - } -} - -constantProperties -{ - parcelTypeId 1; - - rhoMin 1e-15; - TMin 200; - pMin 1000; - minParticleMass 1e-15; - - rho0 1000; - T0 300; - Cp0 4187; - - epsilon0 1; - f0 0.5; - - Pr 0.7; - Tvap 273; - Tbp 373; - youngsModulus 0; - poissonsRatio 0; - - constantVolume false; -} - -particleForces -{ - gravity on; - virtualMass off; - pressureGradient off; - paramagnetic off; -} - -subModels -{ - InjectionModel none; - - DragModel none; - - DispersionModel none; - - PatchInteractionModel none; - - CollisionModel none; - - HeatTransferModel none; - - CompositionModel none; - - PhaseChangeModel none; - - PostProcessingModel none; - - SurfaceFilmModel none; - - radiation off; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/extrudeToRegionMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/extrudeToRegionMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..ab1cc2e2de3eb51b6fc84959b9e0ba09bc8ba61a --- /dev/null +++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/extrudeToRegionMeshDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeToRegionMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +region wallFilmRegion; + +faceZones (wallFilmFaces); + +adaptMesh true; + +oneD false; + +extrudeModel linearNormal; + +nLayers 1; + +expansionRatio 1; + +linearNormalCoeffs +{ + thickness 0.01; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/fvSchemes b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/fvSchemes index 8b3b34e9f04f336e4175eb5d0f07a21038362343..755487a1e0e8661fca15a240c4bd8fde432dce9c 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties index cf178e2faae520d143f52f698e3db9b128a69ea8..ff99c3fba903835933e76540c29aa06ffdc2fcec 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties @@ -131,10 +131,10 @@ subModels thetaInner constant 0; thetaOuter constant 45; - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-04; maxValue 0.0012; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/surfaceFilmProperties b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/surfaceFilmProperties index 4099a1fff34d3d2f40552003db06acc81ec13c7d..9a2aa28a680228d502aafd4b6721eaa9c11da1f2 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/surfaceFilmProperties @@ -59,10 +59,10 @@ thermoSingleLayerCoeffs particlesPerParcel 100.0; - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-04; maxValue 0.0012; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/fvSchemes b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/fvSchemes index 00fe7ad37bb2c955ac86578534ad05dc1652900e..10e9bc33cb1273258dcf875d4fb4f3d02b24a690 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/reactingCloud1Properties index afd89ec9ea9923cba37c7f977d04f3a7557ce650..2b4877e8d15362c6c48c3407d9e32062a2ebf2cb 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/reactingCloud1Properties @@ -131,10 +131,10 @@ subModels thetaInner constant 0; thetaOuter constant 45; - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-04; maxValue 0.0012; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/surfaceFilmProperties b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/surfaceFilmProperties index 5b45e086917402cde96f753b9da57f966035eaf0..7c745789b7503e92cd99aa9207ad7724603fb3c2 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/constant/surfaceFilmProperties @@ -61,10 +61,10 @@ thermoSingleLayerCoeffs particlesPerParcel 100.0; - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-04; maxValue 0.0012; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/fvSchemes b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/fvSchemes index 2595da9c8776ad2ef16ed1565cbda69b46b465fe..0d68d95cfd6a22f84bd6231218bc3f57f93ac06b 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/panel/Allrun.pre index 74726aadb0ab8e9f580c68c97aa85df481e4a909..9a69e3b490ac8ceb86cdbe238fc29fb3c32fb52c 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/Allrun.pre @@ -6,7 +6,7 @@ runApplication blockMesh runApplication setSet -batch wallFilmRegion.setSet mv log.setSet log.wallFilmRegion.setSet -runApplication extrudeToRegionMesh wallFilmRegion '(wallFilmFaces)' 0.01 -overwrite +runApplication extrudeToRegionMesh -overwrite runApplication setSet -region wallFilmRegion -batch createWallFilmRegionPatches.setSet mv log.setSet log.createWallFilmRegionPatches.setSet diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/reactingCloud1Properties index 78ac17426fc66ba437c173bd673ec13767f2c755..1f9b1416c03c428f2434299c3a24f10c5cc39997 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/reactingCloud1Properties @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -18,70 +18,6 @@ FoamFile solution { active false; - - integrationSchemes - { - U Euler; - T Analytical; - } -} - -constantProperties -{ - parcelTypeId 1; - - rhoMin 1e-15; - TMin 200; - pMin 1000; - minParticleMass 1e-15; - - rho0 1000; - T0 300; - Cp0 4187; - - youngsModulus 1e9; - poissonsRatio 0.35; - - epsilon0 1; - f0 0.5; - Pr 0.7; - Tvap 273; - Tbp 373; - - constantVolume false; -} - -particleForces -{ - gravity on; - virtualMass off; - pressureGradient off; - paramagnetic off; -} - -subModels -{ - InjectionModel none; - - DragModel none; - - DispersionModel none; - - PatchInteractionModel none; - - HeatTransferModel none; - - CompositionModel none; - - PhaseChangeModel none; - - PostProcessingModel none; - - CollisionModel none; - - SurfaceFilmModel none; - - radiation off; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/extrudeToRegionMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/extrudeToRegionMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..ab1cc2e2de3eb51b6fc84959b9e0ba09bc8ba61a --- /dev/null +++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/extrudeToRegionMeshDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeToRegionMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +region wallFilmRegion; + +faceZones (wallFilmFaces); + +adaptMesh true; + +oneD false; + +extrudeModel linearNormal; + +nLayers 1; + +expansionRatio 1; + +linearNormalCoeffs +{ + thickness 0.01; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/fvSchemes b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/fvSchemes index 251b34454d3dddede9f3eac1ea4bab5a1664a3a9..8592bd21ba373f225dc68b195779149d803331c5 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index ea65dea920b870ac5bf4372d86c09ce175fc9188..823e4111abd34bc55bfe1733f5fadb680990668f 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -123,10 +123,10 @@ subModels SOI 0; positionsFile "reactingCloud1Positions"; U0 ( 0 0 0 ); - parcelPDF + sizeDistribution { pdfType uniform; - uniformPDF + uniformDistribution { minValue 1e-04; maxValue 1e-04; diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes index f3e423d4000d10e9ab618c99d0b725c0bee3c8b8..6c5f4f9422d34484d90295bc77bca7b61bcfcd23 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options index 5e0052eb1d842193486331d1a5a47474399885a8..345c5148f7302262c86966085d9c1e82adb44b0f 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options @@ -11,7 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/surfaceFilmModels/lnInclude @@ -26,7 +26,7 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lSLGThermo \ -lspecie \ - -lradiation \ + -lradiationModels \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lsurfaceFilmModels diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties index 22c787b2ab8c6d8525504f154cee0cc085b530cd..4896ab3e80903ff5cb64a237f04745c741f815f8 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties @@ -87,10 +87,10 @@ subModels SOI 0; positionsFile "kinematicCloud1Positions"; U0 ( 0 0 0 ); - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-05; maxValue 0.0001; diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties index 99f68b618bdc1e423b24269ee05c81f89858d4db..451e2419c729370b176395e9327d6242fdf6daf2 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -106,10 +106,10 @@ subModels SOI 0; positionsFile "thermoCloud1Positions"; U0 ( 0 0 0 ); - parcelPDF + sizeDistribution { pdfType RosinRammler; - RosinRammlerPDF + RosinRammlerDistribution { minValue 5e-06; maxValue 0.0005; diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes index 028dde9685c1b7ae2cb39c9cc2f5c063c1d28385..d12a51f36c0d495dbfb0b073be0de750be467b26 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes @@ -36,7 +36,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(U) Gauss linear; - div((muEff*dev2(grad(U).T()))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; } diff --git a/tutorials/lagrangian/steadyReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/steadyReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index 65952342c966310b1a16c95caa8f90be24e3ba50..1201e969082907e32bc35501f706157b215e6e3f 100644 --- a/tutorials/lagrangian/steadyReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/steadyReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -144,10 +144,10 @@ subModels duration 1; // NOTE: set to 1 for steady state U0 (0 40 0); flowRateProfile constant 1; - parcelPDF + sizeDistribution { pdfType general; - generalPDF + generalDistribution { distribution ( diff --git a/tutorials/multiphase/bubbleFoam/bubbleColumn/system/fvSchemes b/tutorials/multiphase/bubbleFoam/bubbleColumn/system/fvSchemes index 3a2d4e492cd2e809166d0490917422be80a4f15e..b1d28be923c546ac5e2ff11e984d3c8c1038e378 100644 --- a/tutorials/multiphase/bubbleFoam/bubbleColumn/system/fvSchemes +++ b/tutorials/multiphase/bubbleFoam/bubbleColumn/system/fvSchemes @@ -33,8 +33,8 @@ divSchemes div(phib,k) Gauss limitedLinear 1; div(phib,epsilon) Gauss limitedLinear 1; div(phi,alpha) Gauss limitedLinear01 1; - div((-nuEffa*grad(Ua).T())) Gauss linear; - div((-nuEffb*grad(Ub).T())) Gauss linear; + div((-nuEffa*T(grad(Ua)))) Gauss linear; + div((-nuEffb*T(grad(Ub)))) Gauss linear; } laplacianSchemes diff --git a/wmake/Makefile b/wmake/Makefile index 7ff37450ba8f9cc52f45d0dd083f9c3da6722219..72fd3ed087c5582c789520701fd72ab35895f9b8 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -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,8 +56,7 @@ WM_SCRIPTS = $(WM_DIR)/scripts #------------------------------------------------------------------------------ LIB_SRC = $(WM_PROJECT_DIR)/src -LIB_DIR = $(WM_PROJECT_DIR)/lib -LIB_WM_OPTIONS_DIR = $(LIB_DIR)/$(WM_OPTIONS) +LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS) CLASSES_DIR = $(MAKE_DIR)/classes @@ -148,7 +147,7 @@ LIB_HEADER_DIRS = \ $(EXE): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(EXE) - $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \ + $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE) exe: $(SEXE) @@ -173,7 +172,7 @@ $(LIB).$(SO): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f so_locations @cd $(OBJECTS_DIR) ; \ - $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) + $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_PLATFORMS) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) lib: $(LIB).a @echo \'$(LIB).a\' is up to date. diff --git a/wmake/rules/General/version b/wmake/rules/General/version index 11f83c7b746d942212da652b728f82a181a26948..19633ffc9dca7796939cdd4fe33b7ae9a1f4fd18 100644 --- a/wmake/rules/General/version +++ b/wmake/rules/General/version @@ -4,8 +4,8 @@ # update version strings in C++ file and in $WM_PROJECT_DIR/.build file # Cvertoo = \ - sed -e 's/VERSION_STRING/$(shell wmakePrintBuild -major)/' \ - -e 's/BUILD_STRING/$(shell wmakePrintBuild -update)/' \ + sed -e 's!VERSION_STRING!$(shell wmakePrintBuild -major)!' \ + -e 's!BUILD_STRING!$(shell wmakePrintBuild -update)!' \ $$SOURCE > $*.C; \ $(CC) $(c++FLAGS) -c $*.C -o $@ diff --git a/wmake/wmakePrintBuild b/wmake/wmakePrintBuild index 4b705036875a37cad1c73d40a2ab5b778b940c6d..3812bece3e9e2cfbf9bc26d4d8dc85ba52a81104 100755 --- a/wmake/wmakePrintBuild +++ b/wmake/wmakePrintBuild @@ -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) 2008-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -30,6 +30,8 @@ # #------------------------------------------------------------------------------ usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<<USAGE usage: ${0##*/} [OPTION] @@ -38,6 +40,7 @@ options: (exit code 0 for no changes) -major report \$WM_PROJECT_VERSION only and exit -update update \$WM_PROJECT_DIR/.build from the git information + -pkg TAG specify packager/release tag ('none' marks an empty packager) -version VER specify an alternative version Print the version used when building the project, in this order of precedence: @@ -50,7 +53,7 @@ USAGE } #------------------------------------------------------------------------------ -unset checkOnly update version +unset checkOnly update package version oldPackage oldVersion # parse options while [ "$#" -gt 0 ] @@ -71,6 +74,12 @@ do update=true shift ;; + -pkg | -package) + [ "$#" -ge 2 ] || usage "'$1' option requires an argument" + # mark empty as 'none', disallow '!' and spaces in string + package=$(echo "${2:-none}" | sed -e 's/!//g' -e 's/ //g') + shift 2 + ;; -v | -version) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" version="$2" @@ -88,7 +97,31 @@ done # persistent build tag # build="$WM_PROJECT_DIR/.build" -previous=$(tail -1 $build 2>/dev/null) + +# retrieve old values from the $WM_PROJECT_DIR/.build cache, stored as +# version [packager] +set -- $(tail -1 $build 2>/dev/null) + +oldVersion="$1"; shift +oldPackage="$@" +[ "${oldPackage:-none}" = none ] && unset oldPackage + + +# +# printTag - output the build tag +# reuses the old -package tag if needed +# +printTag() +{ + if [ "${package:-${oldPackage:-none}}" = none ] + then + echo "$version" + else + echo "$version ${package:-$oldPackage}" + fi +} + + if [ -n "$version" ] then @@ -115,12 +148,17 @@ else fi +# # update persistent build tag if possible -if [ $rc -eq 0 -a -n "$update" -a "$version" != "$previous" ] +# +if [ $rc -eq 0 -a -n "$update" ] then - if [ -w "$build" -o \( -w "$WM_PROJECT_DIR" -a ! -e "$build" \) ] + if [ "$version:$package" != "$oldVersion:$oldPackage" ] then - echo $version >| "$build" 2>/dev/null + if [ -w "$build" -o \( -w "$WM_PROJECT_DIR" -a ! -e "$build" \) ] + then + printTag >| "$build" 2>/dev/null + fi fi fi @@ -130,32 +168,38 @@ if [ -n "$checkOnly" ] then if [ $rc -eq 0 ] then - test "$version" = "$previous" + test "$version:${package:-$oldPackage}" = "$oldVersion:$oldPackage" rc=$? if [ $rc -eq 0 ] then - echo "same version as previous build" + echo "same version as previous build" 1>&2 else - echo "version changed from previous build" + echo "version changed from previous build" 1>&2 fi else - echo "no git description found" + echo "no git description found" 1>&2 fi exit $rc fi -if [ $rc -eq 0 ] -then - # output the git information or the -version version - echo $version -elif [ -n "$previous" ] +# +# cannot get git information or -version version +# +if [ $rc -ne 0 ] then - # use previous build tag - echo $previous -else - # fallback to WM_PROJECT_VERSION alone - echo ${WM_PROJECT_VERSION:-unknown} + if [ -n "$oldVersion" ] + then + # use previous version info + version="$oldVersion" + else + # fallback to WM_PROJECT_VERSION alone + version="${WM_PROJECT_VERSION:-unknown}" + fi fi + +# output the tag +printTag + #------------------------------------------------------------------------------