diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake index 8f1133699c..421f05ab35 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x wmake libso phaseModel -wmake libso interfacialModels wmake libso multiphaseSystem +wmake libso interfacialModels wmake libso kineticTheoryModels wmake diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options index 8fc20e8623..d4cfc30136 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -ggdb3 \ -IphaseModel/lnInclude \ -ImultiphaseSystem/lnInclude \ /*-IkineticTheoryModels/lnInclude*/ \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index 1ee149c48e..1d12ba871d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -33,7 +33,7 @@ forAllIter(PtrDictionary, fluid.phases(), iter) + (alpha/phase.rho())*fluid.Svm(phase) ) ); - mrfZones.addCoriolis(alpha, UEqns[phasei]); + mrfZones.addCoriolis(UEqns[phasei]); UEqns[phasei].relax(); phasei++; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options index 231ff8a2ce..e956bfdc91 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -ggdb3 \ -I../phaseModel/lnInclude \ -I../interfacialModels/lnInclude \ -IalphaContactAngle \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 3382504153..fc4351037b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -56,6 +56,9 @@ void Foam::multiphaseSystem::calcAlphas() void Foam::multiphaseSystem::solveAlphas() { + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + surfaceScalarField phic(mag(phi_/mesh_.magSf())); PtrList phiAlphaCorrs(phases_.size()); @@ -64,7 +67,6 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary, phases_, iter) { phaseModel& phase1 = iter(); - volScalarField& alpha1 = phase1; phase1.phiAlpha() = dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); @@ -78,7 +80,7 @@ void Foam::multiphaseSystem::solveAlphas() ( phi_, phase1, - "div(phi," + alpha1.name() + ')' + alphaScheme ) ) ); @@ -88,7 +90,6 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary, phases_, iter2) { phaseModel& phase2 = iter2(); - volScalarField& alpha2 = phase2; if (&phase2 == &phase1) continue; @@ -99,16 +100,11 @@ void Foam::multiphaseSystem::solveAlphas() *nHatf(phase1, phase2) ); - word phirScheme - ( - "div(phir," + alpha2.name() + ',' + alpha1.name() + ')' - ); - phiAlphaCorr += fvc::flux ( - -fvc::flux(-phir, phase2, phirScheme), + -fvc::flux(-phir, phase2, alpharScheme), phase1, - phirScheme + alpharScheme ); } diff --git a/applications/test/directMappedPatch/Make/files b/applications/test/directMappedPatch/Make/files deleted file mode 100644 index d33cd29958..0000000000 --- a/applications/test/directMappedPatch/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-DirectMappedPatch.C - -EXE = $(FOAM_USER_APPBIN)/Test-DirectMappedPatch diff --git a/applications/test/mappedPatch/Make/files b/applications/test/mappedPatch/Make/files new file mode 100644 index 0000000000..468940aaec --- /dev/null +++ b/applications/test/mappedPatch/Make/files @@ -0,0 +1,3 @@ +Test-MappedPatch.C + +EXE = $(FOAM_USER_APPBIN)/Test-MappedPatch diff --git a/applications/test/directMappedPatch/Make/options b/applications/test/mappedPatch/Make/options similarity index 100% rename from applications/test/directMappedPatch/Make/options rename to applications/test/mappedPatch/Make/options diff --git a/applications/test/directMappedPatch/Test-DirectMappedPatch.C b/applications/test/mappedPatch/Test-MappedPatch.C similarity index 84% rename from applications/test/directMappedPatch/Test-DirectMappedPatch.C rename to applications/test/mappedPatch/Test-MappedPatch.C index 87d937da11..9f0258dfec 100644 --- a/applications/test/directMappedPatch/Test-DirectMappedPatch.C +++ b/applications/test/mappedPatch/Test-MappedPatch.C @@ -22,10 +22,10 @@ License along with OpenFOAM. If not, see . Application - testDirectMappedPatch + testMappedPatch Description - Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()). + Test mapped b.c. by mapping face centres (mesh.C().boundaryField()). \*---------------------------------------------------------------------------*/ @@ -37,7 +37,8 @@ Description #include "Time.H" #include "OFstream.H" #include "volFields.H" -#include "directMappedFixedValueFvPatchFields.H" +#include "mappedPolyPatch.H" +#include "mappedFixedValueFvPatchFields.H" using namespace Foam; @@ -48,10 +49,10 @@ using namespace Foam; int main(int argc, char *argv[]) { -# include "addTimeOptions.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" + #include "addTimeOptions.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" wordList patchFieldTypes ( @@ -61,10 +62,10 @@ int main(int argc, char *argv[]) forAll(mesh.boundaryMesh(), patchI) { - if (isA(mesh.boundaryMesh()[patchI])) + if (isA(mesh.boundaryMesh()[patchI])) { patchFieldTypes[patchI] = - directMappedFixedValueFvPatchVectorField::typeName; + mappedFixedValueFvPatchVectorField::typeName; } } @@ -92,13 +93,13 @@ int main(int argc, char *argv[]) { if ( - isA + isA ( cc.boundaryField()[patchI] ) ) { - Pout<< "Detected a directMapped patch:" << patchI << endl; + Pout<< "Detected a mapped patch:" << patchI << endl; OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj"); Pout<< "Writing mapped values to " << str.name() << endl; diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 7a72591095..853752239b 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -27,9 +27,9 @@ Description - used to e.g. extrude baffles (extrude internal faces) or create liquid film regions. - if extruding internal faces: - - create baffles in original mesh with directMappedWall patches + - create baffles in original mesh with mappedWall patches - if extruding boundary faces: - - convert boundary faces to directMappedWall patches + - convert boundary faces to mappedWall patches - extrude edges of faceZone as a \_sidePatch - extrude edges inbetween different faceZones as a (nonuniformTransform)cyclic \_\ @@ -68,9 +68,9 @@ into the space of the neighbour: | | +-------------+ - BBB=directMapped between owner on original mesh and new extrusion. + BBB=mapped between owner on original mesh and new extrusion. (zero offset) - CCC=directMapped between neighbour on original mesh and new extrusion + CCC=mapped between neighbour on original mesh and new extrusion (offset due to the thickness of the extruded mesh) For the case of flipMap the extrusion is the other way around: from the @@ -98,7 +98,7 @@ becomes | | +-----------+ - BBB=directMapped between original mesh and new extrusion + BBB=mapped between original mesh and new extrusion CCC=polypatch @@ -126,7 +126,7 @@ Usage #include "patchPointEdgeCirculator.H" #include "OFstream.H" #include "meshTools.H" -#include "directMappedWallPolyPatch.H" +#include "mappedWallPolyPatch.H" #include "createShellMesh.H" #include "volFields.H" #include "surfaceFields.H" @@ -1122,7 +1122,7 @@ int main(int argc, char *argv[]) // Check whether the zone is internal or external faces to determine // what patch type to insert. Cannot be mixed - // since then how to couple? - directMapped only valid for a whole patch. + // since then how to couple? - mapped only valid for a whole patch. boolList isInternal(zoneIDs.size(), false); forAll(zoneIDs, i) { @@ -1174,7 +1174,7 @@ int main(int argc, char *argv[]) if (isInternal[i]) { - interRegionTopPatch[i] = addPatch + interRegionTopPatch[i] = addPatch ( mesh, interName + "_top" @@ -1185,7 +1185,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName + "_bottom" @@ -1209,7 +1209,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName @@ -1222,7 +1222,7 @@ int main(int argc, char *argv[]) } else if (zoneShadowNames.size() > 0) //patch using shadow face zones. { - interRegionTopPatch[i] = addPatch + interRegionTopPatch[i] = addPatch ( mesh, zoneShadowNames[i] + "_top" @@ -1233,7 +1233,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName @@ -1661,7 +1661,7 @@ int main(int argc, char *argv[]) if ( - isA(pp) + isA(pp) && (findIndex(interRegionTopPatch, patchI) != -1) ) { @@ -1669,14 +1669,14 @@ int main(int argc, char *argv[]) topOffsets[index] = calcOffset(extrudePatch, extruder, pp); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, regionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + mappedPatchBase::NEARESTPATCHFACE,// sampleMode pp.name(), // samplePatch topOffsets[index], // offset patches @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[]) } else if ( - isA(pp) + isA(pp) && (findIndex(interRegionBottomPatch, patchI) != -1) ) { @@ -1692,14 +1692,14 @@ int main(int argc, char *argv[]) bottomOffsets[index] = calcOffset(extrudePatch, extruder, pp); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, regionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + mappedPatchBase::NEARESTPATCHFACE,// sampleMode pp.name(), // samplePatch bottomOffsets[index], // offset patches @@ -1985,19 +1985,19 @@ int main(int argc, char *argv[]) if ( - isA(pp) + isA(pp) && (findIndex(interRegionTopPatch, patchI) != -1) ) { label index = findIndex(interRegionTopPatch, patchI); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, shellRegionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + mappedPatchBase::NEARESTPATCHFACE,// sampleMode pp.name(), // samplePatch -topOffsets[index], // offset patches @@ -2005,20 +2005,20 @@ int main(int argc, char *argv[]) } else if ( - isA(pp) + isA(pp) && (findIndex(interRegionBottomPatch, patchI) != -1) ) { label index = findIndex(interRegionBottomPatch, patchI); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, shellRegionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + mappedPatchBase::NEARESTPATCHFACE,// sampleMode pp.name(), // samplePatch -bottomOffsets[index], // offset patches diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict index 6f65c1cff1..7aa652fb79 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict @@ -23,13 +23,13 @@ faceZones (f0); // FaceZone shadow //faceZonesShadow (fBaffleShadow); -// Adapt the original mesh to have directMapped patches at where the +// Adapt the original mesh to have mapped patches at where the // faceZones are? // If true: -// - extruding internal faces: become baffles on directMapped patches -// - extruding boundary faces: repatched to be on directMapped patches +// - extruding internal faces: become baffles on mapped patches +// - extruding boundary faces: repatched to be on mapped patches // If false: leave original mesh intact. Extruded mesh will still have -// directMapped patch which might need to be adapted. +// mapped patch which might need to be adapted. adaptMesh true; // Extrude 1D-columns of cells? diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index b80fde8654..5ce408d305 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -36,7 +36,7 @@ Description Output is: - volScalarField with regions as different scalars (-detectOnly) or - - mesh with multiple regions and directMapped patches. These patches + - mesh with multiple regions and mapped patches. These patches either cover the whole interface between two region (default) or only part according to faceZones (-useFaceZones) or @@ -57,7 +57,7 @@ Description - Should work in parallel. cellZones can differ on either side of processor boundaries in which case - the faces get moved from processor patch to directMapped patch. Not + the faces get moved from processor patch to mapped patch. Not very well tested. - If a cell zone gets split into more than one region it can detect @@ -94,7 +94,7 @@ Description #include "EdgeMap.H" #include "syncTools.H" #include "ReadFields.H" -#include "directMappedWallPolyPatch.H" +#include "mappedWallPolyPatch.H" #include "zeroGradientFvPatchFields.H" using namespace Foam; @@ -1260,14 +1260,14 @@ labelList addRegionPatches // << " trying to add patches " << names << endl; - directMappedWallPolyPatch patch1 + mappedWallPolyPatch patch1 ( names[0], 0, // overridden 0, // overridden 0, // overridden regionNames[e[1]], // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE, + mappedPatchBase::NEARESTPATCHFACE, names[1], // samplePatch point::zero, // offset mesh.boundaryMesh() @@ -1275,14 +1275,14 @@ labelList addRegionPatches interfacePatches[interI] = addPatch(mesh, patch1); - directMappedWallPolyPatch patch2 + mappedWallPolyPatch patch2 ( names[1], 0, 0, 0, regionNames[e[0]], // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE, + mappedPatchBase::NEARESTPATCHFACE, names[0], point::zero, // offset mesh.boundaryMesh() diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionaryDict b/applications/utilities/preProcessing/changeDictionary/changeDictionaryDict index 0e6d9453d2..34a2be07d2 100644 --- a/applications/utilities/preProcessing/changeDictionary/changeDictionaryDict +++ b/applications/utilities/preProcessing/changeDictionary/changeDictionaryDict @@ -20,7 +20,7 @@ dictionaryReplacement { ".*" { - type directMappedPatch; + type mappedPatch; } } diff --git a/etc/controlDict b/etc/controlDict index 2ff1bfc4e4..c367f5d853 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -393,9 +393,9 @@ DebugSwitches diagonal 0; dictionary 0; dimensionSet 1; - directMappedBase 0; - directMappedPatch 0; - directMappedVelocityFlux 0; + mappedBase 0; + mappedPatch 0; + mappedVelocityFlux 0; directionMixed 0; directional 0; disallowGenericFvPatchField 0; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index ba4f80b0bb..e81819706f 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -30,8 +30,6 @@ derivedFvPatches = $(fvPatches)/derived $(derivedFvPatches)/wall/wallFvPatch.C $(derivedFvPatches)/mapped/mappedFvPatch.C $(derivedFvPatches)/mapped/mappedWallFvPatch.C -$(derivedFvPatches)/directMapped/directMappedFvPatch.C -$(derivedFvPatches)/directMapped/directMappedWallFvPatch.C wallDist = fvMesh/wallDist $(wallDist)/wallPointYPlus/wallPointYPlus.C @@ -123,16 +121,13 @@ $(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C $(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C $(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/directMappedField/directMappedFieldFvPatchFields.C -$(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C -$(derivedFvPatchFields)/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C +$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C +$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C +$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C @@ -156,7 +151,7 @@ $(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocit $(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C -$(derivedFvPatchFields)/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.C +$(derivedFvPatchFields)/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/slip/slipFvPatchFields.C $(derivedFvPatchFields)/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C deleted file mode 100644 index 1f4e77192c..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C +++ /dev/null @@ -1,321 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFieldFvPatchField.H" - -#include "volFields.H" -#include "interpolationCell.H" -#include "mapDistribute.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const fvPatch& p, - const DimensionedField& iF -) -: - directMappedPatchBase(p.patch()), - fixedValueFvPatchField(p, iF), - fieldName_(iF.name()), - setAverage_(false), - average_(pTraits::zero) -{} - - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const directMappedFieldFvPatchField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - directMappedPatchBase(p.patch(), ptf), - fixedValueFvPatchField(ptf, p, iF, mapper), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_) -{} - - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - directMappedPatchBase(p.patch(), dict), - fixedValueFvPatchField(p, iF, dict), - fieldName_(dict.template lookupOrDefault("fieldName", iF.name())), - setAverage_(readBool(dict.lookup("setAverage"))), - average_(pTraits(dict.lookup("average"))) -{} - - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - - // directMappedPatchBase - const word& sampleRegion, - const sampleMode sampleMode, - const word& samplePatch, - const scalar distance, - - // My settings - const word& fieldName, - const bool setAverage, - const Type average -) -: - directMappedPatchBase - ( - p.patch(), - sampleRegion, - sampleMode, - samplePatch, - distance - ), - fixedValueFvPatchField(p, iF), - fieldName_(fieldName), - setAverage_(setAverage), - average_(average) -{} - - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const directMappedFieldFvPatchField& ptf -) -: - directMappedPatchBase(ptf.patch().patch(), ptf), - fixedValueFvPatchField(ptf), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_) -{} - - -template -directMappedFieldFvPatchField::directMappedFieldFvPatchField -( - const directMappedFieldFvPatchField& ptf, - const DimensionedField& iF -) -: - directMappedPatchBase(ptf.patch().patch(), ptf), - fixedValueFvPatchField(ptf, iF), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -const GeometricField& -directMappedFieldFvPatchField::sampleField() const -{ - typedef GeometricField fieldType; - - const fvMesh& nbrMesh = refCast(sampleMesh()); - - if (sameRegion()) - { - if (fieldName_ == this->dimensionedInternalField().name()) - { - // Optimisation: bypass field lookup - return - dynamic_cast - ( - this->dimensionedInternalField() - ); - } - else - { - const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); - return thisMesh.template lookupObject(fieldName_); - } - } - else - { - return nbrMesh.template lookupObject(fieldName_); - } -} - - -template -void directMappedFieldFvPatchField::updateCoeffs() -{ - if (this->updated()) - { - return; - } - - typedef GeometricField fieldType; - - // Since we're inside initEvaluate/evaluate there might be processor - // comms underway. Change the tag we use. - int oldTag = UPstream::msgType(); - UPstream::msgType() = oldTag+1; - - const fvMesh& nbrMesh = refCast(sampleMesh()); - const mapDistribute& distMap = directMappedPatchBase::map(); - - // Result of obtaining remote values - Field newValues; - - switch (mode()) - { - case NEARESTCELL: - { - newValues = sampleField(); - - distMap.distribute(newValues); - - break; - } - case NEARESTPATCHFACE: - { - const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID - ( - samplePatch() - ); - if (nbrPatchID < 0) - { - FatalErrorIn - ( - "void directMappedFieldFvPatchField::updateCoeffs()" - )<< "Unable to find sample patch " << samplePatch() - << " in region " << sampleRegion() - << " for patch " << this->patch().name() << nl - << abort(FatalError); - } - - const fieldType& nbrField = sampleField(); - - newValues = nbrField.boundaryField()[nbrPatchID]; - distMap.distribute(newValues); - - break; - } - case NEARESTFACE: - { - Field allValues(nbrMesh.nFaces(), pTraits::zero); - - const fieldType& nbrField = sampleField(); - - forAll(nbrField.boundaryField(), patchI) - { - const fvPatchField& pf = - nbrField.boundaryField()[patchI]; - label faceStart = pf.patch().patch().start(); - - forAll(pf, faceI) - { - allValues[faceStart++] = pf[faceI]; - } - } - - distMap.distribute(allValues); - - newValues.transfer(allValues); - - break; - } - default: - { - FatalErrorIn("directMappedFieldFvPatchField::updateCoeffs()") - << "Unknown sampling mode: " << mode() - << nl << abort(FatalError); - } - } - - if (setAverage_) - { - Type averagePsi = - gSum(this->patch().magSf()*newValues) - /gSum(this->patch().magSf()); - - if (mag(averagePsi)/mag(average_) > 0.5) - { - newValues *= mag(average_)/mag(averagePsi); - } - else - { - newValues += (average_ - averagePsi); - } - } - - this->operator==(newValues); - - if (debug) - { - Info<< "operating on field:" << this->dimensionedInternalField().name() - << " patch:" << this->patch().name() - << " avg:" << gAverage(*this) - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << endl; - } - - // Restore tag - UPstream::msgType() = oldTag; - - fixedValueFvPatchField::updateCoeffs(); -} - - -template -void directMappedFieldFvPatchField::write(Ostream& os) const -{ - fvPatchField::write(os); - directMappedPatchBase::write(os); - os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl; - os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; - os.writeKeyword("average") << average_ << token::END_STATEMENT << nl; - this->writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.H deleted file mode 100644 index 5ad1c3586b..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.H +++ /dev/null @@ -1,201 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedFieldFvPatchField - -Description - Self-contained version of directMapped. Does not use information on - patch, instead holds it locally (and possibly duplicate) so use - normal directMapped in preference and only use this if you cannot - change the underlying patch type to directMapped. - -SourceFiles - directMappedFieldFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFieldFvPatchField_H -#define directMappedFieldFvPatchField_H - -#include "directMappedPatchBase.H" -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFieldFvPatchField Declaration -\*---------------------------------------------------------------------------*/ - -template -class directMappedFieldFvPatchField -: - public directMappedPatchBase, - public fixedValueFvPatchField -{ - // Private data - - //- Name of field to sample - defaults to field associated with this - // patchField if not specified - word fieldName_; - - //- If true adjust the mapped field to maintain average value average_ - const bool setAverage_; - - //- Average value the mapped field is adjusted to maintain if - // setAverage_ is set true - const Type average_; - - - // Private Member Functions - - //- Field to sample. Either on my or nbr mesh - const GeometricField& sampleField() const; - - -public: - - //- Runtime type information - TypeName("directMappedField"); - - - // Constructors - - //- Construct from patch and internal field - directMappedFieldFvPatchField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - directMappedFieldFvPatchField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct from patch, internal field and distance for normal type - // sampling - directMappedFieldFvPatchField - ( - const fvPatch&, - const DimensionedField&, - - // directMappedPatchBase - const word& sampleRegion, - const sampleMode sampleMode, - const word& samplePatch, - const scalar distance, - - // My settings - const word& fieldName, - const bool setAverage, - const Type average - ); - - //- Construct by mapping given - // directMappedFieldFvPatchField - // onto a new patch - directMappedFieldFvPatchField - ( - const directMappedFieldFvPatchField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - directMappedFieldFvPatchField - ( - const directMappedFieldFvPatchField& - ); - - //- Construct and return a clone - virtual tmp > clone() const - { - return tmp > - ( - new directMappedFieldFvPatchField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - directMappedFieldFvPatchField - ( - const directMappedFieldFvPatchField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp > clone - ( - const DimensionedField& iF - ) const - { - return tmp > - ( - new directMappedFieldFvPatchField - ( - *this, - iF - ) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "directMappedFieldFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.H deleted file mode 100644 index 5aff671827..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFieldFvPatchFields_H -#define directMappedFieldFvPatchFields_H - -#include "directMappedFieldFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedField) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C deleted file mode 100644 index 177fbbe428..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C +++ /dev/null @@ -1,161 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedInternalValueFvPatchField.H" -#include "UIndirectList.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::directMappedFixedInternalValueFvPatchField:: -directMappedFixedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF -) -: - directMappedFixedValueFvPatchField(p, iF) -{} - - -template -Foam::directMappedFixedInternalValueFvPatchField:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - directMappedFixedValueFvPatchField(ptf, p, iF, mapper) -{} - - -template -Foam::directMappedFixedInternalValueFvPatchField:: -directMappedFixedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - directMappedFixedValueFvPatchField(p, iF, dict) -{} - - -template -Foam::directMappedFixedInternalValueFvPatchField:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField& ptf -) -: - directMappedFixedValueFvPatchField(ptf) -{} - - -template -Foam::directMappedFixedInternalValueFvPatchField:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField& ptf, - const DimensionedField& iF -) -: - directMappedFixedValueFvPatchField(ptf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::directMappedFixedInternalValueFvPatchField::updateCoeffs() -{ - typedef GeometricField FieldType; - - if (this->updated()) - { - return; - } - - // Since we're inside initEvaluate/evaluate there might be processor - // comms underway. Change the tag we use. - int oldTag = UPstream::msgType(); - UPstream::msgType() = oldTag+1; - - // Retrieve the neighbour values and assign to this patch boundary field - directMappedFixedValueFvPatchField::updateCoeffs(); - - // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = - refCast(this->patch().patch()); - const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); - const label samplePatchI = mpp.samplePolyPatch().index(); - const fvPatch& nbrPatch = nbrMesh.boundary()[samplePatchI]; - - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - - // Retrieve the neighbour field - const fvPatchField& nbrField = - nbrPatch.template lookupPatchField - ( - this->dimensionedInternalField().name() - ); - - // Retrieve the neighbour patch internal field - Field nbrIntFld(nbrField.patchInternalField()); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrIntFld - ); - - // Restore tag - UPstream::msgType() = oldTag; - - // Assign (this) patch internal field to its neighbour values - Field& intFld = const_cast&>(this->internalField()); - UIndirectList(intFld, this->patch().faceCells()) = nbrIntFld; -} - - -template -void Foam::directMappedFixedInternalValueFvPatchField::write -( - Ostream& os -) const -{ - directMappedFixedValueFvPatchField::write(os); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C deleted file mode 100644 index 5a172b9b82..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedInternalValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(directMappedFixedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H deleted file mode 100644 index 60037bcc66..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedInternalValueFvPatchFields_H -#define directMappedFixedInternalValueFvPatchFields_H - -#include "directMappedFixedInternalValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H deleted file mode 100644 index 503f590140..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H -#define directMappedFixedInternalValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template class directMappedFixedInternalValueFvPatchField; - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C deleted file mode 100644 index 062cdf051b..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C +++ /dev/null @@ -1,125 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedPushedInternalValueFvPatchField.H" -#include "UIndirectList.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::directMappedFixedPushedInternalValueFvPatchField:: -directMappedFixedPushedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF -) -: - directMappedFixedValueFvPatchField(p, iF) -{} - - -template -Foam::directMappedFixedPushedInternalValueFvPatchField:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - directMappedFixedValueFvPatchField(ptf, p, iF, mapper) -{} - - -template -Foam::directMappedFixedPushedInternalValueFvPatchField:: -directMappedFixedPushedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - directMappedFixedValueFvPatchField(p, iF, dict) -{} - - -template -Foam::directMappedFixedPushedInternalValueFvPatchField:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField& ptf -) -: - directMappedFixedValueFvPatchField(ptf) -{} - - -template -Foam::directMappedFixedPushedInternalValueFvPatchField:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField& ptf, - const DimensionedField& iF -) -: - directMappedFixedValueFvPatchField(ptf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void -Foam::directMappedFixedPushedInternalValueFvPatchField::updateCoeffs() -{ - typedef GeometricField FieldType; - - if (this->updated()) - { - return; - } - - // Retrieve the neighbour values and assign to this patch boundary field - directMappedFixedValueFvPatchField::updateCoeffs(); - - // Assign the patch internal field to its boundary value - Field& intFld = const_cast&>(this->internalField()); - UIndirectList(intFld, this->patch().faceCells()) = *this; -} - - -template -void Foam::directMappedFixedPushedInternalValueFvPatchField::write -( - Ostream& os -) const -{ - directMappedFixedValueFvPatchField::write(os); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H deleted file mode 100644 index 525ca2f97e..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H +++ /dev/null @@ -1,157 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedFixedPushedInternalValueFvPatchField - -Description - Recycles the boundary values of a neighbour patch field to the boundary - and internal values of *this. - -SourceFiles - directMappedFixedPushedInternalValueFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchField_H -#define directMappedFixedPushedInternalValueFvPatchField_H - -#include "directMappedFixedValueFvPatchField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFixedPushedInternalValueFvPatchField Declaration -\*---------------------------------------------------------------------------*/ - -template -class directMappedFixedPushedInternalValueFvPatchField -: - public directMappedFixedValueFvPatchField -{ - -public: - - //- Runtime type information - TypeName("directMappedFixedPushedInternalValue"); - - - // Constructors - - //- Construct from patch and internal field - directMappedFixedPushedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - directMappedFixedPushedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given a - // directMappedFixedPushedInternalValueFvPatchField onto a new patch - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField& - ); - - //- Construct and return a clone - virtual tmp > clone() const - { - return tmp > - ( - new directMappedFixedPushedInternalValueFvPatchField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp > clone - ( - const DimensionedField& iF - ) const - { - return tmp > - ( - new directMappedFixedPushedInternalValueFvPatchField - ( - *this, - iF - ) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "directMappedFixedPushedInternalValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C deleted file mode 100644 index c13c56997d..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedPushedInternalValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(directMappedFixedPushedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H deleted file mode 100644 index a5d2e1d3da..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchFields_H -#define directMappedFixedPushedInternalValueFvPatchFields_H - -#include "directMappedFixedPushedInternalValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H deleted file mode 100644 index 3ba546bc36..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchFieldsFwd_H -#define directMappedFixedPushedInternalValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template class directMappedFixedPushedInternalValueFvPatchField; - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C deleted file mode 100644 index 1b54303db6..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C +++ /dev/null @@ -1,396 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedValueFvPatchField.H" -#include "directMappedPatchBase.H" -#include "volFields.H" -#include "interpolationCell.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchField(p, iF), - fieldName_(iF.name()), - setAverage_(false), - average_(pTraits::zero), - interpolationScheme_(interpolationCell::typeName) -{} - - -template -directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField -( - const directMappedFixedValueFvPatchField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchField(ptf, p, iF, mapper), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_), - interpolationScheme_(ptf.interpolationScheme_) -{ - if (!isA(this->patch().patch())) - { - FatalErrorIn - ( - "directMappedFixedValueFvPatchField::" - "directMappedFixedValueFvPatchField\n" - "(\n" - " const directMappedFixedValueFvPatchField&,\n" - " const fvPatch&,\n" - " const Field&,\n" - " const fvPatchFieldMapper&\n" - ")\n" - ) << "\n patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" - << "\n for patch " << p.name() - << " of field " << this->dimensionedInternalField().name() - << " in file " << this->dimensionedInternalField().objectPath() - << exit(FatalError); - } -} - - -template -directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchField(p, iF, dict), - fieldName_(dict.lookupOrDefault("fieldName", iF.name())), - setAverage_(readBool(dict.lookup("setAverage"))), - average_(pTraits(dict.lookup("average"))), - interpolationScheme_(interpolationCell::typeName) -{ - if (!isA(this->patch().patch())) - { - FatalErrorIn - ( - "directMappedFixedValueFvPatchField::" - "directMappedFixedValueFvPatchField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" - << "\n for patch " << p.name() - << " of field " << this->dimensionedInternalField().name() - << " in file " << this->dimensionedInternalField().objectPath() - << exit(FatalError); - } - - const directMappedPatchBase& mpp = refCast - ( - directMappedFixedValueFvPatchField::patch().patch() - ); - if (mpp.mode() == directMappedPatchBase::NEARESTCELL) - { - dict.lookup("interpolationScheme") >> interpolationScheme_; - } -} - - -template -directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField -( - const directMappedFixedValueFvPatchField& ptf -) -: - fixedValueFvPatchField(ptf), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_), - interpolationScheme_(ptf.interpolationScheme_) -{} - - -template -directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField -( - const directMappedFixedValueFvPatchField& ptf, - const DimensionedField& iF -) -: - fixedValueFvPatchField(ptf, iF), - fieldName_(ptf.fieldName_), - setAverage_(ptf.setAverage_), - average_(ptf.average_), - interpolationScheme_(ptf.interpolationScheme_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -const GeometricField& -directMappedFixedValueFvPatchField::sampleField() const -{ - typedef GeometricField fieldType; - - const directMappedPatchBase& mpp = refCast - ( - directMappedFixedValueFvPatchField::patch().patch() - ); - const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); - - if (mpp.sameRegion()) - { - if (fieldName_ == this->dimensionedInternalField().name()) - { - // Optimisation: bypass field lookup - return - dynamic_cast - ( - this->dimensionedInternalField() - ); - } - else - { - const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); - return thisMesh.lookupObject(fieldName_); - } - } - else - { - return nbrMesh.lookupObject(fieldName_); - } -} - - -template -const interpolation& -directMappedFixedValueFvPatchField::interpolator() const -{ - if (!interpolator_.valid()) - { - interpolator_ = interpolation::New - ( - interpolationScheme_, - sampleField() - ); - } - return interpolator_(); -} - - -template -void directMappedFixedValueFvPatchField::updateCoeffs() -{ - if (this->updated()) - { - return; - } - - typedef GeometricField fieldType; - - // Since we're inside initEvaluate/evaluate there might be processor - // comms underway. Change the tag we use. - int oldTag = UPstream::msgType(); - UPstream::msgType() = oldTag+1; - - - // Get the scheduling information from the directMappedPatchBase - const directMappedPatchBase& mpp = refCast - ( - directMappedFixedValueFvPatchField::patch().patch() - ); - const mapDistribute& distMap = mpp.map(); - - const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); - const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); - - // Result of obtaining remote values - Field newValues; - - switch (mpp.mode()) - { - case directMappedPatchBase::NEARESTCELL: - { - if (interpolationScheme_ != interpolationCell::typeName) - { - // Send back sample points to the processor that holds the cell - vectorField samples(mpp.samplePoints()); - distMap.reverseDistribute - ( - (mpp.sameRegion() ? thisMesh.nCells() : nbrMesh.nCells()), - point::max, - samples - ); - - const interpolation& interp = interpolator(); - - newValues.setSize(samples.size(), pTraits::max); - forAll(samples, cellI) - { - if (samples[cellI] != point::max) - { - newValues[cellI] = interp.interpolate - ( - samples[cellI], - cellI - ); - } - } - } - else - { - newValues = sampleField(); - } - - distMap.distribute(newValues); - - break; - } - case directMappedPatchBase::NEARESTPATCHFACE: - { - const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID - ( - mpp.samplePatch() - ); - if (nbrPatchID < 0) - { - FatalErrorIn - ( - "void directMappedFixedValueFvPatchField::" - "updateCoeffs()" - )<< "Unable to find sample patch " << mpp.samplePatch() - << " in region " << mpp.sampleRegion() - << " for patch " << this->patch().name() << nl - << abort(FatalError); - } - - const fieldType& nbrField = sampleField(); - - newValues = nbrField.boundaryField()[nbrPatchID]; - distMap.distribute(newValues); - - break; - } - case directMappedPatchBase::NEARESTFACE: - { - Field allValues(nbrMesh.nFaces(), pTraits::zero); - - const fieldType& nbrField = sampleField(); - - forAll(nbrField.boundaryField(), patchI) - { - const fvPatchField& pf = - nbrField.boundaryField()[patchI]; - label faceStart = pf.patch().start(); - - forAll(pf, faceI) - { - allValues[faceStart++] = pf[faceI]; - } - } - - distMap.distribute(allValues); - newValues.transfer(allValues); - - break; - } - default: - { - FatalErrorIn - ( - "directMappedFixedValueFvPatchField::updateCoeffs()" - )<< "Unknown sampling mode: " << mpp.mode() - << nl << abort(FatalError); - } - } - - if (setAverage_) - { - Type averagePsi = - gSum(this->patch().magSf()*newValues) - /gSum(this->patch().magSf()); - - if (mag(averagePsi)/mag(average_) > 0.5) - { - newValues *= mag(average_)/mag(averagePsi); - } - else - { - newValues += (average_ - averagePsi); - } - } - - this->operator==(newValues); - - if (debug) - { - Info<< "directMapped on field:" - << this->dimensionedInternalField().name() - << " patch:" << this->patch().name() - << " avg:" << gAverage(*this) - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << endl; - } - - // Restore tag - UPstream::msgType() = oldTag; - - fixedValueFvPatchField::updateCoeffs(); -} - - -template -void directMappedFixedValueFvPatchField::write(Ostream& os) const -{ - fvPatchField::write(os); - os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl; - os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; - os.writeKeyword("average") << average_ << token::END_STATEMENT << nl; - os.writeKeyword("interpolationScheme") << interpolationScheme_ - << token::END_STATEMENT << nl; - this->writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.H deleted file mode 100644 index 408ffbfbc6..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.H +++ /dev/null @@ -1,193 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedFixedValueFvPatchField - -Description - Recycles the value at a set of cells or patch faces back to *this. Can not - sample internal faces (since volField not defined on faces). - - mode = NEARESTCELL : sample nearest cell - mode = NEARESTPATCHFACE : sample nearest face on selected patch - mode = NEARESTFACE : sample nearest face on any patch. Note: does not - warn if nearest actually is on internal face! - - For NEARESTCELL you have to provide an 'interpolationScheme' entry - which can be any one of the interpolation schemes (cell, cellPoint, etc.) - In case of interpolation (so scheme != cell) the limitation is that - there is only one value per cell. So e.g. if you have a cell with two - boundary faces and both faces sample into the cell both faces will get - the same value. - - See directMappedPatchBase for options on sampling. - - Optional 'fieldName' entry to supply a different filename - -SourceFiles - directMappedFixedValueFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedValueFvPatchField_H -#define directMappedFixedValueFvPatchField_H - -#include "fixedValueFvPatchFields.H" -#include "directMappedFvPatch.H" -#include "interpolation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFixedValueFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -template -class directMappedFixedValueFvPatchField -: - public fixedValueFvPatchField -{ - // Private data - - //- Name of field to sample - defaults to field associated with this - // patchField if not specified - word fieldName_; - - //- If true adjust the mapped field to maintain average value average_ - const bool setAverage_; - - //- Average value the mapped field is adjusted to maintain if - // setAverage_ is set true - const Type average_; - - //- Interpolation scheme to use for nearestcell mode - word interpolationScheme_; - - mutable autoPtr > interpolator_; - - // Private Member Functions - - //- Field to sample. Either on my or nbr mesh - const GeometricField& sampleField() const; - - //- Access the interpolation method - const interpolation& interpolator() const; - -public: - - //- Runtime type information - TypeName("directMapped"); - - - // Constructors - - //- Construct from patch and internal field - directMappedFixedValueFvPatchField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - directMappedFixedValueFvPatchField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given directMappedFixedValueFvPatchField - // onto a new patch - directMappedFixedValueFvPatchField - ( - const directMappedFixedValueFvPatchField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - directMappedFixedValueFvPatchField - ( - const directMappedFixedValueFvPatchField& - ); - - //- Construct and return a clone - virtual tmp > clone() const - { - return tmp > - ( - new directMappedFixedValueFvPatchField(*this) - ); - } - - //- Construct as copy setting internal field reference - directMappedFixedValueFvPatchField - ( - const directMappedFixedValueFvPatchField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp > clone - ( - const DimensionedField& iF - ) const - { - return tmp > - ( - new directMappedFixedValueFvPatchField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "directMappedFixedValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.C deleted file mode 100644 index eaaa003d4a..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFixedValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(directMappedFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H deleted file mode 100644 index bfeb1624e9..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedValueFvPatchFields_H -#define directMappedFixedValueFvPatchFields_H - -#include "directMappedFixedValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H index a890ffbd27..b7838497e5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H @@ -42,7 +42,7 @@ Description boundary faces and both faces sample into the cell both faces will get the same value. - See directMappedPatchBase for options on sampling. + See mappedPatchBase for options on sampling. Optional 'fieldName' entry to supply a different filename diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C similarity index 83% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C rename to src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C index 9c18c19e8c..9584f2b96c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C @@ -23,18 +23,17 @@ License \*---------------------------------------------------------------------------*/ -#include "directMappedFlowRateFvPatchVectorField.H" +#include "mappedFlowRateFvPatchVectorField.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" -#include "directMappedPatchBase.H" +#include "mappedPatchBase.H" #include "mapDistribute.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::directMappedFlowRateFvPatchVectorField:: -directMappedFlowRateFvPatchVectorField +Foam::mappedFlowRateFvPatchVectorField::mappedFlowRateFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF @@ -47,10 +46,9 @@ directMappedFlowRateFvPatchVectorField {} -Foam::directMappedFlowRateFvPatchVectorField:: -directMappedFlowRateFvPatchVectorField +Foam::mappedFlowRateFvPatchVectorField::mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField& ptf, + const mappedFlowRateFvPatchVectorField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -63,8 +61,7 @@ directMappedFlowRateFvPatchVectorField {} -Foam::directMappedFlowRateFvPatchVectorField:: -directMappedFlowRateFvPatchVectorField +Foam::mappedFlowRateFvPatchVectorField::mappedFlowRateFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, @@ -78,10 +75,9 @@ directMappedFlowRateFvPatchVectorField {} -Foam::directMappedFlowRateFvPatchVectorField:: -directMappedFlowRateFvPatchVectorField +Foam::mappedFlowRateFvPatchVectorField::mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField& ptf + const mappedFlowRateFvPatchVectorField& ptf ) : fixedValueFvPatchField(ptf), @@ -91,10 +87,9 @@ directMappedFlowRateFvPatchVectorField {} -Foam::directMappedFlowRateFvPatchVectorField:: -directMappedFlowRateFvPatchVectorField +Foam::mappedFlowRateFvPatchVectorField::mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField& ptf, + const mappedFlowRateFvPatchVectorField& ptf, const DimensionedField& iF ) : @@ -107,7 +102,7 @@ directMappedFlowRateFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() +void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -119,8 +114,8 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag+1; - // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = refCast + // Get the coupling information from the mappedPatchBase + const mappedPatchBase& mpp = refCast ( patch().patch() ); @@ -173,7 +168,7 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() { FatalErrorIn ( - "directMappedFlowRateFvPatchVectorField::updateCoeffs()" + "mappedFlowRateFvPatchVectorField::updateCoeffs()" ) << "dimensions of " << phiName_ << " are incorrect" << nl << " on patch " << this->patch().name() << " of field " << this->dimensionedInternalField().name() @@ -188,7 +183,7 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() } -void Foam::directMappedFlowRateFvPatchVectorField::write +void Foam::mappedFlowRateFvPatchVectorField::write ( Ostream& os ) const @@ -208,7 +203,7 @@ namespace Foam makePatchTypeField ( fvPatchVectorField, - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H similarity index 82% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H rename to src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H index 3ade3cb041..45c42233b6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::directMappedFlowRateFvPatchVectorField + Foam::mappedFlowRateFvPatchVectorField Description Describes a volumetric/mass flow normal vector boundary condition by its @@ -41,7 +41,7 @@ Description @verbatim inlet { - type directMappedFlowRate; + type mappedFlowRate; phi phi; rho rho; neigPhi neigPhiName_; // Volumetric/mass flow rate @@ -51,12 +51,12 @@ Description @endverbatim SourceFiles - directMappedFlowRateFvPatchVectorField.C + mappedFlowRateFvPatchVectorField.C \*---------------------------------------------------------------------------*/ -#ifndef directMappedFlowRateFvPatchVectorField_H -#define directMappedFlowRateFvPatchVectorField_H +#ifndef mappedFlowRateFvPatchVectorField_H +#define mappedFlowRateFvPatchVectorField_H #include "fixedValueFvPatchFields.H" @@ -68,7 +68,7 @@ namespace Foam Class flowRateInletVelocityFvPatch Declaration \*---------------------------------------------------------------------------*/ -class directMappedFlowRateFvPatchVectorField +class mappedFlowRateFvPatchVectorField : public fixedValueFvPatchVectorField { @@ -87,20 +87,20 @@ class directMappedFlowRateFvPatchVectorField public: //- Runtime type information - TypeName("directMappedFlowRate"); + TypeName("mappedFlowRate"); // Constructors //- Construct from patch and internal field - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ( const fvPatch&, const DimensionedField&, @@ -108,20 +108,20 @@ public: ); //- Construct by mapping given - // directMappedFlowRateFvPatchVectorField + // mappedFlowRateFvPatchVectorField // onto a new patch - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField&, + const mappedFlowRateFvPatchVectorField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField& + const mappedFlowRateFvPatchVectorField& ); //- Construct and return a clone @@ -129,14 +129,14 @@ public: { return tmp ( - new directMappedFlowRateFvPatchVectorField(*this) + new mappedFlowRateFvPatchVectorField(*this) ); } //- Construct as copy setting internal field reference - directMappedFlowRateFvPatchVectorField + mappedFlowRateFvPatchVectorField ( - const directMappedFlowRateFvPatchVectorField&, + const mappedFlowRateFvPatchVectorField&, const DimensionedField& ); @@ -148,7 +148,7 @@ public: { return tmp ( - new directMappedFlowRateFvPatchVectorField(*this, iF) + new mappedFlowRateFvPatchVectorField(*this, iF) ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C similarity index 74% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C rename to src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C index caf00eff10..29f6afa027 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C @@ -23,9 +23,9 @@ License \*---------------------------------------------------------------------------*/ -#include "directMappedVelocityFluxFixedValueFvPatchField.H" +#include "mappedVelocityFluxFixedValueFvPatchField.H" #include "fvPatchFieldMapper.H" -#include "directMappedPatchBase.H" +#include "mappedPatchBase.H" #include "volFields.H" #include "surfaceFields.H" #include "addToRunTimeSelectionTable.H" @@ -33,8 +33,8 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::directMappedVelocityFluxFixedValueFvPatchField:: -directMappedVelocityFluxFixedValueFvPatchField +Foam::mappedVelocityFluxFixedValueFvPatchField:: +mappedVelocityFluxFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -45,10 +45,10 @@ directMappedVelocityFluxFixedValueFvPatchField {} -Foam::directMappedVelocityFluxFixedValueFvPatchField:: -directMappedVelocityFluxFixedValueFvPatchField +Foam::mappedVelocityFluxFixedValueFvPatchField:: +mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField& ptf, + const mappedVelocityFluxFixedValueFvPatchField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -57,20 +57,20 @@ directMappedVelocityFluxFixedValueFvPatchField fixedValueFvPatchVectorField(ptf, p, iF, mapper), phiName_(ptf.phiName_) { - if (!isA(this->patch().patch())) + if (!isA(this->patch().patch())) { FatalErrorIn ( - "directMappedVelocityFluxFixedValueFvPatchField::" - "directMappedVelocityFluxFixedValueFvPatchField" + "mappedVelocityFluxFixedValueFvPatchField::" + "mappedVelocityFluxFixedValueFvPatchField" "(" - "const directMappedVelocityFluxFixedValueFvPatchField&, " + "const mappedVelocityFluxFixedValueFvPatchField&, " "const fvPatch&, " "const DimensionedField&, " "const fvPatchFieldMapper&" ")" ) << "Patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" + << "' not type '" << mappedPatchBase::typeName << "'" << " for patch " << p.name() << " of field " << dimensionedInternalField().name() << " in file " << dimensionedInternalField().objectPath() @@ -79,8 +79,8 @@ directMappedVelocityFluxFixedValueFvPatchField } -Foam::directMappedVelocityFluxFixedValueFvPatchField:: -directMappedVelocityFluxFixedValueFvPatchField +Foam::mappedVelocityFluxFixedValueFvPatchField:: +mappedVelocityFluxFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -90,35 +90,35 @@ directMappedVelocityFluxFixedValueFvPatchField fixedValueFvPatchVectorField(p, iF, dict), phiName_(dict.lookupOrDefault("phi", "phi")) { - if (!isA(this->patch().patch())) + if (!isA(this->patch().patch())) { FatalErrorIn ( - "directMappedVelocityFluxFixedValueFvPatchField::" - "directMappedVelocityFluxFixedValueFvPatchField" + "mappedVelocityFluxFixedValueFvPatchField::" + "mappedVelocityFluxFixedValueFvPatchField" "(" "const fvPatch&, " "const DimensionedField&, " "const dictionary&" ")" ) << "Patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" + << "' not type '" << mappedPatchBase::typeName << "'" << " for patch " << p.name() << " of field " << dimensionedInternalField().name() << " in file " << dimensionedInternalField().objectPath() << exit(FatalError); } - const directMappedPatchBase& mpp = refCast + const mappedPatchBase& mpp = refCast ( this->patch().patch() ); - if (mpp.mode() == directMappedPolyPatch::NEARESTCELL) + if (mpp.mode() == mappedPolyPatch::NEARESTCELL) { FatalErrorIn ( - "directMappedVelocityFluxFixedValueFvPatchField::" - "directMappedVelocityFluxFixedValueFvPatchField" + "mappedVelocityFluxFixedValueFvPatchField::" + "mappedVelocityFluxFixedValueFvPatchField" "(" "const fvPatch&, " "const DimensionedField&, " @@ -134,10 +134,10 @@ directMappedVelocityFluxFixedValueFvPatchField } -Foam::directMappedVelocityFluxFixedValueFvPatchField:: -directMappedVelocityFluxFixedValueFvPatchField +Foam::mappedVelocityFluxFixedValueFvPatchField:: +mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField& ptf + const mappedVelocityFluxFixedValueFvPatchField& ptf ) : fixedValueFvPatchVectorField(ptf), @@ -145,10 +145,10 @@ directMappedVelocityFluxFixedValueFvPatchField {} -Foam::directMappedVelocityFluxFixedValueFvPatchField:: -directMappedVelocityFluxFixedValueFvPatchField +Foam::mappedVelocityFluxFixedValueFvPatchField:: +mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField& ptf, + const mappedVelocityFluxFixedValueFvPatchField& ptf, const DimensionedField& iF ) : @@ -159,7 +159,7 @@ directMappedVelocityFluxFixedValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() +void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs() { if (updated()) { @@ -171,10 +171,10 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag+1; - // Get the directMappedPatchBase - const directMappedPatchBase& mpp = refCast + // Get the mappedPatchBase + const mappedPatchBase& mpp = refCast ( - directMappedVelocityFluxFixedValueFvPatchField::patch().patch() + mappedVelocityFluxFixedValueFvPatchField::patch().patch() ); const mapDistribute& distMap = mpp.map(); const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); @@ -194,7 +194,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() switch (mpp.mode()) { - case directMappedPolyPatch::NEARESTFACE: + case mappedPolyPatch::NEARESTFACE: { vectorField allUValues(nbrMesh.nFaces(), vector::zero); scalarField allPhiValues(nbrMesh.nFaces(), 0.0); @@ -221,7 +221,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() break; } - case directMappedPolyPatch::NEARESTPATCHFACE: + case mappedPolyPatch::NEARESTPATCHFACE: { const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID ( @@ -240,7 +240,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() { FatalErrorIn ( - "directMappedVelocityFluxFixedValueFvPatchField::" + "mappedVelocityFluxFixedValueFvPatchField::" "updateCoeffs()" ) << "patch can only be used in NEARESTPATCHFACE or NEARESTFACE " << "mode" << nl << abort(FatalError); @@ -257,7 +257,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() } -void Foam::directMappedVelocityFluxFixedValueFvPatchField::write +void Foam::mappedVelocityFluxFixedValueFvPatchField::write ( Ostream& os ) const @@ -275,7 +275,7 @@ namespace Foam makePatchTypeField ( fvPatchVectorField, - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H similarity index 76% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.H rename to src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H index 418358f4cc..c1d40666dd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::directMappedVelocityFluxFixedValueFvPatchField + Foam::mappedVelocityFluxFixedValueFvPatchField Description Recycles the velocity and flux at a patch to this patch @@ -32,15 +32,15 @@ Description warn if nearest actually is on internal face! SourceFiles - directMappedVelocityFluxFixedValueFvPatchField.C + mappedVelocityFluxFixedValueFvPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef directMappedVelocityFluxFixedValueFvPatchField_H -#define directMappedVelocityFluxFixedValueFvPatchField_H +#ifndef mappedVelocityFluxFixedValueFvPatchField_H +#define mappedVelocityFluxFixedValueFvPatchField_H #include "fixedValueFvPatchFields.H" -#include "directMappedFvPatch.H" +#include "mappedFvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,10 +48,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class directMappedVelocityFluxFixedValueFvPatch Declaration + Class mappedVelocityFluxFixedValueFvPatch Declaration \*---------------------------------------------------------------------------*/ -class directMappedVelocityFluxFixedValueFvPatchField +class mappedVelocityFluxFixedValueFvPatchField : public fixedValueFvPatchVectorField { @@ -63,20 +63,20 @@ class directMappedVelocityFluxFixedValueFvPatchField public: //- Runtime type information - TypeName("directMappedVelocityFlux"); + TypeName("mappedVelocityFlux"); // Constructors //- Construct from patch and internal field - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ( const fvPatch&, const DimensionedField&, @@ -84,20 +84,20 @@ public: ); //- Construct by mapping given - // directMappedVelocityFluxFixedValueFvPatchField + // mappedVelocityFluxFixedValueFvPatchField // onto a new patch - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField&, + const mappedVelocityFluxFixedValueFvPatchField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField& + const mappedVelocityFluxFixedValueFvPatchField& ); //- Construct and return a clone @@ -105,14 +105,14 @@ public: { return tmp ( - new directMappedVelocityFluxFixedValueFvPatchField(*this) + new mappedVelocityFluxFixedValueFvPatchField(*this) ); } //- Construct as copy setting internal field reference - directMappedVelocityFluxFixedValueFvPatchField + mappedVelocityFluxFixedValueFvPatchField ( - const directMappedVelocityFluxFixedValueFvPatchField&, + const mappedVelocityFluxFixedValueFvPatchField&, const DimensionedField& ); @@ -124,7 +124,7 @@ public: { return tmp ( - new directMappedVelocityFluxFixedValueFvPatchField(*this, iF) + new mappedVelocityFluxFixedValueFvPatchField(*this, iF) ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C new file mode 100644 index 0000000000..be534fb8fa --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "multiphaseFixedFluxPressureFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::multiphaseFixedFluxPressureFvPatchScalarField:: +multiphaseFixedFluxPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedGradientFvPatchScalarField(p, iF), + UName_("U"), + phiName_("phi"), + rhoName_("rho") +{} + + +Foam::multiphaseFixedFluxPressureFvPatchScalarField:: +multiphaseFixedFluxPressureFvPatchScalarField +( + const multiphaseFixedFluxPressureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_) +{} + + +Foam::multiphaseFixedFluxPressureFvPatchScalarField:: +multiphaseFixedFluxPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedGradientFvPatchScalarField(p, iF), + UName_(dict.lookupOrDefault("U", "U")), + phiName_(dict.lookupOrDefault("phi", "phi")), + rhoName_(dict.lookupOrDefault("rho", "rho")) +{ + if (dict.found("gradient")) + { + gradient() = scalarField("gradient", dict, p.size()); + fixedGradientFvPatchScalarField::updateCoeffs(); + fixedGradientFvPatchScalarField::evaluate(); + } + else + { + fvPatchField::operator=(patchInternalField()); + gradient() = 0.0; + } +} + + +Foam::multiphaseFixedFluxPressureFvPatchScalarField:: +multiphaseFixedFluxPressureFvPatchScalarField +( + const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf +) +: + fixedGradientFvPatchScalarField(wbppsf), + UName_(wbppsf.UName_), + phiName_(wbppsf.phiName_), + rhoName_(wbppsf.rhoName_) +{} + + +Foam::multiphaseFixedFluxPressureFvPatchScalarField:: +multiphaseFixedFluxPressureFvPatchScalarField +( + const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf, + const DimensionedField& iF +) +: + fixedGradientFvPatchScalarField(wbppsf, iF), + UName_(wbppsf.UName_), + phiName_(wbppsf.phiName_), + rhoName_(wbppsf.rhoName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const fvPatchField& Up = + patch().lookupPatchField(UName_); + + const surfaceScalarField& phi = + db().lookupObject(phiName_); + + fvsPatchField phip = + patch().patchField(phi); + + if (phi.dimensions() == dimDensity*dimVelocity*dimArea) + { + const fvPatchField& rhop = + patch().lookupPatchField(rhoName_); + + phip /= rhop; + } + + const fvsPatchField& Dpp = + patch().lookupPatchField("Dp"); + + gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp; + + fixedGradientFvPatchScalarField::updateCoeffs(); +} + + +void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + gradient().writeEntry("gradient", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + multiphaseFixedFluxPressureFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H similarity index 55% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H rename to src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H index 5072b319cd..b97001a5c0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H @@ -22,21 +22,22 @@ License along with OpenFOAM. If not, see . Class - Foam::directMappedFixedInternalValueFvPatchField + Foam::multiphaseFixedFluxPressureFvPatchScalarField Description - Recycles the boundary and internal values of a neighbour patch field to - the boundary and internal values of *this. + Foam::multiphaseFixedFluxPressureFvPatchScalarField SourceFiles - directMappedFixedInternalValueFvPatchField.C + multiphaseFixedFluxPressureFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef directMappedFixedInternalValueFvPatchField_H -#define directMappedFixedInternalValueFvPatchField_H +#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H +#define multiphaseFixedFluxPressureFvPatchScalarFields_H -#include "directMappedFixedValueFvPatchField.H" +#include "fvPatchFields.H" +#include "fixedGradientFvPatchFields.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,89 +45,98 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class directMappedFixedInternalValueFvPatchField Declaration + Class multiphaseFixedFluxPressureFvPatch Declaration \*---------------------------------------------------------------------------*/ -template -class directMappedFixedInternalValueFvPatchField +class multiphaseFixedFluxPressureFvPatchScalarField : - public directMappedFixedValueFvPatchField + public fixedGradientFvPatchScalarField { + // Private data + + //- Name of the velocity field + word UName_; + + //- Name of the flux transporting the field + word phiName_; + + //- Name of the density field used to normalise the mass flux + // if neccessary + word rhoName_; + public: //- Runtime type information - TypeName("directMappedFixedInternalValue"); + TypeName("multiphaseFixedFluxPressure"); // Constructors //- Construct from patch and internal field - directMappedFixedInternalValueFvPatchField + multiphaseFixedFluxPressureFvPatchScalarField ( const fvPatch&, - const DimensionedField& + const DimensionedField& ); //- Construct from patch, internal field and dictionary - directMappedFixedInternalValueFvPatchField + multiphaseFixedFluxPressureFvPatchScalarField ( const fvPatch&, - const DimensionedField&, + const DimensionedField&, const dictionary& ); //- Construct by mapping given - // directMappedFixedInternalValueFvPatchField onto a new patch - directMappedFixedInternalValueFvPatchField + // multiphaseFixedFluxPressureFvPatchScalarField onto a new patch + multiphaseFixedFluxPressureFvPatchScalarField ( - const directMappedFixedInternalValueFvPatchField&, + const multiphaseFixedFluxPressureFvPatchScalarField&, const fvPatch&, - const DimensionedField&, + const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - directMappedFixedInternalValueFvPatchField + multiphaseFixedFluxPressureFvPatchScalarField ( - const directMappedFixedInternalValueFvPatchField& + const multiphaseFixedFluxPressureFvPatchScalarField& ); //- Construct and return a clone - virtual tmp > clone() const + virtual tmp clone() const { - return tmp > + return tmp ( - new directMappedFixedInternalValueFvPatchField(*this) + new multiphaseFixedFluxPressureFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - directMappedFixedInternalValueFvPatchField + multiphaseFixedFluxPressureFvPatchScalarField ( - const directMappedFixedInternalValueFvPatchField&, - const DimensionedField& + const multiphaseFixedFluxPressureFvPatchScalarField&, + const DimensionedField& ); //- Construct and return a clone setting internal field reference - virtual tmp > clone + virtual tmp clone ( - const DimensionedField& iF + const DimensionedField& iF ) const { - return tmp > + return tmp ( - new directMappedFixedInternalValueFvPatchField(*this, iF) + new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF) ); } // Member functions - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); //- Write virtual void write(Ostream&) const; @@ -139,12 +149,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "directMappedFixedInternalValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.C deleted file mode 100644 index cf7b31286c..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "selfContainedDirectMappedFixedValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(selfContainedDirectMappedFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H deleted file mode 100644 index 77c6bd7d6a..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef selfContainedDirectMappedFixedValueFvPatchFields_H -#define selfContainedDirectMappedFixedValueFvPatchFields_H - -#include "selfContainedDirectMappedFixedValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H deleted file mode 100644 index 45e47dcb1a..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef selfContainedDirectMappedFixedValueFvPatchFieldsFwd_H -#define selfContainedDirectMappedFixedValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template class selfContainedDirectMappedFixedValueFvPatchField; - -makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C similarity index 83% rename from src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C rename to src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C index 05a2b55c5a..1a3334c927 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "selfContainedDirectMappedFixedValueFvPatchField.H" +#include "selfContainedMappedFixedValueFvPatchField.H" #include "volFields.H" #include "interpolationCell.H" @@ -35,14 +35,14 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF ) : - directMappedPatchBase(p.patch()), + mappedPatchBase(p.patch()), fixedValueFvPatchField(p, iF), fieldName_(iF.name()), setAverage_(false), @@ -52,16 +52,16 @@ selfContainedDirectMappedFixedValueFvPatchField template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField& ptf, + const selfContainedMappedFixedValueFvPatchField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - directMappedPatchBase(p.patch(), ptf), + mappedPatchBase(p.patch(), ptf), fixedValueFvPatchField(ptf, p, iF, mapper), fieldName_(ptf.fieldName_), setAverage_(ptf.setAverage_), @@ -71,22 +71,22 @@ selfContainedDirectMappedFixedValueFvPatchField template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - directMappedPatchBase(p.patch(), dict), + mappedPatchBase(p.patch(), dict), fixedValueFvPatchField(p, iF, dict), fieldName_(dict.lookupOrDefault("fieldName", iF.name())), setAverage_(readBool(dict.lookup("setAverage"))), average_(pTraits(dict.lookup("average"))), interpolationScheme_(interpolationCell::typeName) { - if (mode() == directMappedPatchBase::NEARESTCELL) + if (mode() == mappedPatchBase::NEARESTCELL) { dict.lookup("interpolationScheme") >> interpolationScheme_; } @@ -94,13 +94,13 @@ selfContainedDirectMappedFixedValueFvPatchField template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, - // directMappedPatchBase + // mappedPatchBase const word& sampleRegion, const sampleMode sampleMode, const word& samplePatch, @@ -113,7 +113,7 @@ selfContainedDirectMappedFixedValueFvPatchField const word& interpolationScheme ) : - directMappedPatchBase + mappedPatchBase ( p.patch(), sampleRegion, @@ -130,13 +130,13 @@ selfContainedDirectMappedFixedValueFvPatchField template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField& ptf + const selfContainedMappedFixedValueFvPatchField& ptf ) : - directMappedPatchBase(ptf.patch().patch(), ptf), + mappedPatchBase(ptf.patch().patch(), ptf), fixedValueFvPatchField(ptf), fieldName_(ptf.fieldName_), setAverage_(ptf.setAverage_), @@ -146,14 +146,14 @@ selfContainedDirectMappedFixedValueFvPatchField template -selfContainedDirectMappedFixedValueFvPatchField:: -selfContainedDirectMappedFixedValueFvPatchField +selfContainedMappedFixedValueFvPatchField:: +selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField& ptf, + const selfContainedMappedFixedValueFvPatchField& ptf, const DimensionedField& iF ) : - directMappedPatchBase(ptf.patch().patch(), ptf), + mappedPatchBase(ptf.patch().patch(), ptf), fixedValueFvPatchField(ptf, iF), fieldName_(ptf.fieldName_), setAverage_(ptf.setAverage_), @@ -166,7 +166,7 @@ selfContainedDirectMappedFixedValueFvPatchField template const GeometricField& -selfContainedDirectMappedFixedValueFvPatchField::sampleField() const +selfContainedMappedFixedValueFvPatchField::sampleField() const { typedef GeometricField fieldType; @@ -198,7 +198,7 @@ selfContainedDirectMappedFixedValueFvPatchField::sampleField() const template const interpolation& -selfContainedDirectMappedFixedValueFvPatchField::interpolator() const +selfContainedMappedFixedValueFvPatchField::interpolator() const { if (!interpolator_.valid()) { @@ -213,7 +213,7 @@ selfContainedDirectMappedFixedValueFvPatchField::interpolator() const template -void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() +void selfContainedMappedFixedValueFvPatchField::updateCoeffs() { if (this->updated()) { @@ -229,7 +229,7 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); const fvMesh& nbrMesh = refCast(sampleMesh()); - const mapDistribute& distMap = directMappedPatchBase::map(); + const mapDistribute& distMap = mappedPatchBase::map(); // Result of obtaining remote values Field newValues; @@ -286,7 +286,7 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() FatalErrorIn ( "void " - "selfContainedDirectMappedFixedValueFvPatchField::" + "selfContainedMappedFixedValueFvPatchField::" "updateCoeffs()" )<< "Unable to find sample patch " << samplePatch() << " in region " << sampleRegion() @@ -329,7 +329,7 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() { FatalErrorIn ( - "selfContainedDirectMappedFixedValueFvPatchField::" + "selfContainedMappedFixedValueFvPatchField::" "updateCoeffs()" ) << "Unknown sampling mode: " << mode() << nl << abort(FatalError); @@ -356,7 +356,7 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() if (debug) { - Info<< "selfContainedDirectMapped on field:" + Info<< "selfContainedMapped on field:" << this->dimensionedInternalField().name() << " patch:" << this->patch().name() << " avg:" << gAverage(*this) @@ -373,11 +373,11 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() template -void selfContainedDirectMappedFixedValueFvPatchField::write(Ostream& os) +void selfContainedMappedFixedValueFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - directMappedPatchBase::write(os); + mappedPatchBase::write(os); os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl; os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; os.writeKeyword("average") << average_ << token::END_STATEMENT << nl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.H similarity index 76% rename from src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H rename to src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.H index 7f10dcae78..030f9a9d44 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.H @@ -22,23 +22,23 @@ License along with OpenFOAM. If not, see . Class - Foam::selfContainedDirectMappedFixedValueFvPatchField + Foam::selfContainedMappedFixedValueFvPatchField Description - Self-contained version of directMapped. Does not use information on + Self-contained version of mapped. Does not use information on patch, instead holds it locally (and possibly duplicate) so use - normal directMapped in preference and only use this if you cannot - change the underlying patch type to directMapped. + normal mapped in preference and only use this if you cannot + change the underlying patch type to mapped. SourceFiles - selfContainedDirectMappedFixedValueFvPatchField.C + selfContainedMappedFixedValueFvPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef selfContainedDirectMappedFixedValueFvPatchField_H -#define selfContainedDirectMappedFixedValueFvPatchField_H +#ifndef selfContainedMappedFixedValueFvPatchField_H +#define selfContainedMappedFixedValueFvPatchField_H -#include "directMappedPatchBase.H" +#include "mappedPatchBase.H" #include "fixedValueFvPatchFields.H" #include "interpolation.H" @@ -48,13 +48,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class selfContainedDirectMappedFixedValueFvPatchField Declaration + Class selfContainedMappedFixedValueFvPatchField Declaration \*---------------------------------------------------------------------------*/ template -class selfContainedDirectMappedFixedValueFvPatchField +class selfContainedMappedFixedValueFvPatchField : - public directMappedPatchBase, + public mappedPatchBase, public fixedValueFvPatchField { // Private data @@ -88,20 +88,20 @@ class selfContainedDirectMappedFixedValueFvPatchField public: //- Runtime type information - TypeName("selfContainedDirectMapped"); + TypeName("selfContainedMapped"); // Constructors //- Construct from patch and internal field - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( const fvPatch&, const DimensionedField&, @@ -110,12 +110,12 @@ public: //- Construct from patch, internal field and distance for normal type // sampling - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( const fvPatch&, const DimensionedField&, - // directMappedPatchBase + // mappedPatchBase const word& sampleRegion, const sampleMode sampleMode, const word& samplePatch, @@ -129,20 +129,20 @@ public: ); //- Construct by mapping given - // selfContainedDirectMappedFixedValueFvPatchField + // selfContainedMappedFixedValueFvPatchField // onto a new patch - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField&, + const selfContainedMappedFixedValueFvPatchField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField& + const selfContainedMappedFixedValueFvPatchField& ); //- Construct and return a clone @@ -150,7 +150,7 @@ public: { return tmp > ( - new selfContainedDirectMappedFixedValueFvPatchField + new selfContainedMappedFixedValueFvPatchField ( *this ) @@ -158,9 +158,9 @@ public: } //- Construct as copy setting internal field reference - selfContainedDirectMappedFixedValueFvPatchField + selfContainedMappedFixedValueFvPatchField ( - const selfContainedDirectMappedFixedValueFvPatchField&, + const selfContainedMappedFixedValueFvPatchField&, const DimensionedField& ); @@ -172,7 +172,7 @@ public: { return tmp > ( - new selfContainedDirectMappedFixedValueFvPatchField + new selfContainedMappedFixedValueFvPatchField ( *this, iF @@ -201,7 +201,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "selfContainedDirectMappedFixedValueFvPatchField.C" +# include "selfContainedMappedFixedValueFvPatchField.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.C similarity index 93% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.C rename to src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.C index 84e8d02ab1..5f4fdd7ad5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "directMappedFieldFvPatchFields.H" +#include "selfContainedMappedFixedValueFvPatchFields.H" #include "volMesh.H" #include "addToRunTimeSelectionTable.H" @@ -34,7 +34,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePatchFields(directMappedField); +makePatchFields(selfContainedMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.H similarity index 88% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H rename to src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.H index a9f69be9fa..7efd9dbace 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFields.H @@ -23,9 +23,10 @@ License \*---------------------------------------------------------------------------*/ -#ifndef directMappedFixedValueFvPatchFieldsFwd_H -#define directMappedFixedValueFvPatchFieldsFwd_H +#ifndef selfContainedMappedFixedValueFvPatchFields_H +#define selfContainedMappedFixedValueFvPatchFields_H +#include "selfContainedMappedFixedValueFvPatchField.H" #include "fieldTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -35,9 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template class directMappedFixedValueFvPatchField; - -makePatchTypeFieldTypedefs(directMappedFixedValue); +makePatchTypeFieldTypedefs(selfContainedMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFieldsFwd.H similarity index 87% rename from src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFieldsFwd.H rename to src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFieldsFwd.H index 472ef08039..0a892391c9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchFieldsFwd.H @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#ifndef directMappedFieldFvPatchFieldsFwd_H -#define directMappedFieldFvPatchFieldsFwd_H +#ifndef selfContainedMappedFixedValueFvPatchFieldsFwd_H +#define selfContainedMappedFixedValueFvPatchFieldsFwd_H #include "fieldTypes.H" @@ -35,9 +35,9 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template class directMappedFieldFvPatchField; +template class selfContainedMappedFixedValueFvPatchField; -makePatchTypeFieldTypedefs(directMappedField) +makePatchTypeFieldTypedefs(selfContainedMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.C deleted file mode 100644 index 37e2b149bc..0000000000 --- a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.C +++ /dev/null @@ -1,37 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedFvPatch.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(directMappedFvPatch, 0); - addToRunTimeSelectionTable(fvPatch, directMappedFvPatch, polyPatch); -} - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.H deleted file mode 100644 index e9c469f4c4..0000000000 --- a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedFvPatch.H +++ /dev/null @@ -1,79 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedFvPatch - -Description - Foam::directMappedFvPatch - -SourceFiles - directMappedFvPatch.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFvPatch_H -#define directMappedFvPatch_H - -#include "fvPatch.H" -#include "directMappedPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class directMappedFvPatch -: - public fvPatch -{ - -public: - - //- Runtime type information - TypeName(directMappedPolyPatch::typeName_()); - - - // Constructors - - //- Construct from components - directMappedFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) - : - fvPatch(patch, bm) - {} -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.C deleted file mode 100644 index 6ab1c05a4c..0000000000 --- a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.C +++ /dev/null @@ -1,37 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedWallFvPatch.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(directMappedWallFvPatch, 0); - addToRunTimeSelectionTable(fvPatch, directMappedWallFvPatch, polyPatch); -} - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H deleted file mode 100644 index 0e7a727237..0000000000 --- a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedWallFvPatch - -Description - Foam::directMappedWallFvPatch - -SourceFiles - directMappedWallFvPatch.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedWallFvPatch_H -#define directMappedWallFvPatch_H - -#include "wallFvPatch.H" -#include "directMappedWallPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedWallFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class directMappedWallFvPatch -: - public wallFvPatch -{ - -public: - - //- Runtime type information - TypeName(directMappedWallPolyPatch::typeName_()); - - - // Constructors - - //- Construct from components - directMappedWallFvPatch - ( - const polyPatch& patch, - const fvBoundaryMesh& bm - ) - : - wallFvPatch(patch, bm) - {} -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 12a8dee327..51be547786 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -157,13 +157,6 @@ triSurface/triSurfaceTools/geompack/geompack.C twoDPointCorrector/twoDPointCorrector.C -directMapped/directMappedPolyPatch/directMappedPatchBase.C -directMapped/directMappedPolyPatch/directMappedPolyPatch.C -directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C -directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.C -directMapped/directMappedPointPatch/directMappedPointPatch.C -directMapped/directMappedPointPatch/directMappedWallPointPatch.C - AMI=AMIInterpolation $(AMI)/AMIInterpolation/AMIInterpolationName.C $(AMI)/faceAreaIntersect/faceAreaIntersect.C @@ -178,7 +171,9 @@ mappedPatches/mappedPolyPatch/mappedPatchBase.C mappedPatches/mappedPolyPatch/mappedPolyPatch.C mappedPatches/mappedPolyPatch/mappedWallPolyPatch.C mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C -mappedPatches/mappedPolyPatch/mappedWallPointPatch.C + +mappedPatches/mappedPointPatch/mappedPointPatch.C +mappedPatches/mappedPointPatch/mappedWallPointPatch.C LIB = $(FOAM_LIBBIN)/libmeshTools diff --git a/src/meshTools/directMapped/directMappedPointPatch/directMappedPointPatch.H b/src/meshTools/directMapped/directMappedPointPatch/directMappedPointPatch.H deleted file mode 100644 index 2f8b22d1e6..0000000000 --- a/src/meshTools/directMapped/directMappedPointPatch/directMappedPointPatch.H +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::directMappedPointPatch - -Description - DirectMapped patch. - -SourceFiles - directMappedPointPatch.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedPointPatch_H -#define directMappedPointPatch_H - -#include "facePointPatch.H" -#include "directMappedPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedPointPatch Declaration -\*---------------------------------------------------------------------------*/ - -class directMappedPointPatch -: - public facePointPatch -{ - -public: - - //- Runtime type information - TypeName(directMappedPolyPatch::typeName_()); - - - // Constructors - - //- Construct from polyPatch - directMappedPointPatch - ( - const polyPatch& patch, - const pointBoundaryMesh& bm - ) - : - facePointPatch(patch, bm) - {} -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.C b/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.C deleted file mode 100644 index 818ac73b90..0000000000 --- a/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.C +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedWallPointPatch.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defineTypeNameAndDebug(directMappedWallPointPatch, 0); - -// Add the patch constructor functions to the hash tables -addToRunTimeSelectionTable -( - facePointPatch, - directMappedWallPointPatch, - polyPatch -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C deleted file mode 100644 index 475b4b3b4a..0000000000 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ /dev/null @@ -1,882 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "directMappedPatchBase.H" -#include "addToRunTimeSelectionTable.H" -#include "ListListOps.H" -#include "meshSearch.H" -#include "meshTools.H" -#include "OFstream.H" -#include "Random.H" -#include "treeDataFace.H" -#include "indexedOctree.H" -#include "polyMesh.H" -#include "polyPatch.H" -#include "Time.H" -#include "mapDistribute.H" -#include "SubField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(directMappedPatchBase, 0); - - template<> - const char* Foam::NamedEnum - < - Foam::directMappedPatchBase::sampleMode, - 3 - >::names[] = - { - "nearestCell", - "nearestPatchFace", - "nearestFace" - }; - - template<> - const char* Foam::NamedEnum - < - Foam::directMappedPatchBase::offsetMode, - 3 - >::names[] = - { - "uniform", - "nonuniform", - "normal" - }; -} - - -const Foam::NamedEnum - Foam::directMappedPatchBase::sampleModeNames_; - -const Foam::NamedEnum - Foam::directMappedPatchBase::offsetModeNames_; - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::directMappedPatchBase::collectSamples -( - pointField& samples, - labelList& patchFaceProcs, - labelList& patchFaces, - pointField& patchFc -) const -{ - - // Collect all sample points and the faces they come from. - List globalFc(Pstream::nProcs()); - List globalSamples(Pstream::nProcs()); - labelListList globalFaces(Pstream::nProcs()); - - globalFc[Pstream::myProcNo()] = patch_.faceCentres(); - globalSamples[Pstream::myProcNo()] = samplePoints(); - globalFaces[Pstream::myProcNo()] = identity(patch_.size()); - - // Distribute to all processors - Pstream::gatherList(globalSamples); - Pstream::scatterList(globalSamples); - Pstream::gatherList(globalFaces); - Pstream::scatterList(globalFaces); - Pstream::gatherList(globalFc); - Pstream::scatterList(globalFc); - - // Rework into straight list - samples = ListListOps::combine - ( - globalSamples, - accessOp() - ); - patchFaces = ListListOps::combine - ( - globalFaces, - accessOp() - ); - patchFc = ListListOps::combine - ( - globalFc, - accessOp() - ); - - patchFaceProcs.setSize(patchFaces.size()); - labelList nPerProc - ( - ListListOps::subSizes - ( - globalFaces, - accessOp() - ) - ); - label sampleI = 0; - forAll(nPerProc, procI) - { - for (label i = 0; i < nPerProc[procI]; i++) - { - patchFaceProcs[sampleI++] = procI; - } - } -} - - -// Find the processor/cell containing the samples. Does not account -// for samples being found in two processors. -void Foam::directMappedPatchBase::findSamples -( - const pointField& samples, - labelList& sampleProcs, - labelList& sampleIndices, - pointField& sampleLocations -) const -{ - // Lookup the correct region - const polyMesh& mesh = sampleMesh(); - - // All the info for nearest. Construct to miss - List nearest(samples.size()); - - switch (mode_) - { - case NEARESTCELL: - { - if (samplePatch_.size() && samplePatch_ != "none") - { - FatalErrorIn - ( - "directMappedPatchBase::findSamples(const pointField&," - " labelList&, labelList&, pointField&) const" - ) << "No need to supply a patch name when in " - << sampleModeNames_[mode_] << " mode." << exit(FatalError); - } - - // Octree based search engine - meshSearch meshSearchEngine(mesh, false); - - forAll(samples, sampleI) - { - const point& sample = samples[sampleI]; - - label cellI = meshSearchEngine.findCell(sample); - - if (cellI == -1) - { - nearest[sampleI].second().first() = Foam::sqr(GREAT); - nearest[sampleI].second().second() = Pstream::myProcNo(); - } - else - { - const point& cc = mesh.cellCentres()[cellI]; - - nearest[sampleI].first() = pointIndexHit - ( - true, - cc, - cellI - ); - nearest[sampleI].second().first() = magSqr(cc-sample); - nearest[sampleI].second().second() = Pstream::myProcNo(); - } - } - break; - } - - case NEARESTPATCHFACE: - { - Random rndGen(123456); - - const polyPatch& pp = samplePolyPatch(); - - if (pp.empty()) - { - forAll(samples, sampleI) - { - nearest[sampleI].second().first() = Foam::sqr(GREAT); - nearest[sampleI].second().second() = Pstream::myProcNo(); - } - } - else - { - // patch faces - const labelList patchFaces(identity(pp.size()) + pp.start()); - - treeBoundBox patchBb - ( - treeBoundBox(pp.points(), pp.meshPoints()).extend - ( - rndGen, - 1E-4 - ) - ); - patchBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - patchBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - - indexedOctree boundaryTree - ( - treeDataFace // all information needed to search faces - ( - false, // do not cache bb - mesh, - patchFaces // boundary faces only - ), - patchBb, // overall search domain - 8, // maxLevel - 10, // leafsize - 3.0 // duplicity - ); - - forAll(samples, sampleI) - { - const point& sample = samples[sampleI]; - - pointIndexHit& nearInfo = nearest[sampleI].first(); - nearInfo = boundaryTree.findNearest - ( - sample, - magSqr(patchBb.span()) - ); - - if (!nearInfo.hit()) - { - nearest[sampleI].second().first() = Foam::sqr(GREAT); - nearest[sampleI].second().second() = - Pstream::myProcNo(); - } - else - { - point fc(pp[nearInfo.index()].centre(pp.points())); - nearInfo.setPoint(fc); - nearest[sampleI].second().first() = magSqr(fc-sample); - nearest[sampleI].second().second() = - Pstream::myProcNo(); - } - } - } - break; - } - - case NEARESTFACE: - { - if (samplePatch_.size() && samplePatch_ != "none") - { - FatalErrorIn - ( - "directMappedPatchBase::findSamples(const pointField&," - " labelList&, labelList&, pointField&) const" - ) << "No need to supply a patch name when in " - << sampleModeNames_[mode_] << " mode." << exit(FatalError); - } - - // Octree based search engine - meshSearch meshSearchEngine(mesh, false); - - forAll(samples, sampleI) - { - const point& sample = samples[sampleI]; - - label faceI = meshSearchEngine.findNearestFace(sample); - - if (faceI == -1) - { - nearest[sampleI].second().first() = Foam::sqr(GREAT); - nearest[sampleI].second().second() = Pstream::myProcNo(); - } - else - { - const point& fc = mesh.faceCentres()[faceI]; - - nearest[sampleI].first() = pointIndexHit - ( - true, - fc, - faceI - ); - nearest[sampleI].second().first() = magSqr(fc-sample); - nearest[sampleI].second().second() = Pstream::myProcNo(); - } - } - break; - } - - default: - { - FatalErrorIn("directMappedPatchBase::findSamples(..)") - << "problem." << abort(FatalError); - } - } - - - // Find nearest. - Pstream::listCombineGather(nearest, nearestEqOp()); - Pstream::listCombineScatter(nearest); - - if (debug) - { - Info<< "directMappedPatchBase::findSamples on mesh " << sampleRegion_ - << " : " << endl; - forAll(nearest, sampleI) - { - label procI = nearest[sampleI].second().second(); - label localI = nearest[sampleI].first().index(); - - Info<< " " << sampleI << " coord:"<< samples[sampleI] - << " found on processor:" << procI - << " in local cell/face:" << localI - << " with cc:" << nearest[sampleI].first().rawPoint() << endl; - } - } - - // Check for samples not being found - forAll(nearest, sampleI) - { - if (!nearest[sampleI].first().hit()) - { - FatalErrorIn - ( - "directMappedPatchBase::findSamples" - "(const pointField&, labelList&" - ", labelList&, pointField&)" - ) << "Did not find sample " << samples[sampleI] - << " on any processor of region " << sampleRegion_ - << exit(FatalError); - } - } - - - // Convert back into proc+local index - sampleProcs.setSize(samples.size()); - sampleIndices.setSize(samples.size()); - sampleLocations.setSize(samples.size()); - - forAll(nearest, sampleI) - { - sampleProcs[sampleI] = nearest[sampleI].second().second(); - sampleIndices[sampleI] = nearest[sampleI].first().index(); - sampleLocations[sampleI] = nearest[sampleI].first().hitPoint(); - } -} - - -void Foam::directMappedPatchBase::calcMapping() const -{ - if (mapPtr_.valid()) - { - FatalErrorIn("directMappedPatchBase::calcMapping() const") - << "Mapping already calculated" << exit(FatalError); - } - - // Do a sanity check - // Am I sampling my own patch? This only makes sense for a non-zero - // offset. - bool sampleMyself = - ( - mode_ == NEARESTPATCHFACE - && sampleRegion_ == patch_.boundaryMesh().mesh().name() - && samplePatch_ == patch_.name() - ); - - // Check offset - vectorField d(samplePoints()-patch_.faceCentres()); - if (sampleMyself && gAverage(mag(d)) <= ROOTVSMALL) - { - WarningIn - ( - "directMappedPatchBase::directMappedPatchBase\n" - "(\n" - " const polyPatch& pp,\n" - " const word& sampleRegion,\n" - " const sampleMode mode,\n" - " const word& samplePatch,\n" - " const vector& offset\n" - ")\n" - ) << "Invalid offset " << d << endl - << "Offset is the vector added to the patch face centres to" - << " find the patch face supplying the data." << endl - << "Setting it to " << d - << " on the same patch, on the same region" - << " will find the faces themselves which does not make sense" - << " for anything but testing." << endl - << "patch_:" << patch_.name() << endl - << "sampleRegion_:" << sampleRegion_ << endl - << "mode_:" << sampleModeNames_[mode_] << endl - << "samplePatch_:" << samplePatch_ << endl - << "offsetMode_:" << offsetModeNames_[offsetMode_] << endl; - } - - - - // Get global list of all samples and the processor and face they come from. - pointField samples; - labelList patchFaceProcs; - labelList patchFaces; - pointField patchFc; - collectSamples(samples, patchFaceProcs, patchFaces, patchFc); - - // Find processor and cell/face samples are in and actual location. - labelList sampleProcs; - labelList sampleIndices; - pointField sampleLocations; - findSamples(samples, sampleProcs, sampleIndices, sampleLocations); - - - // Now we have all the data we need: - // - where sample originates from (so destination when mapping): - // patchFaces, patchFaceProcs. - // - cell/face sample is in (so source when mapping) - // sampleIndices, sampleProcs. - - //forAll(samples, i) - //{ - // Info<< i << " need data in region " - // << patch_.boundaryMesh().mesh().name() - // << " for proc:" << patchFaceProcs[i] - // << " face:" << patchFaces[i] - // << " at:" << patchFc[i] << endl - // << "Found data in region " << sampleRegion_ - // << " at proc:" << sampleProcs[i] - // << " face:" << sampleIndices[i] - // << " at:" << sampleLocations[i] - // << nl << endl; - //} - - - - if (debug && Pstream::master()) - { - OFstream str - ( - patch_.boundaryMesh().mesh().time().path() - / patch_.name() - + "_directMapped.obj" - ); - Pout<< "Dumping mapping as lines from patch faceCentres to" - << " sampled cell/faceCentres to file " << str.name() << endl; - - label vertI = 0; - - forAll(patchFc, i) - { - meshTools::writeOBJ(str, patchFc[i]); - vertI++; - meshTools::writeOBJ(str, sampleLocations[i]); - vertI++; - str << "l " << vertI-1 << ' ' << vertI << nl; - } - } - - - // Determine schedule. - mapPtr_.reset(new mapDistribute(sampleProcs, patchFaceProcs)); - - // Rework the schedule from indices into samples to cell data to send, - // face data to receive. - - labelListList& subMap = mapPtr_().subMap(); - labelListList& constructMap = mapPtr_().constructMap(); - - forAll(subMap, procI) - { - subMap[procI] = UIndirectList