NeoN
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
uncorrected.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoN authors
3
4#pragma once
5
11
12#include <Kokkos_Core.hpp>
13
14#include <functional>
15
16
18{
19
20template<typename ValueType>
22 const VolumeField<ValueType>& volVector,
23 const std::shared_ptr<GeometryScheme> geometryScheme,
24 SurfaceField<ValueType>& surfaceVector
25);
26
27template<typename ValueType>
29 public FaceNormalGradientFactory<ValueType>::template Register<Uncorrected<ValueType>>
30{
32
33
34public:
35
36 Uncorrected(const Executor& exec, const UnstructuredMesh& mesh, Input)
37 : Base(exec, mesh), geometryScheme_(GeometryScheme::readOrCreate(mesh)) {};
38
39 Uncorrected(const Executor& exec, const UnstructuredMesh& mesh)
40 : Base(exec, mesh), geometryScheme_(GeometryScheme::readOrCreate(mesh)) {};
41
42 static std::string name() { return "uncorrected"; }
43
44 static std::string doc() { return "Uncorrected interpolation"; }
45
46 static std::string schema() { return "none"; }
47
48 virtual void faceNormalGrad(
49 const VolumeField<ValueType>& volVector, SurfaceField<ValueType>& surfaceVector
50 ) const override
51 {
52 computeFaceNormalGrad(volVector, geometryScheme_, surfaceVector);
53 }
54
55 virtual const SurfaceField<scalar>& deltaCoeffs() const override
56 {
57 return geometryScheme_->nonOrthDeltaCoeffs();
58 }
59
60 std::unique_ptr<FaceNormalGradientFactory<ValueType>> clone() const override
61 {
62 return std::make_unique<Uncorrected>(*this);
63 }
64
65private:
66
67 const std::shared_ptr<GeometryScheme> geometryScheme_;
68};
69
70// instantiate the template class
71template class Uncorrected<scalar>;
72template class Uncorrected<Vec3>;
73
74} // 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:13
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:16