NeoN
A framework for CFD software
Loading...
Searching...
No Matches
gaussGreenLaplacian.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 - 2026 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
14
16{
17
18// Deferred non-orthogonal correction kernel for the Laplacian (defined in gaussGreenLaplacian.cpp).
19// Declared here so other operators (e.g. GaussGreenDivLaplacian) can reuse it. Adds the explicit
20// snGrad correction to the linear system's rhs; a no-op unless the snGrad scheme is corrected.
21template<typename FieldValueType, typename AssemblyType = FieldValueType>
24 const SurfaceField<scalar>& gamma,
26 const dsl::Coeff coeff,
27 const FaceNormalGradient<FieldValueType>& faceNormalGradient
28);
29
30template<typename FieldValueType, typename AssemblyType = FieldValueType>
32 public LaplacianOperatorFactory<FieldValueType, AssemblyType>::template Register<
33 GaussGreenLaplacian<FieldValueType, AssemblyType>>
34{
37
38public:
39
40 static std::string name() { return "Gauss"; }
41
42 static std::string doc() { return "Gauss-Green Laplacian"; }
43
44 static std::string schema() { return "none"; }
45
46 GaussGreenLaplacian(const Executor& exec, const UnstructuredMesh& mesh, const Input& inputs)
47 : Base(exec, mesh), surfaceInterpolation_(exec, mesh, inputs),
48 faceNormalGradient_(exec, mesh, inputs) {};
49
50 virtual void laplacian(
52 const SurfaceField<scalar>& gamma,
54 const dsl::Coeff coeff
55 ) override;
56
58 const SurfaceField<scalar>& gamma,
60 const dsl::Coeff coeff
61 ) const override;
62
63 virtual void laplacian(
65 const SurfaceField<scalar>& gamma,
67 const dsl::Coeff coeff
68 ) override;
69
70 virtual void laplacian(
72 const SurfaceField<scalar>& gamma,
74 const dsl::Coeff coeff
75 ) override;
76
77 std::unique_ptr<LaplacianOperatorFactory<FieldValueType, AssemblyType>> clone() const override
78 {
79 return std::make_unique<GaussGreenLaplacian<FieldValueType, AssemblyType>>(*this);
80 };
81
82private:
83
84 SurfaceInterpolation<FieldValueType> surfaceInterpolation_;
85
86 FaceNormalGradient<FieldValueType> faceNormalGradient_;
87};
88
89// Required on MSVC: without extern template, each TU (DLL and EXE) gets its own
90// instantiation of table() static local, so the DLL's addSubType() inserts into
91// a different map than the one the test binary queries.
92extern template class GaussGreenLaplacian<scalar>;
93extern template class GaussGreenLaplacian<Vec3>;
94extern template class GaussGreenLaplacian<Vec3, scalar>;
95
96} // namespace NeoN
Represents an unstructured mesh in NeoN.
A class to contain the data and executors for a field and define some basic operations.
Definition vector.hpp:27
A class that represents a coefficient for the NeoN dsl.
Definition coeff.hpp:24
std::unique_ptr< LaplacianOperatorFactory< FieldValueType, AssemblyType > > clone() const override
virtual VolumeField< FieldValueType > laplacian(const SurfaceField< scalar > &gamma, const VolumeField< FieldValueType > &phi, const dsl::Coeff coeff) const override
virtual void laplacian(Vector< FieldValueType > &lapPhi, const SurfaceField< scalar > &gamma, const VolumeField< FieldValueType > &phi, const dsl::Coeff coeff) override
virtual void laplacian(VolumeField< FieldValueType > &lapPhi, const SurfaceField< scalar > &gamma, const VolumeField< FieldValueType > &phi, const dsl::Coeff coeff) override
GaussGreenLaplacian(const Executor &exec, const UnstructuredMesh &mesh, const Input &inputs)
virtual void laplacian(la::LinearSystem< AssemblyType, FieldValueType > &ls, const SurfaceField< scalar > &gamma, const VolumeField< FieldValueType > &phi, const dsl::Coeff coeff) override
Represents a surface field in a finite volume method.
Represents a volume field in a finite volume method.
A class representing a linear system of equations.
A template class for registering derived classes with a base class.
void computeLaplacianNonOrthCorrImpl(la::LinearSystem< AssemblyType, FieldValueType > &ls, const SurfaceField< scalar > &gamma, const VolumeField< FieldValueType > &phi, const dsl::Coeff coeff, const FaceNormalGradient< FieldValueType > &faceNormalGradient)
std::variant< Dictionary, TokenList > Input
Definition input.hpp:15
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:20