/* This file is part of the OpenLB library * * Copyright (C) 2006, Orestis Malaspinas and Jonas Latt * E-mail contact: info@openlb.net * The most recent release of OpenLB can be downloaded at * * * 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 -- generic implementation. */ #ifndef INAMURO_BOUNDARY_2D_HH #define INAMURO_BOUNDARY_2D_HH #include "inamuroBoundary2D.h" #include "inamuroAnalyticalDynamics.h" #include "inamuroAnalyticalDynamics.hh" #include "boundaryInstantiator2D.h" namespace olb { template class InamuroBoundaryManager2D { public: template static Momenta* getVelocityBoundaryMomenta(); template static Dynamics* getVelocityBoundaryDynamics(T omega, Momenta& momenta); template static PostProcessorGenerator2D* getVelocityBoundaryProcessor(int x0, int x1, int y0, int y1); template static Momenta* getPressureBoundaryMomenta(); template static Dynamics* getPressureBoundaryDynamics(T omega, Momenta& momenta); template static PostProcessorGenerator2D* getPressureBoundaryProcessor(int x0, int x1, int y0, int y1); template static PostProcessorGenerator2D* getConvectionBoundaryProcessor(int x0, int x1, int y0, int y1, T* uAv=NULL); template static Momenta* getExternalVelocityCornerMomenta(); template static Dynamics* getExternalVelocityCornerDynamics(T omega, Momenta& momenta); template static PostProcessorGenerator2D* getExternalVelocityCornerProcessor(int x, int y); template static Momenta* getInternalVelocityCornerMomenta(); template static Dynamics* getInternalVelocityCornerDynamics(T omega, Momenta& momenta); template static PostProcessorGenerator2D* getInternalVelocityCornerProcessor(int x, int y); }; ////////// InamuroBoundaryManager2D ///////////////////////////////////////// template template Momenta* InamuroBoundaryManager2D::getVelocityBoundaryMomenta() { return new BasicDirichletBM; } template template Dynamics* InamuroBoundaryManager2D:: getVelocityBoundaryDynamics(T omega, Momenta& momenta) { return new InamuroAnalyticalDynamics(omega, momenta); } template template PostProcessorGenerator2D* InamuroBoundaryManager2D:: getVelocityBoundaryProcessor(int x0, int x1, int y0, int y1) { return nullptr; } template template Momenta* InamuroBoundaryManager2D::getPressureBoundaryMomenta() { return new BasicDirichletBM; } template template Dynamics* InamuroBoundaryManager2D:: getPressureBoundaryDynamics(T omega, Momenta& momenta) { return new InamuroAnalyticalDynamics(omega, momenta); } template template PostProcessorGenerator2D* InamuroBoundaryManager2D:: getPressureBoundaryProcessor(int x0, int x1, int y0, int y1) { return nullptr; } template template PostProcessorGenerator2D* InamuroBoundaryManager2D:: getConvectionBoundaryProcessor(int x0, int x1, int y0, int y1, T* uAv) { return nullptr; } template template Momenta* InamuroBoundaryManager2D::getExternalVelocityCornerMomenta() { return new FixedVelocityBM; } template template Dynamics* InamuroBoundaryManager2D:: getExternalVelocityCornerDynamics(T omega, Momenta& momenta) { return new MixinDynamics(omega, momenta); } template template PostProcessorGenerator2D* InamuroBoundaryManager2D:: getExternalVelocityCornerProcessor(int x, int y) { return new OuterVelocityCornerProcessorGenerator2D (x,y); } template template Momenta* InamuroBoundaryManager2D::getInternalVelocityCornerMomenta() { return new InnerCornerVelBM2D; } template template Dynamics* InamuroBoundaryManager2D:: getInternalVelocityCornerDynamics(T omega, Momenta& momenta) { return new CombinedRLBdynamics(omega, momenta); } template template PostProcessorGenerator2D* InamuroBoundaryManager2D::getInternalVelocityCornerProcessor (int x, int y) { return nullptr; } ////////// Factory function ////////////////////////////////////////////////// template OnLatticeBoundaryCondition2D* createInamuroBoundaryCondition2D(BlockLatticeStructure2D& block) { return new BoundaryConditionInstantiator2D < T, DESCRIPTOR, InamuroBoundaryManager2D > (block); } } // namespace olb #endif