diff --git a/src/fvOptions/Make/files b/src/fvOptions/Make/files index d16c8f6b9c..ee2371113a 100644 --- a/src/fvOptions/Make/files +++ b/src/fvOptions/Make/files @@ -1,10 +1,16 @@ -fvOptions/fvOption.C -fvOptions/fvOptionIO.C -fvOptions/fvOptionList.C -fvOptions/fvIOoptionList.C +fvOption/fvOption.C +fvOption/fvOptionIO.C +fvOption/fvOptionList.C +fvOption/fvIOoptionList.C + +cellSetOption/cellSetOption.C +cellSetOption/cellSetOptionIO.C + +interRegionOption/interRegionOption.C +interRegionOption/interRegionOptionIO.C -/* sources */ +/* Sources */ generalSources=sources/general $(generalSources)/codedSource/codedSource.C @@ -32,16 +38,17 @@ $(derivedSources)/solidificationMeltingSource/solidificationMeltingSourceIO.C $(derivedSources)/tabulatedAccelerationSource/tabulatedAccelerationSource.C $(derivedSources)/tabulatedAccelerationSource/tabulated6DoFAcceleration/tabulated6DoFAcceleration.C + interRegion = sources/interRegion -$(interRegion)/interRegionHeatTransferModel/constantHeatTransfer/constantHeatTransfer.C -$(interRegion)/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C -$(interRegion)/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C -$(interRegion)/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C +$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C +$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelIO.C +$(interRegion)/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C +$(interRegion)/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C +$(interRegion)/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C $(interRegion)/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C - -/* constraints */ +/* Constraints */ generalConstraints=constraints/general $(generalConstraints)/explicitSetValue/explicitSetValue.C diff --git a/src/fvOptions/cellSetOption/cellSetOption.C b/src/fvOptions/cellSetOption/cellSetOption.C new file mode 100644 index 0000000000..0711348e8b --- /dev/null +++ b/src/fvOptions/cellSetOption/cellSetOption.C @@ -0,0 +1,237 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2015 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 "cellSetOption.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace fv + { + defineTypeNameAndDebug(cellSetOption, 0); + } + + template<> const char* NamedEnum + < + fv::cellSetOption::selectionModeType, + 4 + >::names[] = + { + "points", + "cellSet", + "cellZone", + "all" + }; + + const NamedEnum + fv::cellSetOption::selectionModeTypeNames_; +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::fv::cellSetOption::setSelection(const dictionary& dict) +{ + switch (selectionMode_) + { + case smPoints: + { + dict.lookup("points") >> points_; + break; + } + case smCellSet: + { + dict.lookup("cellSet") >> cellSetName_; + break; + } + case smCellZone: + { + dict.lookup("cellZone") >> cellSetName_; + break; + } + case smAll: + { + break; + } + default: + { + FatalErrorIn("::setSelection(const dictionary&)") + << "Unknown selectionMode " + << selectionModeTypeNames_[selectionMode_] + << ". Valid selectionMode types are" << selectionModeTypeNames_ + << exit(FatalError); + } + } +} + + +void Foam::fv::cellSetOption::setCellSet() +{ + switch (selectionMode_) + { + case smPoints: + { + Info<< indent << "- selecting cells using points" << endl; + + labelHashSet selectedCells; + + forAll(points_, i) + { + label cellI = mesh_.findCell(points_[i]); + if (cellI >= 0) + { + selectedCells.insert(cellI); + } + + label globalCellI = returnReduce(cellI, maxOp