NeoN
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
boundary.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoN authors
3
4#pragma once
5
8
14
18
20{
21
22/* @brief creates a vector of boundary conditions of type calculated for every boundary
23 *
24 * @tparam Type of the Boundary ie SurfaceBoundary<scalar>
25 */
26template<typename BoundaryType>
27std::vector<BoundaryType> createCalculatedBCs(const UnstructuredMesh& mesh)
28{
29 std::vector<BoundaryType> bcs;
30 bcs.reserve(mesh.nBoundaries());
31
32 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
33 {
34 Dictionary patchDict({{"type", std::string("calculated")}});
35 bcs.emplace_back(mesh, patchDict, patchID);
36 }
37 return bcs;
38};
39
40template<typename BoundaryType>
41std::vector<BoundaryType> createExtrapolatedBCs(const UnstructuredMesh& mesh)
42{
43 std::vector<BoundaryType> bcs;
44 bcs.reserve(mesh.nBoundaries());
45 for (localIdx patchID = 0; patchID < mesh.nBoundaries(); patchID++)
46 {
47 Dictionary patchDict({{"type", std::string("extrapolated")}});
48 bcs.emplace_back(mesh, patchDict, patchID);
49 }
50 return bcs;
51};
52
53}
54
55namespace NeoN
56{
57
58namespace fvcc = finiteVolume::cellCentred;
59
62
63template class fvcc::volumeBoundary::FixedValue<scalar>;
64template class fvcc::volumeBoundary::FixedValue<Vec3>;
65
66template class fvcc::volumeBoundary::FixedGradient<scalar>;
67template class fvcc::volumeBoundary::FixedGradient<Vec3>;
68
69template class fvcc::volumeBoundary::Calculated<scalar>;
70template class fvcc::volumeBoundary::Calculated<Vec3>;
71
72template class fvcc::volumeBoundary::Extrapolated<scalar>;
73template class fvcc::volumeBoundary::Extrapolated<Vec3>;
74
75template class fvcc::volumeBoundary::Empty<scalar>;
76template class fvcc::volumeBoundary::Empty<Vec3>;
77
80
81template class fvcc::surfaceBoundary::FixedValue<scalar>;
82template class fvcc::surfaceBoundary::FixedValue<Vec3>;
83
84template class fvcc::surfaceBoundary::Calculated<scalar>;
85template class fvcc::surfaceBoundary::Calculated<Vec3>;
86
87template class fvcc::surfaceBoundary::Empty<scalar>;
88template class fvcc::surfaceBoundary::Empty<Vec3>;
89
90}
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:27
std::vector< BoundaryType > createExtrapolatedBCs(const UnstructuredMesh &mesh)
Definition boundary.hpp:41
int32_t localIdx
Definition label.hpp:30