OpenLB 1.7
Loading...
Searching...
No Matches
operator.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 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
24#ifndef CORE_OPERATOR_H
25#define CORE_OPERATOR_H
26
27namespace olb {
28
29template <typename T, typename DESCRIPTOR, Platform PLATFORM> class ConcreteBlockLattice;
30template <typename T, Platform PLATFORM> class ConcreteBlockMask;
31
34 virtual ~AbstractBlockO() = default;
35
36 virtual std::type_index id() const = 0;
37};
38
40template <typename T, typename DESCRIPTOR, Platform PLATFORM>
41struct BlockO : public AbstractBlockO {
43 virtual void set(CellID iCell, bool state) = 0;
48};
49
51
54enum struct OperatorScope {
56 PerCell,
61};
62
64template<typename T, typename DESCRIPTOR, Platform PLATFORM, typename OPERATOR, OperatorScope SCOPE>
66
68template <typename T, typename DESCRIPTOR>
71
73
77 virtual std::size_t weight() const = 0;
79
84 virtual void set(CellID iCell, bool state, bool overlap) = 0;
85};
86
94
96template <typename T, typename DESCRIPTOR, Platform PLATFORM>
97struct BlockCollisionO : public AbstractCollisionO<T,DESCRIPTOR> {
101
106 CollisionDispatchStrategy strategy) = 0;
107};
108
110template<typename T, typename DESCRIPTOR, Platform PLATFORM, typename DYNAMICS>
112
114template <typename COUPLEES>
117 using value_t = typename COUPLEES::values_t::template get<0>::value_t;
119 using descriptor_t = typename COUPLEES::values_t::template get<0>::descriptor_t;
120
123
125 template <typename FIELD>
127
129 virtual void execute() = 0;
133
136 virtual void set(CellID iCell, bool state) = 0;
137
138};
139
141template<typename COUPLEES, Platform PLATFORM, typename OPERATOR, OperatorScope SCOPE>
143
144
145}
146
147#endif
Collision operation of concrete DYNAMICS on concrete block lattices of PLATFORM.
Coupling of COUPLEES using concrete OPERATOR with SCOPE on PLATFORM lattices.
Definition operator.h:142
Implementation of BlockLattice on a concrete PLATFORM.
Block application of concrete OPERATOR called using SCOPE on PLATFORM.
Definition operator.h:65
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.
std::uint32_t CellID
Type for sequential block-local cell indices.
CollisionDispatchStrategy
Collision dispatch strategy.
Definition operator.h:88
@ Individual
Apply all dynamics individually (async for Platform::GPU_CUDA)
@ Dominant
Apply dominant dynamics using mask and fallback to virtual dispatch for others.
OperatorScope
Block-wide operator application scopes.
Definition operator.h:54
@ PerBlock
Per-block application, i.e. OPERATOR::apply is passed a ConcreteBlockLattice.
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
Base of any block operator.
Definition operator.h:33
virtual std::type_index id() const =0
virtual ~AbstractBlockO()=default
Base of collision operations performed by BlockDynamicsMap.
Definition operator.h:69
virtual void set(CellID iCell, bool state, bool overlap)=0
Set whether iCell is covered by the present collision step.
virtual std::size_t weight() const =0
Returns number of assigned cells.
virtual Dynamics< T, DESCRIPTOR > * getDynamics()=0
Base of block-wide coupling operators executed by SuperLatticeCoupling.
Definition operator.h:115
typename COUPLEES::values_t::template get< 0 >::descriptor_t descriptor_t
Descriptor type used for coupling parameters.
Definition operator.h:119
typename COUPLEES::values_t::template get< 0 >::value_t value_t
Value type used for coupling parameters.
Definition operator.h:117
virtual void set(CellID iCell, bool state)=0
Set whether iCell is covered by the present coupling.
virtual AbstractParameters & getParameters()=0
Return reference to parameters of coupling operator.
virtual void execute()=0
Execute coupling operation.
Dynamic access interface for FIELD-valued parameters.
Collision operation on concrete blocks of PLATFORM.
Definition operator.h:97
virtual void setup(ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
Setup collision on block.
virtual void apply(ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block, ConcreteBlockMask< T, PLATFORM > &subdomain, CollisionDispatchStrategy strategy)=0
Apply collision on subdomain of block using strategy.
Base of block-wide operators such as post processors.
Definition operator.h:41
virtual void apply(ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
Apply operator on block.
virtual void set(CellID iCell, bool state)=0
Set whether iCell is covered by the operator (optional)
virtual void setup(ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
Setup operator context.
Interface for per-cell dynamics.
Definition interface.h:54
Set of FIELD-valued parameters.