/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015 IH-Cantabria ------------------------------------------------------------------------------- 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 "waveInletVelocityFvPatchVectorField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "waveModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF ) : fixedValueFvPatchField(p, iF), waveDictName_(waveModel::dictName) {} Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ( const waveInletVelocityFvPatchVectorField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : fixedValueFvPatchField(ptf, p, iF, mapper), waveDictName_(ptf.waveDictName_) {} Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : fixedValueFvPatchField(p, iF, dict), waveDictName_(dict.lookupOrDefault("waveDict", waveModel::dictName)) {} Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ( const waveInletVelocityFvPatchVectorField& ptf ) : fixedValueFvPatchField(ptf), waveDictName_(ptf.waveDictName_) {} Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField ( const waveInletVelocityFvPatchVectorField& ptf, const DimensionedField& iF ) : fixedValueFvPatchField(ptf, iF), waveDictName_(ptf.waveDictName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::waveInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { return; } tmp tmodel ( waveModel::lookupOrCreate ( patch().patch(), internalField().mesh(), waveDictName_ ) ); waveModel& model = const_cast(tmodel()); model.correct(db().time().value()); operator == (model.U()); fixedValueFvPatchField::updateCoeffs(); } void Foam::waveInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); os.writeKeyword("waveDictName") << waveDictName_ << token::END_STATEMENT << nl; writeEntry("value", os); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { makePatchTypeField ( fvPatchVectorField, waveInletVelocityFvPatchVectorField ); } // ************************************************************************* //