/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- 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 "faOption.H" #include "areaFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace fa { defineTypeNameAndDebug(option, 0); defineRunTimeSelectionTable(option, dictionary); } } // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::fa::option::resetApplied() { applied_.resize(fieldNames_.size()); applied_ = false; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fa::option::option ( const word& name, const word& modelType, const dictionary& dict, const fvPatch& patch ) : name_(name), modelType_(modelType), mesh_(patch.boundaryMesh().mesh()), patch_(patch), dict_(dict), coeffs_(dict.optionalSubDict(modelType + "Coeffs")), fieldNames_(), applied_(), regionName_(dict.get("region")), regionMeshPtr_(nullptr), vsmPtr_(nullptr), active_(dict.getOrDefault("active", true)), log(true) { Log << incrIndent << indent << "Source: " << name_ << endl << decrIndent; } // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // Foam::autoPtr Foam::fa::option::New ( const word& name, const dictionary& coeffs, const fvPatch& patch ) { const word modelType(coeffs.get("type")); Info<< indent << "Selecting finite area options type " << modelType << endl; const_cast(patch.boundaryMesh().mesh().time()).libs().open ( coeffs, "libs", dictionaryConstructorTablePtr_ ); auto* ctorPtr = dictionaryConstructorTable(modelType); if (!ctorPtr) { FatalErrorInFunction << "Unknown faOption model type " << modelType << nl << nl << "Valid faOption types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr