NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
ddt.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2//
3// SPDX-FileCopyrightText: 2023 NeoFOAM authors
4
5#pragma once
6
9
11{
12
13template<typename FieldType>
14class Ddt : public OperatorMixin<FieldType>
15{
16
17public:
18
19 Ddt(FieldType& field) : OperatorMixin<FieldType>(field.exec(), field, Operator::Type::Temporal)
20 {}
21
22 std::string getName() const { return "TimeOperator"; }
23
24 void explicitOperation([[maybe_unused]] Field<scalar>& source, [[maybe_unused]] scalar scale)
25 {
26 NF_ERROR_EXIT("Not implemented");
27 }
28
29 void implicitOperation([[maybe_unused]] Field<scalar>& phi)
30 {
31 NF_ERROR_EXIT("Not implemented");
32 }
33};
34
35/* @brief factory function to create a Ddt term as ddt() */
36template<typename FieldType>
37Ddt<FieldType> ddt(FieldType& in)
38{
39 return Ddt(in);
40};
41
42} // namespace NeoFOAM
A class to contain the data and executors for a field and define some basic operations.
Definition field.hpp:49
virtual const Executor & exec() const final
Definition operator.hpp:208
std::string getName() const
Definition ddt.hpp:22
void implicitOperation(Field< scalar > &phi)
Definition ddt.hpp:29
Ddt(FieldType &field)
Definition ddt.hpp:19
void explicitOperation(Field< scalar > &source, scalar scale)
Definition ddt.hpp:24
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
Definition error.hpp:108
Ddt< FieldType > ddt(FieldType &in)
Definition ddt.hpp:37
float scalar
Definition scalar.hpp:11