NeoN
A framework for CFD software
Loading...
Searching...
No Matches
surfaceBoundaryFactory.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
16template<typename ValueType>
19 SurfaceBoundaryFactory<ValueType>,
20 Parameters<const UnstructuredMesh&, const Dictionary&, localIdx>>,
22{
23public:
24
25 static std::string name() { return "SurfaceBoundaryFactory"; }
26
28 const UnstructuredMesh& mesh, [[maybe_unused]] const Dictionary&, localIdx patchID
29 )
30 : BoundaryPatchMixin(mesh, patchID) {};
31
33
34 virtual std::unique_ptr<SurfaceBoundaryFactory> clone() const = 0;
35};
36
37
43template<typename ValueType>
45{
46public:
47
50 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID)],
51 mesh.boundaryMesh().offset()[static_cast<size_t>(patchID) + 1],
53 ),
54 boundaryCorrectionStrategy_(SurfaceBoundaryFactory<ValueType>::create(
55 dict.get<std::string>("type"), mesh, dict, patchID
56 ))
57 {}
58
60 : BoundaryPatchMixin(other),
61 boundaryCorrectionStrategy_(other.boundaryCorrectionStrategy_->clone())
62 {}
63
64 virtual void correctBoundaryCondition(Field<ValueType>& domainVector)
65 {
66 boundaryCorrectionStrategy_->correctBoundaryCondition(domainVector);
67 }
68
69
70private:
71
72 // NOTE needs full namespace to be not ambiguous
73 std::unique_ptr<NeoN::finiteVolume::cellCentred::SurfaceBoundaryFactory<ValueType>>
74 boundaryCorrectionStrategy_;
75};
76
77
78}
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< SurfaceBoundaryFactory > clone() const =0
virtual void correctBoundaryCondition(Field< ValueType > &field)=0
SurfaceBoundaryFactory(const UnstructuredMesh &mesh, const Dictionary &, localIdx patchID)
Represents a surface boundary field for a cell-centered finite volume method.
virtual void correctBoundaryCondition(Field< ValueType > &domainVector)
SurfaceBoundary(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
int32_t localIdx
Definition label.hpp:30
std::size_t size_t
Definition label.hpp:36