⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 communicator2d.h

📁 open lattice boltzmann project www.openlb.org
💻 H
字号:
/*  This file is part of the OpenLB library * *  Copyright (C) 2007 Mathias J. Krause *  Address: Wilhelm-Maybach-Str. 24, 68766 Hockenheim, Germany  *  E-mail: mathias.j.krause@gmx.de * *  This program 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 2 *  of the License, or (at your option) any later version. * *  This program 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 this program; if not, write to the Free  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *  Boston, MA  02110-1301, USA.*//** \file * A communincator provides a cuboids with cells of other  * cuboids -- header file. */#ifndef COMMUNICATOR_2D_H#define COMMUNICATOR_2D_H#include <vector>#include "cuboidNeighbourhood2D.h"#include "superLattice2D.h"/// All OpenLB code is contained in this namespace.namespace olb {/// A communincator provides a cuboids with data of other /// cuboids./** For each cuboid is a cuboid neighbourhood devined. A communicator * coordinates the communication of the single cuboids there the data * is stored locally. * * There are methods to add needed cells, send, receive and write * data of the cell. * * This class is not intended to be derived from. */template<typename T, template<typename U> class Lattice> class SuperLattice2D;template<typename T, template<typename U> class Lattice> class CuboidNeighbourhood2D;template<typename T, template<typename U> class Lattice>class Communicator2D {    private:        /// Stores the single cuboid neighbourhoods information        std::vector<CuboidNeighbourhood2D<T,Lattice> > _nh;        /// Reference to the super strucrture        SuperLattice2D<T,Lattice>& _sLattice;        /// Number of coboids in the structure        int _nC;        /// Indecates if there was an initialization done        bool _initDone;    public:        /// Constructor        Communicator2D(SuperLattice2D<T,Lattice>& sLattice);        /// Initializes the cuboid neighbourhoods        void init_nh();        /// Adds a cell (globX/globY) to the cuboid neigbourhood iC         /// that is then able to get data of the cell        void add_cell(int iC, T globX, T globY);        /// Adds all cells of the overlaps to its accociated cuboid        /// neigbourhood         void add_cells(int overlap);        /// Initializes the communicator        void init();        /// Resets all cuboids neighbourhoods        void reset();        /// Sends the needed data        void send();        /// Receives the needed data        void receive();        /// Writes all data to the block lattices of the super structure        void write();};}  // namespace olb#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -