NeoN
A framework for CFD software
Loading...
Searching...
No Matches
gaussGreenDivLaplacian.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
13
15{
16
17
18/* @brief
19 *
20 */
21template<typename ValueType>
22class GaussGreenDivLaplacian : public dsl::OperatorMixin<VolumeField<ValueType>>
23{
24
25public:
26
27 using VectorValueType = ValueType;
28
30
32
34
36 requires(!std::is_same_v<ValueType, scalar>);
37
38 void read(const Input& input);
39
40 std::string getName() const;
41
43
44private:
45
46 dsl::Coeff coeffA_; // div coeff
47 dsl::Coeff coeffB_; // lap coeff
48
49 const SurfaceField<scalar>& gamma_;
50 const SurfaceField<scalar>& flux_;
51
52 std::shared_ptr<SurfaceInterpolation<ValueType>> divSurfaceInterpolation_;
53 std::shared_ptr<FaceNormalGradient<ValueType>> faceNormalGradient_;
54
55 // True when the div scheme carried a leading `bounded` prefix. The fused kernel then also emits
56 // the bounded-convection Sp diagonal term (applyBoundedDivDiagonal), matching the un-fused
57 // BoundedDiv path -- without it the momentum matrix loses its boundedness stabilisation and the
58 // solve diverges.
59 bool bounded_ = false;
60};
61
62// Required on MSVC: without extern template, each TU (DLL and EXE) gets its own
63// instantiation, causing duplicate-symbol linker errors and bloating compile times.
64extern template class GaussGreenDivLaplacian<scalar>;
65extern template class GaussGreenDivLaplacian<Vec3>;
66
67} // namespace NeoN
A class representing a dictionary that stores key-value pairs.
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
virtual const Executor & exec() const final
Definition operator.hpp:52
void implicitOperation(la::LinearSystem< scalar, ValueType > &ls) const
void implicitOperation(la::LinearSystem< ValueType > &ls) const
GaussGreenDivLaplacian(const Executor &exec, Dictionary divConfig, Dictionary lapConfig)
void explicitOperation(Vector< ValueType > &source) const
Represents a surface field in a finite volume method.
A class representing a linear system of equations.
std::variant< Dictionary, TokenList > Input
Definition input.hpp:15
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:20