NeoN
A framework for CFD software
Loading...
Searching...
No Matches
boundary.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2023 - 2025 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
9
16
21
23{
24
25/* @brief creates a vector of boundary conditions of type calculated for every boundary
26 *
27 * @tparam Type of the Boundary ie SurfaceBoundary<scalar>
28 */
29template<typename BoundaryType>
30std::vector<BoundaryType> createCalculatedBCs(const UnstructuredMesh& mesh)
31{
32 std::vector<BoundaryType> bcs;
33 bcs.reserve(static_cast<std::size_t>(mesh.nBoundaries()));
34
35 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
36 {
37 Dictionary patchDict({{"type", std::string("calculated")}});
38 bcs.emplace_back(mesh, patchDict, patchID);
39 }
40 return bcs;
41};
42
43template<typename BoundaryType>
44std::vector<BoundaryType> createExtrapolatedBCs(const UnstructuredMesh& mesh)
45{
46 std::vector<BoundaryType> bcs;
47 bcs.reserve(mesh.nBoundaries());
48 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
49 {
50 Dictionary patchDict({{"type", std::string("extrapolated")}});
51 bcs.emplace_back(mesh, patchDict, patchID);
52 }
53 return bcs;
54};
55
56}
57
58namespace NeoN
59{
60
61namespace fvcc = finiteVolume::cellCentred;
62
65
66template class fvcc::volumeBoundary::FixedValue<scalar>;
67template class fvcc::volumeBoundary::FixedValue<Vec3>;
68
69template class fvcc::volumeBoundary::FixedGradient<scalar>;
70template class fvcc::volumeBoundary::FixedGradient<Vec3>;
71
72template class fvcc::volumeBoundary::Calculated<scalar>;
73template class fvcc::volumeBoundary::Calculated<Vec3>;
74
75template class fvcc::volumeBoundary::Extrapolated<scalar>;
76template class fvcc::volumeBoundary::Extrapolated<Vec3>;
77
78template class fvcc::volumeBoundary::Empty<scalar>;
79template class fvcc::volumeBoundary::Empty<Vec3>;
80
81template class fvcc::volumeBoundary::Symmetry<scalar>;
82template class fvcc::volumeBoundary::Symmetry<Vec3>;
83
86
87template class fvcc::surfaceBoundary::FixedValue<scalar>;
88template class fvcc::surfaceBoundary::FixedValue<Vec3>;
89
90template class fvcc::surfaceBoundary::Calculated<scalar>;
91template class fvcc::surfaceBoundary::Calculated<Vec3>;
92
93template class fvcc::surfaceBoundary::Empty<scalar>;
94template class fvcc::surfaceBoundary::Empty<Vec3>;
95
96template class fvcc::surfaceBoundary::Symmetry<scalar>;
97template class fvcc::surfaceBoundary::Symmetry<Vec3>;
98
99}
A class representing a dictionary that stores key-value pairs.
Represents an unstructured mesh in NeoN.
localIdx nBoundaries() const
Get the number of boundaries in the mesh.
std::vector< BoundaryType > createCalculatedBCs(const UnstructuredMesh &mesh)
Definition boundary.hpp:30
std::vector< BoundaryType > createExtrapolatedBCs(const UnstructuredMesh &mesh)
Definition boundary.hpp:44
Definition array.hpp:20
int32_t localIdx
Definition label.hpp:32