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
15
19
21{
22
23/* @brief creates a vector of boundary conditions of type calculated for every boundary
24 *
25 * @tparam Type of the Boundary ie SurfaceBoundary<scalar>
26 */
27template<typename BoundaryType>
28std::vector<BoundaryType> createCalculatedBCs(const UnstructuredMesh& mesh)
29{
30 std::vector<BoundaryType> bcs;
31 bcs.reserve(static_cast<std::size_t>(mesh.nBoundaries()));
32
33 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
34 {
35 Dictionary patchDict({{"type", std::string("calculated")}});
36 bcs.emplace_back(mesh, patchDict, patchID);
37 }
38 return bcs;
39};
40
41template<typename BoundaryType>
42std::vector<BoundaryType> createExtrapolatedBCs(const UnstructuredMesh& mesh)
43{
44 std::vector<BoundaryType> bcs;
45 bcs.reserve(mesh.nBoundaries());
46 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
47 {
48 Dictionary patchDict({{"type", std::string("extrapolated")}});
49 bcs.emplace_back(mesh, patchDict, patchID);
50 }
51 return bcs;
52};
53
54}
55
56namespace NeoN
57{
58
59namespace fvcc = finiteVolume::cellCentred;
60
63
64template class fvcc::volumeBoundary::FixedValue<scalar>;
65template class fvcc::volumeBoundary::FixedValue<Vec3>;
66
67template class fvcc::volumeBoundary::FixedGradient<scalar>;
68template class fvcc::volumeBoundary::FixedGradient<Vec3>;
69
70template class fvcc::volumeBoundary::Calculated<scalar>;
71template class fvcc::volumeBoundary::Calculated<Vec3>;
72
73template class fvcc::volumeBoundary::Extrapolated<scalar>;
74template class fvcc::volumeBoundary::Extrapolated<Vec3>;
75
76template class fvcc::volumeBoundary::Empty<scalar>;
77template class fvcc::volumeBoundary::Empty<Vec3>;
78
81
82template class fvcc::surfaceBoundary::FixedValue<scalar>;
83template class fvcc::surfaceBoundary::FixedValue<Vec3>;
84
85template class fvcc::surfaceBoundary::Calculated<scalar>;
86template class fvcc::surfaceBoundary::Calculated<Vec3>;
87
88template class fvcc::surfaceBoundary::Empty<scalar>;
89template class fvcc::surfaceBoundary::Empty<Vec3>;
90
91}
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:28
std::vector< BoundaryType > createExtrapolatedBCs(const UnstructuredMesh &mesh)
Definition boundary.hpp:42
Definition array.hpp:20
int32_t localIdx
Definition label.hpp:32