NeoN
A framework for CFD software
Loading...
Searching...
No Matches
uncorrected.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
12
13#include <Kokkos_Core.hpp>
14
15#include <functional>
16
17
19{
20
21template<typename ValueType>
23 const VolumeField<ValueType>& volVector,
24 const std::shared_ptr<GeometryScheme> geometryScheme,
25 SurfaceField<ValueType>& surfaceVector
26);
27
28template<typename ValueType>
30 public FaceNormalGradientFactory<ValueType>::template Register<Uncorrected<ValueType>>
31{
33
34
35public:
36
37 Uncorrected(const Executor& exec, const UnstructuredMesh& mesh, Input)
38 : Base(exec, mesh), geometryScheme_(GeometryScheme::readOrCreate(mesh)) {};
39
40 Uncorrected(const Executor& exec, const UnstructuredMesh& mesh)
41 : Base(exec, mesh), geometryScheme_(GeometryScheme::readOrCreate(mesh)) {};
42
43 static std::string name() { return "uncorrected"; }
44
45 static std::string doc() { return "Uncorrected interpolation"; }
46
47 static std::string schema() { return "none"; }
48
49 virtual void faceNormalGrad(
50 const VolumeField<ValueType>& volVector, SurfaceField<ValueType>& surfaceVector
51 ) const override
52 {
53 computeFaceNormalGrad(volVector, geometryScheme_, surfaceVector);
54 }
55
56 virtual const SurfaceField<scalar>& deltaCoeffs() const override
57 {
58 return geometryScheme_->nonOrthDeltaCoeffs();
59 }
60
61 std::unique_ptr<FaceNormalGradientFactory<ValueType>> clone() const override
62 {
63 return std::make_unique<Uncorrected>(*this);
64 }
65
66private:
67
68 const std::shared_ptr<GeometryScheme> geometryScheme_;
69};
70
71// instantiate the template class
72template class Uncorrected<scalar>;
73template class Uncorrected<Vec3>;
74
75} // namespace NeoN
Represents an unstructured mesh in NeoN.
Represents a surface field in a finite volume method.
Uncorrected(const Executor &exec, const UnstructuredMesh &mesh)
Uncorrected(const Executor &exec, const UnstructuredMesh &mesh, Input)
virtual const SurfaceField< scalar > & deltaCoeffs() const override
virtual void faceNormalGrad(const VolumeField< ValueType > &volVector, SurfaceField< ValueType > &surfaceVector) const override
std::unique_ptr< FaceNormalGradientFactory< ValueType > > clone() const override
Represents a volume field in a finite volume method.
A template class for registering derived classes with a base class.
void computeFaceNormalGrad(const VolumeField< ValueType > &volVector, const std::shared_ptr< GeometryScheme > geometryScheme, SurfaceField< ValueType > &surfaceVector)
std::variant< Dictionary, TokenList > Input
Definition input.hpp:15
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:18