/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2023-2026 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 "irregular.H" #include "mathematicalConstants.H" #include "OSspecific.H" #include "randomGenerator.H" #include "rawSetWriter.H" #include "writeFile.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace waveModels { defineTypeNameAndDebug(irregular, 0); addToRunTimeSelectionTable(waveModel, irregular, dictionary); } } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::waveModels::AiryCoeffs Foam::waveModels::irregular::coeffs(const label i) const { return AiryCoeffs(depth_, amplitudes_[i], lengths_[i], g()); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::waveModels::irregular::irregular(const irregular& wave) : waveModel(wave), depth_(wave.depth_), spectrum_(wave.spectrum_, false), n_(wave.n_), span_(wave.span_), formatter_(wave.formatter_, false), amplitudes_(wave.amplitudes_), lengths_(wave.lengths_), phases_(wave.phases_) {} Foam::waveModels::irregular::irregular ( const dictionary& dict, const scalar g, const word& modelName ) : waveModel(dict, g), depth_(dict.lookupOrDefault("depth", great)), spectrum_(waveSpectrum::New(dict, g)), n_(dict.lookup