OpenLB 1.7
Loading...
Searching...
No Matches
blockLatticeStructure3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2006-2018 Jonas Latt, Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
27#ifndef BLOCK_LATTICE_STRUCTURE_3D_H
28#define BLOCK_LATTICE_STRUCTURE_3D_H
29
30#include <vector>
31#include "cell.h"
32#include "blockData3D.h"
33#include "blockStructure3D.h"
34#include "postProcessing.h"
35#include "serializer.h"
36#include "spatiallyExtendedObject3D.h"
37#include "geometry/blockGeometryStructure3D.h"
38#include "latticeStatistics.h"
41
42
43namespace olb {
44
45template<typename T, typename DESCRIPTOR> struct Dynamics;
46template<typename T, typename DESCRIPTOR> struct WriteCellFunctional;
47template<typename T> class BlockIndicatorF3D;
48template<typename T> class IndicatorSphere3D;
49
50
54template<typename T, typename DESCRIPTOR>
55class BlockLatticeStructure3D : public BlockStructure3D, public SpatiallyExtendedObject3D {
56public:
57 BlockLatticeStructure3D(int nx, int ny, int nz) : BlockStructure3D(nx,ny,nz) {};
59public:
60 /*
61 * Vectors out of Boundary instantiator privates
62 */
63 std::vector<Momenta<T,DESCRIPTOR>*> momentaVector;
64 std::vector<Dynamics<T,DESCRIPTOR>*> dynamicsVector;
66
70 virtual void defineRho(BlockIndicatorF3D<T>& indicator,
73 virtual void defineRho(BlockGeometryStructure3D<T>& blockGeometry, int material,
75
77
81 virtual void defineU(BlockIndicatorF3D<T>& indicator,
84 virtual void defineU(BlockGeometryStructure3D<T>& blockGeometry, int material,
86
88
93 virtual void defineRhoU(BlockIndicatorF3D<T>& indicator,
96 virtual void defineRhoU(BlockGeometryStructure3D<T>& blockGeometry, int material,
98
100
105 AnalyticalF<3,T,T>& Pop);
107 virtual void definePopulations(BlockGeometryStructure3D<T>& blockGeometry, int material,
108 AnalyticalF<3,T,T>& Pop);
114 BlockF3D<T>& Pop);
116 virtual void definePopulations(BlockGeometryStructure3D<T>& blockGeometry, int material,
117 BlockF3D<T>& Pop);
118
120
124 template <typename FIELD>
126 AnalyticalF<3,T,T>& field);
128 template <typename FIELD>
129 void defineField(BlockGeometryStructure3D<T>& blockGeometry, int material,
130 AnalyticalF<3,T,T>& field);
132
135 template <typename FIELD>
136 void defineField(BlockGeometryStructure3D<T>& blockGeometry,
137 IndicatorF3D<T>& indicatorF,
138 AnalyticalF<3,T,T>& field);
139
141
146 virtual void iniEquilibrium(BlockIndicatorF3D<T>& indicator,
149 virtual void iniEquilibrium(BlockGeometryStructure3D<T>& blockGeometry, int material,
151
153
158 virtual void iniRegularized(BlockIndicatorF3D<T>& indicator,
161 virtual void iniRegularized(BlockGeometryStructure3D<T>& blockGeometry, int material,
163
164 // pure virtual member functions
165 virtual Cell<T,DESCRIPTOR> get(int iX, int iY, int iZ) =0;
166 virtual Cell<T,DESCRIPTOR> get(const int latticeR[]) =0;
167 virtual ConstCell<T,DESCRIPTOR> get(int iX, int iY, int iZ) const =0;
168
169 virtual T& getPop(std::size_t iCell, unsigned iPop) =0;
170 virtual T& getPop(int iX, int iY, int iZ, unsigned iPop) =0;
171
172 virtual void initialize() =0;
173
175 virtual void defineDynamics(int iX, int iY, int iZ, Dynamics<T,DESCRIPTOR>* dynamics) = 0;
177 virtual void defineDynamics(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
178 Dynamics<T,DESCRIPTOR>* dynamics) = 0;
180 virtual void defineDynamics(BlockIndicatorF3D<T>& indicator,
181 Dynamics<T,DESCRIPTOR>* dynamics) = 0;
183 virtual void defineDynamics(BlockGeometryStructure3D<T>& blockGeometry, int material,
184 Dynamics<T,DESCRIPTOR>* dynamics) = 0;
185
186 virtual Dynamics<T,DESCRIPTOR>* getDynamics(int iX, int iY, int iZ) = 0;
187
188 virtual void collide(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) =0;
189 virtual void collide() =0;
190
191 virtual void stripeOffDensityOffset(int x0_, int x1_, int y0_, int y1_, int z0_,
192 int z1_, T offset) =0;
193 virtual void stripeOffDensityOffset(T offset) =0;
194
196 virtual void resetPostProcessors() =0;
197 virtual void postProcess(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) =0;
198 virtual void postProcess() =0;
199
201 std::vector<SpatiallyExtendedObject3D*> partners ) =0;
202 virtual void executeCoupling(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) =0;
203 virtual void executeCoupling() =0;
204
206 virtual LatticeStatistics<T> const& getStatistics() const =0;
207
208 virtual void freeSurfacePostProcess(size_t i, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) =0;
209 virtual void freeSurfacePostProcess(size_t i) =0;
210
211 virtual void freeSurfaceInitialize() = 0;
212};
213
215
216template <typename T>
217bool getRangeBlockGeometrySmoothIndicatorIntersection3D(BlockGeometryStructure3D<T>& blockGeometry,
219 T invDeltaX, std::vector<int>& start, std::vector<int>& end);
220
221template <typename T, typename DESCRIPTOR>
222void setBlockExternalParticleField( BlockGeometryStructure3D<T>& blockGeometry, AnalyticalF<3,T,T>& velocity,
224 BlockLattice3D<T,DESCRIPTOR>& extendedBlockLattice);
225
226template <typename T, typename DESCRIPTOR>
227void setBlockExternalParticleField( BlockGeometryStructure3D<T>& blockGeometry, AnalyticalF<3,T,T>& velocity,
229 BlockLattice3D<T,DESCRIPTOR>& extendedBlockLattice,
230 Vector<T,3> cellMin, Vector<T,3> cellMax,
231 Vector<bool,3> periodic);
232
233} // namespace olb
234
235#endif
Definition of a LB cell – header file.
AnalyticalF are applications from DD to XD, where X is set by the constructor.
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
Base block indicator functor.
BlockLatticeStructure3D is a interface class for defining dynamics on a BlockStructure3D.
virtual void freeSurfaceInitialize()=0
virtual void postProcess(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)=0
virtual void executeCoupling(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)=0
virtual ConstCell< T, DESCRIPTOR > get(int iX, int iY, int iZ) const =0
virtual Cell< T, DESCRIPTOR > get(int iX, int iY, int iZ)=0
virtual Dynamics< T, DESCRIPTOR > * getDynamics(int iX, int iY, int iZ)=0
virtual T & getPop(int iX, int iY, int iZ, unsigned iPop)=0
virtual void addPostProcessor(PostProcessorGenerator3D< T, DESCRIPTOR > const &ppGen)=0
virtual void stripeOffDensityOffset(T offset)=0
void defineField(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &field)
Define a field on a domain with a particular material number.
virtual void resetPostProcessors()=0
virtual void defineRhoU(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u)
Define rho and u on a domain described by an indicator.
virtual void defineU(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &u)
Define u on a domain described by an indicator.
virtual void defineRhoU(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u)
Define rho and u on a domain with a particular material number.
virtual void defineRho(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &rho)
Define rho on a domain described by an indicator.
virtual void defineRho(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &rho)
Define rho on a domain with a particular material number.
virtual void iniEquilibrium(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u)
Initialize by equilibrium on a domain described by an indicator.
virtual void definePopulations(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &Pop)
Define a population on a domain with a particular material number.
virtual Cell< T, DESCRIPTOR > get(const int latticeR[])=0
virtual void defineDynamics(int iX, int iY, int iZ, Dynamics< T, DESCRIPTOR > *dynamics)=0
Define the dynamics on a lattice site.
virtual void defineDynamics(BlockGeometryStructure3D< T > &blockGeometry, int material, Dynamics< T, DESCRIPTOR > *dynamics)=0
Define the dynamics on a domain with a particular material number.
std::vector< Momenta< T, DESCRIPTOR > * > momentaVector
virtual void iniRegularized(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u, AnalyticalF< 3, T, T > &pi)
Initialize by non- and equilibrium on a domain described by an indicator.
std::vector< Dynamics< T, DESCRIPTOR > * > dynamicsVector
virtual void stripeOffDensityOffset(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T offset)=0
virtual void initialize()=0
virtual void freeSurfacePostProcess(size_t i)=0
virtual void defineDynamics(BlockIndicatorF3D< T > &indicator, Dynamics< T, DESCRIPTOR > *dynamics)=0
Define the dynamics on a domain described by an indicator.
virtual void defineDynamics(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, Dynamics< T, DESCRIPTOR > *dynamics)=0
Define the dynamics on a 3D sub-box.
virtual void postProcess()=0
virtual void iniEquilibrium(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u)
Initialize by equilibrium on a domain with a particular material number.
BlockLatticeStructure3D(int nx, int ny, int nz)
virtual void executeCoupling()=0
void defineField(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &field)
Define a field on a domain described by an indicator.
virtual T & getPop(std::size_t iCell, unsigned iPop)=0
virtual void freeSurfacePostProcess(size_t i, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)=0
virtual void defineU(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &u)
Define u on a domain with a particular material number.
virtual void definePopulations(BlockIndicatorF3D< T > &indicator, AnalyticalF< 3, T, T > &Pop)
Define a population on a domain described by an indicator.
virtual void definePopulations(BlockIndicatorF3D< T > &indicator, BlockF3D< T > &Pop)
virtual void addLatticeCoupling(LatticeCouplingGenerator3D< T, DESCRIPTOR > const &lcGen, std::vector< SpatiallyExtendedObject3D * > partners)=0
virtual void collide(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)=0
virtual LatticeStatistics< T > & getStatistics()=0
virtual void definePopulations(BlockGeometryStructure3D< T > &blockGeometry, int material, BlockF3D< T > &Pop)
Define a population on a domain with a particular material number.
void defineField(BlockGeometryStructure3D< T > &blockGeometry, IndicatorF3D< T > &indicatorF, AnalyticalF< 3, T, T > &field)
Define a field on a domain described by an analytical indicator.
virtual void iniRegularized(BlockGeometryStructure3D< T > &blockGeometry, int material, AnalyticalF< 3, T, T > &rho, AnalyticalF< 3, T, T > &u, AnalyticalF< 3, T, T > &pi)
Initialize by equilibrium on a domain with a particular material number.
virtual LatticeStatistics< T > const & getStatistics() const =0
Highest-level interface to Cell data.
Definition cell.h:148
Highest-level interface to read-only Cell data.
Definition cell.h:53
IndicatorF3D is an application from .
Plain old scalar vector.
Definition vector.h:47
Interface for post-processing steps – header file.
Top level namespace for all of OpenLB.
void setBlockExternalParticleField(BlockGeometryStructure2D< T > &blockGeometry, AnalyticalF< 2, T, T > &velocity, SmoothIndicatorF2D< T, T, true > &sIndicator, BlockLattice2D< T, DESCRIPTOR > &extendedBlockLattice)
bool getRangeBlockGeometrySmoothIndicatorIntersection3D(BlockGeometryStructure3D< T > &blockGeometry, SmoothIndicatorF3D< T, T, true > &sIndicator, T invDeltaX, std::vector< int > &start, std::vector< int > &end)
Interface for post-processing steps – header file.
Interface for per-cell dynamics.
Definition interface.h:54