diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-1.4.3.spec b/ThirdParty/rpmBuild/SPECS/openmpi-1.4.3.spec index 67f0ec939..531d7167c 100644 --- a/ThirdParty/rpmBuild/SPECS/openmpi-1.4.3.spec +++ b/ThirdParty/rpmBuild/SPECS/openmpi-1.4.3.spec @@ -204,8 +204,8 @@ setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`" setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`" # Set the OpenFOAM compilation flags -setenv PINC \`echo \$OPENMPI_COMPILE_FLAGS\` -setenv PLIBS \`echo \$OPENMPI_LINK_FLAGS\` +setenv PINC "\$OPENMPI_COMPILE_FLAGS" +setenv PLIBS "\$OPENMPI_LINK_FLAGS" if (\$?FOAM_VERBOSE && \$?prompt) then diff --git a/applications/solvers/DNS/dnsFoam/Make/options b/applications/solvers/DNS/dnsFoam/Make/options index 34c3503a5..4d06d63f5 100644 --- a/applications/solvers/DNS/dnsFoam/Make/options +++ b/applications/solvers/DNS/dnsFoam/Make/options @@ -7,4 +7,5 @@ EXE_LIBS = \ -lfiniteVolume \ -lrandomProcesses \ -lsampling \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoCentralFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/Make/options index 4714ca611..6b901e96d 100644 --- a/applications/solvers/compressible/rhoCentralFoam/Make/options +++ b/applications/solvers/compressible/rhoCentralFoam/Make/options @@ -8,4 +8,5 @@ EXE_LIBS = \ -lfiniteVolume \ -lbasicThermophysicalModels \ -lspecie \ - -lrhoCentralFoam + -lrhoCentralFoam \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options index 47a62ae92..47500aea9 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoPisoFoam/Make/options b/applications/solvers/compressible/rhoPisoFoam/Make/options index 8ef0951d5..21a200763 100644 --- a/applications/solvers/compressible/rhoPisoFoam/Make/options +++ b/applications/solvers/compressible/rhoPisoFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lspecie \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ - -lcompressibleLESModels + -lcompressibleLESModels \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options index 809b4a63a..39a4e4197 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options @@ -13,4 +13,5 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options index 61456e486..74924fb07 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lspecie \ -lcompressibleRASModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/rhoSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/Make/options index d51be54ab..f75e725ad 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoSimpleFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lspecie \ -lcompressibleRASModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/rhopSonicFoam/Make/options b/applications/solvers/compressible/rhopSonicFoam/Make/options index 31374b9af..f9791eeae 100644 --- a/applications/solvers/compressible/rhopSonicFoam/Make/options +++ b/applications/solvers/compressible/rhopSonicFoam/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ - -lrhopSonicFoam + -lrhopSonicFoam \ + -llduSolvers diff --git a/applications/solvers/compressible/sonicFoam/Make/options b/applications/solvers/compressible/sonicFoam/Make/options index a5b9436ac..2c45c3943 100644 --- a/applications/solvers/compressible/sonicFoam/Make/options +++ b/applications/solvers/compressible/sonicFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/Make/options b/applications/solvers/compressible/sonicFoamAutoMotion/Make/options index a86609b75..ebd0b3a1a 100644 --- a/applications/solvers/compressible/sonicFoamAutoMotion/Make/options +++ b/applications/solvers/compressible/sonicFoamAutoMotion/Make/options @@ -6,4 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -ldynamicMesh \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/compressible/sonicLiquidFoam/Make/options b/applications/solvers/compressible/sonicLiquidFoam/Make/options index 725122ea1..552db34e2 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/Make/options +++ b/applications/solvers/compressible/sonicLiquidFoam/Make/options @@ -1,4 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = -lfiniteVolume +EXE_LIBS = \ + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/electromagnetics/electrostaticFoam/Make/options b/applications/solvers/electromagnetics/electrostaticFoam/Make/options index d9745f69a..d53b6877c 100644 --- a/applications/solvers/electromagnetics/electrostaticFoam/Make/options +++ b/applications/solvers/electromagnetics/electrostaticFoam/Make/options @@ -1,3 +1,5 @@ EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = -lfiniteVolume +EXE_LIBS = \ + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/electromagnetics/mhdFoam/Make/options b/applications/solvers/electromagnetics/mhdFoam/Make/options index 725122ea1..552db34e2 100644 --- a/applications/solvers/electromagnetics/mhdFoam/Make/options +++ b/applications/solvers/electromagnetics/mhdFoam/Make/options @@ -1,4 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = -lfiniteVolume +EXE_LIBS = \ + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/engine/icoDyMEngineFoam/Make/options b/applications/solvers/engine/icoDyMEngineFoam/Make/options index d3454b604..594dc3cd1 100644 --- a/applications/solvers/engine/icoDyMEngineFoam/Make/options +++ b/applications/solvers/engine/icoDyMEngineFoam/Make/options @@ -13,4 +13,5 @@ EXE_LIBS = \ -ltopoChangerFvMesh \ -lmeshTools \ -lfiniteVolume \ - $(WM_DECOMP_LIBS) + $(WM_DECOMP_LIBS) \ + -llduSolvers diff --git a/applications/solvers/engine/sonicTurbDyMEngineFoam/Make/options b/applications/solvers/engine/sonicTurbDyMEngineFoam/Make/options index 3b64956ea..78be8bfcb 100644 --- a/applications/solvers/engine/sonicTurbDyMEngineFoam/Make/options +++ b/applications/solvers/engine/sonicTurbDyMEngineFoam/Make/options @@ -18,4 +18,5 @@ EXE_LIBS = \ -lspecie \ -lmeshTools \ -lfiniteVolume \ - $(WM_DECOMP_LIBS) + $(WM_DECOMP_LIBS) \ + -llduSolvers diff --git a/applications/solvers/engine/turbDyMEngineFoam/Make/options b/applications/solvers/engine/turbDyMEngineFoam/Make/options index 0ab2b0f26..0bb2bdab2 100644 --- a/applications/solvers/engine/turbDyMEngineFoam/Make/options +++ b/applications/solvers/engine/turbDyMEngineFoam/Make/options @@ -20,4 +20,5 @@ EXE_LIBS = \ -lincompressibleLESModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - $(WM_DECOMP_LIBS) + $(WM_DECOMP_LIBS) \ + -llduSolvers diff --git a/applications/solvers/financial/financialFoam/Make/options b/applications/solvers/financial/financialFoam/Make/options index 347d2f2f1..11abcd035 100644 --- a/applications/solvers/financial/financialFoam/Make/options +++ b/applications/solvers/financial/financialFoam/Make/options @@ -5,4 +5,5 @@ EXE_INC = \ EXE_LIBS = \ -lsampling \ -lmeshTools \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/boussinesqBuoyantFoam/Make/options b/applications/solvers/heatTransfer/boussinesqBuoyantFoam/Make/options index fa15f1245..552db34e2 100644 --- a/applications/solvers/heatTransfer/boussinesqBuoyantFoam/Make/options +++ b/applications/solvers/heatTransfer/boussinesqBuoyantFoam/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options index b870232e3..83f7d43ab 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lincompressibleTransportModels + -lincompressibleTransportModels \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options index a53061a93..7428bd37b 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options @@ -9,4 +9,5 @@ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lincompressibleRASModels \ - -lincompressibleTransportModels + -lincompressibleTransportModels \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/Make/options b/applications/solvers/heatTransfer/buoyantPisoFoam/Make/options index 8d01214e6..042b02565 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options index ec604cf28..8b8257e63 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ -lcompressibleRASModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options index 89d7787af..efec577a7 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options @@ -14,4 +14,5 @@ EXE_LIBS = \ -lradiation \ -lcompressibleRASModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index e2f2569be..f8a8e52f3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -15,4 +15,5 @@ EXE_LIBS = \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options index 47f9e1caf..98032ace8 100755 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options @@ -14,4 +14,5 @@ EXE_LIBS = \ -lspecie \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ - -lcompressibleLESModels + -lcompressibleLESModels \ + -llduSolvers diff --git a/applications/solvers/incompressible/boundaryFoam/Make/options b/applications/solvers/incompressible/boundaryFoam/Make/options index b5a6f5b40..751b36915 100644 --- a/applications/solvers/incompressible/boundaryFoam/Make/options +++ b/applications/solvers/incompressible/boundaryFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools \ - -lsampling + -lsampling \ + -llduSolvers diff --git a/applications/solvers/incompressible/channelFoam/Make/options b/applications/solvers/incompressible/channelFoam/Make/options index 76a1a299d..238d93eca 100644 --- a/applications/solvers/incompressible/channelFoam/Make/options +++ b/applications/solvers/incompressible/channelFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleLESModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options index 8dbc9ba28..17267826d 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options @@ -5,4 +5,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ - -lincompressibleTransportModels + -lincompressibleTransportModels \ + -llduSolvers diff --git a/applications/solvers/incompressible/pimpleDyMFoam/Make/options b/applications/solvers/incompressible/pimpleDyMFoam/Make/options index a665a30d1..7b3201e92 100644 --- a/applications/solvers/incompressible/pimpleDyMFoam/Make/options +++ b/applications/solvers/incompressible/pimpleDyMFoam/Make/options @@ -16,4 +16,5 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/incompressible/pimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/Make/options index 47d95d97c..3849f1041 100644 --- a/applications/solvers/incompressible/pimpleFoam/Make/options +++ b/applications/solvers/incompressible/pimpleFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/incompressible/pisoFoam/Make/options b/applications/solvers/incompressible/pisoFoam/Make/options index 259f95f7b..47f0a846e 100644 --- a/applications/solvers/incompressible/pisoFoam/Make/options +++ b/applications/solvers/incompressible/pisoFoam/Make/options @@ -10,4 +10,5 @@ EXE_LIBS = \ -lincompressibleLESModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/incompressible/porousSimpleFoam/Make/options b/applications/solvers/incompressible/porousSimpleFoam/Make/options index f490133ba..39e0ffa67 100644 --- a/applications/solvers/incompressible/porousSimpleFoam/Make/options +++ b/applications/solvers/incompressible/porousSimpleFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/incompressible/shallowWaterFoam/Make/options b/applications/solvers/incompressible/shallowWaterFoam/Make/options index fa15f1245..552db34e2 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/Make/options +++ b/applications/solvers/incompressible/shallowWaterFoam/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options index 1223bdd06..5d2b99e6d 100644 --- a/applications/solvers/incompressible/simpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/Make/options @@ -8,4 +8,5 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options index 6fca56988..002dead2f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -37,4 +37,5 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ - -lODE + -lODE \ + -llduSolvers diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options index 25b61fbf1..6ca99f28a 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options @@ -36,4 +36,5 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ - -lODE + -lODE \ + -llduSolvers diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index 43ea6f2fe..44457115d 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -35,4 +35,5 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ - -lODE + -lODE \ + -llduSolvers diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 70a14c5fd..60cc2a7ca 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -20,4 +20,5 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/multiphase/barotropicCavitatingFoam/Make/options b/applications/solvers/multiphase/barotropicCavitatingFoam/Make/options index fa15f1245..552db34e2 100644 --- a/applications/solvers/multiphase/barotropicCavitatingFoam/Make/options +++ b/applications/solvers/multiphase/barotropicCavitatingFoam/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 0f2981ab4..ca4e1c057 100644 --- a/applications/solvers/multiphase/cavitatingFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -12,4 +12,5 @@ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ - -lbarotropicCompressibilityModel + -lbarotropicCompressibilityModel \ + -llduSolvers diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options index a46743045..daa46d6ff 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options @@ -17,5 +17,6 @@ EXE_LIBS = \ -lfiniteVolume \ -ldynamicMesh \ -lmeshTools \ - -ldynamicFvMesh + -ldynamicFvMesh \ + -llduSolvers diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index 930987369..2f3ffdfcd 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/multiphase/interMixingFoam/Make/options b/applications/solvers/multiphase/interMixingFoam/Make/options index 62271c2bb..5eb827e46 100644 --- a/applications/solvers/multiphase/interMixingFoam/Make/options +++ b/applications/solvers/multiphase/interMixingFoam/Make/options @@ -15,4 +15,5 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/multiphase/porousInterFoam/Make/options b/applications/solvers/multiphase/porousInterFoam/Make/options index b45231d42..0d97aae13 100644 --- a/applications/solvers/multiphase/porousInterFoam/Make/options +++ b/applications/solvers/multiphase/porousInterFoam/Make/options @@ -16,5 +16,6 @@ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -llduSolvers diff --git a/applications/solvers/multiphase/settlingFoam/Make/options b/applications/solvers/multiphase/settlingFoam/Make/options index fa15f1245..552db34e2 100644 --- a/applications/solvers/multiphase/settlingFoam/Make/options +++ b/applications/solvers/multiphase/settlingFoam/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index 930987369..2f3ffdfcd 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options @@ -11,4 +11,5 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -llduSolvers diff --git a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/Make/options b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/Make/options index 9783c227f..6db739d7c 100644 --- a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/Make/options +++ b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/Make/options @@ -12,4 +12,5 @@ EXE_LIBS = \ -ldynamicMesh \ -lmeshTools \ -lfiniteVolume \ - -lfiniteArea + -lfiniteArea \ + -llduSolvers diff --git a/applications/solvers/surfaceTracking/freeSurface/Make/options b/applications/solvers/surfaceTracking/freeSurface/Make/options index 79a7c5ceb..688a9d492 100644 --- a/applications/solvers/surfaceTracking/freeSurface/Make/options +++ b/applications/solvers/surfaceTracking/freeSurface/Make/options @@ -13,5 +13,4 @@ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -ldynamicMesh \ - $(WM_DECOMP_LIBS) \ - -llduSolvers + $(WM_DECOMP_LIBS) diff --git a/applications/solvers/surfaceTracking/freeSurface/freeSurfacePointDisplacement.C b/applications/solvers/surfaceTracking/freeSurface/freeSurfacePointDisplacement.C index 5ca692b3d..640c6597b 100644 --- a/applications/solvers/surfaceTracking/freeSurface/freeSurfacePointDisplacement.C +++ b/applications/solvers/surfaceTracking/freeSurface/freeSurfacePointDisplacement.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak + \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,11 @@ License #include "freeSurface.H" #include "primitivePatchInterpolation.H" #include "emptyFaPatch.H" +#include "wedgeFaPatch.H" +#include "PstreamCombineReduceOps.H" +#include "coordinateSystem.H" +#include "scalarMatrices.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,16 +42,13 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - tmp freeSurface::pointDisplacement(const scalarField& deltaH) { const pointField& points = aMesh().patch().localPoints(); const labelListList& pointFaces = aMesh().patch().pointFaces(); - controlPoints() += facesDisplacementDir()*deltaH; - tmp tdisplacement ( new vectorField @@ -60,9 +62,8 @@ tmp freeSurface::pointDisplacement(const scalarField& deltaH) // Calculate displacement of internal points - + const vectorField& pointNormals = aMesh().pointAreaNormals(); const edgeList& edges = aMesh().patch().edges(); - labelList internalPoints = aMesh().internalPoints(); forAll (internalPoints, pointI) @@ -71,64 +72,88 @@ tmp freeSurface::pointDisplacement(const scalarField& deltaH) const labelList& curPointFaces = pointFaces[curPoint]; - tensor M = tensor::zero; + vectorField lsPoints(curPointFaces.size(), vector::zero); - vector S = vector::zero; - - - scalarField w(curPointFaces.size(), 0.0); - - forAll (curPointFaces, faceI) + for (label i=0; i patchMirrorPoints(aMesh().boundary().size()); - // Calculate displacement of points which belonge to empty patches + forAll(patchMirrorPoints, patchI) + { + patchMirrorPoints.set + ( + patchI, + new vectorField + ( + aMesh().boundary()[patchI].faPatch::size(), + vector::zero + ) + ); + vectorField N = + aMesh().boundary()[patchI].ngbPolyPatchFaceNormals(); + + const labelList peFaces = + labelList::subList + ( + aMesh().edgeOwner(), + aMesh().boundary()[patchI].faPatch::size(), + aMesh().boundary()[patchI].start() + ); + + const labelList& pEdges = aMesh().boundary()[patchI]; + + vectorField peCentres(pEdges.size(), vector::zero); + forAll(peCentres, edgeI) + { + peCentres[edgeI] = + edges[pEdges[edgeI]].centre(points); + } + + vectorField delta = + vectorField(controlPoints(), peFaces) + - peCentres; + + patchMirrorPoints[patchI] = + peCentres + ((I - 2*N*N)&delta); + } + + + // Calculate displacement of boundary points labelList boundaryPoints = aMesh().boundaryPoints(); const labelListList& edgeFaces = aMesh().patch().edgeFaces(); const labelListList& pointEdges = aMesh().patch().pointEdges(); - vectorField pointNormals = aMesh().pointAreaNormals(); - forAll (boundaryPoints, pointI) { label curPoint = boundaryPoints[pointI]; - if (motionPointsMask()[curPoint]) + if (motionPointsMask()[curPoint] == 1) { // Calculating mirror points const labelList& curPointEdges = pointEdges[curPoint]; @@ -140,146 +165,380 @@ tmp freeSurface::pointDisplacement(const scalarField& deltaH) forAll (curPointEdges, edgeI) { label curEdge = curPointEdges[edgeI]; - + if(edgeFaces[curEdge].size() == 1) { - vector nE = - pointNormals[edges[curEdge].start()] - + pointNormals[edges[curEdge].end()]; + label patchID = -1; + label edgeID = -1; + forAll(aMesh().boundary(), patchI) + { + const labelList& pEdges = + aMesh().boundary()[patchI]; + label index = findIndex(pEdges, curEdge); + if (index != -1) + { + patchID = patchI; + edgeID = index; + break; + } + } - nE /= mag(nE); - - vector eP = - controlPoints()[edgeFaces[curEdge][0]] - - edges[curEdge].centre(points); - - mirrorPoints[++counter] = - edges[curEdge].centre(points) - + ((2.0*nE*nE - I)&eP); + mirrorPoints[++counter] = + patchMirrorPoints[patchID][edgeID]; } } - - // Calculating LS plane interpolation + // Calculating LS plane fit const labelList& curPointFaces = pointFaces[curPoint]; - tensor M = tensor::zero; + vectorField lsPoints + ( + curPointFaces.size() + mirrorPoints.size(), + vector::zero + ); - vector S = vector::zero; - - scalarField w(curPointFaces.size() + 2, 0.0); - - forAll (curPointFaces, faceI) + counter = -1; + + for (label i=0; i(aMesh().boundary()[patchI]); - labelListList patchPointEdges = - aMesh().boundary()[patchI].pointEdges(); - - unallocLabelList patchEdgeFaces = - aMesh().boundary()[patchI].edgeFaces(); - - forAll(patchPoints, pointI) + if(wedgePatch.axisPoint() > -1) { - forAll(patchPointEdges[pointI], edgeI) - { - label curEdge = patchPointEdges[pointI][edgeI]; - - displacement[patchPoints[pointI]] += - pointsDisplacementDir()[patchPoints[pointI]]* - deltaH[patchEdgeFaces[curEdge]]; - } - - displacement[patchPoints[pointI]] /= - patchPointEdges[pointI].size(); + label axisPoint = wedgePatch.axisPoint(); + + displacement[axisPoint] = + pointsDisplacementDir()[axisPoint] + *( + pointsDisplacementDir()[axisPoint] + &( + controlPoints()[pointFaces[axisPoint][0]] + - points[axisPoint] + ) + ); } } } + // Calculate displacement of processor patch points + forAll (aMesh().boundary(), patchI) + { + if + ( + aMesh().boundary()[patchI].type() + == processorFaPatch::typeName + ) + { + const processorFaPatch& procPatch = + refCast(aMesh().boundary()[patchI]); + + const labelList& patchPointLabels = + procPatch.pointLabels(); + + FieldField lsPoints(patchPointLabels.size()); + forAll(lsPoints, pointI) + { + lsPoints.set(pointI, new vectorField(0, vector::zero)); + } + + const labelList& nonGlobalPatchPoints = + procPatch.nonGlobalPatchPoints(); + + forAll(nonGlobalPatchPoints, pointI) + { + label curPatchPoint = + nonGlobalPatchPoints[pointI]; + + label curPoint = + patchPointLabels[curPatchPoint]; + + const labelList& curPointFaces = pointFaces[curPoint]; + + lsPoints[curPatchPoint].setSize(curPointFaces.size()); + + forAll(curPointFaces, faceI) + { + label curFace = curPointFaces[faceI]; + + lsPoints[curPatchPoint][faceI] = controlPoints()[curFace]; + } + +# include "boundaryProcessorFaPatchPoints.H" + } + + scalar lsPointsSize = 0; + forAll(lsPoints, pointI) + { + lsPointsSize += + 2*lsPoints[pointI].size()*sizeof(vector); + } + + // Parallel data exchange + { + OPstream toNeighbProc + ( + Pstream::blocking, + procPatch.neighbProcNo(), + lsPointsSize + ); + + toNeighbProc << lsPoints; + } + + FieldField ngbLsPoints(patchPointLabels.size()); + + { + IPstream fromNeighbProc + ( + Pstream::blocking, + procPatch.neighbProcNo(), + lsPointsSize + ); + + fromNeighbProc >> ngbLsPoints; + } + + forAll(nonGlobalPatchPoints, pointI) + { + label curPatchPoint = + nonGlobalPatchPoints[pointI]; + + label curPoint = + patchPointLabels[curPatchPoint]; + + label curNgbPoint = procPatch.neighbPoints()[curPatchPoint]; + + vectorField allLsPoints + ( + lsPoints[curPatchPoint].size() + + ngbLsPoints[curNgbPoint].size(), + vector::zero + ); + + label counter = -1; + forAll(lsPoints[curPatchPoint], pointI) + { + allLsPoints[++counter] = lsPoints[curPatchPoint][pointI]; + } + forAll(ngbLsPoints[curNgbPoint], pointI) + { + allLsPoints[++counter] = ngbLsPoints[curNgbPoint][pointI]; + } + + vectorField pointAndNormal = + lsPlanePointAndNormal + ( + allLsPoints, + points[curPoint], + pointNormals[curPoint] + ); + + vector& P = pointAndNormal[0]; + vector& N = pointAndNormal[1]; + + if (motionPointsMask()[curPoint] != 0) + { + displacement[curPoint] = + pointsDisplacementDir()[curPoint] + *((P - points[curPoint])&N) + /(pointsDisplacementDir()[curPoint]&N); + } + } + } + } + + + // Calculate displacement of global processor patch points + if (aMesh().globalData().nGlobalPoints() > 0) + { + const labelList& spLabels = + aMesh().globalData().sharedPointLabels(); + + const labelList& addr = aMesh().globalData().sharedPointAddr(); + + for (label k=0; k > procLsPoints(Pstream::nProcs()); + + label curSharedPointIndex = findIndex(addr, k); + + if (curSharedPointIndex != -1) + { + label curPoint = spLabels[curSharedPointIndex]; + + const labelList& curPointFaces = pointFaces[curPoint]; + + procLsPoints[Pstream::myProcNo()] = + List(curPointFaces.size()); + + forAll (curPointFaces, faceI) + { + label curFace = curPointFaces[faceI]; + + procLsPoints[Pstream::myProcNo()][faceI] = + controlPoints()[curFace]; + } + } + + Pstream::gatherList(procLsPoints); + Pstream::scatterList(procLsPoints); + + if (curSharedPointIndex != -1) + { + label curPoint = spLabels[curSharedPointIndex]; + + label nAllPoints = 0; + forAll(procLsPoints, procI) + { + nAllPoints += procLsPoints[procI].size(); + } + + vectorField allPoints(nAllPoints, vector::zero); + + label counter = 0; + forAll(procLsPoints, procI) + { + forAll(procLsPoints[procI], pointI) + { + allPoints[counter++] = + procLsPoints[procI][pointI]; + } + } + + vectorField pointAndNormal = + lsPlanePointAndNormal + ( + allPoints, + points[curPoint], + pointNormals[curPoint] + ); + + const vector& P = pointAndNormal[0]; + const vector& N = pointAndNormal[1]; + + displacement[curPoint] = + pointsDisplacementDir()[curPoint] + *((P - points[curPoint])&N) + /(pointsDisplacementDir()[curPoint]&N); + } + } + } + return tdisplacement; } +tmp freeSurface::lsPlanePointAndNormal +( + const vectorField& points, + const vector& origin, + const vector& axis +) const +{ + // LS in local CS + vector dir = (points[0] - origin); + dir -= axis*(axis&dir); + dir /= mag(dir); + coordinateSystem cs("cs", origin, axis, dir); + + vectorField localPoints = cs.localPosition(points); + scalarField W = 1.0/(mag(points - origin) + SMALL); + + scalarRectangularMatrix M + ( + points.size(), + 3, + 0.0 + ); + + for (label i=0; i pointAndNormal + ( + new vectorField(2, vector::zero) + ); + + pointAndNormal()[0] = p0; + pointAndNormal()[1] = n0; + + return pointAndNormal; +} + // tmp freeSurface::pointDisplacementSM() // { diff --git a/applications/solvers/surfaceTracking/interTrackFoam/Make/options b/applications/solvers/surfaceTracking/interTrackFoam/Make/options index 9783c227f..6db739d7c 100644 --- a/applications/solvers/surfaceTracking/interTrackFoam/Make/options +++ b/applications/solvers/surfaceTracking/interTrackFoam/Make/options @@ -12,4 +12,5 @@ EXE_LIBS = \ -ldynamicMesh \ -lmeshTools \ -lfiniteVolume \ - -lfiniteArea + -lfiniteArea \ + -llduSolvers diff --git a/applications/utilities/mesh/manipulation/moveDyMEngineMesh/Make/files b/applications/utilities/mesh/manipulation/moveDyMEngineMesh/Make/files index 157c5b736..19f2415d5 100644 --- a/applications/utilities/mesh/manipulation/moveDyMEngineMesh/Make/files +++ b/applications/utilities/mesh/manipulation/moveDyMEngineMesh/Make/files @@ -1,3 +1,3 @@ -moveDyEngineMesh.C +moveDyMEngineMesh.C -EXE = $(FOAM_APPBIN)/moveDyEngineMesh +EXE = $(FOAM_APPBIN)/moveDyMEngineMesh diff --git a/applications/utilities/mesh/manipulation/moveDyMEngineMesh/moveDyEngineMesh.C b/applications/utilities/mesh/manipulation/moveDyMEngineMesh/moveDyMEngineMesh.C similarity index 100% rename from applications/utilities/mesh/manipulation/moveDyMEngineMesh/moveDyEngineMesh.C rename to applications/utilities/mesh/manipulation/moveDyMEngineMesh/moveDyMEngineMesh.C diff --git a/applications/utilities/miscellaneous/findRoot/findRoot.C b/applications/utilities/miscellaneous/findRoot/findRoot.C index 376c64f74..a6fe4d328 100644 --- a/applications/utilities/miscellaneous/findRoot/findRoot.C +++ b/applications/utilities/miscellaneous/findRoot/findRoot.C @@ -34,6 +34,7 @@ Description #include "IOmanip.H" #include "BisectionRoot.H" #include "RiddersRoot.H" +#include "NewtonSecantRoot.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,15 +51,38 @@ public: } }; + +class testFunctionDerivative +{ +public: + + testFunctionDerivative() + {} + + scalar operator()(const scalar& x) const + { + return 0.5*Foam::pow(x,-1.5) - Foam::cos(x); + } +}; + + int main(int argc, char *argv[]) { - testFunction tf; + testFunction tf; + testFunctionDerivative df; Info<< setprecision(10) << "Bisection root " << BisectionRoot(tf, 1e-5).root(0, 10) << nl << "Ridders root " - << RiddersRoot(tf, 1e-5).root(0, 10) << endl; + << RiddersRoot(tf, 1e-5).root(0, 10) << nl + << "NewtonSecant root " + << NewtonSecantRoot + ( + tf, + df, + 1e-5 + ).root(1.5) << endl; Info<< "End\n" << endl; diff --git a/bin/doxyFilt b/bin/doxyFilt index 327de5076..6eb83a866 100755 --- a/bin/doxyFilt +++ b/bin/doxyFilt @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/finddep b/bin/finddep index 638fb3217..585dbe34a 100755 --- a/bin/finddep +++ b/bin/finddep @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamAllHC b/bin/foamAllHC index 5f86ad718..3a8f45338 100755 --- a/bin/foamAllHC +++ b/bin/foamAllHC @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamCheckJobs b/bin/foamCheckJobs index da73cf464..c2ca4887d 100755 --- a/bin/foamCheckJobs +++ b/bin/foamCheckJobs @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # @@ -40,12 +40,12 @@ PROGNAME=${0##*/} -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ #- User settings #- Number of days for files to be considered old NDAYSLIMIT=7 -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ #- work file TMPFILE=/tmp/${PROGNAME}$$.tmp @@ -62,11 +62,11 @@ else fi -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Functions # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # getRawEntry dictionary entry # Prints value of dictionary entry @@ -169,11 +169,11 @@ LABEL } -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Main # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ #- Check a few things diff --git a/bin/foamCleanPath b/bin/foamCleanPath index 15161277c..371764d3c 100755 --- a/bin/foamCleanPath +++ b/bin/foamCleanPath @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamClearPolyMesh b/bin/foamClearPolyMesh index 7fdb08961..a7790918e 100755 --- a/bin/foamClearPolyMesh +++ b/bin/foamClearPolyMesh @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamDistccd b/bin/foamDistccd index 380ae24db..917c6795f 100755 --- a/bin/foamDistccd +++ b/bin/foamDistccd @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamEbrowse b/bin/foamEbrowse index 7e2aaa2f7..7873fc7b7 100755 --- a/bin/foamEbrowse +++ b/bin/foamEbrowse @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamEndJob b/bin/foamEndJob index 0a6e676cc..1736ece24 100755 --- a/bin/foamEndJob +++ b/bin/foamEndJob @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # @@ -35,16 +35,16 @@ # - controlDict modified # to restore controlDict # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ PROGNAME=`basename $0` -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Functions # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # getNumberedLine dictionary entry # Prints dictionary entry line + lineno @@ -185,11 +185,11 @@ restoreDict() { } -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Main # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ ARCH=`uname -s` diff --git a/bin/foamEtcFile b/bin/foamEtcFile index 5bae566b5..3413aa1d0 100755 --- a/bin/foamEtcFile +++ b/bin/foamEtcFile @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # @@ -38,7 +38,7 @@ # && _foamSource $foamPrefs # @endverbatim # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ usage() { [ "$quietOpt" = true ] && exit 1 @@ -76,7 +76,7 @@ USAGE # This script must exist in /OpenFOAM-/bin/ # or /openfoam/bin/ (for the debian version) # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # the bindir: binDir="${0%/*}" diff --git a/bin/foamExec b/bin/foamExec index 9fed6e2ff..e3e276e06 100755 --- a/bin/foamExec +++ b/bin/foamExec @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamGraphExecTime b/bin/foamGraphExecTime index 528854f84..88879c1a4 100755 --- a/bin/foamGraphExecTime +++ b/bin/foamGraphExecTime @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamGraphResKE b/bin/foamGraphResKE index b380af4d0..a2b9b6635 100755 --- a/bin/foamGraphResKE +++ b/bin/foamGraphResKE @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamGraphResUVWP b/bin/foamGraphResUVWP index 699574c3a..6cb506286 100755 --- a/bin/foamGraphResUVWP +++ b/bin/foamGraphResUVWP @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest index c67961e88..a58dc4454 100755 --- a/bin/foamInstallationTest +++ b/bin/foamInstallationTest @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamJob b/bin/foamJob index 5e6f454e4..07cc4e200 100755 --- a/bin/foamJob +++ b/bin/foamJob @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamLog b/bin/foamLog index 0eae5db2c..6ca32e67b 100755 --- a/bin/foamLog +++ b/bin/foamLog @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamNew b/bin/foamNew index 87ad6508d..0f598a76b 100755 --- a/bin/foamNew +++ b/bin/foamNew @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPack b/bin/foamPack index a4f6e66f7..0ebe26e78 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackBin b/bin/foamPackBin index 71e9e002b..8555ad0dd 100755 --- a/bin/foamPackBin +++ b/bin/foamPackBin @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll index bc5658009..ce13ef3ea 100755 --- a/bin/foamPackBinAll +++ b/bin/foamPackBinAll @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackGeneral b/bin/foamPackGeneral index fa90a764b..e3eb2458f 100755 --- a/bin/foamPackGeneral +++ b/bin/foamPackGeneral @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackSource b/bin/foamPackSource index 8b2a7306f..0947236f9 100755 --- a/bin/foamPackSource +++ b/bin/foamPackSource @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin index 00f8b93f6..005a976bd 100755 --- a/bin/foamPackThirdPartyBin +++ b/bin/foamPackThirdPartyBin @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPackThirdPartyGeneral b/bin/foamPackThirdPartyGeneral index 87493b240..2a17c4eb1 100755 --- a/bin/foamPackThirdPartyGeneral +++ b/bin/foamPackThirdPartyGeneral @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamPrintJobs b/bin/foamPrintJobs index d09cebe21..42afa1dc4 100755 --- a/bin/foamPrintJobs +++ b/bin/foamPrintJobs @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # @@ -38,11 +38,11 @@ JOBSTRING='%4s %8s %20s %10s %8s %4s %12s %12s %20s\n' DEFSTATEFILE=$HOME/.OpenFOAM/foamCheckJobs.out -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Functions # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ printUsage() { cat << LABEL @@ -98,11 +98,11 @@ leftStr() { echo "$2" | sed -e "s/\(.\{$1\}\).*/\1/" } -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # # Main # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ if [ ! "$FOAM_JOB_DIR" ]; then echo "$PROGNAME : FOAM_JOB_DIR environment variable not set." diff --git a/bin/foamProcessInfo b/bin/foamProcessInfo index 1bc3a7a2f..99a78cd00 100755 --- a/bin/foamProcessInfo +++ b/bin/foamProcessInfo @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # @@ -37,7 +37,7 @@ # # Tested on Linux,IRIX,SunOS # -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ PROGNAME=`basename $0` TMPFILE=/tmp/${PROGNAME}$$.tmp diff --git a/bin/foamSolverSweeps b/bin/foamSolverSweeps index e8c25788a..cd6a17195 100755 --- a/bin/foamSolverSweeps +++ b/bin/foamSolverSweeps @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamSystemCheck b/bin/foamSystemCheck index 5a4d892b9..1fea5018a 100755 --- a/bin/foamSystemCheck +++ b/bin/foamSystemCheck @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamTemplates/source/newSource b/bin/foamTemplates/source/newSource index 72557fa42..a1f3c9277 100755 --- a/bin/foamTemplates/source/newSource +++ b/bin/foamTemplates/source/newSource @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamTemplates/sourceTemplate/newSourceTemplate b/bin/foamTemplates/sourceTemplate/newSourceTemplate index 938066498..aee023416 100755 --- a/bin/foamTemplates/sourceTemplate/newSourceTemplate +++ b/bin/foamTemplates/sourceTemplate/newSourceTemplate @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/foamVersion b/bin/foamVersion index 66705a51e..99a18ff66 100755 --- a/bin/foamVersion +++ b/bin/foamVersion @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/mpirunDebug b/bin/mpirunDebug index bf9bbc210..d09d5c25b 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/paraFoam b/bin/paraFoam index 877ec4591..21f4411e9 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/rmclassall b/bin/rmclassall index 41190c994..01f756d96 100755 --- a/bin/rmclassall +++ b/bin/rmclassall @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/rmcore b/bin/rmcore index d1e3b997a..60589698d 100755 --- a/bin/rmcore +++ b/bin/rmcore @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/rmdepall b/bin/rmdepall index df3e80437..812e12acd 100755 --- a/bin/rmdepall +++ b/bin/rmdepall @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/rmoall b/bin/rmoall index 75e934ad3..895c2fe62 100755 --- a/bin/rmoall +++ b/bin/rmoall @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/rm~all b/bin/rm~all index bd1b15bf6..2130384a5 100755 --- a/bin/rm~all +++ b/bin/rm~all @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index a8df1274c..5ad8c2456 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -107,4 +107,29 @@ cloneCase () fi } +makeFsiCaseLinks () +{ + cd $1 + cd system + ln -s ../../$2/system $2 + cd ../constant + ln -s ../../$2/constant $2 + cd ../0 + ln -s ../../$2/0 $2 + cd ../.. +} + +makeFsiResultsLinks () +{ + cd $1 + TIME_DIRS=`foamInfoExec -times | sed '1,/constant/d'` + echo "makeFsiResultsLinks for" $TIME_DIRS + cd ../$2 + for T in $TIME_DIRS + do + ln -s ../$1/${T}/solid ${T} + done + cd .. +} + #------------------------------------------------------------------------------ diff --git a/bin/touchapp b/bin/touchapp index 10163f297..e03b72990 100755 --- a/bin/touchapp +++ b/bin/touchapp @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/touchdep b/bin/touchdep index abdc8c57b..bab7abaf8 100755 --- a/bin/touchdep +++ b/bin/touchdep @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/touchlib b/bin/touchlib index fd36002dd..fc5740aa5 100755 --- a/bin/touchlib +++ b/bin/touchlib @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/bin/toucho b/bin/toucho index f93af41cc..b2bb09925 100755 --- a/bin/toucho +++ b/bin/toucho @@ -5,7 +5,7 @@ # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # diff --git a/etc/settings.csh b/etc/settings.csh index 3b313f290..b74145e4d 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -37,7 +37,7 @@ alias _foamAddPath 'set path=(\!* $path)' alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}' # location of the jobControl directory -setenv FOAM_JOB_DIR $HOME/$WM_PROJECT/jobControl +setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl # wmake configuration setenv WM_DIR $WM_PROJECT_DIR/wmake @@ -52,18 +52,18 @@ setenv WM_DECOMP_LIBS "-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver # base configuration setenv FOAM_APP $WM_PROJECT_DIR/applications -setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin +setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS setenv FOAM_LIB $WM_PROJECT_DIR/lib setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS setenv FOAM_SRC $WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~OpenFOAM expansion -setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin -setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib +setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS +setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS # user configuration -setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin -setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib +setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS +setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS # convenience setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials diff --git a/etc/settings.sh b/etc/settings.sh index 8e0fe82c6..13d068e1a 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -70,7 +70,7 @@ _foamSource() } # location of the jobControl directory -export FOAM_JOB_DIR=$HOME/$WM_PROJECT/jobControl +export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl # wmake configuration export WM_DIR=$WM_PROJECT_DIR/wmake @@ -85,18 +85,18 @@ export WM_DECOMP_LIBS="-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver # base configuration export FOAM_APP=$WM_PROJECT_DIR/applications -export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin +export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS export FOAM_LIB=$WM_PROJECT_DIR/lib -export FOAM_LIBBIN=$WM_PROJECT_DIR/lib +export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS export FOAM_SRC=$WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~OpenFOAM expansion -export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin -export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib +export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS +export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS # user configuration -export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin -export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib +export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS +export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS # convenience export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials diff --git a/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.C b/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.C new file mode 100644 index 000000000..96b5ea82e --- /dev/null +++ b/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + NewtonSecantRoot + +Description + NewtonSecant root finder for better stability. + Function is provided as a template parameter function object, evaluated + using operator()(const scalar x) + +Author + Aleksandar Jemcov. All rights reserved. + +\*---------------------------------------------------------------------------*/ + +#include "NewtonSecantRoot.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template +const Foam::label Foam::NewtonSecantRoot::maxIter = 60; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::NewtonSecantRoot::NewtonSecantRoot +( + const Func& f, + const Deriv& d, + const scalar eps +) +: + f_(f), + d_(d), + eps_(eps) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::NewtonSecantRoot::root +( + scalar xN +) const +{ + if (0 == d_(xN)) + { + FatalErrorIn + ( + "Foam::scalar Foam::NewtonSecantRoot::root\n" + "(\n" + " const scalar xN,\n" + ") const" + ) << "Jacobian equal to zero. f'(xN) = " << d_(xN) + << abort(FatalError); + } + + scalar xNp1; + + for (label nIter = 0; nIter < maxIter; ++nIter) + { + scalar fN = this->f_(xN); + scalar dN = this->d_(xN); + scalar dx = fN/dN; + + scalar xBar = xN - dx; + + xNp1 = xN - fN*fN/(dN*(fN - f_(xBar))); + if (mag(xN - xNp1) <= this->eps_) + { + return xNp1; + } + + xN = xNp1; + } + + return xNp1; +} + + +// ************************************************************************* // diff --git a/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.H b/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.H new file mode 100644 index 000000000..8673a9e5e --- /dev/null +++ b/src/ODE/findRoot/NewtonSecantRoot/NewtonSecantRoot.H @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + NewtonSecantRoot + +Description + NewtonSecant root is based on combination of Newton and Secant methods. + Function and the funciton derivative are provided as a template parameter + function object, evaluated using operator()(const scalar x) + +Author + Aleksandar Jemcov. All rights reserved. + +SourceFiles + NewtonSecantRoot.C + +\*---------------------------------------------------------------------------*/ + +#ifndef NewtonSecantRoot_H +#define NewtonSecantRoot_H + +#include "scalar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class NewtonSecantRoot Declaration +\*---------------------------------------------------------------------------*/ + +template +class NewtonSecantRoot +{ + // Private data + + //- Reference to a function + const Func& f_; + + //- Reference to a derivative + const Deriv& d_; + + //- Required accuracy + const scalar eps_; + + +public: + + // Static data members + + //- Maximum number of iterations + static const label maxIter; + + + // Constructors + + //- Construct given a function + NewtonSecantRoot(const Func& f, const Deriv& d, const scalar eps); + + + // Destructor - default + + + // Member Functions + + //- Return root + scalar root(scalar xN) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NewtonSecantRoot.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index cc61e3c9c..23aa67d1a 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -386,7 +386,8 @@ Foam::label Foam::FaceCellWave::getChangedPatchFaces if (changedFace_[meshFaceI]) { changedPatchFaces[nChangedPatchFaces] = patchFaceI; - changedPatchFacesInfo[nChangedPatchFaces] = allFaceInfo_[meshFaceI]; + changedPatchFacesInfo[nChangedPatchFaces] = + allFaceInfo_[meshFaceI]; nChangedPatchFaces++; } } @@ -405,7 +406,7 @@ void Foam::FaceCellWave::leaveDomain ) const { const vectorField& fc = mesh_.faceCentres(); - + for(label i = 0; i < nFaces; i++) { label patchFaceI = faceLabels[i]; @@ -427,7 +428,7 @@ void Foam::FaceCellWave::enterDomain ) const { const vectorField& fc = mesh_.faceCentres(); - + for(label i = 0; i < nFaces; i++) { label patchFaceI = faceLabels[i]; @@ -739,7 +740,7 @@ void Foam::FaceCellWave::handleCyclicPatches() if (debug) { - Pout<< " Cyclic patch " << patchI << ' ' << patch.name() + Pout<< " Cyclic patch " << patchI << ' ' << patch.name() << " Changed on first half : " << nSendFaces << " Changed on second half : " << nReceiveFaces << endl; @@ -819,7 +820,7 @@ Foam::FaceCellWave::FaceCellWave {} -// Iterate, propagating changedFacesInfo across mesh, until no change (or +// Iterate, propagating changedFacesInfo across mesh, until no change (or // maxIter reached). Initial cell values specified. template Foam::FaceCellWave::FaceCellWave @@ -861,7 +862,7 @@ Foam::FaceCellWave::FaceCellWave "(const polyMesh&, const labelList&, const List," " UList&, UList&, const label maxIter)" ) - << "Maximum number of iterations reached. Increase maxIter." << endl + << "Maximum number of iterations reached. Increase maxIter." << nl << " maxIter:" << maxIter << endl << " nChangedCells:" << nChangedCells_ << endl << " nChangedFaces:" << nChangedFaces_ << endl @@ -989,7 +990,8 @@ Foam::label Foam::FaceCellWave::cellToFace() label cellI = changedCells_[changedCellI]; if (!changedCell_[cellI]) { - FatalErrorIn("FaceCellWave::cellToFace()") << "Cell " << cellI + FatalErrorIn("FaceCellWave::cellToFace()") + << "Cell " << cellI << " not marked as having been changed" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index ef1f4b468..46e504fa0 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -26,7 +26,7 @@ License #include "SlicedGeometricField.H" -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // template < diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index be07c6103..9d59823e3 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -37,7 +37,7 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -Foam::SLList Foam::argList::validArgs; +Foam::SLList Foam::argList::validArgs; Foam::HashTable Foam::argList::validOptions; Foam::HashTable Foam::argList::validParOptions; bool Foam::argList::bannerEnabled(true); @@ -114,7 +114,7 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv) } -// get rootPath_ / globalCase_ from one of the following forms +// get rootPath_/globalCase_ from one of the following forms // * [-case dir] // * cwd // @@ -152,29 +152,26 @@ void Foam::argList::getRootCase() casePath = cwd(); } - rootPath_ = casePath.path(); + rootPath_ = casePath.path(); globalCase_ = casePath.name(); - case_ = globalCase_; - + case_ = globalCase_; // Set the case and case-name as an environment variable if (rootPath_[0] == '/') { - // absolute path - use as-is + // Absolute path - use as-is setEnv("FOAM_CASE", rootPath_/globalCase_, true); setEnv("FOAM_CASENAME", globalCase_, true); } else { - // qualify relative path + // Qualify relative path fileName casePath = cwd()/rootPath_/globalCase_; casePath.clean(); setEnv("FOAM_CASE", casePath, true); setEnv("FOAM_CASENAME", casePath.name(), true); } - - } diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index ee0e812f2..1f03f15d3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -159,8 +159,8 @@ public: //- Return patch index for a given face label label whichPatch(const label faceIndex) const; - //- Return the set of patch IDs corresponding to the given list of names - // Wild cards are expanded. + //- Return the set of patch IDs corresponding to the given list + // of names. Wild cards are expanded. labelHashSet patchSet(const wordList&) const; //- Check whether all procs have all patches and in same order. Return diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index d0a5e69e7..a9084a23f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -35,6 +35,7 @@ License #include "EdgeMap.H" #include "Time.H" #include "RodriguesRotation.H" +#include "standAlonePatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -133,12 +134,12 @@ void Foam::cyclicPolyPatch::calcTransforms() fileName fvPath(boundaryMesh().mesh().time().path()/"VTK"); mkDir(fvPath); - fileName nm0(fvPath/name()+"_half0_faces"); + fileName nm0(fvPath/name() + "_half0_faces"); Pout<< "cyclicPolyPatch::calcTransforms : Writing half0" << " faces to file " << nm0 << endl; half0.writeVTK(nm0, half0, points); - fileName nm1(fvPath/name()+"_half1_faces"); + fileName nm1(fvPath/name() + "_half1_faces"); Pout<< "cyclicPolyPatch::calcTransforms : Writing half1" << " faces to file " << nm1 << endl; half1.writeVTK(nm1, half1, points); @@ -171,7 +172,7 @@ void Foam::cyclicPolyPatch::calcTransforms() else if ( mag(magSf - nbrMagSf)/avSf - > coupledPolyPatch::matchTol_ + > polyPatch::matchTol_ ) { // Error in area matching. Find largest error @@ -186,40 +187,6 @@ void Foam::cyclicPolyPatch::calcTransforms() } } - // Check for error in face matching - if (maxMatchError > coupledPolyPatch::matchTol_) - { - label nbrFacei = errorFace + size()/2; - scalar magSf = mag(half0Normals[errorFace]); - scalar nbrMagSf = mag(half1Normals[errorFace]); - scalar avSf = (magSf + nbrMagSf)/2.0; - - FatalErrorIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "face " << errorFace - << " area does not match neighbour " - << nbrFacei << " by " - << 100*mag(magSf - nbrMagSf)/avSf - << "% -- possible face ordering problem." << endl - << "patch:" << name() - << " my area:" << magSf - << " neighbour area:" << nbrMagSf - << " matching tolerance:" << coupledPolyPatch::matchTol_ - << endl - << "Mesh face:" << start() + errorFace - << " vertices:" - << IndirectList(points, operator[](errorFace))() - << endl - << "Neighbour face:" << start() + nbrFacei - << " vertices:" - << IndirectList(points, operator[](nbrFacei))() - << endl - << "Other errors also exist, only the largest is reported. " - << "Please rerun with cyclic debug flag set" - << " for more information." << exit(FatalError); - } - // See if transformation is prescribed // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -284,15 +251,76 @@ void Foam::cyclicPolyPatch::calcTransforms() ( "void cyclicPolyPatch::calcTransforms()" ) << "Transformation tensor is not constant for the cyclic " - << "patch. Please reconsider your setup and definition of " + << "patch " << name() + << ". Please reconsider your setup and definition of " << "cyclic boundaries." << endl; } } + // Dump transformed first half + if (debug) + { + fileName fvPath(boundaryMesh().mesh().time().path()/"VTK"); + + pointField transformPoints = half0.localPoints(); + + forAll (transformPoints, pointI) + { + transformPoints[pointI] = + Foam::transform(reverseT_[0], transformPoints[pointI]); + } + + standAlonePatch transformHalf0 + ( + half0.localFaces(), + transformPoints + ); + + fileName nm2(fvPath/name() + "_transform_half0_faces"); + Pout<< "cyclicPolyPatch::calcTransforms : Writing transform_half0" + << " faces to file " << nm2 << endl; + transformHalf0.writeVTK(nm2, transformHalf0, transformPoints); + } + + // Check for error in face matching + if (maxMatchError > polyPatch::matchTol_) + { + label nbrFacei = errorFace + size()/2; + scalar magSf = mag(half0Normals[errorFace]); + scalar nbrMagSf = mag(half1Normals[errorFace]); + scalar avSf = (magSf + nbrMagSf)/2.0; + + FatalErrorIn + ( + "cyclicPolyPatch::calcTransforms()" + ) << "face " << errorFace + << " area does not match neighbour " + << nbrFacei << " by " + << 100*mag(magSf - nbrMagSf)/avSf + << "% -- possible face ordering problem." << endl + << "patch:" << name() + << " my area:" << magSf + << " neighbour area:" << nbrMagSf + << " matching tolerance:" << polyPatch::matchTol_ + << endl + << "Mesh face:" << start() + errorFace + << " vertices:" + << IndirectList(points, operator[](errorFace))() + << endl + << "Neighbour face:" << start() + nbrFacei + << " vertices:" + << IndirectList(points, operator[](nbrFacei))() + << endl + << "Other errors also exist, only the largest is reported. " + << "Please rerun with cyclic debug flag set" + << " for more information." << exit(FatalError); + } + if (debug) { // Check the transformation scalar maxDistance = 0; + scalar maxRelDistance = 0; forAll (half0Ctrs, faceI) { @@ -307,8 +335,19 @@ void Foam::cyclicPolyPatch::calcTransforms() Foam::transform(reverseT_[0], half0Ctrs[faceI]) - half1Ctrs[faceI] ) + ); + + maxRelDistance = + Foam::max + ( + maxRelDistance, + mag + ( + Foam::transform(reverseT_[0], half0Ctrs[faceI]) + - half1Ctrs[faceI] + ) /( - mag(half1Ctrs[faceI] - half0Ctrs[faceI]) + mag(half1Ctrs[faceI] - half0Ctrs[faceI]) + SMALL ) ); @@ -324,8 +363,19 @@ void Foam::cyclicPolyPatch::calcTransforms() half0Ctrs[faceI] - half1Ctrs[faceI] ) + ); + + maxRelDistance = + Foam::max + ( + maxRelDistance, + mag + ( + half0Ctrs[faceI] + - half1Ctrs[faceI] + ) /( - mag(half1Ctrs[faceI] - half0Ctrs[faceI]) + mag(half1Ctrs[faceI] - half0Ctrs[faceI]) + SMALL ) ); @@ -334,14 +384,15 @@ void Foam::cyclicPolyPatch::calcTransforms() // Check max distance between face centre and // transformed face centre - if (maxDistance > sqrt(areaMatchTol)) + if (maxRelDistance > sqrt(areaMatchTol)) { SeriousErrorIn ( "void cyclicPolyPatch::calcTransforms()" - ) << "Relative difference in transformation = " - << 100*maxDistance - << "%. Please check the definition of the transformation" + ) << "Relative difference in transformation for patch " + << name() << " = " << 100*maxRelDistance + << "%, abs distance = " << maxDistance + << ". Please check the definition of the transformation" << endl; } } @@ -582,7 +633,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors } } - if (mag(n0 & n1) < 1 - coupledPolyPatch::matchTol_) + if (mag(n0 & n1) < 1 - polyPatch::matchTol_) { if (debug) { @@ -697,7 +748,7 @@ bool Foam::cyclicPolyPatch::matchAnchors SeriousErrorIn ( "cyclicPolyPatch::matchAnchors(..)" - ) << "Patch:" << name() << " : " + ) << "Patch " << name() << " : " << "Cannot find point on face " << f << " with vertices:" << IndirectList(pp.points(), f)() @@ -821,7 +872,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch ) << "Incorrect rotation axis: " << rotationAxis_ << abort(FatalError); } - + rotationAxis_ /= mag(rotationAxis_); // Check rotation axis if appropriate @@ -1455,9 +1506,10 @@ bool Foam::cyclicPolyPatch::order ( "cyclicPolyPatch::order" "(const primitivePatch&, labelList&, labelList&) const" - ) << "Patch:" << name() << " : " - << "Cannot match vectors to faces on both sides of patch" << endl - << " Perhaps your faces do not match?" + ) << "Patch " << name() << " : " + << "Cannot match vectors to faces on both sides of patch " + << name() << endl + << ". Perhaps your faces do not match?" << " The obj files written contain the current match." << endl << " Continuing with incorrect face ordering from now on!" << endl; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index 50cb80786..1d365aa09 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -196,7 +196,7 @@ void Foam::processorPolyPatch::calcGeometry() faceNormals[facei] = point(1, 0, 0); nbrFaceNormals[facei] = faceNormals[facei]; } - else if (mag(magSf - nbrMagSf)/avSf > coupledPolyPatch::matchTol_) + else if (mag(magSf - nbrMagSf)/avSf > polyPatch::matchTol_) { FatalErrorIn ( @@ -207,7 +207,7 @@ void Foam::processorPolyPatch::calcGeometry() << "patch: " << name() << " my area:" << magSf << " neighbour area: " << nbrMagSf - << " matching tolerance: " << coupledPolyPatch::matchTol_ + << " matching tolerance: " << polyPatch::matchTol_ << endl << "Mesh face: " << start()+facei << " vertices: " diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H index 21e394044..1c6572e86 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H @@ -87,10 +87,6 @@ class processorPolyPatch //- Whether to use geometric or topological matching static bool geometricMatch_; - //- Relative tolerance (for geometric matching only). Is factor of - // maximum edge length per face. - static scalar matchTol_; - protected: diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H b/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H index 5db791c64..62114a8ba 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H @@ -69,18 +69,58 @@ public: // Constructors //- Construct from name - polyPatchID(const word& name, const polyBoundaryMesh& bm) + polyPatchID + ( + const word& name, + const polyBoundaryMesh& bm, + bool checkValid = false + ) : name_(name), index_(bm.findPatchID(name)) - {} + { + if (checkValid && index_ < 0) + { + FatalErrorIn + ( + "polyPatchID\n" + "(\n" + " const word& name,\n" + " const polyBoundaryMesh& bm,\n" + " bool checkValid = false\n" + ")" + ) << "Patch " << name_ << " not found. Valid patch names: " + << bm.names() + << abort(FatalError); + } + } //- Construct from Istream - polyPatchID(Istream& is, const polyBoundaryMesh& bm) + polyPatchID + ( + Istream& is, + const polyBoundaryMesh& bm, + bool checkValid = false + ) : name_(is), index_(bm.findPatchID(name_)) - {} + { + if (checkValid && index_ < 0) + { + FatalErrorIn + ( + "polyPatchID\n" + "(\n" + " Istream& is\n" + " const polyBoundaryMesh& bm,\n" + " bool checkValid = false\n" + ")" + ) << "Patch " << name_ << " not found. Valid patch names: " + << bm.names() + << abort(FatalError); + } + } // Member Functions diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index a09bb40b0..a8a68269f 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -547,10 +547,14 @@ bool Foam::faceZone::checkParallelSync(const bool report) const { label faceI = operator[](i); - if (!mesh.isInternalFace(faceI)) + // Only check live faces + if (faceI < mesh.nFaces()) { - neiZoneFace[faceI-mesh.nInternalFaces()] = true; - neiZoneFlip[faceI-mesh.nInternalFaces()] = flipMap()[i]; + if (!mesh.isInternalFace(faceI)) + { + neiZoneFace[faceI - mesh.nInternalFaces()] = true; + neiZoneFlip[faceI - mesh.nInternalFaces()] = flipMap()[i]; + } } } @@ -563,44 +567,49 @@ bool Foam::faceZone::checkParallelSync(const bool report) const { label faceI = operator[](i); - label patchI = bm.whichPatch(faceI); - - if (patchI != -1 && bm[patchI].coupled()) + // Only check live faces + if (faceI < mesh.nFaces()) { - label bFaceI = faceI-mesh.nInternalFaces(); + label patchI = bm.whichPatch(faceI); - // Check face in zone on both sides - if (myZoneFace[bFaceI] != neiZoneFace[bFaceI]) + if (patchI != -1 && isA(bm[patchI])) { - boundaryError = true; + label bFaceI = faceI-mesh.nInternalFaces(); - if (report) + // Check face in zone on both sides + if (myZoneFace[bFaceI] != neiZoneFace[bFaceI]) { - Pout<< " ***Problem with faceZone " << index() - << " named " << name() - << ". Face " << faceI - << " on coupled patch " - << bm[patchI].name() - << " is not consistent with its coupled neighbour." - << endl; + boundaryError = true; + + if (report) + { + Pout<< " ***Problem with faceZone " << index() + << " named " << name() + << ". Face " << faceI + << " on coupled patch " + << bm[patchI].name() + << " is not consistent with its " + << "coupled neighbour." + << endl; + } } - } - // Flip state should be opposite. - if (myZoneFlip[bFaceI] == neiZoneFlip[bFaceI]) - { - boundaryError = true; - - if (report) + // Flip state should be opposite. + if (myZoneFlip[bFaceI] == neiZoneFlip[bFaceI]) { - Pout<< " ***Problem with faceZone " << index() - << " named " << name() - << ". Face " << faceI - << " on coupled patch " - << bm[patchI].name() - << " does not have consistent flipMap" - << " across coupled faces." - << endl; + boundaryError = true; + + if (report) + { + Pout<< " ***Problem with faceZone " << index() + << " named " << name() + << ". Face " << faceI + << " on coupled patch " + << bm[patchI].name() + << " does not have consistent flipMap" + << " across coupled faces." + << endl; + } } } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C index 6be2465b4..9d01f6ec9 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C @@ -30,6 +30,8 @@ Description #include "primitiveMesh.H" +#include "tetPointRef.H" + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::primitiveMesh::calcCellCentresAndVols() const @@ -108,50 +110,100 @@ void Foam::primitiveMesh::makeCellCentresAndVols cEst[celli] /= nCellFaces[celli]; } - forAll (own, facei) + const faceList& allFaces = faces(); + const pointField& allPoints = points(); + + forAll(own, faceI) { - // Calculate 3*face-pyramid volume + const face& f = allFaces[faceI]; - // Bug fix: incorrect volume calculation for mildly concave cells - // Critical in mesh motion sliding cases for volume conservation - // HJ, 9/Feb/2009 - scalar pyr3Vol = -// max(fAreas[facei] & (fCtrs[facei] - cEst[own[facei]]), VSMALL); - fAreas[facei] & (fCtrs[facei] - cEst[own[facei]]); + if (f.size() == 3) + { + tetPointRef tpr + ( + allPoints[f[2]], + allPoints[f[1]], + allPoints[f[0]], + cEst[own[faceI]] + ); - // Calculate face-pyramid centre - vector pc = (3.0/4.0)*fCtrs[facei] + (1.0/4.0)*cEst[own[facei]]; + scalar tetVol = tpr.mag(); - // Accumulate volume-weighted face-pyramid centre - cellCtrs[own[facei]] += pyr3Vol*pc; + // Accumulate volume-weighted tet centre + cellCtrs[own[faceI]] += tetVol*tpr.centre(); - // Accumulate face-pyramid volume - cellVols[own[facei]] += pyr3Vol; + // Accumulate tet volume + cellVols[own[faceI]] += tetVol; + } + else + { + forAll(f, pI) + { + tetPointRef tpr + ( + allPoints[f[pI]], + allPoints[f.prevLabel(pI)], + fCtrs[faceI], + cEst[own[faceI]] + ); + + scalar tetVol = tpr.mag(); + + // Accumulate volume-weighted tet centre + cellCtrs[own[faceI]] += tetVol*tpr.centre(); + + // Accumulate tet volume + cellVols[own[faceI]] += tetVol; + } + } } - forAll (nei, facei) + forAll(nei, faceI) { - // Calculate 3*face-pyramid volume + const face& f = allFaces[faceI]; - // Bug fix: incorrect volume calculation for mildly concave cells - // Critical in mesh motion sliding cases for volume conservation - // HJ, 9/Feb/2009 - scalar pyr3Vol = -// max(fAreas[facei] & (cEst[nei[facei]] - fCtrs[facei]), VSMALL); - fAreas[facei] & (cEst[nei[facei]] - fCtrs[facei]); + if (f.size() == 3) + { + tetPointRef tpr + ( + allPoints[f[0]], + allPoints[f[1]], + allPoints[f[2]], + cEst[nei[faceI]] + ); - // Calculate face-pyramid centre - vector pc = (3.0/4.0)*fCtrs[facei] + (1.0/4.0)*cEst[nei[facei]]; + scalar tetVol = tpr.mag(); - // Accumulate volume-weighted face-pyramid centre - cellCtrs[nei[facei]] += pyr3Vol*pc; + // Accumulate volume-weighted tet centre + cellCtrs[nei[faceI]] += tetVol*tpr.centre(); - // Accumulate face-pyramid volume - cellVols[nei[facei]] += pyr3Vol; + // Accumulate tet volume + cellVols[nei[faceI]] += tetVol; + } + else + { + forAll(f, pI) + { + tetPointRef tpr + ( + allPoints[f[pI]], + allPoints[f.nextLabel(pI)], + fCtrs[faceI], + cEst[nei[faceI]] + ); + + scalar tetVol = tpr.mag(); + + // Accumulate volume-weighted tet centre + cellCtrs[nei[faceI]] += tetVol*tpr.centre(); + + // Accumulate tet volume + cellVols[nei[faceI]] += tetVol; + } + } } cellCtrs /= cellVols + VSMALL; - cellVols *= (1.0/3.0); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H index 832993a19..cf02efd92 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H @@ -138,6 +138,9 @@ public: //- Return volume inline scalar mag() const; + //- Return centre + inline vector centre() const; + //- Return circum-centre inline vector circumCentre() const; diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H index 9ffce00f7..31cba4f77 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H @@ -133,6 +133,13 @@ inline scalar tetrahedron::mag() const } +template +inline vector tetrahedron::centre() const +{ + return 0.25*(a_ + b_ + c_ + d_); +} + + template inline vector tetrahedron::circumCentre() const { diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C index af510206a..5a76bb4ea 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C @@ -277,9 +277,13 @@ void Foam::enrichedPatch::calcCutFaces() const FatalErrorIn("void enrichedPatch::calcCutFaces() const") << "Cannot determine best atan point. " << "Doing face: " << curGlobalFace - << " Cur point: " << mp[curPointLabel] - << " Next points: " - << IndirectList