📄 superboundarycondition2d.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 helper for initialising 2D boundaries -- header file. */#ifndef SUPER_BOUNDARY_CONDITION_2D_H#define SUPER_BOUNDARY_CONDITION_2D_H#include <vector>#include "core/boundaryCondition2D.h"#include "superLattice2D.h"/// All OpenLB code is contained in this namespace.namespace olb {/// A helper for initialising 2D boundaries for super lattices./** Here we have methods that initializes for a given global * point or global range the local postprocessors and the * communicator (_commBC in SuperLattice) for boundary conditions. * * This class is not intended to be derived from. */template<typename T, template<typename U> class Lattice>class sOnLatticeBoundaryCondition2D { public: /// Constructor sOnLatticeBoundaryCondition2D(SuperLattice2D<T,Lattice>& sLattice); /// Copy construction sOnLatticeBoundaryCondition2D(sOnLatticeBoundaryCondition2D<T,Lattice> const& rhs); /// Copy assignment sOnLatticeBoundaryCondition2D operator=(sOnLatticeBoundaryCondition2D<T,Lattice> rhs); /// Destructor ~sOnLatticeBoundaryCondition2D(); void addVelocityBoundary0N(T x0, T x1, T y0, T y1, T omega); void addVelocityBoundary0P(T x0, T x1, T y0, T y1, T omega); void addVelocityBoundary1N(T x0, T x1, T y0, T y1, T omega); void addVelocityBoundary1P(T x0, T x1, T y0, T y1, T omega); void addPressureBoundary0N(T x0, T x1, T y0, T y1, T omega); void addPressureBoundary0P(T x0, T x1, T y0, T y1, T omega); void addPressureBoundary1N(T x0, T x1, T y0, T y1, T omega); void addPressureBoundary1P(T x0, T x1, T y0, T y1, T omega); void addExternalVelocityCornerNN(T x, T y, T omega); void addExternalVelocityCornerNP(T x, T y, T omega); void addExternalVelocityCornerPN(T x, T y, T omega); void addExternalVelocityCornerPP(T x, T y, T omega); void addInternalVelocityCornerNN(T x, T y, T omega); void addInternalVelocityCornerNP(T x, T y, T omega); void addInternalVelocityCornerPN(T x, T y, T omega); void addInternalVelocityCornerPP(T x, T y, T omega); /// Adds needed Cells to the Communicator _commBC in SuperLattice void addPoints2CommBC(int x0, int x1, int y0, int y1, int iCglob); SuperLattice2D<T,Lattice>& get_sLattice() {return _sLattice; }; std::vector<OnLatticeBoundaryCondition2D<T,Lattice>* >& get_blockBCs() {return _blockBCs; }; int get_overlap() {return _overlap; }; void set_overlap(int overlap) {_overlap = overlap; }; private: SuperLattice2D<T,Lattice>& _sLattice; std::vector<OnLatticeBoundaryCondition2D<T,Lattice>* > _blockBCs; int _overlap;};template<typename T, template<typename U> class Lattice, typename MixinDynamics>void createLocalBoundaryCondition2D(sOnLatticeBoundaryCondition2D<T,Lattice>& sBC);template<typename T, template<typename U> class Lattice, typename MixinDynamics>void createInterpBoundaryCondition2D(sOnLatticeBoundaryCondition2D<T,Lattice>& sBC);template<typename T, template<typename U> class Lattice>void createLocalBoundaryCondition2D(sOnLatticeBoundaryCondition2D<T,Lattice>& sBC) { createLocalBoundaryCondition2D<T,Lattice,BGKdynamics<T,Lattice> > (sBC);}template<typename T, template<typename U> class Lattice>void createInterpBoundaryCondition2D(sOnLatticeBoundaryCondition2D<T,Lattice>& sBC) { createInterpBoundaryCondition2D<T,Lattice,RLBdynamics<T,Lattice> > (sBC);}} // namespace olb#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -