From 94d3e79a8617f88dc0219cfdeedfa3147833719d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 24 Jun 2019 14:43:36 +0200 Subject: Initialize at openlb-1-3 --- src/core/blockLatticeView3D.h | 97 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/core/blockLatticeView3D.h (limited to 'src/core/blockLatticeView3D.h') diff --git a/src/core/blockLatticeView3D.h b/src/core/blockLatticeView3D.h new file mode 100644 index 0000000..af412ce --- /dev/null +++ b/src/core/blockLatticeView3D.h @@ -0,0 +1,97 @@ +/* This file is part of the OpenLB library + * + * Copyright (C) 2006, 2007 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 + * Dynamics for a generic 3D block lattice view -- header file. + */ + +#ifndef BLOCK_LATTICE_VIEW_3D_H +#define BLOCK_LATTICE_VIEW_3D_H + +#include +#include "blockLatticeStructure3D.h" +#include "geometry/blockGeometryStatistics3D.h" + +namespace olb { + +template +class BlockLatticeView3D : public BlockLatticeStructure3D { +public: + BlockLatticeView3D(BlockLatticeStructure3D& originalLattice_); + BlockLatticeView3D(BlockLatticeStructure3D& originalLattice_, + int x0_, int x1_, int y0_, int y1_, int z0_, int z1_); + ~BlockLatticeView3D() override; + BlockLatticeView3D(BlockLatticeView3D const& rhs); + BlockLatticeView3D& operator= + (BlockLatticeView3D const& rhs); + void swap(BlockLatticeView3D& rhs); + + Cell& get(int iX, int iY, int iZ) override; + Cell& get(const int latticeR[]) override; + Cell const& get(int iX, int iY, int iZ) const override; + void initialize() override; + void defineDynamics(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, + Dynamics* dynamics) override; + void defineDynamics(int iX, int iY, int iZ, Dynamics* dynamics) override; + void defineDynamics(BlockIndicatorF3D& indicator, + Dynamics* dynamics) override; + void defineDynamics(BlockGeometryStructure3D& blockGeometry, int material, + Dynamics* dynamics) override; + Dynamics* getDynamics(int iX, int iY, int iZ) override; + void collide ( + int x0_, int x1_, int y0_, int y1_, int z0_, int z1_ ) override; + void collide() override; + void stream(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override; + void stream(bool periodic=false) override; + void collideAndStream(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override; + void collideAndStream(bool periodic=false) override; + T computeAverageDensity ( + int x0_, int x1_, int y0_, int y1_, int z0_, int z1_ ) const override; + T computeAverageDensity() const override; + void computeStress(int iX, int iY, int iZ, T pi[util::TensorVal::n]) override; + void stripeOffDensityOffset ( + int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T offset ) override; + void stripeOffDensityOffset(T offset) override; + void forAll(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, + WriteCellFunctional const& application) override; + void forAll(WriteCellFunctional const& application) override; + void addPostProcessor ( + PostProcessorGenerator3D const& ppGen) override; + void resetPostProcessors() override; + void postProcess(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override; + void postProcess() override; + void addLatticeCoupling ( + LatticeCouplingGenerator3D const& lcGen, + std::vector partners ) override; + void executeCoupling(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override; + void executeCoupling() override; + LatticeStatistics& getStatistics() override; + LatticeStatistics const& getStatistics() const override; +private: + BlockLatticeStructure3D *originalLattice; + int x0, y0, z0; +}; + +} // namespace olb + +#endif -- cgit v1.2.3