NeoN
A framework for CFD software
Loading...
Searching...
No Matches
volumeBoundaryFactory.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
10#include "NeoN/fields/field.hpp"
13
15{
16
17/* collects attributes of a boundary for simple queries
18 *
19 */
21{
23 // bool fixesValue;
24};
25
26template<typename ValueType>
29 VolumeBoundaryFactory<ValueType>,
30 Parameters<const UnstructuredMesh&, const Dictionary&, localIdx>>,
32{
33public:
34
35 static std::string name() { return "VolumeBoundaryFactory"; }
36
44
45 virtual ~VolumeBoundaryFactory() = default;
46
47 virtual void correctBoundaryCondition(Field<ValueType>& domainVector) = 0;
48
49 virtual std::unique_ptr<VolumeBoundaryFactory> clone() const = 0;
50
52
53protected:
54
56};
57
58
64template<typename ValueType>
66{
67public:
68
71 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID)],
72 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID) + 1],
74 ),
75 boundaryCorrectionStrategy_(VolumeBoundaryFactory<ValueType>::create(
76 dict.get<std::string>("type"), mesh, dict, patchID
77 ))
78 {}
79
81 : BoundaryPatchMixin(other),
82 boundaryCorrectionStrategy_(other.boundaryCorrectionStrategy_->clone())
83 {}
84
85 virtual void correctBoundaryCondition(Field<ValueType>& domainVector)
86 {
87 boundaryCorrectionStrategy_->correctBoundaryCondition(domainVector);
88 }
89
91 {
92 return boundaryCorrectionStrategy_->attributes();
93 }
94
95private:
96
97 // NOTE needs full namespace to be not ambiguous
98 std::unique_ptr<NeoN::finiteVolume::cellCentred::VolumeBoundaryFactory<ValueType>>
99 boundaryCorrectionStrategy_;
100};
101
102}
A class representing a dictionary that stores key-value pairs.
Represents the domain fields for a computational domain.
Definition field.hpp:36
A factory class for runtime selection of derived classes.
Represents an unstructured mesh in NeoN.
A base class for implementing derived boundary conditions.
virtual std::unique_ptr< VolumeBoundaryFactory > clone() const =0
virtual void correctBoundaryCondition(Field< ValueType > &domainVector)=0
VolumeBoundaryFactory(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID, BoundaryAttributes attributes)
BoundaryAttributes attributes_
The attributes of the patch.
Represents a volume boundary field for a cell-centered finite volume method.
VolumeBoundary(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
virtual void correctBoundaryCondition(Field< ValueType > &domainVector)
int32_t localIdx
Definition label.hpp:32
std::size_t size_t
Definition label.hpp:38
bool assignable
whether values can be assigned to the boundary patch