NeoN
A framework for CFD software
Loading...
Searching...
No Matches
volumeBoundaryFactory.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoN authors
3
4#pragma once
5
12
14{
15
16/* collects attributes of a boundary for simple queries
17 *
18 */
20{
22 // bool fixesValue;
23};
24
25template<typename ValueType>
28 VolumeBoundaryFactory<ValueType>,
29 Parameters<const UnstructuredMesh&, const Dictionary&, localIdx>>,
31{
32public:
33
34 static std::string name() { return "VolumeBoundaryFactory"; }
35
43
44 virtual ~VolumeBoundaryFactory() = default;
45
46 virtual void correctBoundaryCondition(Field<ValueType>& domainVector) = 0;
47
48 virtual std::unique_ptr<VolumeBoundaryFactory> clone() const = 0;
49
51
52protected:
53
55};
56
57
63template<typename ValueType>
65{
66public:
67
70 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID)],
71 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID) + 1],
73 ),
74 boundaryCorrectionStrategy_(VolumeBoundaryFactory<ValueType>::create(
75 dict.get<std::string>("type"), mesh, dict, patchID
76 ))
77 {}
78
80 : BoundaryPatchMixin(other),
81 boundaryCorrectionStrategy_(other.boundaryCorrectionStrategy_->clone())
82 {}
83
84 virtual void correctBoundaryCondition(Field<ValueType>& domainVector)
85 {
86 boundaryCorrectionStrategy_->correctBoundaryCondition(domainVector);
87 }
88
90 {
91 return boundaryCorrectionStrategy_->attributes();
92 }
93
94private:
95
96 // NOTE needs full namespace to be not ambiguous
97 std::unique_ptr<NeoN::finiteVolume::cellCentred::VolumeBoundaryFactory<ValueType>>
98 boundaryCorrectionStrategy_;
99};
100
101}
A class representing a dictionary that stores key-value pairs.
Represents the domain fields for a computational domain.
Definition field.hpp:34
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:30
std::size_t size_t
Definition label.hpp:36
bool assignable
whether values can be assigned to the boundary patch