.. _program_listing_file_helpers_helpers.H: Program Listing for File helpers.H ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``helpers/helpers.H``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /*---------------------------------------------------------------------------* \ License This file is part of libWallModelledLES. libWallModelledLES 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. libWallModelledLES 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 libWallModelledLES. If not, see . Class Foam::PatchProjector @brief Class for projecting fields and lists onto a patch. Contributors/Copyright: 2019 Timofey Mukha SourceFiles helpers.C \*---------------------------------------------------------------------------*/ #ifndef Helpers_H #define Helpers_H #include "fixedValueFvPatchFields.H" #include "scalarListIOList.H" #include "scalarListListIOList.H" #include "tmp.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace Helpers { void projectOnPatch(tmp normals, vectorField & field, bool inward=true); void projectOnPatch(tmp normals, scalarListListList & field); void projectOnPatch(tmp normals, scalarListList & field); tmp mag(const scalarListList & list); //- Convert listList to a field template tmp > listListToField(const scalarListList & list) { tmp > tField ( new Field(list.size(), pTraits::zero) ); Field & field = tField.ref(); forAll(list, i) { Type element; forAll(list[i], j) { element[j] = list[i][j]; } field[i] = element; } return tField; } Foam::scalar gaussian( const Foam::scalar scale, const Foam::scalar mu, const Foam::scalar sigma, const Foam::scalar x ); } // End namespace Foam } // End namespace Helpers // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif