.. _program_listing_file_samplers_MultiCellSampler_MultiCellSampler.H: Program Listing for File MultiCellSampler.H =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``samplers/MultiCellSampler/MultiCellSampler.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::MultiCellSampler @brief Class for sampling from several consecutive cells per wall face. Contributors/Copyright: 2018-2026 Timofey Mukha SourceFiles MultiCellSampler.C \*---------------------------------------------------------------------------*/ #ifndef MultiCellSampler_H #define MultiCellSampler_H #include "fixedValueFvPatchFields.H" #include "Sampler.H" #include "SampledField.H" #include "scalarListIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class MultiCellSampler Declaration \*---------------------------------------------------------------------------*/ class MultiCellSampler: public Sampler { protected: // Protected data //- The lists of indices of the cells that data is sampled from labelListList indexList_; //- The distance from the wall that data is sampled from scalarListList h_; //- The distance from the wall that data is sampled from scalarListList lengthList_; // Protected Member Functions //- Create list of cell-indices from where data is sampled void createIndexList() override; //- Compute the length-scales void createLengthList(const word lengthScaleType) override; //- Compute length-scales as cubic root of the volume void createLengthListCubeRootVol(); //- Compute length-scales as distance across wall-normal direction void createLengthListWallNormalDistance(); public: #if !defined(DOXYGEN_SHOULD_SKIP_THIS) //- Runtime type information TypeName("MultiCellSampler"); #endif // Constructors //- Construct from patch and averaging time MultiCellSampler ( const fvPatch&, scalar averagingTime, const word interpolationType="cell", const word cellFinderType="Tree", const word lengthScaleType="CubeRootVol", bool hIsIndex=false, bool excludeWallAdjacent=false ); //- Construct from type, patch and averaging time MultiCellSampler ( const word & samplerName, const fvPatch & p, scalar averagingTime, const word interpolationType="cell", const word cellFinderType="Tree", const word lengthScaleType="CubeRootVol", bool hIsIndex=false, bool excludeWallAdjacent=false ); //- Copy constructor MultiCellSampler(const MultiCellSampler & orig) : Sampler(orig), indexList_(orig.indexList_), h_(orig.h_), lengthList_(orig.lengthList_) {} // Destructor virtual ~MultiCellSampler() {} // Member functions //- Add field for sampling void addField(SampledField *) override; //- Return the list of lists of cell-indices that are used to sample data const labelListList & indexList() const { return indexList_; } //- Return h const scalarListList & h() const { return h_; } //- Return the length-list const scalarListList & lengthList() const { return lengthList_; } //- Returning sampling cell indices for a given wall face using [] inline labelList operator[](const label i) const { return indexList_[i]; } //- Sample the fields void sample() const override; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif