OpenLB 1.7
Loading...
Searching...
No Matches
wall.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 Jan E. Marquardt, Mathias J. Krause
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 WALL_H
25#define WALL_H
26
29#include "utilities/aliases.h"
31
32namespace olb {
33
34template <typename T, unsigned D>
36private:
38 std::unique_ptr<IndicatorF<T, D>> _indPtr;
40 const unsigned _latticeMaterial;
42 const unsigned _contactMaterial;
44 const T _enlargementForContact;
45
46public:
48 constexpr SolidBoundary() = delete;
50 constexpr SolidBoundary(std::unique_ptr<IndicatorF<T, D>> indPtr,
51 unsigned latticeMaterial, unsigned contactMaterial,
52 T enlargementForContact = T {0});
53
55 constexpr unsigned getLatticeMaterial() const;
56 constexpr unsigned getContactMaterial() const;
57 constexpr T getEnlargementForContact() const;
58};
59
60
63template<typename T, unsigned D>
64std::unordered_set<int> getLatticeMaterials(
65 const std::vector<SolidBoundary<T,D>>& solidBoundaries )
66{
67 std::unordered_set<int> materials;
68 for (const SolidBoundary<T,D>& solidBoundary : solidBoundaries ){
69 materials.insert( solidBoundary.getLatticeMaterial() );
70 }
71 return materials;
72}
73
74
75} // namespace olb
76
77#endif
Top level namespace for all of OpenLB.
std::conditional_t< D==2, IndicatorF2D< T >, IndicatorF3D< T > > IndicatorF
Definition aliases.h:258
std::unordered_set< int > getLatticeMaterials(const std::vector< SolidBoundary< T, D > > &solidBoundaries)
Get material numbers of multiple solid boundaries in std::vector.
Definition wall.h:64
constexpr unsigned getLatticeMaterial() const
Definition wall.hh:48
constexpr unsigned getContactMaterial() const
Definition wall.hh:54
constexpr T getEnlargementForContact() const
Definition wall.hh:60
IndicatorF< T, D > * getIndicator()
Definition wall.hh:42
constexpr SolidBoundary()=delete
Constructor.