mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
#+DATE: TBA
|
#+DATE: TBA
|
||||||
#+LINK: http://www.openfoam.com
|
#+LINK: http://www.openfoam.com
|
||||||
#+OPTIONS: author:nil ^:{}
|
#+OPTIONS: author:nil ^:{}
|
||||||
# Copyright (c) 2010 OpenCFD Ltd.
|
# Copyright (c) 2011 OpenCFD Ltd.
|
||||||
|
|
||||||
* Overview
|
* Overview
|
||||||
OpenFOAM-dev is the latest major release of OpenFOAM including many new
|
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.
|
*** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary.
|
||||||
*** *Updated* runTimeModifiable
|
*** *Updated* runTimeModifiable
|
||||||
+ user selectable model to use for checking run-time modifiable
|
+ user selectable model to use for checking run-time modifiable
|
||||||
dictionaries:
|
dictionaries (see also doc/changes/inotify.txt):
|
||||||
+ timeStamp : use time stamp as before
|
+ timeStamp : use time stamp as before
|
||||||
+ inotify : use inotify instead of time stamp
|
+ inotify : use inotify instead of time stamp
|
||||||
+ timeStampMaster : only master checks and reads file. Slaves get file
|
+ timeStampMaster : only master checks and reads file. Slaves get file
|
||||||
|
|||||||
@ -23,7 +23,7 @@ fvMesh mesh
|
|||||||
fvMesh::defaultRegion,
|
fvMesh::defaultRegion,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::NO_READ
|
IOobject::MUST_READ
|
||||||
),
|
),
|
||||||
xferMove<Field<vector> >(points),
|
xferMove<Field<vector> >(points),
|
||||||
faces.xfer(),
|
faces.xfer(),
|
||||||
|
|||||||
@ -4,8 +4,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
@ -27,12 +27,12 @@ EXE_LIBS = \
|
|||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldieselSpray \
|
-ldieselSpray \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lpdf
|
-ldistributionModels
|
||||||
|
|||||||
@ -5,8 +5,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
@ -24,13 +24,13 @@ EXE_LIBS = \
|
|||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldieselSpray \
|
-ldieselSpray \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -5,7 +5,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
@ -17,4 +17,4 @@ EXE_LIBS = \
|
|||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lradiation
|
-lradiationModels
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../buoyantSimpleFoam \
|
-I../buoyantSimpleFoam \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-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 \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||||
@ -11,7 +11,7 @@ EXE_INC = \
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -5,18 +5,18 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/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/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/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)/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/ODE/lnInclude
|
-I$(LIB_SRC)/ODE/lnInclude
|
||||||
|
|
||||||
@ -31,14 +31,14 @@ EXE_LIBS = \
|
|||||||
-lcoalCombustion\
|
-lcoalCombustion\
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-lODE
|
-lODE
|
||||||
|
|||||||
@ -4,7 +4,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/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)/turbulenceModels/incompressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
@ -21,7 +21,7 @@ EXE_LIBS = \
|
|||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
|||||||
@ -4,7 +4,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/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)/turbulenceModels/incompressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
@ -18,7 +18,7 @@ EXE_LIBS = \
|
|||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
|||||||
@ -5,18 +5,18 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/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/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/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)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||||
|
|
||||||
@ -30,14 +30,14 @@ EXE_LIBS = \
|
|||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lsurfaceFilmModels
|
-lsurfaceFilmModels
|
||||||
|
|||||||
@ -2,18 +2,18 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-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/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/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)/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
@ -26,13 +26,13 @@ EXE_LIBS = \
|
|||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lODE
|
-lODE
|
||||||
|
|||||||
@ -4,18 +4,18 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/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/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/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)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||||
|
|
||||||
@ -29,14 +29,14 @@ EXE_LIBS = \
|
|||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lsurfaceFilmModels
|
-lsurfaceFilmModels
|
||||||
|
|||||||
@ -5,18 +5,18 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/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/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/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)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||||
|
|
||||||
@ -30,14 +30,14 @@ EXE_LIBS = \
|
|||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lsurfaceFilmModels
|
-lsurfaceFilmModels
|
||||||
|
|||||||
@ -4,7 +4,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/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)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
@ -16,7 +16,7 @@ EXE_LIBS = \
|
|||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
|
|||||||
3
applications/test/Distribution/Make/files
Normal file
3
applications/test/Distribution/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Test-Distribution.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/Test-DistributionTest
|
||||||
2
applications/test/Distribution/Make/options
Normal file
2
applications/test/Distribution/Make/options
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/* EXE_INC = */
|
||||||
|
/* EXE_LIBS = */
|
||||||
292
applications/test/Distribution/Test-Distribution.C
Normal file
292
applications/test/Distribution/Test-Distribution.C
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Application
|
||||||
|
Test-Distribution
|
||||||
|
|
||||||
|
Description
|
||||||
|
Test the Distribution class
|
||||||
|
|
||||||
|
Plot normal distribution test in gnuplot using:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
normalDistribution(mean, sigma, x) = \
|
||||||
|
sqrt(1.0/(2.0*pi*sigma**2))*exp(-(x - mean)**2.0/(2.0*sigma**2))
|
||||||
|
|
||||||
|
plot normalDistribution(8.5, 2.5, x), "Distribution_scalar_test_x" w p
|
||||||
|
@endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "vector.H"
|
||||||
|
#include "labelVector.H"
|
||||||
|
#include "tensor.H"
|
||||||
|
#include "Distribution.H"
|
||||||
|
#include "Random.H"
|
||||||
|
#include "dimensionedTypes.H"
|
||||||
|
#include "argList.H"
|
||||||
|
#include "PstreamReduceOps.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
# include "setRootCase.H"
|
||||||
|
|
||||||
|
Random R(918273);
|
||||||
|
|
||||||
|
{
|
||||||
|
// scalar
|
||||||
|
label randomDistributionTestSize = 50000000;
|
||||||
|
|
||||||
|
Distribution<scalar> dS(scalar(5e-2));
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<scalar>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from GaussNormal distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dS.add(2.5*R.GaussNormal() + 8.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dS.mean() << nl
|
||||||
|
<< "Median " << dS.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dS.write("Distribution_scalar_test_1");
|
||||||
|
|
||||||
|
Distribution<scalar> dS2(scalar(1e-2));
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<scalar>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from GaussNormal distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dS2.add(1.5*R.GaussNormal() -6.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dS2.mean() << nl
|
||||||
|
<< "Median " << dS2.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dS2.write("Distribution_scalar_test_2");
|
||||||
|
|
||||||
|
Info<< nl << "Adding previous two Distribution<scalar>" << endl;
|
||||||
|
|
||||||
|
dS = dS + dS2;
|
||||||
|
|
||||||
|
dS.write("Distribution_scalar_test_1+2");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
// scalar in parallel
|
||||||
|
label randomDistributionTestSize = 100000000;
|
||||||
|
|
||||||
|
Distribution<scalar> dS(scalar(1e-1));
|
||||||
|
|
||||||
|
Pout<< "Distribution<scalar>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from uniform distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dS.add(R.scalar01() + 10*Pstream::myProcNo());
|
||||||
|
}
|
||||||
|
|
||||||
|
Pout<< "Mean " << dS.mean() << nl
|
||||||
|
<< "Median " << dS.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
reduce(dS, sumOp< Distribution<scalar> >());
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
Info<< "Reducing parallel Distribution<scalar>" << nl
|
||||||
|
<< "Mean " << dS.mean() << nl
|
||||||
|
<< "Median " << dS.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dS.write("Distribution_scalar_test_parallel_reduced");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// vector
|
||||||
|
Distribution<vector> dV(vector(0.1, 0.05, 0.15));
|
||||||
|
|
||||||
|
label randomDistributionTestSize = 1000000;
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<vector>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from uniform and GaussNormal distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dV.add(R.vector01());
|
||||||
|
|
||||||
|
// Adding separate GaussNormal components with component
|
||||||
|
// weights
|
||||||
|
|
||||||
|
dV.add
|
||||||
|
(
|
||||||
|
vector
|
||||||
|
(
|
||||||
|
R.GaussNormal()*3.0 + 1.5,
|
||||||
|
R.GaussNormal()*0.25 + 4.0,
|
||||||
|
R.GaussNormal()*3.0 - 1.5
|
||||||
|
),
|
||||||
|
vector(1.0, 2.0, 5.0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dV.mean() << nl
|
||||||
|
<< "Median " << dV.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dV.write("Distribution_vector_test");
|
||||||
|
}
|
||||||
|
|
||||||
|
// {
|
||||||
|
// // labelVector
|
||||||
|
// Distribution<labelVector> dLV(labelVector::one*10);
|
||||||
|
|
||||||
|
// label randomDistributionTestSize = 2000000;
|
||||||
|
|
||||||
|
// Info<< nl << "Distribution<labelVector>" << nl
|
||||||
|
// << "Sampling "
|
||||||
|
// << randomDistributionTestSize
|
||||||
|
// << " times from uniform distribution."
|
||||||
|
// << endl;
|
||||||
|
|
||||||
|
// for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
// {
|
||||||
|
// dLV.add
|
||||||
|
// (
|
||||||
|
// labelVector
|
||||||
|
// (
|
||||||
|
// R.integer(-1000, 1000),
|
||||||
|
// R.integer(-5000, 5000),
|
||||||
|
// R.integer(-2000, 7000)
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Info<< "Mean " << dLV.mean() << nl
|
||||||
|
// << "Median " << dLV.median()
|
||||||
|
// << endl;
|
||||||
|
|
||||||
|
// dLV.write("Distribution_labelVector_test");
|
||||||
|
// }
|
||||||
|
|
||||||
|
{
|
||||||
|
// tensor
|
||||||
|
Distribution<tensor> dT(tensor::one*1e-2);
|
||||||
|
|
||||||
|
label randomDistributionTestSize = 2000000;
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<tensor>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from uniform distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dT.add(R.tensor01());
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dT.mean() << nl
|
||||||
|
<< "Median " << dT.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dT.write("Distribution_tensor_test");
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// symmTensor
|
||||||
|
Distribution<symmTensor> dSyT(symmTensor::one*1e-2);
|
||||||
|
|
||||||
|
label randomDistributionTestSize = 2000000;
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<symmTensor>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from uniform distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dSyT.add(R.symmTensor01());
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dSyT.mean() << nl
|
||||||
|
<< "Median " << dSyT.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dSyT.write("Distribution_symmTensor_test");
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// sphericalTensor
|
||||||
|
Distribution<sphericalTensor> dSpT(sphericalTensor::one*1e-2);
|
||||||
|
|
||||||
|
label randomDistributionTestSize = 50000000;
|
||||||
|
|
||||||
|
Info<< nl << "Distribution<sphericalTensor>" << nl
|
||||||
|
<< "Sampling "
|
||||||
|
<< randomDistributionTestSize
|
||||||
|
<< " times from uniform distribution."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
for (label i = 0; i < randomDistributionTestSize; i++)
|
||||||
|
{
|
||||||
|
dSpT.add(R.sphericalTensor01());
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Mean " << dSpT.mean() << nl
|
||||||
|
<< "Median " << dSpT.median()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
dSpT.write("Distribution_sphericalTensor_test");
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< nl << "End" << nl << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,3 +1,3 @@
|
|||||||
hashTableTest2.C
|
Test-HashTable2.C
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/hashTableTest2
|
EXE = $(FOAM_USER_APPBIN)/Test-HashTable2
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,6 +22,7 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Miscellaneous tests for HashTable
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
hashTableTest3.C
|
Test-HashTable3.C
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/hashTableTest3
|
EXE = $(FOAM_USER_APPBIN)/Test-HashTable3
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,7 +22,6 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
Test speeds for some HashTable operations
|
Test speeds for some HashTable operations
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -1,3 +1,3 @@
|
|||||||
Test-namedEnum.C
|
Test-namedEnum.C
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/NamedEnum
|
EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/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
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lthermophysicalFunctions
|
-lthermophysicalFunctions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Application
|
|||||||
testDataEntry
|
testDataEntry
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Tests lagrangian/intermediate/submodels/IO/DataEntry
|
Tests DataEntry
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
Test-dimensionedType.C
|
Test-dimensionedType.C
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/dimensionedType
|
EXE = $(FOAM_USER_APPBIN)/Test-dimensionedType
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,133 +50,71 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const globalMeshData& globalData = mesh.globalData();
|
const globalMeshData& globalData = mesh.globalData();
|
||||||
const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch();
|
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 =
|
const mapDistribute& globalPointSlavesMap =
|
||||||
globalData.globalPointSlavesMap();
|
globalData.globalPointSlavesMap();
|
||||||
|
const labelListList& slaves =
|
||||||
|
globalData.globalPointSlaves();
|
||||||
|
const labelListList& transformedSlaves =
|
||||||
|
globalData.globalPointTransformedSlaves();
|
||||||
|
|
||||||
|
// Create field with my local data
|
||||||
pointField coords(globalPointSlavesMap.constructSize());
|
pointField coords(globalPointSlavesMap.constructSize());
|
||||||
SubList<point>(coords, coupledPatch.nPoints()).assign
|
SubList<point>(coords, coupledPatch.nPoints()).assign
|
||||||
(
|
(
|
||||||
coupledPatch.localPoints()
|
coupledPatch.localPoints()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Exchange data
|
// Exchange data. Apply positional transforms.
|
||||||
globalPointSlavesMap.distribute(coords);
|
globalPointSlavesMap.distribute(transforms, coords, true);
|
||||||
|
|
||||||
// Print
|
// Print
|
||||||
forAll(globalPointSlaves, pointI)
|
forAll(slaves, pointI)
|
||||||
{
|
{
|
||||||
const labelList& slavePoints = globalPointSlaves[pointI];
|
const labelList& slavePoints = slaves[pointI];
|
||||||
|
|
||||||
if (slavePoints.size() > 0)
|
if (slavePoints.size() > 0)
|
||||||
{
|
{
|
||||||
Pout<< "Master point:" << pointI
|
Pout<< "Master point:" << pointI
|
||||||
<< " coord:" << coords[pointI]
|
<< " coord:" << coords[pointI]
|
||||||
<< " connected to slave points:" << endl;
|
<< " connected to untransformed slave points:" << endl;
|
||||||
|
|
||||||
forAll(slavePoints, i)
|
forAll(slavePoints, i)
|
||||||
{
|
{
|
||||||
Pout<< " " << coords[slavePoints[i]] << endl;
|
Pout<< " " << coords[slavePoints[i]] << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const labelList& transformedSlavePoints = transformedSlaves[pointI];
|
||||||
|
|
||||||
|
if (transformedSlavePoints.size() > 0)
|
||||||
// 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;
|
Pout<< "Master point:" << pointI
|
||||||
|
<< " coord:" << coords[pointI]
|
||||||
|
<< " connected to transformed slave points:" << endl;
|
||||||
|
|
||||||
|
forAll(transformedSlavePoints, i)
|
||||||
|
{
|
||||||
|
Pout<< " " << coords[transformedSlavePoints[i]]
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test:print shared edges
|
||||||
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Test:print (collocated) shared edges
|
|
||||||
{
|
|
||||||
const labelListList& globalEdgeSlaves =
|
|
||||||
globalData.globalEdgeSlaves();
|
|
||||||
const mapDistribute& globalEdgeSlavesMap =
|
const mapDistribute& globalEdgeSlavesMap =
|
||||||
globalData.globalEdgeSlavesMap();
|
globalData.globalEdgeSlavesMap();
|
||||||
|
const labelListList& slaves =
|
||||||
|
globalData.globalEdgeSlaves();
|
||||||
|
const labelListList& transformedSlaves =
|
||||||
|
globalData.globalEdgeTransformedSlaves();
|
||||||
|
|
||||||
// Test: distribute edge centres
|
// Test: distribute edge centres
|
||||||
pointField ec(globalEdgeSlavesMap.constructSize());
|
pointField ec(globalEdgeSlavesMap.constructSize());
|
||||||
@ -188,13 +126,13 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exchange data
|
// Exchange data Apply positional transforms.
|
||||||
globalEdgeSlavesMap.distribute(ec);
|
globalEdgeSlavesMap.distribute(transforms, ec, true);
|
||||||
|
|
||||||
// Print
|
// Print
|
||||||
forAll(globalEdgeSlaves, edgeI)
|
forAll(slaves, edgeI)
|
||||||
{
|
{
|
||||||
const labelList& slaveEdges = globalEdgeSlaves[edgeI];
|
const labelList& slaveEdges = slaves[edgeI];
|
||||||
|
|
||||||
if (slaveEdges.size() > 0)
|
if (slaveEdges.size() > 0)
|
||||||
{
|
{
|
||||||
@ -207,10 +145,102 @@ int main(int argc, char *argv[])
|
|||||||
Pout<< " " << ec[slaveEdges[i]] << endl;
|
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;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
Test-lduMatrix3.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/Test-lduMatrix
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = -lfiniteVolume
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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);
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
Test-pTraits.C
|
Test-pTraits.C
|
||||||
EXE = $(FOAM_USER_APPBIN)/pTraits
|
EXE = $(FOAM_USER_APPBIN)/Test-pTraits
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
|||||||
mapDistribute map(constructSize, sendMap.xfer(), recvMap.xfer());
|
mapDistribute map(constructSize, sendMap.xfer(), recvMap.xfer());
|
||||||
|
|
||||||
// Distribute complexData
|
// Distribute complexData
|
||||||
mapDistribute::distribute(complexData);
|
map.distribute(complexData);
|
||||||
|
|
||||||
Pout<< "complexData:" << complexData << endl;
|
Pout<< "complexData:" << complexData << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
Test-simpleMatrix.C
|
Test-simpleMatrix.C
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/simpleMatrix
|
EXE = $(FOAM_USER_APPBIN)/Test-simpleMatrix
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
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 vector span = bb.span();
|
||||||
const scalar mergeDim = 1E-4 * bb.minDim();
|
const scalar mergeDim = 1E-4 * bb.minDim();
|
||||||
|
|
||||||
|
|||||||
@ -34,22 +34,22 @@ EXE_LIBS = \
|
|||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lLESdeltas \
|
-lLESdeltas \
|
||||||
-lLESfilters \
|
-lLESfilters \
|
||||||
-lliquidMixture \
|
-lliquidMixtureProperties \
|
||||||
-lliquids \
|
-lliquidProperties \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lmolecularMeasurements \
|
-lmolecularMeasurements \
|
||||||
-lmolecule \
|
-lmolecule \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lOpenFOAM \
|
-lOpenFOAM \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lpotential \
|
-lpotential \
|
||||||
-lradiation \
|
-lradiationModels \
|
||||||
-lrandomProcesses \
|
-lrandomProcesses \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lpointSolidMixture \
|
-lsolidMixtureProperties \
|
||||||
-lsolidParticle \
|
-lsolidParticle \
|
||||||
-lpointSolids \
|
-lsolidProperties \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lsystemCall \
|
-lsystemCall \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -44,7 +44,8 @@ inline bool writeMeshObject
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const fileName& meshDir,
|
const fileName& meshDir,
|
||||||
Time& runTime
|
Time& runTime,
|
||||||
|
bool disableHeaderChecking = false
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IOobject io
|
IOobject io
|
||||||
@ -67,14 +68,21 @@ inline bool writeMeshObject
|
|||||||
|
|
||||||
// Switch off type checking (for reading e.g. faceZones as
|
// Switch off type checking (for reading e.g. faceZones as
|
||||||
// generic list of dictionaries).
|
// generic list of dictionaries).
|
||||||
const word oldTypeName = T::typeName;
|
word oldTypeName;
|
||||||
const_cast<word&>(T::typeName) = word::null;
|
if (disableHeaderChecking)
|
||||||
|
{
|
||||||
|
oldTypeName = T::typeName;
|
||||||
|
const_cast<word&>(T::typeName) = word::null;
|
||||||
|
}
|
||||||
|
|
||||||
T meshObject(io);
|
T meshObject(io);
|
||||||
|
|
||||||
const_cast<word&>(T::typeName) = oldTypeName;
|
if (disableHeaderChecking)
|
||||||
// Fake type back to what was in field
|
{
|
||||||
const_cast<word&>(meshObject.type()) = io.headerClassName();
|
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;
|
Info<< " Writing " << name << endl;
|
||||||
writeOk = meshObject.regIOobject::write();
|
writeOk = meshObject.regIOobject::write();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -910,7 +910,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
args,
|
args,
|
||||||
runTime,
|
runTime,
|
||||||
mesh.globalData().bb()
|
mesh.bounds()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Mesh distribution engine
|
// Mesh distribution engine
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lsampling
|
-lsampling
|
||||||
|
|||||||
@ -22,7 +22,14 @@
|
|||||||
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
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 xMin = p->minValue();
|
||||||
const scalar xMax = p->maxValue();
|
const scalar xMax = p->maxValue();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,7 +27,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "makeGraph.H"
|
#include "makeGraph.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,16 @@ setFormat raw;
|
|||||||
// but without any values!
|
// but without any values!
|
||||||
surfaceFormat vtk;
|
surfaceFormat vtk;
|
||||||
|
|
||||||
|
// optionally define extra controls for the output formats
|
||||||
|
formatOptions
|
||||||
|
{
|
||||||
|
ensight
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// interpolationScheme. choice of
|
// interpolationScheme. choice of
|
||||||
// cell : use cell-centre value only; constant over cells (default)
|
// cell : use cell-centre value only; constant over cells (default)
|
||||||
// cellPoint : use cell-centre and vertex values
|
// cellPoint : use cell-centre and vertex values
|
||||||
@ -231,6 +241,7 @@ surfaces
|
|||||||
// Sampling on triSurface
|
// Sampling on triSurface
|
||||||
type sampledTriSurfaceMesh;
|
type sampledTriSurfaceMesh;
|
||||||
surface integrationPlane.stl;
|
surface integrationPlane.stl;
|
||||||
|
source boundaryFaces; // sample cells or boundaryFaces
|
||||||
interpolate true;
|
interpolate true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -311,8 +311,9 @@ void rewriteField
|
|||||||
{
|
{
|
||||||
IOWarningIn("rewriteField(..)", patchDict)
|
IOWarningIn("rewriteField(..)", patchDict)
|
||||||
<< "Cyclic patch " << patchName
|
<< "Cyclic patch " << patchName
|
||||||
<< " has value entry. Please remove this and rerun."
|
<< " has value entry. This will be removed."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
patchDict.remove("value");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -208,7 +208,7 @@ int main(int argc, char *argv[])
|
|||||||
const scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
|
const scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
|
||||||
|
|
||||||
// Get search box. Anything not within this box will not be considered.
|
// 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();
|
const vector searchSpan = searchTol * meshBb.span();
|
||||||
|
|
||||||
Info<< "All boundary faces further away than " << searchTol
|
Info<< "All boundary faces further away than " << searchTol
|
||||||
|
|||||||
43
bin/foamExec
43
bin/foamExec
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -59,10 +59,10 @@ USAGE
|
|||||||
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
|
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
|
||||||
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
|
# 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
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
@ -72,7 +72,13 @@ do
|
|||||||
;;
|
;;
|
||||||
-v | -version)
|
-v | -version)
|
||||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
[ "$#" -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
|
shift
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
@ -89,19 +95,28 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "$#" -ge 1 ] || usage "no application specified"
|
|
||||||
|
|
||||||
# find OpenFOAM settings (bashrc)
|
#
|
||||||
foamDotFile="$(${0%/*}/foamEtcFile $etcOpts bashrc)" || {
|
# Find and source OpenFOAM settings (bashrc)
|
||||||
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
|
# placed in function to preserve command-line arguments
|
||||||
exit 1
|
#
|
||||||
|
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
|
[ "$#" -ge 1 ] || usage "no application specified"
|
||||||
exec $args
|
|
||||||
|
sourceRc
|
||||||
|
exec "$@"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -145,12 +145,12 @@ fi
|
|||||||
# use FOAM_SETTINGS to pass command-line settings
|
# use FOAM_SETTINGS to pass command-line settings
|
||||||
if [ "$FOAM_INST_DIR" ]
|
if [ "$FOAM_INST_DIR" ]
|
||||||
then
|
then
|
||||||
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
|
sourceFoam="FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS"
|
||||||
else
|
else
|
||||||
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS"
|
sourceFoam=". $sourceFoam $FOAM_SETTINGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "**sourceFoam:$sourceFoam $FOAM_SETTINGS"
|
echo "**sourceFoam:$sourceFoam"
|
||||||
|
|
||||||
rm -f $PWD/mpirun.schema
|
rm -f $PWD/mpirun.schema
|
||||||
touch $PWD/mpirun.schema
|
touch $PWD/mpirun.schema
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
2010-05-28
|
http://www.openfoam.com
|
||||||
|
Copyright (c) 2011 OpenCFD Ltd.
|
||||||
|
|
||||||
Cleanup of automatic regIOobject rereading.
|
Cleanup of automatic regIOobject rereading.
|
||||||
|
|
||||||
- all files (usually only IOdictionary) that need to be monitored
|
- all files (usually only IOdictionary) that need to be monitored
|
||||||
|
|||||||
41
doc/changes/pointAndEdgeSync.txt
Normal file
41
doc/changes/pointAndEdgeSync.txt
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
http://www.openfoam.com
|
||||||
|
Copyright (c) 2011 OpenCFD Ltd.
|
||||||
|
|
||||||
|
Some background on the new structure to synchronise point and edge data. The
|
||||||
|
building blocks:
|
||||||
|
- globalIndex : globally consecutive numbering of (untransformed) data. It
|
||||||
|
consists of a single label which starts at 0 on processor 0 and is numbered
|
||||||
|
consecutively on consecutive processors. The globalIndex class contains
|
||||||
|
functions to convert to/from processor and local index.
|
||||||
|
|
||||||
|
- globalIndexAndTransform : all the transformations in a mesh. Because the
|
||||||
|
transformations (cyclics, processorCyclics) need to fill space there can
|
||||||
|
be only three independent transforms. This class contains functions to encode
|
||||||
|
local index,processor and transformation into a labelPair.
|
||||||
|
|
||||||
|
- mapDistribute : contains constructors from local and remote data and
|
||||||
|
works out a compact storage scheme and returns corresponding indices into
|
||||||
|
the local storage and calculates a scheduling to get the local and remote
|
||||||
|
data into the local storage. The wanted data is
|
||||||
|
- untransformed: labelList(List) in globalIndex numbering
|
||||||
|
- transformed: labelPairList(List) in globalIndexAndTransform
|
||||||
|
See also mapDistribute.H
|
||||||
|
|
||||||
|
- globalMeshData : works out and stores a mapDistribute to get hold
|
||||||
|
of coupled point or edge data:
|
||||||
|
- globalPointSlavesMap() : the map to get all coupled point data
|
||||||
|
into a compact form
|
||||||
|
- globalPointSlaves : per point (on the patch of coupled faces) the
|
||||||
|
indices into the compact data corresponding to untransformed connected
|
||||||
|
points
|
||||||
|
- globalPointTransformedSlaves : same but for transformed connected
|
||||||
|
points
|
||||||
|
See e.g. syncPointData which applies a reduction operator to data on
|
||||||
|
coupled points. Note that it needs to know whether the data is a position
|
||||||
|
(since might need separation() vector).
|
||||||
|
|
||||||
|
These structures get used in e.g.
|
||||||
|
- syncTools : general synchronisation on points,edges, faces. The point and
|
||||||
|
edge synchronisation are thin wrappers around the globalMeshData functionality.
|
||||||
|
- volPointInterpolation : uses a mix of globalMeshData (for synchronising
|
||||||
|
collocated points) and patch-wise (for separated points).
|
||||||
@ -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.
|
Short overview of the changes to have cyclics split into two halves.
|
||||||
|
|
||||||
Cyclics
|
Cyclics
|
||||||
|
|||||||
@ -1,5 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
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
|
set -x
|
||||||
|
|
||||||
rm -rf latex man
|
rm -rf latex man
|
||||||
|
|||||||
@ -760,7 +760,7 @@ ALPHABETICAL_INDEX = YES
|
|||||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
# 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])
|
# 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
|
# 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.
|
# classes will be put under the same header in the alphabetical index.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
</div> <!-- main -->
|
</div> <!-- main -->
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>
|
<p>
|
||||||
Copyright © 2000-2010
|
Copyright © 2004-2011
|
||||||
<a href="http://www.openfoam.com/about">OpenCFD Limited</a>
|
<a href="http://www.openfoam.com/about">OpenCFD Limited</a>
|
||||||
| OPENFOAM® and OpenCFD® are registered trademarks of OpenCFD Ltd.
|
| OPENFOAM® and OpenCFD® are registered trademarks of OpenCFD Ltd.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -52,7 +52,7 @@ alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION
|
|||||||
# Change directory aliases
|
# Change directory aliases
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
alias src 'cd $FOAM_SRC'
|
alias src 'cd $FOAM_SRC'
|
||||||
alias lib 'cd $FOAM_LIB'
|
alias lib 'cd $FOAM_LIBBIN'
|
||||||
alias run 'cd $FOAM_RUN'
|
alias run 'cd $FOAM_RUN'
|
||||||
alias foam 'cd $WM_PROJECT_DIR'
|
alias foam 'cd $WM_PROJECT_DIR'
|
||||||
alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT'
|
alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT'
|
||||||
|
|||||||
@ -57,7 +57,7 @@ foamPV()
|
|||||||
# Change directory aliases
|
# Change directory aliases
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
alias src='cd $FOAM_SRC'
|
alias src='cd $FOAM_SRC'
|
||||||
alias lib='cd $FOAM_LIB'
|
alias lib='cd $FOAM_LIBBIN'
|
||||||
alias run='cd $FOAM_RUN'
|
alias run='cd $FOAM_RUN'
|
||||||
alias foam='cd $WM_PROJECT_DIR'
|
alias foam='cd $WM_PROJECT_DIR'
|
||||||
alias foamsrc='cd $FOAM_SRC/$WM_PROJECT'
|
alias foamsrc='cd $FOAM_SRC/$WM_PROJECT'
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -44,9 +44,5 @@
|
|||||||
## ~~~~~~~~~~~~~~~~~~~~~~
|
## ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
#setenv WM_MPLIB SYSTEMOPENMPI
|
#setenv WM_MPLIB SYSTEMOPENMPI
|
||||||
|
|
||||||
# Specify ParaView version
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
setenv ParaView_VERSION git # eg, cvs/git version
|
|
||||||
setenv ParaView_MAJOR 3.7
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -44,9 +44,5 @@ foamCompiler=system
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
export WM_MPLIB=SYSTEMOPENMPI
|
export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
|
||||||
# Specify ParaView version
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
export ParaView_VERSION=git # eg, cvs/git version
|
|
||||||
export ParaView_MAJOR=3.7
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -65,7 +65,7 @@ setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
|||||||
|
|
||||||
# convenience
|
# convenience
|
||||||
setenv FOAM_APP $WM_PROJECT_DIR/applications
|
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_SRC $WM_PROJECT_DIR/src
|
||||||
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
|
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
|
||||||
setenv FOAM_UTILITIES $FOAM_APP/utilities
|
setenv FOAM_UTILITIES $FOAM_APP/utilities
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
|||||||
|
|
||||||
# convenience
|
# convenience
|
||||||
export FOAM_APP=$WM_PROJECT_DIR/applications
|
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_SRC=$WM_PROJECT_DIR/src
|
||||||
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
|
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
|
||||||
export FOAM_UTILITIES=$FOAM_APP/utilities
|
export FOAM_UTILITIES=$FOAM_APP/utilities
|
||||||
|
|||||||
67
src/Allwmake
67
src/Allwmake
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
|
||||||
|
|
||||||
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
|
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
|
||||||
echo "Error: Current directory is not \$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
|
set -x
|
||||||
|
|
||||||
# update OpenFOAM version strings if required
|
# 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 OpenFOAM
|
||||||
wmakeLnInclude OSspecific/$WM_OSTYPE
|
wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
|
||||||
Pstream/Allwmake
|
Pstream/Allwmake $*
|
||||||
|
|
||||||
OSspecific/$WM_OSTYPE/Allwmake
|
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake
|
||||||
wmake libso OpenFOAM
|
wmake $makeOption OpenFOAM
|
||||||
|
|
||||||
wmake libso fileFormats
|
wmake $makeOption fileFormats
|
||||||
wmake libso triSurface
|
wmake $makeOption triSurface
|
||||||
wmake libso meshTools
|
wmake $makeOption meshTools
|
||||||
wmake libso edgeMesh
|
wmake $makeOption edgeMesh
|
||||||
wmake libso surfMesh
|
wmake $makeOption surfMesh
|
||||||
|
|
||||||
# Decomposition methods needed by dummyThirdParty
|
# Decomposition methods needed by dummyThirdParty
|
||||||
parallel/decompose/AllwmakeLnInclude
|
parallel/decompose/AllwmakeLnInclude
|
||||||
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
|
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
|
||||||
dummyThirdParty/Allwmake
|
dummyThirdParty/Allwmake $*
|
||||||
|
|
||||||
wmake libso lagrangian/basic
|
wmake $makeOption lagrangian/basic
|
||||||
wmake libso finiteVolume
|
wmake $makeOption finiteVolume
|
||||||
wmake libso genericPatchFields
|
wmake $makeOption genericPatchFields
|
||||||
|
|
||||||
# Build the proper scotchDecomp, metisDecomp etc.
|
# 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 $makeOption dynamicMesh
|
||||||
wmake libso dynamicFvMesh
|
wmake $makeOption dynamicFvMesh
|
||||||
wmake libso topoChangerFvMesh
|
wmake $makeOption topoChangerFvMesh
|
||||||
|
|
||||||
wmake libso ODE
|
wmake $makeOption ODE
|
||||||
wmake libso randomProcesses
|
wmake $makeOption randomProcesses
|
||||||
|
|
||||||
thermophysicalModels/Allwmake
|
thermophysicalModels/Allwmake $*
|
||||||
transportModels/Allwmake
|
transportModels/Allwmake $*
|
||||||
turbulenceModels/Allwmake
|
turbulenceModels/Allwmake $*
|
||||||
wmake libso surfaceFilmModels
|
wmake $makeOption surfaceFilmModels
|
||||||
lagrangian/Allwmake
|
lagrangian/Allwmake $*
|
||||||
postProcessing/Allwmake
|
postProcessing/Allwmake $*
|
||||||
mesh/Allwmake
|
mesh/Allwmake $*
|
||||||
|
|
||||||
wmake libso errorEstimation
|
wmake $makeOption errorEstimation
|
||||||
|
|
||||||
fvAgglomerationMethods/Allwmake
|
fvAgglomerationMethods/Allwmake $*
|
||||||
|
|
||||||
wmake libso fvMotionSolver
|
wmake $makeOption fvMotionSolver
|
||||||
wmake libso engine
|
wmake $makeOption engine
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -9,6 +9,7 @@ $(bools)/bool/bool.C
|
|||||||
$(bools)/bool/boolIO.C
|
$(bools)/bool/boolIO.C
|
||||||
$(bools)/Switch/Switch.C
|
$(bools)/Switch/Switch.C
|
||||||
$(bools)/Switch/SwitchIO.C
|
$(bools)/Switch/SwitchIO.C
|
||||||
|
$(bools)/lists/boolList.C
|
||||||
|
|
||||||
chars = primitives/chars
|
chars = primitives/chars
|
||||||
$(chars)/char/charIO.C
|
$(chars)/char/charIO.C
|
||||||
@ -22,10 +23,16 @@ $(ints)/longLong/longLongIO.C
|
|||||||
$(ints)/ulong/ulongIO.C
|
$(ints)/ulong/ulongIO.C
|
||||||
$(ints)/label/label.C
|
$(ints)/label/label.C
|
||||||
$(ints)/uLabel/uLabel.C
|
$(ints)/uLabel/uLabel.C
|
||||||
|
$(ints)/lists/labelIOList.C
|
||||||
|
$(ints)/lists/labelListIOList.C
|
||||||
|
|
||||||
primitives/Scalar/doubleScalar/doubleScalar.C
|
primitives/Scalar/doubleScalar/doubleScalar.C
|
||||||
primitives/Scalar/floatScalar/floatScalar.C
|
primitives/Scalar/floatScalar/floatScalar.C
|
||||||
primitives/Scalar/scalar/scalar.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/DiagTensor/diagTensor/diagTensor.C
|
||||||
primitives/SphericalTensor/sphericalTensor/sphericalTensor.C
|
primitives/SphericalTensor/sphericalTensor/sphericalTensor.C
|
||||||
primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C
|
primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C
|
||||||
@ -33,18 +40,33 @@ primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C
|
|||||||
primitives/SymmTensor/symmTensor/symmTensor.C
|
primitives/SymmTensor/symmTensor/symmTensor.C
|
||||||
primitives/Tensor/labelTensor/labelTensor.C
|
primitives/Tensor/labelTensor/labelTensor.C
|
||||||
primitives/Tensor/tensor/tensor.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/complexVector/complexVector.C
|
||||||
primitives/Vector/labelVector/labelVector.C
|
primitives/Vector/labelVector/labelVector.C
|
||||||
primitives/Vector/vector/vector.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/Tensor2D/tensor2D/tensor2D.C
|
||||||
primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
|
primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
|
||||||
primitives/Vector2D/vector2D/vector2D.C
|
primitives/Vector2D/vector2D/vector2D.C
|
||||||
|
|
||||||
primitives/complex/complex.C
|
primitives/complex/complex.C
|
||||||
|
primitives/globalIndexAndTransform/globalIndexAndTransform.C
|
||||||
|
primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C
|
||||||
primitives/quaternion/quaternion.C
|
primitives/quaternion/quaternion.C
|
||||||
primitives/septernion/septernion.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 = primitives/strings
|
||||||
$(strings)/string/string.C
|
$(strings)/string/string.C
|
||||||
$(strings)/string/stringIO.C
|
$(strings)/string/stringIO.C
|
||||||
@ -54,6 +76,7 @@ $(strings)/fileName/fileName.C
|
|||||||
$(strings)/fileName/fileNameIO.C
|
$(strings)/fileName/fileNameIO.C
|
||||||
$(strings)/keyType/keyType.C
|
$(strings)/keyType/keyType.C
|
||||||
$(strings)/wordRe/wordRe.C
|
$(strings)/wordRe/wordRe.C
|
||||||
|
$(strings)/lists/hashedWordList.C
|
||||||
|
|
||||||
primitives/hashes/Hasher/Hasher.C
|
primitives/hashes/Hasher/Hasher.C
|
||||||
|
|
||||||
@ -80,21 +103,6 @@ containers/Lists/ListOps/ListOps.C
|
|||||||
containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
|
containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
|
||||||
containers/LinkedLists/linkTypes/DLListBase/DLListBase.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 = db/IOstreams
|
||||||
$(Streams)/token/tokenIO.C
|
$(Streams)/token/tokenIO.C
|
||||||
|
|
||||||
|
|||||||
675
src/OpenFOAM/containers/Lists/Distribution/Distribution.C
Normal file
675
src/OpenFOAM/containers/Lists/Distribution/Distribution.C
Normal file
@ -0,0 +1,675 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "Distribution.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Distribution<Type>::Distribution()
|
||||||
|
:
|
||||||
|
List< List<scalar> >(pTraits<Type>::nComponents),
|
||||||
|
binWidth_(pTraits<Type>::one),
|
||||||
|
listStarts_(pTraits<Type>::nComponents, 0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Distribution<Type>::Distribution(const Type& binWidth)
|
||||||
|
:
|
||||||
|
List< List<scalar> >(pTraits<Type>::nComponents),
|
||||||
|
binWidth_(binWidth),
|
||||||
|
listStarts_(pTraits<Type>::nComponents, 0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Distribution<Type>::Distribution(const Distribution<Type>& d)
|
||||||
|
:
|
||||||
|
List< List<scalar> >(static_cast< const List< List<scalar> >& >(d)),
|
||||||
|
binWidth_(d.binWidth()),
|
||||||
|
listStarts_(d.listStarts())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Distribution<Type>::~Distribution()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::scalar Foam::Distribution<Type>::totalWeight(direction cmpt) const
|
||||||
|
{
|
||||||
|
const List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
scalar sumOfWeights = 0.0;
|
||||||
|
|
||||||
|
forAll(cmptDistribution, i)
|
||||||
|
{
|
||||||
|
sumOfWeights += cmptDistribution[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return sumOfWeights;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::List<Foam::label> Foam::Distribution<Type>::keys(direction cmpt) const
|
||||||
|
{
|
||||||
|
List<label> keys = identity((*this)[cmpt].size());
|
||||||
|
|
||||||
|
forAll(keys, k)
|
||||||
|
{
|
||||||
|
keys[k] += listStarts_[cmpt];
|
||||||
|
}
|
||||||
|
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::Distribution<Type>::index
|
||||||
|
(
|
||||||
|
direction cmpt,
|
||||||
|
label n
|
||||||
|
)
|
||||||
|
{
|
||||||
|
List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
if (cmptDistribution.empty())
|
||||||
|
{
|
||||||
|
// Initialise this list with this value
|
||||||
|
|
||||||
|
cmptDistribution.setSize(2, 0.0);
|
||||||
|
|
||||||
|
listStarts_[cmpt] = n;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
label listIndex = -1;
|
||||||
|
|
||||||
|
label& listStart = listStarts_[cmpt];
|
||||||
|
|
||||||
|
label testIndex = n - listStart;
|
||||||
|
|
||||||
|
if (testIndex < 0)
|
||||||
|
{
|
||||||
|
// Underflow of this List, storage increase and remapping
|
||||||
|
// required
|
||||||
|
|
||||||
|
List<scalar> newCmptDistribution(2*cmptDistribution.size(), 0.0);
|
||||||
|
|
||||||
|
label sOld = cmptDistribution.size();
|
||||||
|
|
||||||
|
forAll(cmptDistribution, i)
|
||||||
|
{
|
||||||
|
newCmptDistribution[i + sOld] = cmptDistribution[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
cmptDistribution = newCmptDistribution;
|
||||||
|
|
||||||
|
listStart -= sOld;
|
||||||
|
|
||||||
|
// Recursively call this function in case another remap is required.
|
||||||
|
listIndex = index(cmpt, n);
|
||||||
|
}
|
||||||
|
else if (testIndex > cmptDistribution.size() - 1)
|
||||||
|
{
|
||||||
|
// Overflow of this List, storage increase required
|
||||||
|
|
||||||
|
cmptDistribution.setSize(2*cmptDistribution.size(), 0.0);
|
||||||
|
|
||||||
|
// Recursively call this function in case another storage
|
||||||
|
// alteration is required.
|
||||||
|
listIndex = index(cmpt, n);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
listIndex = n - listStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
return listIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Pair<Foam::label> Foam::Distribution<Type>::validLimits
|
||||||
|
(
|
||||||
|
direction cmpt
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
// limits.first(): lower bound, i.e. the first non-zero entry
|
||||||
|
// limits.second(): upper bound, i.e. the last non-zero entry
|
||||||
|
Pair<label> limits(-1, -1);
|
||||||
|
|
||||||
|
forAll(cmptDistribution, i)
|
||||||
|
{
|
||||||
|
if (cmptDistribution[i] > 0.0)
|
||||||
|
{
|
||||||
|
if (limits.first() == -1)
|
||||||
|
{
|
||||||
|
limits.first() = i;
|
||||||
|
limits.second() = i;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
limits.second() = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return limits;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Type Foam::Distribution<Type>::mean() const
|
||||||
|
{
|
||||||
|
Type meanValue(pTraits<Type>::zero);
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
scalar totalCmptWeight = totalWeight(cmpt);
|
||||||
|
|
||||||
|
List<label> theKeys = keys(cmpt);
|
||||||
|
|
||||||
|
forAll(theKeys, k)
|
||||||
|
{
|
||||||
|
label key = theKeys[k];
|
||||||
|
|
||||||
|
setComponent(meanValue, cmpt) +=
|
||||||
|
(0.5 + scalar(key))
|
||||||
|
*component(binWidth_, cmpt)
|
||||||
|
*cmptDistribution[k]
|
||||||
|
/totalCmptWeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return meanValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Type Foam::Distribution<Type>::median() const
|
||||||
|
{
|
||||||
|
Type medianValue(pTraits<Type>::zero);
|
||||||
|
|
||||||
|
List< List < Pair<scalar> > > normDistribution = normalised();
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
List< Pair<scalar> >& normDist = normDistribution[cmpt];
|
||||||
|
|
||||||
|
if (normDist.size())
|
||||||
|
{
|
||||||
|
if (normDist.size() == 1)
|
||||||
|
{
|
||||||
|
setComponent(medianValue, cmpt) = normDist[0].first();
|
||||||
|
}
|
||||||
|
else if
|
||||||
|
(
|
||||||
|
normDist.size() > 1
|
||||||
|
&& normDist[0].second()*component(binWidth_, cmpt) > 0.5
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar xk =
|
||||||
|
normDist[0].first()
|
||||||
|
+ 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
scalar xkm1 =
|
||||||
|
normDist[0].first()
|
||||||
|
- 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
scalar Sk = (normDist[0].second())*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
setComponent(medianValue, cmpt) = 0.5*(xk - xkm1)/(Sk) + xkm1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label previousNonZeroIndex = 0;
|
||||||
|
|
||||||
|
scalar cumulative = 0.0;
|
||||||
|
|
||||||
|
forAll(normDist, nD)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
cumulative
|
||||||
|
+ (normDist[nD].second()*component(binWidth_, cmpt))
|
||||||
|
> 0.5
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar xk =
|
||||||
|
normDist[nD].first()
|
||||||
|
+ 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
scalar xkm1 =
|
||||||
|
normDist[previousNonZeroIndex].first()
|
||||||
|
+ 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
scalar Sk =
|
||||||
|
cumulative
|
||||||
|
+ (normDist[nD].second()*component(binWidth_, cmpt));
|
||||||
|
|
||||||
|
scalar Skm1 = cumulative;
|
||||||
|
|
||||||
|
setComponent(medianValue, cmpt) =
|
||||||
|
(0.5 - Skm1)*(xk - xkm1)/(Sk - Skm1) + xkm1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (mag(normDist[nD].second()) > VSMALL)
|
||||||
|
{
|
||||||
|
cumulative +=
|
||||||
|
normDist[nD].second()*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
previousNonZeroIndex = nD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return medianValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::Distribution<Type>::add
|
||||||
|
(
|
||||||
|
const Type& valueToAdd,
|
||||||
|
const Type& weight
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
label n =
|
||||||
|
label(component(valueToAdd, cmpt)/component(binWidth_, cmpt))
|
||||||
|
- label(neg(component(valueToAdd, cmpt)/component(binWidth_, cmpt)));
|
||||||
|
|
||||||
|
label listIndex = index(cmpt, n);
|
||||||
|
|
||||||
|
cmptDistribution[listIndex] += component(weight, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
|
||||||
|
Distribution<Type>::normalised() const
|
||||||
|
{
|
||||||
|
List< List < Pair<scalar> > > normDistribution(pTraits<Type>::nComponents);
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
if (cmptDistribution.empty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar totalCmptWeight = totalWeight(cmpt);
|
||||||
|
|
||||||
|
List<label> cmptKeys = keys(cmpt);
|
||||||
|
|
||||||
|
List< Pair<scalar> >& normDist = normDistribution[cmpt];
|
||||||
|
|
||||||
|
Pair<label> limits = validLimits(cmpt);
|
||||||
|
|
||||||
|
normDist.setSize(limits.second() - limits.first() + 1);
|
||||||
|
|
||||||
|
for
|
||||||
|
(
|
||||||
|
label k = limits.first(), i = 0;
|
||||||
|
k <= limits.second();
|
||||||
|
k++, i++
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label key = cmptKeys[k];
|
||||||
|
|
||||||
|
normDist[i].first() =
|
||||||
|
(0.5 + scalar(key))*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
normDist[i].second() =
|
||||||
|
cmptDistribution[k]
|
||||||
|
/totalCmptWeight
|
||||||
|
/component(binWidth_, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return normDistribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
|
||||||
|
Distribution<Type>::raw() const
|
||||||
|
{
|
||||||
|
List< List < Pair<scalar> > > rawDistribution(pTraits<Type>::nComponents);
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List<scalar>& cmptDistribution = (*this)[cmpt];
|
||||||
|
|
||||||
|
if (cmptDistribution.empty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<label> cmptKeys = keys(cmpt);
|
||||||
|
|
||||||
|
List< Pair<scalar> >& rawDist = rawDistribution[cmpt];
|
||||||
|
|
||||||
|
Pair<label> limits = validLimits(cmpt);
|
||||||
|
|
||||||
|
rawDist.setSize(limits.second() - limits.first() + 1);
|
||||||
|
|
||||||
|
for
|
||||||
|
(
|
||||||
|
label k = limits.first(), i = 0;
|
||||||
|
k <= limits.second();
|
||||||
|
k++, i++
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label key = cmptKeys[k];
|
||||||
|
|
||||||
|
rawDist[i].first() = (0.5 + scalar(key))*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
rawDist[i].second() = cmptDistribution[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rawDistribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
|
||||||
|
Distribution<Type>::cumulativeNormalised() const
|
||||||
|
{
|
||||||
|
List< List< Pair<scalar> > > normalisedDistribution = normalised();
|
||||||
|
|
||||||
|
List< List < Pair<scalar> > > cumulativeNormalisedDistribution =
|
||||||
|
normalisedDistribution;
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List< Pair<scalar> >& normalisedCmpt =
|
||||||
|
normalisedDistribution[cmpt];
|
||||||
|
|
||||||
|
List< Pair<scalar> >& cumNormalisedCmpt =
|
||||||
|
cumulativeNormalisedDistribution[cmpt];
|
||||||
|
|
||||||
|
scalar sum = 0.0;
|
||||||
|
|
||||||
|
forAll(normalisedCmpt, i)
|
||||||
|
{
|
||||||
|
cumNormalisedCmpt[i].first() =
|
||||||
|
normalisedCmpt[i].first()
|
||||||
|
+ 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
cumNormalisedCmpt[i].second() =
|
||||||
|
normalisedCmpt[i].second()*component(binWidth_, cmpt) + sum;
|
||||||
|
|
||||||
|
sum = cumNormalisedCmpt[i].second();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cumulativeNormalisedDistribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
|
||||||
|
Distribution<Type>::cumulativeRaw() const
|
||||||
|
{
|
||||||
|
List< List< Pair<scalar> > > rawDistribution = raw();
|
||||||
|
|
||||||
|
List< List < Pair<scalar> > > cumulativeRawDistribution = rawDistribution;
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List< Pair<scalar> >& rawCmpt = rawDistribution[cmpt];
|
||||||
|
|
||||||
|
List< Pair<scalar> >& cumRawCmpt = cumulativeRawDistribution[cmpt];
|
||||||
|
|
||||||
|
scalar sum = 0.0;
|
||||||
|
|
||||||
|
forAll(rawCmpt, i)
|
||||||
|
{
|
||||||
|
cumRawCmpt[i].first() =
|
||||||
|
rawCmpt[i].first()
|
||||||
|
+ 0.5*component(binWidth_, cmpt);
|
||||||
|
|
||||||
|
cumRawCmpt[i].second() = rawCmpt[i].second() + sum;
|
||||||
|
|
||||||
|
sum = cumRawCmpt[i].second();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cumulativeRawDistribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::Distribution<Type>::clear()
|
||||||
|
{
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
(*this)[cmpt].clear();
|
||||||
|
|
||||||
|
listStarts_[cmpt] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::Distribution<Type>::write(const fileName& filePrefix) const
|
||||||
|
{
|
||||||
|
List< List< Pair<scalar> > > rawDistribution = raw();
|
||||||
|
|
||||||
|
List< List < Pair<scalar> > > normDistribution = normalised();
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List< Pair<scalar> >& rawPairs = rawDistribution[cmpt];
|
||||||
|
|
||||||
|
const List< Pair<scalar> >& normPairs = normDistribution[cmpt];
|
||||||
|
|
||||||
|
OFstream os(filePrefix + '_' + pTraits<Type>::componentNames[cmpt]);
|
||||||
|
|
||||||
|
os << "# key normalised raw" << endl;
|
||||||
|
|
||||||
|
forAll(normPairs, i)
|
||||||
|
{
|
||||||
|
os << normPairs[i].first()
|
||||||
|
<< ' ' << normPairs[i].second()
|
||||||
|
<< ' ' << rawPairs[i].second()
|
||||||
|
<< nl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List< List< Pair<scalar> > > rawCumDist = cumulativeRaw();
|
||||||
|
|
||||||
|
List< List < Pair<scalar> > > normCumDist = cumulativeNormalised();
|
||||||
|
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
const List< Pair<scalar> >& rawPairs = rawCumDist[cmpt];
|
||||||
|
|
||||||
|
const List< Pair<scalar> >& normPairs = normCumDist[cmpt];
|
||||||
|
|
||||||
|
OFstream os
|
||||||
|
(
|
||||||
|
filePrefix + "_cumulative_" + pTraits<Type>::componentNames[cmpt]
|
||||||
|
);
|
||||||
|
|
||||||
|
os << "# key normalised raw" << endl;
|
||||||
|
|
||||||
|
forAll(normPairs, i)
|
||||||
|
{
|
||||||
|
os << normPairs[i].first()
|
||||||
|
<< ' ' << normPairs[i].second()
|
||||||
|
<< ' ' << rawPairs[i].second()
|
||||||
|
<< nl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::Distribution<Type>::operator=
|
||||||
|
(
|
||||||
|
const Distribution<Type>& rhs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Check for assignment to self
|
||||||
|
if (this == &rhs)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"Foam::Distribution<Type>::operator="
|
||||||
|
"(const Foam::Distribution<Type>&)"
|
||||||
|
) << "Attempted assignment to self"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
List< List<scalar> >::operator=(rhs);
|
||||||
|
|
||||||
|
binWidth_ = rhs.binWidth();
|
||||||
|
|
||||||
|
listStarts_ = rhs.listStarts();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
Foam::Istream& Foam::operator>>
|
||||||
|
(
|
||||||
|
Istream& is,
|
||||||
|
Distribution<Type>& d
|
||||||
|
)
|
||||||
|
{
|
||||||
|
is >> static_cast<List< List<scalar> >&>(d)
|
||||||
|
>> d.binWidth_
|
||||||
|
>> d.listStarts_;
|
||||||
|
|
||||||
|
// Check state of Istream
|
||||||
|
is.check("Istream& operator>>(Istream&, Distribution<Type>&)");
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const Distribution<Type>& d
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << static_cast<const List< List<scalar> >& >(d)
|
||||||
|
<< d.binWidth_ << token::SPACE
|
||||||
|
<< d.listStarts_;
|
||||||
|
|
||||||
|
// Check state of Ostream
|
||||||
|
os.check("Ostream& operator<<(Ostream&, " "const Distribution&)");
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
Foam::Distribution<Type> Foam::operator+
|
||||||
|
(
|
||||||
|
const Distribution<Type>& d1,
|
||||||
|
const Distribution<Type>& d2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// The coarsest binWidth is the sensible choice
|
||||||
|
Distribution<Type> d(max(d1.binWidth(), d2.binWidth()));
|
||||||
|
|
||||||
|
List< List< List < Pair<scalar> > > > rawDists(2);
|
||||||
|
|
||||||
|
rawDists[0] = d1.raw();
|
||||||
|
rawDists[1] = d2.raw();
|
||||||
|
|
||||||
|
forAll(rawDists, rDI)
|
||||||
|
{
|
||||||
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
List<scalar>& cmptDistribution = d[cmpt];
|
||||||
|
|
||||||
|
const List < Pair<scalar> >& cmptRaw = rawDists[rDI][cmpt];
|
||||||
|
|
||||||
|
forAll(cmptRaw, rI)
|
||||||
|
{
|
||||||
|
scalar valueToAdd = cmptRaw[rI].first();
|
||||||
|
scalar cmptWeight = cmptRaw[rI].second();
|
||||||
|
|
||||||
|
label n =
|
||||||
|
label
|
||||||
|
(
|
||||||
|
component(valueToAdd, cmpt)
|
||||||
|
/component(d.binWidth(), cmpt)
|
||||||
|
)
|
||||||
|
- label
|
||||||
|
(
|
||||||
|
neg(component(valueToAdd, cmpt)
|
||||||
|
/component(d.binWidth(), cmpt))
|
||||||
|
);
|
||||||
|
|
||||||
|
label listIndex = d.index(cmpt, n);
|
||||||
|
|
||||||
|
cmptDistribution[listIndex] += cmptWeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Distribution<Type>(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
207
src/OpenFOAM/containers/Lists/Distribution/Distribution.H
Normal file
207
src/OpenFOAM/containers/Lists/Distribution/Distribution.H
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::Distribution
|
||||||
|
|
||||||
|
Description
|
||||||
|
Accumulating histogram of component values.
|
||||||
|
Specified bin resolution, automatic generation of bins.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
DistributionI.H
|
||||||
|
Distribution.C
|
||||||
|
DistributionIO.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef Distribution_H
|
||||||
|
#define Distribution_H
|
||||||
|
|
||||||
|
#include "List.H"
|
||||||
|
#include "Pair.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class Distribution;
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Istream& operator>>(Istream&, Distribution<Type>&);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Ostream& operator<<(Ostream&, const Distribution<Type>&);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class Distribution Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class Distribution
|
||||||
|
:
|
||||||
|
public List< List<scalar> >
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Width of the bin for each component
|
||||||
|
Type binWidth_;
|
||||||
|
|
||||||
|
//- The start bin index of each component
|
||||||
|
List<label> listStarts_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Component type
|
||||||
|
typedef typename pTraits<Type>::cmptType cmptType;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
Distribution();
|
||||||
|
|
||||||
|
//- Construct from separate binWidth for each component
|
||||||
|
Distribution(const Type& binWidth);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
Distribution(const Distribution& d);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
~Distribution();
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Sum the total weight added to the component in the
|
||||||
|
// argument
|
||||||
|
scalar totalWeight(direction cmpt) const;
|
||||||
|
|
||||||
|
List<label> keys(direction cmpt) const;
|
||||||
|
|
||||||
|
//- Return the appropriate List index for the given bin index.
|
||||||
|
// Resizes the List if required
|
||||||
|
label index(direction cmpt, label n);
|
||||||
|
|
||||||
|
//- Returns the indices of the first and last non-zero entries
|
||||||
|
Pair<label> validLimits(direction cmpt) const;
|
||||||
|
|
||||||
|
Type mean() const;
|
||||||
|
|
||||||
|
// From http://mathworld.wolfram.com/StatisticalMedian.html
|
||||||
|
// The statistical median is the value of the Distribution
|
||||||
|
// variable where the cumulative Distribution = 0.5.
|
||||||
|
Type median() const;
|
||||||
|
|
||||||
|
//- Add a value to the distribution, optionally specifying a weight
|
||||||
|
void add
|
||||||
|
(
|
||||||
|
const Type& valueToAdd,
|
||||||
|
const Type& weight = pTraits<Type>::one
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return the normalised distribution (probability density)
|
||||||
|
// and bins
|
||||||
|
List< List<Pair<scalar> > > normalised() const;
|
||||||
|
|
||||||
|
//- Return the distribution of the total bin weights
|
||||||
|
List< List < Pair<scalar> > > raw() const;
|
||||||
|
|
||||||
|
//- Return the cumulative normalised distribution and
|
||||||
|
// integration locations (at end of bins)
|
||||||
|
List< List<Pair<scalar> > > cumulativeNormalised() const;
|
||||||
|
|
||||||
|
//- Return the cumulative total bin weights and integration
|
||||||
|
// locations (at end of bins)
|
||||||
|
List< List<Pair<scalar> > > cumulativeRaw() const;
|
||||||
|
|
||||||
|
//- Resets the Distribution by clearing the stored lists.
|
||||||
|
// Leaves the same number of them and the same binWidth.
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the bin width
|
||||||
|
inline const Type& binWidth() const;
|
||||||
|
|
||||||
|
//- Return the List start bin indices
|
||||||
|
inline const List<label>& listStarts() const;
|
||||||
|
|
||||||
|
// Write
|
||||||
|
|
||||||
|
//- Write the distribution to file: key normalised raw.
|
||||||
|
// Produces a separate file for each component.
|
||||||
|
void write(const fileName& filePrefix) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
void operator=(const Distribution<Type>&);
|
||||||
|
|
||||||
|
// IOstream Operators
|
||||||
|
|
||||||
|
friend Istream& operator>> <Type>
|
||||||
|
(
|
||||||
|
Istream&,
|
||||||
|
Distribution<Type>&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend Ostream& operator<< <Type>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const Distribution<Type>&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Distribution<Type> operator+
|
||||||
|
(
|
||||||
|
const Distribution<Type>&,
|
||||||
|
const Distribution<Type>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "DistributionI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "Distribution.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
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
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "PstreamReduceOps.H"
|
#include "Pstream.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -507,13 +507,23 @@ Foam::argList::argList
|
|||||||
jobInfo.add("startTime", timeString);
|
jobInfo.add("startTime", timeString);
|
||||||
jobInfo.add("userName", userName());
|
jobInfo.add("userName", userName());
|
||||||
jobInfo.add("foamVersion", word(FOAMversion));
|
jobInfo.add("foamVersion", word(FOAMversion));
|
||||||
jobInfo.add("foamBuild", Foam::FOAMbuild);
|
|
||||||
jobInfo.add("code", executable_);
|
jobInfo.add("code", executable_);
|
||||||
jobInfo.add("argList", argListString);
|
jobInfo.add("argList", argListString);
|
||||||
jobInfo.add("currentDir", cwd());
|
jobInfo.add("currentDir", cwd());
|
||||||
jobInfo.add("PPID", ppid());
|
jobInfo.add("PPID", ppid());
|
||||||
jobInfo.add("PGID", pgid());
|
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
|
// Case is a single processor run unless it is running parallel
|
||||||
int nProcs = 1;
|
int nProcs = 1;
|
||||||
@ -883,9 +893,10 @@ void Foam::argList::printUsage() const
|
|||||||
printNotes();
|
printNotes();
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<<"Using OpenFOAM-" << Foam::FOAMversion
|
<<"Using: OpenFOAM-" << Foam::FOAMversion
|
||||||
<<" (build: " << Foam::FOAMbuild << ") - see www.OpenFOAM.com"
|
<< " (see www.OpenFOAM.com)" << nl
|
||||||
<< nl << endl;
|
<<"Build: " << Foam::FOAMbuild << nl
|
||||||
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -260,6 +260,11 @@ void Foam::LUscalarMatrix::convert
|
|||||||
}
|
}
|
||||||
else if (interface.myProcNo_ < interface.neighbProcNo_)
|
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 =
|
const PtrList<procLduInterface>& neiInterfaces =
|
||||||
lduMatrices[interface.neighbProcNo_].interfaces_;
|
lduMatrices[interface.neighbProcNo_].interfaces_;
|
||||||
|
|
||||||
@ -269,8 +274,11 @@ void Foam::LUscalarMatrix::convert
|
|||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
neiInterfaces[ninti].neighbProcNo_
|
(
|
||||||
== interface.myProcNo_
|
neiInterfaces[ninti].neighbProcNo_
|
||||||
|
== interface.myProcNo_
|
||||||
|
)
|
||||||
|
&& (neiInterfaces[ninti].tag_ == interface.tag_)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
neiInterfacei = ninti;
|
neiInterfacei = ninti;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,7 +39,8 @@ Foam::procLduInterface::procLduInterface
|
|||||||
faceCells_(interface.interface().faceCells()),
|
faceCells_(interface.interface().faceCells()),
|
||||||
coeffs_(coeffs),
|
coeffs_(coeffs),
|
||||||
myProcNo_(-1),
|
myProcNo_(-1),
|
||||||
neighbProcNo_(-1)
|
neighbProcNo_(-1),
|
||||||
|
tag_(-1)
|
||||||
{
|
{
|
||||||
if (isA<processorLduInterface>(interface.interface()))
|
if (isA<processorLduInterface>(interface.interface()))
|
||||||
{
|
{
|
||||||
@ -48,6 +49,7 @@ Foam::procLduInterface::procLduInterface
|
|||||||
|
|
||||||
myProcNo_ = pldui.myProcNo();
|
myProcNo_ = pldui.myProcNo();
|
||||||
neighbProcNo_ = pldui.neighbProcNo();
|
neighbProcNo_ = pldui.neighbProcNo();
|
||||||
|
tag_ = pldui.tag();
|
||||||
}
|
}
|
||||||
else if (isA<cyclicLduInterface>(interface.interface()))
|
else if (isA<cyclicLduInterface>(interface.interface()))
|
||||||
{
|
{
|
||||||
@ -70,7 +72,8 @@ Foam::procLduInterface::procLduInterface(Istream& is)
|
|||||||
faceCells_(is),
|
faceCells_(is),
|
||||||
coeffs_(is),
|
coeffs_(is),
|
||||||
myProcNo_(readLabel(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_
|
os << cldui.faceCells_
|
||||||
<< cldui.coeffs_
|
<< cldui.coeffs_
|
||||||
<< cldui.myProcNo_
|
<< cldui.myProcNo_
|
||||||
<< cldui.neighbProcNo_;
|
<< cldui.neighbProcNo_
|
||||||
|
<< cldui.tag_;
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,6 +57,7 @@ class procLduInterface
|
|||||||
scalarField coeffs_;
|
scalarField coeffs_;
|
||||||
label myProcNo_;
|
label myProcNo_;
|
||||||
label neighbProcNo_;
|
label neighbProcNo_;
|
||||||
|
label tag_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,52 +32,56 @@ Description
|
|||||||
- all processor patches to have correct ordering.
|
- all processor patches to have correct ordering.
|
||||||
- all processorPatches to have their transforms set.
|
- all processorPatches to have their transforms set.
|
||||||
|
|
||||||
The shared point addressing is quite interesting. It gives on each processor
|
The shared point and edge addressing is quite interesting.
|
||||||
the vertices that cannot be set using a normal swap on processor patches.
|
It calculates addressing for points and edges on coupled patches. In
|
||||||
These are the vertices that are shared between more than 2 processors.
|
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.
|
||||||
|
|
||||||
There is an issue with these shared vertices if they originate from
|
The alternative is to have an exchange schedule (through a 'mapDistribute')
|
||||||
cyclics (i.e. are now separated processor patches). They will all be
|
which sends all point/edge data (no distinction is made between
|
||||||
mapped to the same global point (so even though the processor points are
|
those on two and those on more than two coupled patches) to the local
|
||||||
not on the same location) since topologically they are one and the same.
|
'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.
|
||||||
|
|
||||||
So if you ask for sharedPoints() you get only one of the coordinates of
|
The exchange needs
|
||||||
the topologically shared points.
|
- 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
|
||||||
|
|
||||||
All the hard work of these shared points is done by the globalPoints class.
|
See also mapDistribute, globalIndexAndTransform
|
||||||
|
|
||||||
Shared edges: similar to shared points gives on all processors the edges
|
Notes:
|
||||||
that are shared between more than two patches (i.e. the edges on which
|
- compared to 17x nTotalFaces, nTotalPoints do not compensate for
|
||||||
data cannot be synchronized by a straightforward edge data swap). Note
|
shared points since this would trigger full connectivity analysis
|
||||||
that shared edges will use shared points but not all edges between shared
|
- most calculation is demand driven and uses parallel communication
|
||||||
points need to be shared edges (e.g. there might be an edge connecting
|
so make sure to invoke on all processors at the same time.
|
||||||
two disconnected regions of shared points).
|
- old sharedEdge calculation: currently an edge is considered shared
|
||||||
|
|
||||||
Currently an edge is considered shared
|
|
||||||
if it uses two shared points and is used more than once. This is not
|
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
|
correct on processor patches but it only slightly overestimates the number
|
||||||
of shared edges. Doing full analysis of how many patches use the edge
|
of shared edges. Doing full analysis of how many patches use the edge
|
||||||
would be too complicated.
|
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
|
SourceFiles
|
||||||
globalMeshData.C
|
globalMeshData.C
|
||||||
|
globalMeshDataTemplates.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef globalMeshData_H
|
#ifndef globalMeshData_H
|
||||||
#define globalMeshData_H
|
#define globalMeshData_H
|
||||||
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "processorTopology.H"
|
#include "processorTopology.H"
|
||||||
#include "labelPair.H"
|
#include "labelPair.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "boundBox.H"
|
|
||||||
#include "IOobject.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -86,13 +90,11 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
class globalMeshData;
|
|
||||||
Ostream& operator<<(Ostream&, const globalMeshData&);
|
|
||||||
class globalIndex;
|
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
class mapDistribute;
|
class mapDistribute;
|
||||||
template<class T> class EdgeMap;
|
template<class T> class EdgeMap;
|
||||||
class globalPoints;
|
class globalIndex;
|
||||||
|
class globalIndexAndTransform;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class globalMeshData Declaration
|
Class globalMeshData Declaration
|
||||||
@ -126,9 +128,6 @@ class globalMeshData
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef List<labelPair> labelPairList;
|
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference to mesh
|
//- Reference to mesh
|
||||||
@ -137,9 +136,6 @@ class globalMeshData
|
|||||||
|
|
||||||
// Data related to the complete mesh
|
// Data related to the complete mesh
|
||||||
|
|
||||||
//- Bounding box of complete mesh
|
|
||||||
boundBox bb_;
|
|
||||||
|
|
||||||
//- Total number of points in the complete mesh
|
//- Total number of points in the complete mesh
|
||||||
label nTotalPoints_;
|
label nTotalPoints_;
|
||||||
|
|
||||||
@ -165,23 +161,70 @@ class globalMeshData
|
|||||||
labelList processorPatchNeighbours_;
|
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
|
// Globally shared point addressing
|
||||||
|
|
||||||
//- Total number of global points
|
//- Total number of global points
|
||||||
label nGlobalPoints_;
|
mutable label nGlobalPoints_;
|
||||||
|
|
||||||
//- Indices of local points that are globally shared
|
//- Indices of local points that are globally shared
|
||||||
labelList sharedPointLabels_;
|
mutable autoPtr<labelList> sharedPointLabelsPtr_;
|
||||||
|
|
||||||
//- Indices of globally shared points in the master list
|
//- Indices of globally shared points in the master list
|
||||||
// This list contains all the shared points in the mesh
|
// This list contains all the shared points in the mesh
|
||||||
labelList sharedPointAddr_;
|
mutable autoPtr<labelList> sharedPointAddrPtr_;
|
||||||
|
|
||||||
//- Shared point global labels.
|
//- Shared point global labels.
|
||||||
// Global point index for every local shared point.
|
// Global point index for every local shared point.
|
||||||
// Only valid if constructed with this information or if
|
// Only valid if constructed with this information or if
|
||||||
// pointProcAddressing read.
|
// pointProcAddressing read.
|
||||||
mutable labelList* sharedPointGlobalLabelsPtr_;
|
mutable autoPtr<labelList> sharedPointGlobalLabelsPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Globally shared edge addressing. Derived from shared points.
|
// Globally shared edge addressing. Derived from shared points.
|
||||||
@ -191,68 +234,11 @@ class globalMeshData
|
|||||||
mutable label nGlobalEdges_;
|
mutable label nGlobalEdges_;
|
||||||
|
|
||||||
//- Indices of local edges that are globally shared
|
//- Indices of local edges that are globally shared
|
||||||
mutable labelList* sharedEdgeLabelsPtr_;
|
mutable autoPtr<labelList> sharedEdgeLabelsPtr_;
|
||||||
|
|
||||||
//- Indices of globally shared edge in the master list
|
//- Indices of globally shared edge in the master list
|
||||||
// This list contains all the shared edges in the mesh
|
// This list contains all the shared edges in the mesh
|
||||||
mutable labelList* sharedEdgeAddrPtr_;
|
mutable autoPtr<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_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -268,70 +254,18 @@ class globalMeshData
|
|||||||
label&
|
label&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Calculate shared point addressing
|
||||||
|
void calcSharedPoints() const;
|
||||||
|
|
||||||
//- Calculate shared edge addressing
|
//- Calculate shared edge addressing
|
||||||
void calcSharedEdges() const;
|
void calcSharedEdges() const;
|
||||||
|
|
||||||
//- Count coincident faces.
|
//- Calculate global point addressing.
|
||||||
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.
|
|
||||||
void calcGlobalPointSlaves() const;
|
void calcGlobalPointSlaves() const;
|
||||||
|
|
||||||
//- Calculate global edge addressing.
|
|
||||||
void calcGlobalEdgeSlaves
|
|
||||||
(
|
|
||||||
const labelListList&,
|
|
||||||
const mapDistribute&,
|
|
||||||
const globalIndex&,
|
|
||||||
autoPtr<labelListList>&,
|
|
||||||
autoPtr<mapDistribute>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Calculate global edge addressing.
|
//- Calculate global edge addressing.
|
||||||
void calcGlobalEdgeSlaves() const;
|
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;
|
|
||||||
|
|
||||||
|
|
||||||
// Non-collocated
|
|
||||||
|
|
||||||
//- Calculate global point addressing.
|
|
||||||
void calcGlobalPointAllSlaves() 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;
|
|
||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
globalMeshData(const globalMeshData&);
|
globalMeshData(const globalMeshData&);
|
||||||
@ -348,7 +282,7 @@ public:
|
|||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
|
|
||||||
//- Geomtric tolerance (fraction of bounding box)
|
//- Geomteric tolerance (fraction of bounding box)
|
||||||
static const Foam::scalar matchTol_;
|
static const Foam::scalar matchTol_;
|
||||||
|
|
||||||
|
|
||||||
@ -357,10 +291,6 @@ public:
|
|||||||
//- Construct from mesh, derive rest (does parallel communication!)
|
//- Construct from mesh, derive rest (does parallel communication!)
|
||||||
globalMeshData(const polyMesh& mesh);
|
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
|
//- Destructor
|
||||||
~globalMeshData();
|
~globalMeshData();
|
||||||
@ -386,24 +316,21 @@ public:
|
|||||||
return processorPatches_.size() > 0;
|
return processorPatches_.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const boundBox& bb() const
|
//- Return total number of points in decomposed mesh. Not
|
||||||
{
|
// compensated for duplicate points!
|
||||||
return bb_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return total number of points in decomposed mesh
|
|
||||||
label nTotalPoints() const
|
label nTotalPoints() const
|
||||||
{
|
{
|
||||||
return nTotalPoints_;
|
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
|
label nTotalFaces() const
|
||||||
{
|
{
|
||||||
return nTotalFaces_;
|
return nTotalFaces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return total number of cells in decomposed mesh
|
//- Return total number of cells in decomposed mesh.
|
||||||
label nTotalCells() const
|
label nTotalCells() const
|
||||||
{
|
{
|
||||||
return nTotalCells_;
|
return nTotalCells_;
|
||||||
@ -438,16 +365,10 @@ public:
|
|||||||
// Globally shared point addressing
|
// Globally shared point addressing
|
||||||
|
|
||||||
//- Return number of globally shared points
|
//- Return number of globally shared points
|
||||||
label nGlobalPoints() const
|
label nGlobalPoints() const;
|
||||||
{
|
|
||||||
return nGlobalPoints_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return indices of local points that are globally shared
|
//- Return indices of local points that are globally shared
|
||||||
const labelList& sharedPointLabels() const
|
const labelList& sharedPointLabels() const;
|
||||||
{
|
|
||||||
return sharedPointLabels_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return addressing into the complete globally shared points
|
//- Return addressing into the complete globally shared points
|
||||||
// list
|
// list
|
||||||
@ -457,10 +378,7 @@ public:
|
|||||||
// points. Shared point addressing gives the index in the
|
// points. Shared point addressing gives the index in the
|
||||||
// list of all globally shared points for each of the locally
|
// list of all globally shared points for each of the locally
|
||||||
// shared points.
|
// shared points.
|
||||||
const labelList& sharedPointAddr() const
|
const labelList& sharedPointAddr() const;
|
||||||
{
|
|
||||||
return sharedPointAddr_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return shared point global labels. Tries to read
|
//- Return shared point global labels. Tries to read
|
||||||
// 'pointProcAddressing' and returns list or -1 if none
|
// 'pointProcAddressing' and returns list or -1 if none
|
||||||
@ -515,70 +433,47 @@ public:
|
|||||||
//- Return map from mesh edges to coupledPatch edges
|
//- Return map from mesh edges to coupledPatch edges
|
||||||
const Map<label>& coupledPatchMeshEdgeMap() const;
|
const Map<label>& coupledPatchMeshEdgeMap() const;
|
||||||
|
|
||||||
|
//- Global transforms numbering
|
||||||
|
const globalIndexAndTransform& globalTransforms() const;
|
||||||
|
|
||||||
// Coupled point to collocated coupled points. Coupled points are
|
//- 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
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Coupled point to coupled points. Coupled points are
|
||||||
// points on any coupled patch.
|
// points on any coupled patch.
|
||||||
|
|
||||||
//- Numbering of coupled points is according to coupledPatch.
|
//- Numbering of coupled points is according to coupledPatch.
|
||||||
const globalIndex& globalPointNumbering() const;
|
const globalIndex& globalPointNumbering() const;
|
||||||
//- For every coupled point the indices into the field
|
|
||||||
// distributed by below map.
|
|
||||||
const labelListList& globalPointSlaves() const;
|
const labelListList& globalPointSlaves() const;
|
||||||
|
const labelListList& globalPointTransformedSlaves() const;
|
||||||
const mapDistribute& globalPointSlavesMap() const;
|
const mapDistribute& globalPointSlavesMap() const;
|
||||||
//- Helper to synchronise mesh data
|
//- Helper to synchronise mesh point data
|
||||||
template<class Type, class CombineOp>
|
template<class Type, class CombineOp>
|
||||||
void syncPointData
|
void syncPointData
|
||||||
(
|
(
|
||||||
List<Type>& pointData,
|
List<Type>& pointData,
|
||||||
const CombineOp& cop
|
const CombineOp& cop,
|
||||||
|
const bool isPosition
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
// Coupled edge to coupled edges.
|
// Coupled edge to coupled edges.
|
||||||
|
|
||||||
const globalIndex& globalEdgeNumbering() const;
|
const globalIndex& globalEdgeNumbering() const;
|
||||||
const labelListList& globalEdgeSlaves() const;
|
const labelListList& globalEdgeSlaves() const;
|
||||||
|
const labelListList& globalEdgeTransformedSlaves() const;
|
||||||
const mapDistribute& globalEdgeSlavesMap() 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
|
// Other
|
||||||
|
|
||||||
@ -617,16 +512,6 @@ public:
|
|||||||
// full parallel analysis to determine shared points and
|
// full parallel analysis to determine shared points and
|
||||||
// boundaries.
|
// boundaries.
|
||||||
void updateMesh();
|
void updateMesh();
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
bool write() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const globalMeshData&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,13 +29,73 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type, class CombineOp>
|
||||||
|
void Foam::globalMeshData::syncData
|
||||||
|
(
|
||||||
|
List<Type>& elems,
|
||||||
|
const labelListList& slaves,
|
||||||
|
const labelListList& transformedSlaves,
|
||||||
|
const mapDistribute& slavesMap,
|
||||||
|
const globalIndexAndTransform& transforms,
|
||||||
|
const CombineOp& cop,
|
||||||
|
const bool isPosition
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Pull slave data onto master
|
||||||
|
slavesMap.distribute(transforms, elems, isPosition);
|
||||||
|
|
||||||
|
// 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
|
||||||
|
(
|
||||||
|
transforms,
|
||||||
|
elems.size(),
|
||||||
|
elems,
|
||||||
|
isPosition
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type, class CombineOp>
|
template<class Type, class CombineOp>
|
||||||
void Foam::globalMeshData::syncPointData
|
void Foam::globalMeshData::syncPointData
|
||||||
(
|
(
|
||||||
List<Type>& pointData,
|
List<Type>& pointData,
|
||||||
const labelListList& slaves,
|
const CombineOp& cop,
|
||||||
const mapDistribute& slavesMap,
|
const bool isPosition
|
||||||
const CombineOp& cop
|
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (pointData.size() != mesh_.nPoints())
|
if (pointData.size() != mesh_.nPoints())
|
||||||
@ -46,81 +106,26 @@ void Foam::globalMeshData::syncPointData
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transfer onto coupled patch
|
||||||
const indirectPrimitivePatch& cpp = coupledPatch();
|
const indirectPrimitivePatch& cpp = coupledPatch();
|
||||||
const labelList& meshPoints = cpp.meshPoints();
|
List<Type> cppFld(UIndirectList<Type>(pointData, cpp.meshPoints()));
|
||||||
|
|
||||||
// Copy mesh (point)data to coupled patch (point)data
|
syncData
|
||||||
Field<Type> cppFld(slavesMap.constructSize());
|
|
||||||
forAll(meshPoints, patchPointI)
|
|
||||||
{
|
|
||||||
cppFld[patchPointI] = pointData[meshPoints[patchPointI]];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pull slave data onto master
|
|
||||||
slavesMap.distribute(cppFld);
|
|
||||||
|
|
||||||
// Combine master data with slave data
|
|
||||||
forAll(slaves, patchPointI)
|
|
||||||
{
|
|
||||||
const labelList& slavePoints = slaves[patchPointI];
|
|
||||||
|
|
||||||
// Combine master with slave data
|
|
||||||
forAll(slavePoints, i)
|
|
||||||
{
|
|
||||||
cop(cppFld[patchPointI], cppFld[slavePoints[i]]);
|
|
||||||
}
|
|
||||||
// Copy result back to slave slots
|
|
||||||
forAll(slavePoints, i)
|
|
||||||
{
|
|
||||||
cppFld[slavePoints[i]] = cppFld[patchPointI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, class CombineOp>
|
|
||||||
void Foam::globalMeshData::syncPointData
|
|
||||||
(
|
|
||||||
List<Type>& pointData,
|
|
||||||
const CombineOp& cop
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const labelListList& slaves = globalPointSlaves();
|
|
||||||
const mapDistribute& map = globalPointSlavesMap();
|
|
||||||
|
|
||||||
syncPointData
|
|
||||||
(
|
(
|
||||||
pointData,
|
cppFld,
|
||||||
slaves,
|
globalPointSlaves(),
|
||||||
map,
|
globalPointTransformedSlaves(),
|
||||||
cop
|
globalPointSlavesMap(),
|
||||||
|
globalTransforms(),
|
||||||
|
cop,
|
||||||
|
isPosition
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
|
// Extract back onto mesh
|
||||||
template<class Type, class CombineOp>
|
forAll(cpp.meshPoints(), i)
|
||||||
void Foam::globalMeshData::syncPointAllData
|
{
|
||||||
(
|
pointData[cpp.meshPoints()[i]] = cppFld[i];
|
||||||
List<Type>& pointData,
|
}
|
||||||
const CombineOp& cop
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
syncPointData
|
|
||||||
(
|
|
||||||
pointData,
|
|
||||||
globalPointAllSlaves(),
|
|
||||||
globalPointAllSlavesMap(),
|
|
||||||
cop
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,17 +39,15 @@ Description
|
|||||||
- f[0] ordering on patch faces to be ok.
|
- f[0] ordering on patch faces to be ok.
|
||||||
|
|
||||||
Works by constructing equivalence lists for all the points on processor
|
Works by constructing equivalence lists for all the points on processor
|
||||||
patches. These list are in globalIndex numbering (so consecutively numbered
|
patches. These list are in globalIndexAndTransform numbering
|
||||||
per processor)
|
|
||||||
E.g.
|
E.g.
|
||||||
@verbatim
|
@verbatim
|
||||||
((7 93)(4 731)(3 114))
|
((7 93)(4 731)(3 114))
|
||||||
@endverbatim
|
@endverbatim
|
||||||
|
|
||||||
means point 93 on proc7 is connected to point 731 on proc4 and 114 on proc3.
|
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
|
It then assigns the lowest numbered processor to be the local 'master' and
|
||||||
sharedPoint label from processor0 and it redistributes this label back to
|
constructs a mapDistribute to send all data to this master.
|
||||||
the other processors in the equivalence list.
|
|
||||||
|
|
||||||
Algorithm:
|
Algorithm:
|
||||||
- get meshPoints of all my points on processor patches and initialize
|
- get meshPoints of all my points on processor patches and initialize
|
||||||
@ -64,24 +62,9 @@ Description
|
|||||||
endloop until nothing changes
|
endloop until nothing changes
|
||||||
|
|
||||||
At this point one will have complete point-point connectivity for all
|
At this point one will have complete point-point connectivity for all
|
||||||
points on processor patches. Now
|
points on processor patches. Now (optionally) remove point
|
||||||
|
equivalences of size 2. These are just normal points shared
|
||||||
- (optional)remove point equivalences of size 2. These are
|
between two neighbouring procPatches.
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
Note: the data held is either mesh point labels (construct from mesh only)
|
Note: the data held is either mesh point labels (construct from mesh only)
|
||||||
or patch point labels (construct from mesh and patch).
|
or patch point labels (construct from mesh and patch).
|
||||||
@ -95,12 +78,9 @@ SourceFiles
|
|||||||
#define globalPoints_H
|
#define globalPoints_H
|
||||||
|
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "Map.H"
|
|
||||||
#include "primitivePatch.H"
|
|
||||||
#include "edgeList.H"
|
|
||||||
#include "globalIndex.H"
|
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "PackedBoolList.H"
|
#include "globalIndex.H"
|
||||||
|
#include "globalIndexAndTransform.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -112,7 +92,7 @@ class polyMesh;
|
|||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
class cyclicPolyPatch;
|
class cyclicPolyPatch;
|
||||||
class polyPatch;
|
class polyPatch;
|
||||||
class coupledPolyPatch;
|
class mapDistribute;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class globalPoints Declaration
|
Class globalPoints Declaration
|
||||||
@ -120,91 +100,85 @@ class coupledPolyPatch;
|
|||||||
|
|
||||||
class globalPoints
|
class globalPoints
|
||||||
{
|
{
|
||||||
// Static data members
|
|
||||||
|
|
||||||
//- Offset to add to points (in globalIndices) originating from
|
|
||||||
// collocated coupled points.
|
|
||||||
static const label fromCollocated;
|
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Mesh reference
|
//- Mesh reference
|
||||||
const polyMesh& mesh_;
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
//- Global numbering of points
|
//- Global numbering of untransformed points
|
||||||
globalIndex globalIndices_;
|
globalIndex globalIndices_;
|
||||||
|
|
||||||
|
//- Global numbering of transformed points
|
||||||
|
const globalIndexAndTransform globalTransforms_;
|
||||||
|
|
||||||
//- Sum of points on processor patches (unfiltered, point on 2 patches
|
//- Sum of points on processor patches (unfiltered, point on 2 patches
|
||||||
// counts as 2)
|
// counts as 2)
|
||||||
const label nPatchPoints_;
|
const label nPatchPoints_;
|
||||||
|
|
||||||
//- All points on boundaries and their corresponding connected points
|
//- All points on boundaries and their corresponding connected points
|
||||||
// on other processors.
|
// on other processors.
|
||||||
DynamicList<labelList> procPoints_;
|
DynamicList<labelPairList> procPoints_;
|
||||||
|
|
||||||
//- Map from mesh (or patch) point to index in procPoints
|
//- Map from mesh (or patch) point to index in procPoints
|
||||||
Map<label> meshToProcPoint_;
|
Map<label> meshToProcPoint_;
|
||||||
|
|
||||||
//- Shared points used by this processor (= global point number)
|
|
||||||
labelList sharedPointAddr_;
|
|
||||||
|
|
||||||
//- My mesh(or patch) points corresponding to the shared points
|
// Calculated mapDistribute addressing
|
||||||
labelList sharedPointLabels_;
|
|
||||||
|
//- Non-transformed connected points per point (in mapDistribute
|
||||||
|
// indices)
|
||||||
|
labelListList pointPoints_;
|
||||||
|
|
||||||
|
//- Transformed points per point (in mapDistribute indices)
|
||||||
|
labelListList transformedPointPoints_;
|
||||||
|
|
||||||
|
//- Corresponding map
|
||||||
|
autoPtr<mapDistribute> map_;
|
||||||
|
|
||||||
//- Total number of shared points.
|
|
||||||
label nGlobalPoints_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
// Wrappers around global point numbering to add collocated bit
|
//- Helper function to sort according minimum proc, minimum index,
|
||||||
|
// minimum transform
|
||||||
//- Convert into globalIndices and add collocated bit
|
class globalIndexAndTransformLessThan
|
||||||
label toGlobal(const label, const bool isCollocated) const;
|
{
|
||||||
|
public:
|
||||||
//- Is collocated bit set
|
bool operator()
|
||||||
bool isCollocated(const label globalI) const;
|
(
|
||||||
|
const labelPair& a,
|
||||||
//- Remove collocated bit
|
const labelPair& b
|
||||||
label removeCollocated(const label globalI) const;
|
);
|
||||||
|
};
|
||||||
//- (remove collocated bit and) check if originates from local proc
|
|
||||||
bool isLocal(const label globalI) const;
|
|
||||||
|
|
||||||
//- (remove collocated bit and) get originating processor
|
|
||||||
label whichProcID(const label globalI) const;
|
|
||||||
|
|
||||||
//- (remove collocated bit and) convert to local number on processor
|
|
||||||
label toLocal(const label procI, const label globalI) const;
|
|
||||||
|
|
||||||
//- (remove collocated bit and) convert to local number on
|
|
||||||
// Pstream::myProcNo
|
|
||||||
label toLocal(const label globalI) const;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//- Count all points on processorPatches. Is all points for which
|
//- Count all points on processorPatches. Is all points for which
|
||||||
// information is collected.
|
// information is collected.
|
||||||
static label countPatchPoints(const polyBoundaryMesh&);
|
static label countPatchPoints(const polyBoundaryMesh&);
|
||||||
|
|
||||||
|
labelPairList addSendTransform
|
||||||
|
(
|
||||||
|
const label patchI,
|
||||||
|
const labelPairList& info
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Add information about patchPointI in relative indices to send
|
//- Add information about patchPointI in relative indices to send
|
||||||
// buffers (patchFaces, indexInFace etc.)
|
// buffers (patchFaces, indexInFace etc.)
|
||||||
static void addToSend
|
void addToSend
|
||||||
(
|
(
|
||||||
const primitivePatch&,
|
const polyPatch&,
|
||||||
const label patchPointI,
|
const label patchPointI,
|
||||||
const labelList&,
|
const labelPairList&,
|
||||||
DynamicList<label>& patchFaces,
|
DynamicList<label>& patchFaces,
|
||||||
DynamicList<label>& indexInFace,
|
DynamicList<label>& indexInFace,
|
||||||
DynamicList<labelList>& allInfo
|
DynamicList<labelPairList>& allInfo
|
||||||
);
|
) const;
|
||||||
|
|
||||||
//- Merge info from neighbour into my data
|
//- Merge info from neighbour into my data
|
||||||
static bool mergeInfo
|
static bool mergeInfo
|
||||||
(
|
(
|
||||||
const labelList& nbrInfo,
|
const labelPairList& nbrInfo,
|
||||||
labelList& myInfo
|
const label localPointI,
|
||||||
|
labelPairList& myInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
//- From mesh point to 'local point'. Is the mesh point itself
|
//- From mesh point to 'local point'. Is the mesh point itself
|
||||||
@ -223,18 +197,26 @@ class globalPoints
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Store (and merge) info for meshPointI
|
//- Store (and merge) info for meshPointI
|
||||||
bool storeInfo
|
bool storeInitialInfo
|
||||||
(
|
(
|
||||||
const labelList& nbrInfo,
|
const labelPairList& nbrInfo,
|
||||||
const label localPointI,
|
const label localPointI
|
||||||
const bool isCollocated
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Store (and merge) info for meshPointI
|
||||||
|
bool mergeInfo
|
||||||
|
(
|
||||||
|
const labelPairList& nbrInfo,
|
||||||
|
const label localPointI
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Get the signs for the individual transforms
|
||||||
|
FixedList<label, 3> transformBits(const label transformIndex) const;
|
||||||
|
|
||||||
void printProcPoints
|
void printProcPoints
|
||||||
(
|
(
|
||||||
const labelList& patchToMeshPoint,
|
const labelList& patchToMeshPoint,
|
||||||
const labelList& pointInfo,
|
const labelPairList& pointInfo
|
||||||
Ostream& os
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Initialize procPoints_ to my patch points. allPoints = true:
|
//- Initialize procPoints_ to my patch points. allPoints = true:
|
||||||
@ -260,6 +242,7 @@ class globalPoints
|
|||||||
(
|
(
|
||||||
const bool mergeSeparated,
|
const bool mergeSeparated,
|
||||||
const Map<label>&,
|
const Map<label>&,
|
||||||
|
const labelList&,
|
||||||
PstreamBuffers&,
|
PstreamBuffers&,
|
||||||
labelHashSet&
|
labelHashSet&
|
||||||
);
|
);
|
||||||
@ -268,34 +251,6 @@ class globalPoints
|
|||||||
// Used to remove normal face-face connected points.
|
// Used to remove normal face-face connected points.
|
||||||
void remove(const labelList& patchToMeshPoint, const Map<label>&);
|
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.
|
//- Return mesh points of other side in same order as my meshPoints.
|
||||||
static labelList reverseMeshPoints(const cyclicPolyPatch&);
|
static labelList reverseMeshPoints(const cyclicPolyPatch&);
|
||||||
|
|
||||||
@ -325,7 +280,7 @@ public:
|
|||||||
|
|
||||||
//- Construct from mesh.
|
//- Construct from mesh.
|
||||||
// keepAllPoints = false : filter out points that are on two
|
// 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:
|
// mergeSeparated:
|
||||||
// true : merge coupled points across separated patches.
|
// true : merge coupled points across separated patches.
|
||||||
// false : do not merge across coupled separated patches.
|
// false : do not merge across coupled separated patches.
|
||||||
@ -338,8 +293,7 @@ public:
|
|||||||
|
|
||||||
//- Construct from mesh and patch of coupled faces. Difference with
|
//- Construct from mesh and patch of coupled faces. Difference with
|
||||||
// construct from mesh only is that this stores the meshToProcPoint,
|
// construct from mesh only is that this stores the meshToProcPoint,
|
||||||
// procPoints and sharedPointLabels as patch local point labels
|
// procPoints as patch local point labels instead of mesh point labels.
|
||||||
// instead of mesh point labels.
|
|
||||||
globalPoints
|
globalPoints
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
@ -353,43 +307,68 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
//- Global numbering of untransformed (mesh or patch) points
|
||||||
|
const globalIndex& globalIndices() const
|
||||||
|
{
|
||||||
|
return globalIndices_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Global numbering of transformed (mesh or patch) points
|
||||||
|
const globalIndexAndTransform& globalTransforms() const
|
||||||
|
{
|
||||||
|
return globalTransforms_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Non-transformed connected points per point (in mapDistribute
|
||||||
|
// indices)
|
||||||
|
const labelListList& pointPoints() const
|
||||||
|
{
|
||||||
|
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_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Transformed points per point (in mapDistribute indices)
|
||||||
|
labelListList& transformedPointPoints()
|
||||||
|
{
|
||||||
|
return transformedPointPoints_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Corresponding map
|
||||||
|
const mapDistribute& map() const
|
||||||
|
{
|
||||||
|
return map_();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Corresponding map
|
||||||
|
mapDistribute& map()
|
||||||
|
{
|
||||||
|
return map_();
|
||||||
|
}
|
||||||
|
|
||||||
//- From (mesh or patch) point to index in procPoints
|
//- From (mesh or patch) point to index in procPoints
|
||||||
const Map<label>& meshToProcPoint() const
|
const Map<label>& meshToProcPoint() const
|
||||||
{
|
{
|
||||||
return meshToProcPoint_;
|
return meshToProcPoint_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- procPoints is per point the connected points (in global
|
//- procPoints is per point the connected points (in
|
||||||
// point numbers)
|
// globalTransformAndIndex point numbers)
|
||||||
const DynamicList<labelList>& procPoints() const
|
const DynamicList<labelPairList>& procPoints() const
|
||||||
{
|
{
|
||||||
return procPoints_;
|
return procPoints_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Global numbering of (mesh or patch) points
|
|
||||||
const globalIndex& globalIndices() const
|
|
||||||
{
|
|
||||||
return globalIndices_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- shared points used by this processor (= global point number)
|
|
||||||
const labelList& sharedPointAddr() const
|
|
||||||
{
|
|
||||||
return sharedPointAddr_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- my (mesh or patch)points corresponding to the shared points
|
|
||||||
const labelList& sharedPointLabels() const
|
|
||||||
{
|
|
||||||
return sharedPointLabels_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- total number of shared points
|
|
||||||
label nGlobalPoints() const
|
|
||||||
{
|
|
||||||
return nGlobalPoints_;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,22 +35,92 @@ Note:
|
|||||||
Schedule is a list of processor pairs (one send, one receive. One of
|
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.
|
them will be myself) which forms a scheduled (i.e. non-buffered) exchange.
|
||||||
See distribute on how to use it.
|
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.
|
of items received on the other processor.
|
||||||
|
|
||||||
Constructors using compact numbering: all my own elements first
|
To aid constructing these maps there are the constructors from global
|
||||||
(whether used or not) followed by used-only remote elements.
|
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
|
So e.g 4 procs and on proc 1 the compact
|
||||||
table will first have all globalIndex.localSize() elements from proc1
|
table will first have all globalIndex.localSize() elements from proc1
|
||||||
followed by used-only elements of proc0, proc2, proc3.
|
followed by used-only elements of proc0, proc2, proc3.
|
||||||
The constructed mapDistribute sends the local elements from and
|
The constructed mapDistribute sends the local elements from and
|
||||||
receives the remote elements into their compact position.
|
receives the remote elements into their compact position.
|
||||||
compactMap[procI] is the position of elements from procI in the compact
|
compactMap[procI] is the position of elements from procI in the compact
|
||||||
map. compactMap[myProcNo()] is empty since trivial addressing. The indices
|
map. compactMap[myProcNo()] is empty since trivial addressing.
|
||||||
into compactMap[procI] are local, not global, indices.
|
|
||||||
|
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
|
SourceFiles
|
||||||
mapDistribute.C
|
mapDistribute.C
|
||||||
|
mapDistributeTemplates.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -62,6 +132,7 @@ SourceFiles
|
|||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
|
#include "point.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -71,6 +142,7 @@ namespace Foam
|
|||||||
class mapPolyMesh;
|
class mapPolyMesh;
|
||||||
class globalIndex;
|
class globalIndex;
|
||||||
class PstreamBuffers;
|
class PstreamBuffers;
|
||||||
|
class globalIndexAndTransform;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class mapDistribute Declaration
|
Class mapDistribute Declaration
|
||||||
@ -89,6 +161,16 @@ class mapDistribute
|
|||||||
//- Maps from subsetted data to new reconstructed data
|
//- Maps from subsetted data to new reconstructed data
|
||||||
labelListList constructMap_;
|
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
|
//- Schedule
|
||||||
mutable autoPtr<List<labelPair> > schedulePtr_;
|
mutable autoPtr<List<labelPair> > schedulePtr_;
|
||||||
|
|
||||||
@ -102,10 +184,73 @@ class mapDistribute
|
|||||||
const label receivedSize
|
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:
|
public:
|
||||||
|
|
||||||
|
// Declare name of the class and its debug switch
|
||||||
|
ClassName("mapDistribute");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
mapDistribute();
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
mapDistribute
|
mapDistribute
|
||||||
(
|
(
|
||||||
@ -114,6 +259,16 @@ public:
|
|||||||
const Xfer<labelListList>& constructMap
|
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
|
//- Construct from reverse addressing: per data item the send
|
||||||
// processor and the receive processor. All processors get same data.
|
// processor and the receive processor. All processors get same data.
|
||||||
mapDistribute
|
mapDistribute
|
||||||
@ -143,6 +298,36 @@ public:
|
|||||||
List<Map<label> >& compactMap
|
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
|
//- Construct copy
|
||||||
mapDistribute(const mapDistribute&);
|
mapDistribute(const mapDistribute&);
|
||||||
|
|
||||||
@ -187,6 +372,22 @@ public:
|
|||||||
return constructMap_;
|
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.
|
//- Calculate a schedule. See above.
|
||||||
static List<labelPair> schedule
|
static List<labelPair> schedule
|
||||||
(
|
(
|
||||||
@ -200,6 +401,12 @@ public:
|
|||||||
|
|
||||||
// Other
|
// 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
|
//- Helper for construct from globalIndex. Renumbers element
|
||||||
// (in globalIndex numbering) into compact indices.
|
// (in globalIndex numbering) into compact indices.
|
||||||
static label renumber
|
static label renumber
|
||||||
@ -245,88 +452,36 @@ public:
|
|||||||
|
|
||||||
//- Distribute data using default commsType.
|
//- Distribute data using default commsType.
|
||||||
template<class T>
|
template<class T>
|
||||||
void distribute(List<T>& fld) const
|
void distribute(List<T>& fld, const bool dummyTransform = true)
|
||||||
{
|
const;
|
||||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
|
||||||
{
|
//- Same but with transforms
|
||||||
distribute
|
template<class T>
|
||||||
(
|
void distribute
|
||||||
Pstream::nonBlocking,
|
(
|
||||||
List<labelPair>(),
|
const globalIndexAndTransform&,
|
||||||
constructSize_,
|
List<T>& fld,
|
||||||
subMap_,
|
const bool isPosition
|
||||||
constructMap_,
|
) const;
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Reverse distribute data using default commsType.
|
//- Reverse distribute data using default commsType.
|
||||||
template<class T>
|
template<class T>
|
||||||
void reverseDistribute(const label constructSize, List<T>& fld)
|
void reverseDistribute
|
||||||
const
|
(
|
||||||
{
|
const label constructSize,
|
||||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
List<T>&,
|
||||||
{
|
const bool dummyTransform = true
|
||||||
distribute
|
) const;
|
||||||
(
|
|
||||||
Pstream::nonBlocking,
|
//- Same but with transforms
|
||||||
List<labelPair>(),
|
template<class T>
|
||||||
constructSize,
|
void reverseDistribute
|
||||||
constructMap_,
|
(
|
||||||
subMap_,
|
const globalIndexAndTransform&,
|
||||||
fld
|
const label constructSize,
|
||||||
);
|
List<T>& fld,
|
||||||
}
|
const bool isPosition
|
||||||
else if (Pstream::defaultCommsType == Pstream::scheduled)
|
) const;
|
||||||
{
|
|
||||||
distribute
|
|
||||||
(
|
|
||||||
Pstream::scheduled,
|
|
||||||
schedule(),
|
|
||||||
constructSize,
|
|
||||||
constructMap_,
|
|
||||||
subMap_,
|
|
||||||
fld
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
distribute
|
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
List<labelPair>(),
|
|
||||||
constructSize,
|
|
||||||
constructMap_,
|
|
||||||
subMap_,
|
|
||||||
fld
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Reverse distribute data using default commsType.
|
//- Reverse distribute data using default commsType.
|
||||||
// Since constructSize might be larger than supplied size supply
|
// Since constructSize might be larger than supplied size supply
|
||||||
@ -336,53 +491,20 @@ public:
|
|||||||
(
|
(
|
||||||
const label constructSize,
|
const label constructSize,
|
||||||
const T& nullValue,
|
const T& nullValue,
|
||||||
List<T>& fld
|
List<T>& fld,
|
||||||
)
|
const bool dummyTransform = true
|
||||||
const
|
) const;
|
||||||
{
|
|
||||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
//- Same but with transforms
|
||||||
{
|
template<class T>
|
||||||
distribute
|
void reverseDistribute
|
||||||
(
|
(
|
||||||
Pstream::nonBlocking,
|
const globalIndexAndTransform&,
|
||||||
List<labelPair>(),
|
const label constructSize,
|
||||||
constructSize,
|
const T& nullValue,
|
||||||
constructMap_,
|
List<T>& fld,
|
||||||
subMap_,
|
const bool isPosition
|
||||||
fld,
|
) const;
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Do all sends using PstreamBuffers
|
//- Do all sends using PstreamBuffers
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -391,6 +513,9 @@ public:
|
|||||||
template<class T>
|
template<class T>
|
||||||
void receive(PstreamBuffers&, List<T>&) const;
|
void receive(PstreamBuffers&, List<T>&) const;
|
||||||
|
|
||||||
|
//- Debug: print layout
|
||||||
|
void printLayout(Ostream& os) const;
|
||||||
|
|
||||||
//- Correct for topo change.
|
//- Correct for topo change.
|
||||||
void updateMesh(const mapPolyMesh&)
|
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;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,6 +26,8 @@ License
|
|||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "PstreamBuffers.H"
|
#include "PstreamBuffers.H"
|
||||||
#include "PstreamCombineReduceOps.H"
|
#include "PstreamCombineReduceOps.H"
|
||||||
|
#include "globalIndexAndTransform.H"
|
||||||
|
#include "transformField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -673,6 +673,8 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
|||||||
|
|
||||||
bool hasError = false;
|
bool hasError = false;
|
||||||
|
|
||||||
|
HashSet<word> patchNames(2*size());
|
||||||
|
|
||||||
forAll(bm, patchI)
|
forAll(bm, patchI)
|
||||||
{
|
{
|
||||||
if (bm[patchI].start() != nextPatchStart && !hasError)
|
if (bm[patchI].start() != nextPatchStart && !hasError)
|
||||||
@ -689,6 +691,17 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
|||||||
<< " Suppressing future warnings." << endl;
|
<< " 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();
|
nextPatchStart += bm[patchI].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,7 +45,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef List<labelPair> labelPairList;
|
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward declaration of friend functions and operators
|
||||||
|
|||||||
@ -276,9 +276,16 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
|
|
||||||
if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1)
|
if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1)
|
||||||
{
|
{
|
||||||
const_cast<tensorField&>(forwardT()).setSize(1);
|
// Get index of maximum area face to minimise truncation errors.
|
||||||
const_cast<tensorField&>(reverseT()).setSize(1);
|
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()).setSize(1);
|
||||||
|
const_cast<boolList&>(collocated())[0] = coll;
|
||||||
|
|
||||||
WarningIn
|
WarningIn
|
||||||
(
|
(
|
||||||
@ -293,8 +300,9 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
) << "For patch " << name()
|
) << "For patch " << name()
|
||||||
<< " calculated non-uniform transform tensor even though"
|
<< " calculated non-uniform transform tensor even though"
|
||||||
<< " the transform type is " << transformTypeNames[transform_]
|
<< " the transform type is " << transformTypeNames[transform_]
|
||||||
<< ". Setting the transformation tensor to be a uniform"
|
<< "." << nl
|
||||||
<< " rotation."
|
<< " Setting the transformation tensor to be a uniform"
|
||||||
|
<< " rotation calculated from face " << max0I
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -695,9 +703,43 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * 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
|
void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
|
||||||
{
|
{
|
||||||
if (!parallel())
|
if (!parallel())
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -197,6 +197,10 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Declare friendship with processorCyclicPolyPatch
|
||||||
|
friend class processorCyclicPolyPatch;
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("cyclic");
|
TypeName("cyclic");
|
||||||
|
|
||||||
@ -321,25 +325,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Neighbour patchID.
|
//- Neighbour patchID.
|
||||||
virtual label neighbPatchID() const
|
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 bool owner() const
|
virtual bool owner() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "processorCyclicPolyPatch.H"
|
#include "processorCyclicPolyPatch.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "SubField.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
|
// - or do we not auto-calculate the transformation but
|
||||||
// have option of reading it.
|
// 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());
|
coupledPolyPatch& pp = const_cast<coupledPolyPatch&>(referPatch());
|
||||||
|
|
||||||
pp.calcGeometry
|
pp.calcGeometry
|
||||||
(
|
(
|
||||||
*this,
|
*this,
|
||||||
@ -184,6 +185,21 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
|||||||
neighbFaceAreas(),
|
neighbFaceAreas(),
|
||||||
neighbFaceCellCentres()
|
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()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,7 +24,6 @@ License
|
|||||||
\*----------------------------------------------------------------------------*/
|
\*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "polyMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -99,24 +98,6 @@ void Foam::syncTools::transform::operator()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * 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.
|
// Determines for every point whether it is coupled and if so sets only one.
|
||||||
Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
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 globalMeshData& globalData = mesh.globalData();
|
||||||
const labelList& meshPoints = globalData.coupledPatch().meshPoints();
|
const labelList& meshPoints = globalData.coupledPatch().meshPoints();
|
||||||
const labelListList& pointSlaves = globalData.globalPointAllSlaves();
|
const labelListList& slaves = globalData.globalPointSlaves();
|
||||||
|
const labelListList& transformedSlaves =
|
||||||
|
globalData.globalPointTransformedSlaves();
|
||||||
|
|
||||||
forAll(meshPoints, coupledPointI)
|
forAll(meshPoints, coupledPointI)
|
||||||
{
|
{
|
||||||
label meshPointI = meshPoints[coupledPointI];
|
label meshPointI = meshPoints[coupledPointI];
|
||||||
if (pointSlaves[coupledPointI].size() > 0)
|
if
|
||||||
|
(
|
||||||
|
(
|
||||||
|
slaves[coupledPointI].size()
|
||||||
|
+ transformedSlaves[coupledPointI].size()
|
||||||
|
)
|
||||||
|
> 0
|
||||||
|
)
|
||||||
{
|
{
|
||||||
isMasterPoint[meshPointI] = true;
|
isMasterPoint[meshPointI] = true;
|
||||||
}
|
}
|
||||||
@ -161,12 +151,21 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
|||||||
|
|
||||||
const globalMeshData& globalData = mesh.globalData();
|
const globalMeshData& globalData = mesh.globalData();
|
||||||
const labelList& meshEdges = globalData.coupledPatchMeshEdges();
|
const labelList& meshEdges = globalData.coupledPatchMeshEdges();
|
||||||
const labelListList& edgeSlaves = globalData.globalEdgeAllSlaves();
|
const labelListList& slaves = globalData.globalEdgeSlaves();
|
||||||
|
const labelListList& transformedSlaves =
|
||||||
|
globalData.globalEdgeTransformedSlaves();
|
||||||
|
|
||||||
forAll(meshEdges, coupledEdgeI)
|
forAll(meshEdges, coupledEdgeI)
|
||||||
{
|
{
|
||||||
label meshEdgeI = meshEdges[coupledEdgeI];
|
label meshEdgeI = meshEdges[coupledEdgeI];
|
||||||
if (edgeSlaves[coupledEdgeI].size() > 0)
|
if
|
||||||
|
(
|
||||||
|
(
|
||||||
|
slaves[coupledEdgeI].size()
|
||||||
|
+ transformedSlaves[coupledEdgeI].size()
|
||||||
|
)
|
||||||
|
> 0
|
||||||
|
)
|
||||||
{
|
{
|
||||||
isMasterEdge[meshEdgeI] = true;
|
isMasterEdge[meshEdgeI] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,12 +33,6 @@ Description
|
|||||||
- null value which gets overridden by any valid value.
|
- null value which gets overridden by any valid value.
|
||||||
- transform function
|
- 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
|
SourceFiles
|
||||||
syncTools.C
|
syncTools.C
|
||||||
syncToolsTemplates.C
|
syncToolsTemplates.C
|
||||||
@ -48,9 +42,7 @@ SourceFiles
|
|||||||
#ifndef syncTools_H
|
#ifndef syncTools_H
|
||||||
#define syncTools_H
|
#define syncTools_H
|
||||||
|
|
||||||
#include "UList.H"
|
|
||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "Map.H"
|
|
||||||
#include "EdgeMap.H"
|
#include "EdgeMap.H"
|
||||||
#include "PackedBoolList.H"
|
#include "PackedBoolList.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
@ -72,9 +64,6 @@ class syncTools
|
|||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Check whether uses couples.
|
|
||||||
static bool hasCouples(const polyBoundaryMesh&);
|
|
||||||
|
|
||||||
//- Combine value with existing value in map.
|
//- Combine value with existing value in map.
|
||||||
template <class T, class CombineOp>
|
template <class T, class CombineOp>
|
||||||
static void combine
|
static void combine
|
||||||
@ -174,41 +163,41 @@ public:
|
|||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const TransformOp& top
|
const TransformOp& top
|
||||||
);
|
);
|
||||||
|
//
|
||||||
//- Synchronize values on all mesh points.
|
// //- Synchronize values on all mesh points.
|
||||||
template <class T, class CombineOp, class TransformOp>
|
// template <class T, class CombineOp, class TransformOp>
|
||||||
static void syncPointList
|
// static void syncPointList
|
||||||
(
|
// (
|
||||||
const polyMesh&,
|
// const polyMesh&,
|
||||||
UList<T>&,
|
// UList<T>&,
|
||||||
const CombineOp& cop,
|
// const CombineOp& cop,
|
||||||
const T& nullValue,
|
// const T& nullValue,
|
||||||
const TransformOp& top
|
// const TransformOp& top
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
//- Synchronize values on selected mesh points.
|
// //- Synchronize values on selected mesh points.
|
||||||
template <class T, class CombineOp, class TransformOp>
|
// template <class T, class CombineOp, class TransformOp>
|
||||||
static void syncPointList
|
// static void syncPointList
|
||||||
(
|
// (
|
||||||
const polyMesh&,
|
// const polyMesh&,
|
||||||
const labelList& meshPoints,
|
// const labelList& meshPoints,
|
||||||
UList<T>&,
|
// UList<T>&,
|
||||||
const CombineOp& cop,
|
// const CombineOp& cop,
|
||||||
const T& nullValue,
|
// const T& nullValue,
|
||||||
const TransformOp& top
|
// const TransformOp& top
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
//- Synchronize values on all mesh edges.
|
// //- Synchronize values on all mesh edges.
|
||||||
template <class T, class CombineOp, class TransformOp>
|
// template <class T, class CombineOp, class TransformOp>
|
||||||
static void syncEdgeList
|
// static void syncEdgeList
|
||||||
(
|
// (
|
||||||
const polyMesh&,
|
// const polyMesh&,
|
||||||
UList<T>&,
|
// UList<T>&,
|
||||||
const CombineOp& cop,
|
// const CombineOp& cop,
|
||||||
const T& nullValue,
|
// const T& nullValue,
|
||||||
const TransformOp& top
|
// const TransformOp& top
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
//- Synchronize values on boundary faces only.
|
//- Synchronize values on boundary faces only.
|
||||||
template <class T, class CombineOp, class TransformOp>
|
template <class T, class CombineOp, class TransformOp>
|
||||||
static void syncBoundaryFaceList
|
static void syncBoundaryFaceList
|
||||||
@ -227,26 +216,20 @@ public:
|
|||||||
static void syncPointList
|
static void syncPointList
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
UList<T>& l,
|
List<T>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue
|
const T& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncPointList(mesh, l, cop, nullValue, transform());
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Synchronize locations on all mesh points.
|
//- Synchronize locations on all mesh points.
|
||||||
template <class CombineOp>
|
template <class CombineOp>
|
||||||
static void syncPointPositions
|
static void syncPointPositions
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
UList<point>& l,
|
List<point>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const point& nullValue
|
const point& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncPointList(mesh, l, cop, nullValue, transformPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Synchronize values on selected mesh points.
|
//- Synchronize values on selected mesh points.
|
||||||
template <class T, class CombineOp>
|
template <class T, class CombineOp>
|
||||||
@ -257,18 +240,7 @@ public:
|
|||||||
UList<T>& l,
|
UList<T>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue
|
const T& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncPointList
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
meshPoints,
|
|
||||||
l,
|
|
||||||
cop,
|
|
||||||
nullValue,
|
|
||||||
transform()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Synchronize locations on selected mesh points.
|
//- Synchronize locations on selected mesh points.
|
||||||
template <class CombineOp>
|
template <class CombineOp>
|
||||||
@ -279,18 +251,7 @@ public:
|
|||||||
UList<point>& l,
|
UList<point>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const point& nullValue
|
const point& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncPointList
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
meshPoints,
|
|
||||||
l,
|
|
||||||
cop,
|
|
||||||
nullValue,
|
|
||||||
transformPosition()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Synchronise edge-wise data
|
// Synchronise edge-wise data
|
||||||
@ -303,10 +264,7 @@ public:
|
|||||||
UList<T>& l,
|
UList<T>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue
|
const T& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncEdgeList(mesh, l, cop, nullValue, transform());
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Synchronize values on all mesh edges.
|
//- Synchronize values on all mesh edges.
|
||||||
template <class CombineOp>
|
template <class CombineOp>
|
||||||
@ -316,10 +274,7 @@ public:
|
|||||||
UList<point>& l,
|
UList<point>& l,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const point& nullValue
|
const point& nullValue
|
||||||
)
|
);
|
||||||
{
|
|
||||||
syncEdgeList(mesh, l, cop, nullValue, transformPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Synchronise face-wise data
|
// Synchronise face-wise data
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,8 +32,6 @@ License
|
|||||||
#include "transform.H"
|
#include "transform.H"
|
||||||
#include "transformList.H"
|
#include "transformList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Combine val with existing value at index
|
// Combine val with existing value at index
|
||||||
@ -93,11 +91,6 @@ void Foam::syncTools::syncPointMap
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
@ -398,11 +391,6 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Do synchronisation without constructing globalEdge addressing
|
// Do synchronisation without constructing globalEdge addressing
|
||||||
// (since this constructs mesh edge addressing)
|
// (since this constructs mesh edge addressing)
|
||||||
@ -767,14 +755,232 @@ 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();
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// 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)
|
||||||
|
// {
|
||||||
|
// // Values on shared points.
|
||||||
|
// Field<T> 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]];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
//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
|
void Foam::syncTools::syncPointList
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
UList<T>& pointValues,
|
List<T>& pointValues,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue,
|
const T& nullValue
|
||||||
const TransformOp& top
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pointValues.size() != mesh.nPoints())
|
if (pointValues.size() != mesh.nPoints())
|
||||||
@ -782,173 +988,48 @@ void Foam::syncTools::syncPointList
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"syncTools<class T, class CombineOp>::syncPointList"
|
"syncTools<class T, class CombineOp>::syncPointList"
|
||||||
"(const polyMesh&, UList<T>&, const CombineOp&, const T&"
|
"(const polyMesh&, UList<T>&, const CombineOp&, const T&)"
|
||||||
", const bool)"
|
|
||||||
) << "Number of values " << pointValues.size()
|
) << "Number of values " << pointValues.size()
|
||||||
<< " is not equal to the number of points in the mesh "
|
<< " is not equal to the number of points in the mesh "
|
||||||
<< mesh.nPoints() << abort(FatalError);
|
<< mesh.nPoints() << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
mesh.globalData().syncPointData(pointValues, cop, false);
|
||||||
|
|
||||||
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]);
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
{
|
|
||||||
// Values on shared points.
|
|
||||||
Field<T> 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]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T, class CombineOp, class TransformOp>
|
template <class CombineOp>
|
||||||
|
void Foam::syncTools::syncPointPositions
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
List<point>& pointValues,
|
||||||
|
const CombineOp& cop,
|
||||||
|
const point& nullValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (pointValues.size() != mesh.nPoints())
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.globalData().syncPointData(pointValues, cop, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <class T, class CombineOp>
|
||||||
void Foam::syncTools::syncPointList
|
void Foam::syncTools::syncPointList
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const labelList& meshPoints,
|
const labelList& meshPoints,
|
||||||
UList<T>& pointValues,
|
UList<T>& pointValues,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue,
|
const T& nullValue
|
||||||
const TransformOp& top
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pointValues.size() != meshPoints.size())
|
if (pointValues.size() != meshPoints.size())
|
||||||
@ -956,49 +1037,116 @@ void Foam::syncTools::syncPointList
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"syncTools<class T, class CombineOp>::syncPointList"
|
"syncTools<class T, class CombineOp>::syncPointList"
|
||||||
"(const polyMesh&, const labelList&, UList<T>&, const CombineOp&"
|
"(const polyMesh&, UList<T>&, const CombineOp&, const T&)"
|
||||||
", const T&, const bool)"
|
|
||||||
) << "Number of values " << pointValues.size()
|
) << "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);
|
<< meshPoints.size() << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
const globalMeshData& gd = mesh.globalData();
|
||||||
|
const indirectPrimitivePatch& cpp = gd.coupledPatch();
|
||||||
|
const Map<label>& mpm = cpp.meshPointMap();
|
||||||
|
|
||||||
if (!hasCouples(mesh.boundaryMesh()))
|
List<T> cppFld(cpp.nPoints(), nullValue);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Field<T> meshValues(mesh.nPoints(), nullValue);
|
|
||||||
|
|
||||||
forAll(meshPoints, i)
|
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,
|
cppFld,
|
||||||
meshValues,
|
gd.globalPointSlaves(),
|
||||||
cop, // combine op
|
gd.globalPointTransformedSlaves(),
|
||||||
nullValue, // null value
|
gd.globalPointSlavesMap(),
|
||||||
top // position or field
|
gd.globalTransforms(),
|
||||||
|
cop,
|
||||||
|
false //position?
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(meshPoints, i)
|
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 CombineOp>
|
||||||
|
void Foam::syncTools::syncPointPositions
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const labelList& meshPoints,
|
||||||
|
UList<point>& pointValues,
|
||||||
|
const CombineOp& cop,
|
||||||
|
const point& nullValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (pointValues.size() != meshPoints.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"syncTools<class CombineOp>::syncPointList"
|
||||||
|
"(const polyMesh&, UList<point>&, const CombineOp&, const point&)"
|
||||||
|
) << "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();
|
||||||
|
|
||||||
|
List<point> cppFld(cpp.nPoints(), nullValue);
|
||||||
|
|
||||||
|
forAll(meshPoints, i)
|
||||||
|
{
|
||||||
|
label pointI = meshPoints[i];
|
||||||
|
Map<label>::const_iterator iter = mpm.find(pointI);
|
||||||
|
if (iter != mpm.end())
|
||||||
|
{
|
||||||
|
cppFld[iter()] = pointValues[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
globalMeshData::syncData
|
||||||
|
(
|
||||||
|
cppFld,
|
||||||
|
gd.globalPointSlaves(),
|
||||||
|
gd.globalPointTransformedSlaves(),
|
||||||
|
gd.globalPointSlavesMap(),
|
||||||
|
gd.globalTransforms(),
|
||||||
|
cop,
|
||||||
|
true //position?
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(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>
|
||||||
void Foam::syncTools::syncEdgeList
|
void Foam::syncTools::syncEdgeList
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
UList<T>& edgeValues,
|
UList<T>& edgeValues,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const T& nullValue,
|
const T& nullValue
|
||||||
const TransformOp& top
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (edgeValues.size() != mesh.nEdges())
|
if (edgeValues.size() != mesh.nEdges())
|
||||||
@ -1006,168 +1154,78 @@ void Foam::syncTools::syncEdgeList
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"syncTools<class T, class CombineOp>::syncEdgeList"
|
"syncTools<class T, class CombineOp>::syncEdgeList"
|
||||||
"(const polyMesh&, UList<T>&, const CombineOp&, const T&"
|
"(const polyMesh&, UList<T>&, const CombineOp&, const T&)"
|
||||||
", const bool)"
|
|
||||||
) << "Number of values " << edgeValues.size()
|
) << "Number of values " << edgeValues.size()
|
||||||
<< " is not equal to the number of edges in the mesh "
|
<< " is not equal to the number of edges in the mesh "
|
||||||
<< mesh.nEdges() << abort(FatalError);
|
<< 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();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
List<T> cppFld(UIndirectList<T>(edgeValues, meshEdges));
|
||||||
|
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pstream::parRun())
|
const globalMeshData& gd = mesh.globalData();
|
||||||
|
const labelList& meshEdges = gd.coupledPatchMeshEdges();
|
||||||
|
|
||||||
|
List<point> cppFld(UIndirectList<point>(edgeValues, meshEdges));
|
||||||
|
|
||||||
|
globalMeshData::syncData
|
||||||
|
(
|
||||||
|
cppFld,
|
||||||
|
gd.globalEdgeSlaves(),
|
||||||
|
gd.globalEdgeTransformedSlaves(),
|
||||||
|
gd.globalEdgeSlavesMap(),
|
||||||
|
gd.globalTransforms(),
|
||||||
|
cop,
|
||||||
|
true //position?
|
||||||
|
);
|
||||||
|
|
||||||
|
// Extract back onto mesh
|
||||||
|
forAll(meshEdges, i)
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
edgeValues[meshEdges[i]] = cppFld[i];
|
||||||
|
|
||||||
// Send
|
|
||||||
|
|
||||||
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();
|
|
||||||
const labelList& neighbEdges = procPatch.neighbEdges();
|
|
||||||
|
|
||||||
// Get region per patch edge in neighbouring edge numbers.
|
|
||||||
Field<T> patchInfo(procPatch.nEdges(), nullValue);
|
|
||||||
|
|
||||||
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]];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,12 +1255,6 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
@ -1223,13 +1275,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
label patchStart = procPatch.start()-mesh.nInternalFaces();
|
label patchStart = procPatch.start()-mesh.nInternalFaces();
|
||||||
|
|
||||||
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr <<
|
toNbr << SubField<T>(faceValues, procPatch.size(), patchStart);
|
||||||
SubField<T>
|
|
||||||
(
|
|
||||||
faceValues,
|
|
||||||
procPatch.size(),
|
|
||||||
patchStart
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1331,11 +1377,6 @@ void Foam::syncTools::syncFaceList
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
@ -1466,11 +1507,6 @@ void Foam::syncTools::syncPointList
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
@ -1630,11 +1666,6 @@ void Foam::syncTools::syncEdgeList
|
|||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (!hasCouples(patches))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,19 +27,26 @@ Typedef
|
|||||||
Description
|
Description
|
||||||
Label pair
|
Label pair
|
||||||
|
|
||||||
|
Typedef
|
||||||
|
Foam::labelPairList
|
||||||
|
|
||||||
|
Description
|
||||||
|
List of labelPairs
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef labelPair_H
|
#ifndef labelPair_H
|
||||||
#define labelPair_H
|
#define labelPair_H
|
||||||
|
|
||||||
#include "label.H"
|
|
||||||
#include "Pair.H"
|
#include "Pair.H"
|
||||||
|
#include "List.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
typedef Pair<label> labelPair;
|
typedef Pair<label> labelPair;
|
||||||
|
typedef List<labelPair> labelPairList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user