OpenLB 1.8.1
Loading...
Searching...
No Matches
superLatticePointExtraction.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2025 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_SUPER_LATTICE_POINT_EXTRACTION_H
25#define CORE_SUPER_LATTICE_POINT_EXTRACTION_H
26
27#include "vector.h"
29
30#include <tuple>
31#include <map>
32
33namespace olb {
34
35template <typename FUNCTOR>
38
39 using parameters = FUNCTOR::parameters;
40
41 template <typename CELLS, typename PARAMETERS>
42 void apply(CELLS& cells, PARAMETERS& parameters) any_platform
43 {
44 auto point = cells.template get<names::Points>();
45 auto cell = cells.template get<names::Lattice>();
46 auto result = FUNCTOR().compute(cell, parameters);
47 point.template setField<typename FUNCTOR::result_field>(result);
48 }
49};
50
52template <typename T, typename DESCRIPTOR, typename FUNCTOR>
54private:
56
57 std::vector<std::tuple<int,std::size_t,Vector<T,DESCRIPTOR::d>>> _rankLocalPoints;
58 std::map<int,int> _rankLocalPointsSize;
59
65 > _couplingO;
66
69
70 void updateExtractionResultD(
72
73public:
75 const std::vector<Vector<T,DESCRIPTOR::d>>& points);
76
77 std::size_t getSize() const {
78 return _extractionPointD.getSize();
79 }
80
81 Vector<T,DESCRIPTOR::d> getPhysR(std::size_t iExtracted) const {
82 return _extractionPointD.getField(iExtracted);
83 }
84
85 auto getValue(std::size_t iExtracted) const {
86 return _extractionResultD.getField(iExtracted);
87 }
88
89 template <typename FIELD>
91 _couplingO.template setParameter<FIELD>(std::move(value));
92 }
93
94 void update();
95
96};
97
98}
99
100#endif
std::size_t getSize() const
SoA storage for instances of a single FIELD.
auto getField(std::size_t iCell) const
Return copy of FIELD data for cell iCell.
Coupling operator COUPLER on named COUPLEES.
Convenience class for extracting data associated to set of arbitrary physical points.
void setParameter(FieldD< T, DESCRIPTOR, FIELD > &&value)
SuperLatticePointExtraction(SuperLattice< T, DESCRIPTOR > &sLattice, const std::vector< Vector< T, DESCRIPTOR::d > > &points)
auto getValue(std::size_t iExtracted) const
Vector< T, DESCRIPTOR::d > getPhysR(std::size_t iExtracted) const
Super class maintaining block lattices for a cuboid decomposition.
Plain old scalar vector.
Top level namespace for all of OpenLB.
OperatorScope
Block-wide operator application scopes.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:77
static constexpr OperatorScope scope
void apply(CELLS &cells, PARAMETERS &parameters) any_platform
Pair of base value and descriptor type.
Definition base.h:123
efficient implementation of a vector class