NeoN
A framework for CFD software
Loading...
Searching...
No Matches
gaussGreenGrad.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
14{
15
16class GaussGreenGrad : public GradOperatorFactory<Vec3>::template Register<GaussGreenGrad>
17{
18
20
21public:
22
23 static std::string name() { return "Gauss"; }
24
25 static std::string doc() { return "Gauss-Green Gradient"; }
26
27 static std::string schema() { return "none"; }
28
29 GaussGreenGrad(const Executor& exec, const UnstructuredMesh& mesh);
30
31 // fvcc::VolumeField<Vec3> grad(const fvcc::VolumeField<scalar>& phi);
32
33 /* @brief compute implicit gradient operator contribution
34 *
35 * @param phi [in] - field for which the gradient is computed
36 * @param operatorScaling [in] - scales operator by a coefficient
37 * @param ls [in,out] - assemble gradient operator into the given linear system
38 */
39 virtual void
41 const override
42 {
43 NF_ERROR_EXIT("Not implemented");
44 };
45
46 virtual void grad(
47 const VolumeField<scalar>& phi, const dsl::Coeff operatorScaling, Vector<Vec3>& gradPhi
48 ) const;
49
50 /* @brief compute grad
51 *
52 * @param phi [in] - field for which the gradient is computed
53 * @param operatorScaling [in] - scales operator by a coefficient
54 * @param gradPhi [in,out] - resulting gradient field
55 */
56 virtual void grad(const VolumeField<scalar>&, const dsl::Coeff, VolumeField<Vec3>&) const
57 {
58 NF_ERROR_EXIT("Not implemented");
59 };
60
61 /* @brief compute explicit gradient operator and return result
62 *
63 * @param phi [in]
64 * @param operatorScaling [in] - scales operator by a coefficient
65 * @return gradPhi - resulting gradient field
66 */
68 grad(const VolumeField<scalar>& phi, const dsl::Coeff operatorScaling = dsl::Coeff {}) const;
69
70 virtual std::unique_ptr<GradOperatorFactory<Vec3>> clone() const
71 {
72 NF_ERROR_EXIT("Not implemented");
73 };
74
75private:
76
77 SurfaceInterpolation<scalar> surfaceInterpolation_;
78};
79
80} // 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:30
A class that represents a coefficient for the NeoN dsl.
Definition coeff.hpp:24
virtual void grad(const VolumeField< scalar > &, const dsl::Coeff, la::LinearSystem< Vec3, localIdx > &) const override
virtual void grad(const VolumeField< scalar > &, const dsl::Coeff, VolumeField< Vec3 > &) const
VolumeField< Vec3 > grad(const VolumeField< scalar > &phi, const dsl::Coeff operatorScaling=dsl::Coeff {}) const
virtual std::unique_ptr< GradOperatorFactory< Vec3 > > clone() const
GaussGreenGrad(const Executor &exec, const UnstructuredMesh &mesh)
virtual void grad(const VolumeField< scalar > &phi, const dsl::Coeff operatorScaling, Vector< Vec3 > &gradPhi) const
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.
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
Definition error.hpp:110
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:18