From ce7cc3a7449414ccae992feef948f739bb1c0324 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Thu, 17 Nov 2016 08:52:15 +0000 Subject: [PATCH] ENH: Wave code tidying --- integration/OpenCFD/code/waveBCs/Make/options | 1 - ...sorptionOutletVelocityFvPatchVectorField.C | 36 +++--------------- ...sorptionOutletVelocityFvPatchVectorField.H | 11 +----- .../waveInletAlphaFvPatchScalarField.C | 37 +++---------------- .../waveInletAlphaFvPatchScalarField.H | 9 ----- .../waveInletVelocityFvPatchVectorField.C | 37 +++---------------- .../waveInletVelocityFvPatchVectorField.H | 9 ----- .../OpenCFD/code/waveModel/Make/options | 1 - .../waveAbsorptionModel/waveAbsorptionModel.H | 1 + .../base/regularWaveModel/regularWaveModel.H | 1 + 10 files changed, 21 insertions(+), 122 deletions(-) diff --git a/integration/OpenCFD/code/waveBCs/Make/options b/integration/OpenCFD/code/waveBCs/Make/options index 0490e0a2c6..dac0999deb 100644 --- a/integration/OpenCFD/code/waveBCs/Make/options +++ b/integration/OpenCFD/code/waveBCs/Make/options @@ -1,7 +1,6 @@ DEV_PATH = .. EXE_INC = \ - -DFULLDEBUG -g -O0 \ -I$(DEV_PATH)/waveModel/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude diff --git a/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.C b/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.C index e9c8107ff4..e4a462c001 100644 --- a/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.C +++ b/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.C @@ -26,26 +26,7 @@ License #include "waveAbsorptionOutletVelocityFvPatchVectorField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" - -Foam::waveModel& -Foam::waveAbsorptionOutletVelocityFvPatchVectorField::getWaveModel() -{ - // Return waveModel from database if present, or create - - if (!waveModel_.valid()) - { - waveModel_ = - waveModel::lookupOrCreate - ( - patch().patch(), - internalField().mesh(), - waveDictName_ - ); - } - - return waveModel_.ref(); -} - +#include "waveModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -57,8 +38,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF), - waveDictName_(waveModel::dictName), - waveModelPtr_() + waveDictName_(waveModel::dictName) {} @@ -72,8 +52,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf, p, iF, mapper), - waveDictName_(ptf.waveDictName_), - waveModelPtr_() + waveDictName_(ptf.waveDictName_) {} @@ -86,8 +65,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF, dict), - waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)), - waveModelPtr_() + waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)) {} @@ -98,8 +76,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf), - waveDictName_(ptf.waveDictName_), - waveModelPtr_() + waveDictName_(ptf.waveDictName_) {} @@ -111,8 +88,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf, iF), - waveDictName_(ptf.waveDictName_), - waveModelPtr_() + waveDictName_(ptf.waveDictName_) {} diff --git a/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.H b/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.H index 1f050ce6f8..d797e8017c 100644 --- a/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.H +++ b/integration/OpenCFD/code/waveBCs/waveAbsorptionOutletVelocity/waveAbsorptionOutletVelocityFvPatchVectorField.H @@ -32,7 +32,6 @@ Description type waveAbsorptionOutletVelocity; waveDict wavesDict; value uniform (0 0 0); - leftORright 1.0; } \endverbatim @@ -40,8 +39,7 @@ Usage \table Property | Description | Required | Default value type | type: waveAbsorptionOutletVelocity | yes | - waveDict | Dictionary where variables for generation/absorption are defined | yes | waveDict - leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1 + waveDict | Dictionary specifying wave variables | no | waveProperties \endtable Note @@ -58,7 +56,6 @@ SourceFiles #define waveAbsorptionOutletVelocityFvPatchVectorField_H #include "fixedValueFvPatchFields.H" -#include "waveModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,12 +74,6 @@ class waveAbsorptionOutletVelocityFvPatchVectorField //- Dictionary name word waveDictName_; - //- Pointer to the wave model - tmp waveModel_; - - //- Help function to retrieve the wave model - waveModel& getWaveModel(); - public: diff --git a/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.C b/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.C index b9d27cf73f..3dd4e5bcd8 100644 --- a/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.C +++ b/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.C @@ -26,27 +26,7 @@ License #include "waveInletAlphaFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -Foam::waveModel& Foam::waveInletAlphaFvPatchScalarField::getWaveModel() -{ - // Return waveModel from database if present, or create - - if (!waveModel_.valid()) - { - waveModel_ = - waveModel::lookupOrCreate - ( - patch().patch(), - internalField().mesh(), - waveDictName_ - ); - } - - return waveModel_.ref(); -} - +#include "waveModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -57,8 +37,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField ) : fixedValueFvPatchField(p, iF), - waveDictName_(waveModel::dictName), - waveModel_() + waveDictName_(waveModel::dictName) {} @@ -71,8 +50,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField ) : fixedValueFvPatchField(ptf, p, iF, mapper), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} @@ -84,8 +62,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField ) : fixedValueFvPatchField(p, iF, dict), - waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)), - waveModel_() + waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)) {} @@ -95,8 +72,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField ) : fixedValueFvPatchField(ptf), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} @@ -107,8 +83,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField ) : fixedValueFvPatchField(ptf, iF), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} diff --git a/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.H b/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.H index b654bd60c8..eb84795be1 100644 --- a/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.H +++ b/integration/OpenCFD/code/waveBCs/waveInletAlpha/waveInletAlphaFvPatchScalarField.H @@ -32,7 +32,6 @@ Description { type waveInletAlpha; value uniform (0 0 0); - leftORright 1.0; } \endverbatim @@ -41,7 +40,6 @@ Usage Property | Description | Required | Default value type | type: waveInletAlpha | yes | waveDict | Dictionary specifying wave variables | no | waveProperties - leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1 \endtable Note @@ -58,7 +56,6 @@ SourceFiles #define waveInletAlphaFvPatchScalarField_H #include "fixedValueFvPatchFields.H" -#include "waveModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,12 +74,6 @@ class waveInletAlphaFvPatchScalarField //- Dictionary name word waveDictName_; - //- Pointer to the wave model - tmp waveModel_; - - //- Help function to retrieve the wave model - waveModel& getWaveModel(); - public: diff --git a/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.C b/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.C index 78df5763ed..5c36dc49d9 100644 --- a/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.C +++ b/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.C @@ -26,27 +26,7 @@ License #include "waveInletVelocityFvPatchVectorField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -Foam::waveModel& Foam::waveInletVelocityFvPatchVectorField::getWaveModel() -{ - // Return waveModel from database if present, or create - - if (!waveModel_.valid()) - { - waveModel_ = - waveModel::lookupOrCreate - ( - patch().patch(), - internalField().mesh(), - waveDictName_ - ); - } - - return waveModel_.ref(); -} - +#include "waveModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -57,8 +37,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF), - waveDictName_(waveModel::dictName), - waveModel_() + waveDictName_(waveModel::dictName) {} @@ -71,8 +50,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf, p, iF, mapper), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} @@ -84,8 +62,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF, dict), - waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)), - waveModel_() + waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)) {} @@ -95,8 +72,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} @@ -107,8 +83,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(ptf, iF), - waveDictName_(ptf.waveDictName_), - waveModel_() + waveDictName_(ptf.waveDictName_) {} diff --git a/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.H b/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.H index faa42bee7b..1356702d9d 100644 --- a/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.H +++ b/integration/OpenCFD/code/waveBCs/waveInletVelocity/waveInletVelocityFvPatchVectorField.H @@ -31,7 +31,6 @@ Description { type waveInletVelocity; value uniform (0 0 0); - leftORright 1.0; } \endverbatim @@ -40,7 +39,6 @@ Usage Property | Description | Required | Default value type | type: waveInletVelocity | yes | waveDict | Dictionary specifying wave variables | no | waveProperties - leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1 \endtable Note @@ -57,7 +55,6 @@ SourceFiles #define waveInletVelocityFvPatchVectorField_H #include "fixedValueFvPatchFields.H" -#include "waveModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -76,12 +73,6 @@ class waveInletVelocityFvPatchVectorField //- Dictionary name word waveDictName_; - //- Pointer to the wave model - tmp waveModel_; - - //- Help function to retrieve the wave model - waveModel& getWaveModel(); - public: diff --git a/integration/OpenCFD/code/waveModel/Make/options b/integration/OpenCFD/code/waveModel/Make/options index 856294218d..71b7873964 100644 --- a/integration/OpenCFD/code/waveModel/Make/options +++ b/integration/OpenCFD/code/waveModel/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - -DFULLDEBUG -g -O0 \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ diff --git a/integration/OpenCFD/code/waveModel/waveAbsorptionModels/base/waveAbsorptionModel/waveAbsorptionModel.H b/integration/OpenCFD/code/waveModel/waveAbsorptionModels/base/waveAbsorptionModel/waveAbsorptionModel.H index 0f60c8c778..ec49892696 100644 --- a/integration/OpenCFD/code/waveModel/waveAbsorptionModels/base/waveAbsorptionModel/waveAbsorptionModel.H +++ b/integration/OpenCFD/code/waveModel/waveAbsorptionModels/base/waveAbsorptionModel/waveAbsorptionModel.H @@ -76,6 +76,7 @@ public: //- Destructor virtual ~waveAbsorptionModel(); + // Public Member Functions //- Read from dictionary diff --git a/integration/OpenCFD/code/waveModel/waveGenerationModels/base/regularWaveModel/regularWaveModel.H b/integration/OpenCFD/code/waveModel/waveGenerationModels/base/regularWaveModel/regularWaveModel.H index 64404b9f46..fe7f192287 100644 --- a/integration/OpenCFD/code/waveModel/waveGenerationModels/base/regularWaveModel/regularWaveModel.H +++ b/integration/OpenCFD/code/waveModel/waveGenerationModels/base/regularWaveModel/regularWaveModel.H @@ -70,6 +70,7 @@ protected: //- Wave phase scalar wavePhase_; + // Protected Member Functions //- Return word description of wave type