Foam::Function1Types::Polynomial<Type>::Polynomial ( const word& entryName, const dictionary& dict ) : Function1<Type>(entryName), coeffs_(), canIntegrate_(true) { Istream& is(dict.lookup(entryName)); word entryType(is); is >> coeffs_; if (!coeffs_.size()) { FatalErrorInFunction << "Polynomial coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } forAll(coeffs_, i) { if (mag(coeffs_[i].second() + pTraits<Type>::one) < rootVSmall) { canIntegrate_ = false; break; } } if (debug) { if (!canIntegrate_) { WarningInFunction << "Polynomial " << this->name_ << " cannot be integrated" << endl; } } }
Foam::autoPtr<Foam::thermalPhaseChangeModel> Foam::thermalPhaseChangeModel::New ( const word& name, const dictionary& thermalPhaseChangeProperties, const twoPhaseThermalMixture& twoPhaseProperties, const volScalarField& T, const volScalarField& alpha1 ) { const word modelType(thermalPhaseChangeProperties.lookup("model")); Info<< "Selecting phase change model: " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "thermalPhaseChangeModel::New" ) << "Unknown thermalPhaseChangeModel type " << modelType << endl << endl << "Valid thermalPhaseChangeModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr<thermalPhaseChangeModel> ( cstrIter() ( name, thermalPhaseChangeProperties, twoPhaseProperties, T, alpha1 ) ); }
autoPtr<polyIntegrator> polyIntegrator::New ( Time& t, polyMoleculeCloud& molCloud, const dictionary& dict ) { word polyIntegratorName = "velocityVerlet"; if(dict.found("integrator")) { const word polyIntegratorNameTemp ( dict.lookup("integrator") ); polyIntegratorName = polyIntegratorNameTemp; } Info<< "Selecting polyIntegrator " << polyIntegratorName << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(polyIntegratorName); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalError << "polyIntegrator::New(const dictionary&) : " << endl << " unknown polyIntegrator type " << polyIntegratorName << ", constructor not in hash table" << endl << endl << " Valid types are :" << endl; Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError); } return autoPtr<polyIntegrator> ( cstrIter()(t, molCloud, dict) ); }
// Construct from dictionary Foam::BurgersViscoelastic::BurgersViscoelastic ( const word& name, const volSymmTensorField& sigma, const dictionary& dict ) : rheologyLaw(name, sigma, dict), rho_(dict.lookup("rho")), k1_(dict.lookup("k1")), eta1_(dict.lookup("eta1")), k2_(dict.lookup("k2")), eta2_(dict.lookup("eta2")), nu_(dict.lookup("nu")) {}
Foam::RBD::rigidBodyMotion::rigidBodyMotion ( const dictionary& dict ) : rigidBodyModel(dict), motionState_(*this, dict), motionState0_(motionState_), X00_(X0_.size()), aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)), aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)), report_(dict.lookupOrDefault<Switch>("report", false)), solver_(rigidBodySolver::New(*this, dict.subDict("solver"))) { if (dict.found("g")) { g() = vector(dict.lookup("g")); } initialize(); }
// Construct from dictionary Foam::multiMaterial::multiMaterial ( const word& name, const volSymmTensorField& sigma, const dictionary& dict ) : rheologyLaw(name, sigma, dict), PtrList<rheologyLaw>(), materials_ ( IOobject ( "materials", mesh().time().timeName(), mesh(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh() ) { PtrList<rheologyLaw>& laws = *this; PtrList<entry> lawEntries(dict.lookup("laws")); laws.setSize(lawEntries.size()); forAll (laws, lawI) { laws.set ( lawI, rheologyLaw::New ( lawEntries[lawI].keyword(), sigma, lawEntries[lawI].dict() ) ); }
sixDoFRigidBodyDisplacementPointPatchVectorField:: sixDoFRigidBodyDisplacementPointPatchVectorField ( const pointPatch& p, const DimensionedField<vector, pointMesh>& iF, const dictionary& dict ) : fixedValuePointPatchField<vector>(p, iF, dict), motion_(dict), rhoInf_(1.0), rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")), lookupGravity_(-1), g_(vector::zero), relaxationFactor_(dict.lookupOrDefault<scalar>("relaxationFactor", 1)) { if (rhoName_ == "rhoInf") { rhoInf_ = readScalar(dict.lookup("rhoInf")); } if (dict.readIfPresent("g", g_)) { lookupGravity_ = -2; } if (!dict.found("value")) { updateCoeffs(); } if (dict.found("initialPoints")) { initialPoints_ = vectorField("initialPoints", dict , p.size()); } else { initialPoints_ = p.localPoints(); } }
Foam::autoPtr<Foam::fieldValue> Foam::fieldValue::New ( const word& name, const objectRegistry& obr, const dictionary& dict, const bool loadFromFiles, const bool output ) { const word modelType(dict.lookup("type")); if (output) { Info<< "Selecting " << typeName << " " << modelType << endl; } dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown " << typeName << " type " << modelType << nl << nl << "Valid " << typeName << " types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr<fieldValue> ( cstrIter() ( name, obr, dict, loadFromFiles ) ); }
Foam::refinementParameters::refinementParameters(const dictionary& dict) : maxGlobalCells_(readLabel(dict.lookup("maxGlobalCells"))), maxLocalCells_(readLabel(dict.lookup("maxLocalCells"))), minRefineCells_(readLabel(dict.lookup("minRefinementCells"))), planarAngle_ ( dict.lookupOrDefault ( "planarAngle", readScalar(dict.lookup("resolveFeatureAngle")) ) ), nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))), keepPoints_(pointField(1, dict.lookup("locationInMesh"))), allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")), useTopologicalSnapDetection_ ( dict.lookupOrDefault<bool>("useTopologicalSnapDetection", true) ), maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance", 0)), handleSnapProblems_ ( dict.lookupOrDefault<Switch>("handleSnapProblems", true) ) { scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle"))); if (featAngle < 0 || featAngle > 180) { curvature_ = -GREAT; } else { curvature_ = Foam::cos(degToRad(featAngle)); } }
Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict ) : fixedGradientFvPatchScalarField(p, iF), limit_(limitControlNames_.read(dict.lookup("limit"))) { if (dict.found("gradient")) { gradient() = scalarField("gradient", dict, p.size()); fixedGradientFvPatchScalarField::updateCoeffs(); fixedGradientFvPatchScalarField::evaluate(); } else { fvPatchField<scalar>::operator=(patchInternalField()); gradient() = 0.0; } }
Foam::wordList Foam::functionObjects::forces::createFileNames ( const dictionary& dict ) const { DynamicList<word> names(1); const word forceType(dict.lookup("type")); names.append(forceType); if (dict.found("binData")) { const dictionary& binDict(dict.subDict("binData")); label nb = readLabel(binDict.lookup("nBin")); if (nb > 0) { names.append(forceType + "_bins"); } } return names; }
Foam::GAMGAgglomeration::GAMGAgglomeration ( const lduMesh& mesh, const dictionary& dict ) : MeshObject<lduMesh, GAMGAgglomeration>(mesh), maxLevels_(50), nCellsInCoarsestLevel_ ( readLabel(dict.lookup("nCellsInCoarsestLevel")) ), nCells_(maxLevels_), restrictAddressing_(maxLevels_), faceRestrictAddressing_(maxLevels_), meshLevels_(maxLevels_), interfaceLevels_(maxLevels_ + 1) {}
Foam::autoPtr<Foam::populationBalanceModel> Foam::populationBalanceModel::New ( const word& name, const dictionary& dict, const volVectorField& U, const surfaceScalarField& phi ) { word populationBalanceModelType(dict.lookup("populationBalanceModel")); Info<< "Selecting populationBalanceModel " << populationBalanceModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(populationBalanceModelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown populationBalanceModelType type " << populationBalanceModelType << endl << endl << "Valid populationBalanceModelType types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr<populationBalanceModel> ( cstrIter() ( name, dict.subDict(populationBalanceModelType + "Coeffs"), U, phi ) ); }
void Foam::addGlobalVariable::read(const dictionary& dict) { if(dict.found("globalVariables")) { const dictionary variables(dict.subDict("globalVariables")); const word scope(dict.lookup("globalScope")); wordList names(variables.toc()); forAll(names,i) { const word &name=names[i]; const dictionary &dict=variables.subDict(name); ExpressionResult &res=GlobalVariablesRepository::getGlobalVariables( obr_ ).addValue( name, scope, ExpressionResult(dict,true,true), false ); res.noReset(); } } else {
Foam:: SRFcylindricalInletVelocityFvPatchVectorField:: SRFcylindricalInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<vector>(p, iF, dict), relative_(dict.lookup("relative")), axis_(dict.lookup("axis")), centre_(dict.lookup("centre")), radialVelocity_(readScalar(dict.lookup("radialVelocity"))), tangentVelocity_(readScalar(dict.lookup("tangentVelocity"))), axialVelocity_(readScalar(dict.lookup("axialVelocity"))) {}
Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New ( const dictionary& dict, const incompressibleTwoPhaseInteractingMixture& mixture ) { word modelType(dict.lookup(typeName)); Info<< "Selecting relative velocity model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "relativeVelocityModel::New" "(" "const dictionary&" ")" ) << "Unknown time scale model type " << modelType << ", constructor not in hash table" << nl << nl << " Valid time scale model types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr<relativeVelocityModel> ( cstrIter() ( dict.subDict(modelType + "Coeffs"), mixture ) ); }
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch ( const word& name, const dictionary& dict, const label index, const polyBoundaryMesh& bm ) : processorPolyPatch(name, dict, index, bm), tag_ ( Pstream::nProcs()*max(myProcNo(), neighbProcNo()) + min(myProcNo(), neighbProcNo()) ), referPatchName_(dict.lookup("referPatch")), referPatchID_(-1) { if (debug) { Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_ << endl; } }
void polyStateController::updateStateControllerProperties ( const dictionary& newDict ) { // controllerDict_ = newDict.subDict("controllerProperties"); //- you can reset the controlling zone from here. This essentially // means that the coupling zone can infact move arbitrarily. To make // this happen we probably need to devise a technique for automatically // changing the cellZone else where, and then calling this function to // reset the controlling zone in which the controller operates in. if (newDict.found("control")) { control_ = Switch(newDict.lookup("control")); } /* if (newDict.found("readStateFromFile")) { readStateFromFile_ = Switch(newDict.lookup("readStateFromFile")); }*/ }
Foam::activePressureForceBaffleVelocityFvPatchVectorField:: activePressureForceBaffleVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchVectorField(p, iF), pName_(dict.lookupOrDefault<word>("p", "p")), cyclicPatchName_(dict.lookup("cyclicPatch")), cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)), orientation_(readLabel(dict.lookup("orientation"))), initWallSf_(0), initCyclicSf_(0), nbrCyclicSf_(0), openFraction_(readScalar(dict.lookup("openFraction"))), openingTime_(readScalar(dict.lookup("openingTime"))), maxOpenFractionDelta_(readScalar(dict.lookup("maxOpenFractionDelta"))), curTimeIndex_(-1), minThresholdValue_(readScalar(dict.lookup("minThresholdValue"))), fBased_(readBool(dict.lookup("forceBased"))), baffleActivated_(0) { fvPatchVectorField::operator=(vector::zero); if (p.size() > 0) { initWallSf_ = p.Sf(); initCyclicSf_ = p.boundaryMesh()[cyclicPatchLabel_].Sf(); nbrCyclicSf_ = refCast<const cyclicFvPatch> ( p.boundaryMesh()[cyclicPatchLabel_] ).neighbFvPatch().Sf(); } if (dict.found("p")) { dict.lookup("p") >> pName_; }
Foam::autoPtr<Foam::evaporationModel> Foam::evaporationModel::New ( const dictionary& dict ) { const word modelType(dict.lookup("evaporationModel")); Info<< "Selecting evaporationModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn("evaporationModel::New(const dictionary&)") << "Unknown evaporationModel type " << modelType << nl << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr<evaporationModel>(cstrIter()(dict)); }
SampledSurfaceValueExpressionDriver::SampledSurfaceValueExpressionDriver( const dictionary& dict, const fvMesh&mesh ) : SubsetValueExpressionDriver(dict), theSurface_( SurfacesRepository::getRepository(mesh).getSurface( dict, mesh ) ), interpolate_(dict.lookupOrDefault<bool>("interpolate",false)), interpolationType_( interpolate_ ? word(dict.lookup("interpolationType")) : word("nix") ) { setDebug(); }
Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::New ( const word& name, const dictionary& dict ) { const word bodyType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(bodyType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown rigidBody type " << bodyType << nl << nl << "Valid rigidBody types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr<rigidBody>(cstrIter()(name, dict)); }
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::InterfaceCompositionModel ( const dictionary& dict, const phasePair& pair ) : interfaceCompositionModel(dict, pair), thermo_ ( pair.phase1().mesh().lookupObject<Thermo> ( IOobject::groupName(basicThermo::dictName, pair.phase1().name()) ) ), otherThermo_ ( pair.phase2().mesh().lookupObject<OtherThermo> ( IOobject::groupName(basicThermo::dictName, pair.phase2().name()) ) ), Le_("Le", dimless, dict.lookup("Le")) {}
Foam::polynomial::polynomial(const word& entryName, const dictionary& dict) : DataEntry<scalar>(entryName), coeffs_(), canIntegrate_(true) { Istream& is(dict.lookup(entryName)); word entryType(is); is >> coeffs_; if (!coeffs_.size()) { FatalErrorIn("Foam::polynomial::polynomial(const word&, Istream&)") << "polynomial coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } forAll(coeffs_, i) { if (mag(coeffs_[i].second() + 1) < ROOTVSMALL) { canIntegrate_ = false; break; } } if (debug) { if (!canIntegrate_) { WarningIn("Foam::polynomial::polynomial(const word&, Istream&)") << "Polynomial " << this->name_ << " cannot be integrated" << endl; } } }
Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New ( const word& name, const fvMesh& mesh, const dictionary& dict, const word& cellZoneName ) { const word modelType(dict.lookup("type")); Info<< "Porosity region " << name << ":" << nl << " selecting model: " << modelType << endl; meshConstructorTable::iterator cstrIter = meshConstructorTablePtr_->find(modelType); if (cstrIter == meshConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown " << typeName << " type " << modelType << nl << nl << "Valid " << typeName << " types are:" << nl << meshConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr<porosityModel> ( cstrIter() ( name, modelType, mesh, dict, cellZoneName ) ); }
Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New ( const dictionary& surfaceCellSizeFunctionDict, const searchableSurface& surface, const scalar& defaultCellSize ) { word surfaceCellSizeFunctionTypeName ( surfaceCellSizeFunctionDict.lookup("surfaceCellSizeFunction") ); Info<< indent << "Selecting surfaceCellSizeFunction " << surfaceCellSizeFunctionTypeName << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(surfaceCellSizeFunctionTypeName); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "surfaceCellSizeFunction::New(dictionary&, " "const conformalVoronoiMesh&, const searchableSurface&)" ) << "Unknown surfaceCellSizeFunction type " << surfaceCellSizeFunctionTypeName << endl << endl << "Valid surfaceCellSizeFunction types are :" << endl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } return autoPtr<surfaceCellSizeFunction> ( cstrIter()(surfaceCellSizeFunctionDict, surface, defaultCellSize) ); }
Foam::XiModel::XiModel ( const dictionary& XiProperties, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su, const volScalarField& rho, const volScalarField& b, const surfaceScalarField& phi ) : XiModelCoeffs_ ( XiProperties.subDict ( word(XiProperties.lookup("XiModel")) + "Coeffs" ) ), thermo_(thermo), turbulence_(turbulence), Su_(Su), rho_(rho), b_(b), phi_(phi), Xi_ ( IOobject ( "Xi", b.time().timeName(), b.db(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), b.mesh() ) {}
timeVaryingSolidTractionFvPatchVectorField:: timeVaryingSolidTractionFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : solidTractionFvPatchVectorField(p, iF), timeSeries_(dict) { fieldName() = dimensionedInternalField().name(); traction() = vector::zero; pressure() = 0.0; nonLinear() = nonLinearGeometry::nonLinearNames_.read(dict.lookup("nonLinear")); //- the leastSquares has zero non-orthogonal correction //- on the boundary //- so the gradient scheme should be extendedLeastSquares if ( Foam::word ( dimensionedInternalField().mesh().schemesDict().gradScheme ( "grad(" + fieldName() + ")" ) ) != "extendedLeastSquares" ) { Warning << "The gradScheme for " << fieldName() << " should be \"extendedLeastSquares 0\" for the boundary " << "non-orthogonal correction to be right" << endl; } }
autoPtr<porosityCoefficient> porosityCoefficient::New ( const dictionary & poroProp ) { word poroForm = poroProp.lookup("resistanceFormulation"); porosityCoefficientConstructorTable::iterator cstrIter = porosityCoefficientConstructorTablePtr_->find(poroForm); if (cstrIter == porosityCoefficientConstructorTablePtr_->end()) { FatalErrorIn ( "porosityCoefficient::New(const dictionary &)" ) << "Unknown resistance formulation: " << poroForm << endl << endl << "Valid methods are :" << endl << porosityCoefficientConstructorTablePtr_->toc() << exit(FatalError); } return autoPtr<porosityCoefficient>(cstrIter()( poroProp )); }
autoPtr<dualGradeMountain> dualGradeMountain::New(const dictionary& dict) { const word mountainType(dict.lookup("type")); dictConstructorTable::iterator cstrIter = dictConstructorTablePtr_->find(mountainType); if (cstrIter == dictConstructorTablePtr_->end()) { FatalErrorIn ( "dualGradeMountain::New(const dictionary&)" ) << "Unknown type " << mountainType << nl << "Valid types: " << endl << dictConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr<dualGradeMountain> ( cstrIter()(dict) ); }