Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL implementation stack #102

Merged
merged 136 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
d888bde
add documentation
HenningScheufler Sep 4, 2024
2140ab8
documentation update
HenningScheufler Sep 4, 2024
8c97fb2
Apply suggestions from code review
HenningScheufler Sep 5, 2024
03ef014
Apply suggestions from code review
greole Sep 29, 2024
00daf21
build always a documentation
greole Sep 30, 2024
a71a79f
comment test url
greole Sep 30, 2024
ed7c326
keep one sentence per line
greole Sep 30, 2024
72ed98a
move DSL documentation
greole Sep 30, 2024
5b0cac0
move DSL documentation
greole Sep 30, 2024
d964046
wording change plus/minus ->addition,subtraction. Deduplicate
greole Sep 30, 2024
00097bd
init implemnetation of the DSL
HenningScheufler Jul 24, 2024
a79e5a7
categorize terms into temporal, implicit and sources
HenningScheufler Jul 25, 2024
a2f18f8
added forward euler as integration method
HenningScheufler Jul 25, 2024
29bf3f4
changes kokkos header
HenningScheufler Jul 25, 2024
3a954c5
eqnTerm uses field
HenningScheufler Jul 25, 2024
90ec6ee
initial commit
greole Jul 11, 2024
d2aa274
FIX: false specified executor
HenningScheufler Jul 26, 2024
5f64d8c
WIP: forwardEuler
HenningScheufler Jul 26, 2024
8ec3309
added dt to eqnsystem
HenningScheufler Jul 26, 2024
d2109e7
DSl use move semantics reduce complexity to linear
HenningScheufler Aug 10, 2024
fd165d0
Pull scaling field from from #136
greole Sep 30, 2024
b10bb2b
refactor scalingFields to coeff
greole Sep 30, 2024
7e43c6b
Update include/NeoFOAM/DSL/coeff.hpp
greole Oct 4, 2024
634568a
fix namespace and toField docstring
greole Oct 4, 2024
fc4c38b
move toField to free function
greole Oct 4, 2024
929d37e
fix: getSpan tests segfault on GPU span access GPU memory from CPU
HenningScheufler Oct 6, 2024
e2af6cd
test coeff in parallelfor
HenningScheufler Oct 6, 2024
7377af8
Merge pull request #151 from exasim-project/impl/scalingField
HenningScheufler Oct 6, 2024
549daa6
wip add modifications to operators
greole Oct 4, 2024
2a9c309
refactor constructors
greole Oct 4, 2024
9f01abb
wip add tests
greole Oct 5, 2024
ba1a68f
rename input/add further operator tests
greole Oct 7, 2024
627bf90
add getName()
greole Oct 7, 2024
62f2fc5
fix format
greole Oct 7, 2024
f9e82e8
add getName function
greole Oct 7, 2024
7111a82
remove evaluated
greole Oct 7, 2024
135b918
remove field and nCells
greole Oct 7, 2024
281137e
refactor operator=
greole Oct 7, 2024
7516cc3
remove operator=
greole Oct 7, 2024
37b8763
Merge pull request #152 from exasim-project/impl/eqnTerm
greole Oct 8, 2024
d376d27
renamed EqnSystem->Equation
greole Oct 7, 2024
13905d1
mark explicitOperation as const
greole Oct 7, 2024
b5bc333
add overload for explicitOperation
greole Oct 7, 2024
9c8aa79
remove volumeField for now
greole Oct 7, 2024
b182f06
Merge pull request #150 from exasim-project/impl/dsl_interface
greole Oct 8, 2024
e0098fc
update class names
greole Oct 10, 2024
2c01069
Merge pull request #147 from exasim-project/doc/dsl
greole Oct 10, 2024
852a433
wip refactor timeintegration
greole Oct 8, 2024
a3d2d4f
reorganize, change DSL->dsl, move timeIntegration to dsl
greole Oct 11, 2024
a9bf558
fix warnings, clean NeoFOAM:: in test
greole Oct 11, 2024
5441e72
init implemnetation of the DSL
HenningScheufler Jul 24, 2024
79294ea
categorize terms into temporal, implicit and sources
HenningScheufler Jul 25, 2024
f125c11
added forward euler as integration method
HenningScheufler Jul 25, 2024
cb58d6b
changes kokkos header
HenningScheufler Jul 25, 2024
624748a
eqnTerm uses field
HenningScheufler Jul 25, 2024
f4837db
initial commit
greole Jul 11, 2024
99fc3eb
FIX: false specified executor
HenningScheufler Jul 26, 2024
b9dfe10
WIP: forwardEuler
HenningScheufler Jul 26, 2024
48518a5
added dt to eqnsystem
HenningScheufler Jul 26, 2024
74c2a3f
DSl use move semantics reduce complexity to linear
HenningScheufler Aug 10, 2024
dc12ab0
Pull scaling field from from #136
greole Sep 30, 2024
387f95f
refactor scalingFields to coeff
greole Sep 30, 2024
dac0c54
Update include/NeoFOAM/DSL/coeff.hpp
greole Oct 4, 2024
d89202c
fix namespace and toField docstring
greole Oct 4, 2024
28ceb80
move toField to free function
greole Oct 4, 2024
b837006
fix: getSpan tests segfault on GPU span access GPU memory from CPU
HenningScheufler Oct 6, 2024
a415f6d
test coeff in parallelfor
HenningScheufler Oct 6, 2024
f9b8453
wip add modifications to operators
greole Oct 4, 2024
d85c1ce
refactor constructors
greole Oct 4, 2024
06120b1
wip add tests
greole Oct 5, 2024
2457021
rename input/add further operator tests
greole Oct 7, 2024
fe1cee0
add getName()
greole Oct 7, 2024
250935f
fix format
greole Oct 7, 2024
d6c5512
add getName function
greole Oct 7, 2024
9415cf7
remove evaluated
greole Oct 7, 2024
8df98b1
remove field and nCells
greole Oct 7, 2024
cb2484b
refactor operator=
greole Oct 7, 2024
a436a8b
remove operator=
greole Oct 7, 2024
663e9e5
renamed EqnSystem->Equation
greole Oct 7, 2024
e42845b
mark explicitOperation as const
greole Oct 7, 2024
3a1b7a1
add overload for explicitOperation
greole Oct 7, 2024
0127c97
remove volumeField for now
greole Oct 7, 2024
d229c29
add documentation
HenningScheufler Sep 4, 2024
9803896
documentation update
HenningScheufler Sep 4, 2024
3534aea
Apply suggestions from code review
HenningScheufler Sep 5, 2024
0c9eed2
Apply suggestions from code review
greole Sep 29, 2024
9c1648f
build always a documentation
greole Sep 30, 2024
feb8ce2
comment test url
greole Sep 30, 2024
daf3a13
keep one sentence per line
greole Sep 30, 2024
9b9fbf7
move DSL documentation
greole Sep 30, 2024
3962692
move DSL documentation
greole Sep 30, 2024
c0996f9
wording change plus/minus ->addition,subtraction. Deduplicate
greole Sep 30, 2024
6436f3f
update class names
greole Oct 10, 2024
50f6c7c
wip time integration
greole Oct 11, 2024
c5d5c6a
use and test dedicated ddt operator
greole Oct 12, 2024
51df98e
add free solve function
greole Oct 13, 2024
34fc503
improve error message for non matching executors
greole Oct 14, 2024
ecfeac7
add size() getter
greole Oct 14, 2024
f102094
make exec() method final
greole Oct 14, 2024
e5f5a95
add time setter/getter, docstrings, pass dictionaries
greole Oct 14, 2024
38a97a2
improve simple time integration test
greole Oct 14, 2024
41acd45
remove EquationType template argument
greole Oct 16, 2024
83be03a
move solve out of equation
greole Oct 16, 2024
08a2fa8
rename Equation -> Expression
greole Oct 18, 2024
a61ec61
reorganize structure
greole Oct 18, 2024
ee0f1c0
Apply suggestions from code review
greole Oct 21, 2024
1e08f07
require field in OperatorMixin
greole Oct 25, 2024
3993582
remove dt from equation, fix warnings
greole Oct 25, 2024
ce14d19
remove unused file, rename timeIntegrationFactory->timeIntegrationBase
greole Oct 25, 2024
7a755e5
Merge branch 'stack/dsl' into impl/timeIntegration
greole Oct 25, 2024
adb378f
fixup
greole Oct 25, 2024
d752b23
Merge pull request #158 from exasim-project/impl/timeIntegration
greole Oct 25, 2024
701da67
add missing mermaid package
greole Oct 25, 2024
ea8cbbe
- Removed old include/NeoFOAM/DSL
bevanwsjones Oct 27, 2024
ffd01e7
- removed finiteVolume time integration, which was based on DSL.
bevanwsjones Oct 27, 2024
95dc8f2
- Updated DSL->dsl change to docs
bevanwsjones Oct 27, 2024
5ce7bb8
- Removed equation test (replaced by expression test).
bevanwsjones Oct 27, 2024
747e334
- Added trailing white space to CMakeLists.txt in test/dsl
bevanwsjones Oct 27, 2024
ecbda03
Merge pull request #173 from exasim-project/remove-old-DSL
bevanwsjones Oct 27, 2024
0581b6f
wip fix unused #include
greole Nov 2, 2024
1ffb726
format files
greole Nov 2, 2024
08221c3
wip fix unused #include
greole Nov 2, 2024
7e641af
Merge pull request #175 from exasim-project/fix/headers
greole Nov 14, 2024
1b9c574
fix docstrings
greole Nov 26, 2024
a8ca05d
remove unused headers
greole Nov 26, 2024
0ba618a
add [[nodiscard]]
greole Nov 26, 2024
8d9b954
fix warnings
greole Nov 26, 2024
34deb21
update documentatioin
greole Nov 26, 2024
c995f62
update docstring
greole Nov 26, 2024
f4c2e97
update changelog
greole Nov 26, 2024
36e8c48
Merge branch 'main' into stack/dsl
greole Nov 26, 2024
d270cf3
clean-up
greole Nov 26, 2024
d1c25ad
clean-up
greole Nov 26, 2024
df8fc57
update documentation
greole Nov 26, 2024
5eeb6fa
fix interpolation
greole Nov 26, 2024
05e94db
update documentation
greole Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/build_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ env:

on:
pull_request:
branches:
- main
types: [closed, synchronize, opened]
push:
tags:
Expand Down Expand Up @@ -50,6 +48,13 @@ jobs:
with:
folder: docs_build
target-folder: latest
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Deployed test documentation to https://exasim-project.com/NeoFOAM/Build_PR_${{ env.PR_NUMBER }}
comment_tag: build_url

- name: Echo Build PR URL
run: |
echo "Deploy to: https://exasim-project.com/NeoFOAM/Build_PR_${{ env.PR_NUMBER }}"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Version 0.1.0 (unreleased)
- Implement a DSL interface []()
- improved error handling and addition of tokenList and Input [#134](https://github.com/exasim-project/NeoFOAM/pull/134)
- disable span from temporary objects and simplification related to fields [#139](https://github.com/exasim-project/NeoFOAM/pull/139)
- added launch json to debug unit test in vscode [#135](https://github.com/exasim-project/NeoFOAM/pull/135)
Expand Down
4 changes: 2 additions & 2 deletions doc/basics/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Fields
Cell Centered Fields
^^^^^^^^^^^^^^^^^^^^

The ``VolumeField`` stores the field values at cell centers and along boundaries, providing essential data for constructing the DSL (Domain Specific Language). This functionality also includes access to mesh data, integrating closely with the computational framework.
The ``VolumeField`` stores the field values at cell centers and along boundaries, providing essential data for constructing the Domain Specific Language (DSL). This functionality also includes access to mesh data, integrating closely with the computational framework.

``DomainField`` acts as the fundamental data container within this structure, offering both read and write to the ``internalField`` and ``boundaryFields`` provided by the ``DomainField``. The ``correctBoundaryConditions`` member function updates the field's boundary conditions, which are specified at construction. It does not hold the data but rather modifies the ``DomainField`` or ``BoundaryField`` container.

Expand All @@ -26,7 +26,7 @@ Functionally, ``fvccVolField`` parallels several OpenFOAM classes such as ``volS
Face Centered fields
^^^^^^^^^^^^^^^^^^^^

The ``SurfaceField`` class stores the field values interpreted as face centers values. Additionally, it stores boundaries for the corresponding boundary conditions. This provides essential data for constructing the DSL (Domain Specific Language). The functionality also includes access to mesh data, integrating closely with the computational framework.
The ``SurfaceField`` class stores the field values interpreted as face centers values. Additionally, it stores boundaries for the corresponding boundary conditions. This provides essential data for constructing the DSL. The functionality also includes access to mesh data, integrating closely with the computational framework.

``DomainField`` acts as the fundamental data container within this structure, offering both read and to the ``internalField`` and ``boundaryField`` provided by the ``DomainField``. The ``correctBoundaryConditions`` member function updates field's boundary conditions, which are specified at construction. It does not hold the data, but modify the ``DomainField`` or ``BoundaryField`` container.

Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.mermaid',
'sphinx.ext.intersphinx',
'sphinx.ext.autosectionlabel',
'sphinx.ext.todo',
Expand Down
50 changes: 50 additions & 0 deletions doc/dsl/equation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Equation
---------


The `Equation` class in NeoFOAM holds, manages, builds and solves the expressed/programmed equation.
Its core responsibility lie in the answering of the following questions:

- How to discretize the spatial terms?
- In OpenFOAM this information is provided in **fvSchemes**
- How to integrate the system in time?
- In OpenFOAM this information is provided in **fvSchemes**
- How to solve the system?
- In OpenFOAM this information is provided in **fvSolution**

The main difference between NeoFOAM and OpenFOAM is that the DSL is evaluated lazily, i.e. evaluation is not performed on construction by default.
Since, the evaluation is not tied to the construction but rather delayed, other numerical integration strategies (e.g. RK methods or even sub-stepping within an the equation) are possible.

To implement lazy evaluation, the `Equation` stores 3 vectors:

.. mermaid::

classDiagram
class Operator {
+explicitOperation(...)
+implicitOperation(...)
}
class DivOperator {
+explicitOperation(...)
+implicitOperation(...)
}
class TemporalOperator {
+explicitOperation(...)
+implicitOperation(...)
}
class Others["..."] {
+explicitOperation(...)
+implicitOperation(...)
}
class Equation {
+temporalTerms_: vector~Operator~
+implicitTerms_: vector~Operator~
+explicitTerms_: vector~Operator~
}
Operator <|-- DivOperator
Operator <|-- TemporalOperator
Operator <|-- Others
Equation <|-- Operator

Thus, an `Equation` consists of multiple `Operators` which are either explicit, implicit, or temporal.
Consequently, addition, subtraction, and scaling with a field needs to be handled by the `Operator`.
71 changes: 71 additions & 0 deletions doc/dsl/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.. _fvcc:

Domain Specific Language (DSL)
==============================

The concept of a Domain Specific Language (DSL) allows to dramatically simplify the process of implementing and solving equations in a given programming language like C++.
Engineers can express equations in a concise and readable form, closely resembling their mathematical representation and no or little knowledge of the numerical schemes and implementation is required.
This approach allows engineers to focus on the physics of the problem rather than the numerical implementation and helps in reducing the time and effort required to develop and maintain complex simulations.

The Navier-Stokes equations can be expressed in the DSL in OpenFOAM as follows:

.. code-block:: cpp

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);

solve(UEqn == -fvc::grad(p));

To solve the continuity equation in OpenFOAM with the PISO or SIMPLE algorithm, the VectorMatrix, UEqn, needs to provide the diagonal and off-diagonal terms of the matrix.

.. code-block:: cpp

volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));

This approach is readable and easy to understand for engineers familiar with OpenFOAM. However, it has several limitations due to its implementation in OpenFOAM:

- the solution system is always a sparse matrix
- the sparse matrix is always a LDU matrix that is not supported by external linear solvers
- Only cell-centred discretisation is supported

NeoFOAM DSL tries to address these issues by providing:

- lazy evaluation of the equations terms. This allows for better optimisation of the resulting equation and can reduce the number of required temporaries.
- a more modular design
- Support for standard matrix formats like COO and CSR, to simplify the use of external linear solvers

The use of standard matrix format combined with lazy evaluation allows for the use of external libraries to integrate PDEs in time and space.
The equation system can be passed to **sundials** and be integrated by **RK methods** and **BDF methods** on heterogeneous architectures.

The NeoFOAM DSL is designed as drop in replacement for OpenFOAM DSL and the adoption should be possible with minimal effort and the same equation from above should read:

.. code-block:: cpp

dsl::Equation<NeoFOAM::scalar> UEqn
(
fvcc::impOp::ddt(U)
+ fvcc::impOp::div(phi, U)
- fvcc::impOp::laplacian(nu, U)
)

solve(UEqn == -fvcc::expOp::grad(p));


In contrast to OpenFOAM, here the majority of the work is done in the solve step.
That is 1. assemble the system and 2. solve the system.
After the system is assembled or solved, it provides access to the linear system for the SIMPLE and PISO algorithms.




.. toctree::
:maxdepth: 2
:glob:

equation.rst
operator.rst
118 changes: 118 additions & 0 deletions doc/dsl/operator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Operator
=======


The `Operator` class represents a term in an equation and can be instantiated with different value types.
An `Operator` is either explicit, implicit or temporal, and can be scalable by a an additional coefficient, for example a scalar value or a further field.
The `Operator` implementation uses Type Erasure (more details `[1] <https://medium.com/@gealleh/type-erasure-idiom-in-c-0d1cb4f61cf0>`_ `[2] <https://www.youtube.com/watch?v=4eeESJQk-mw>`_ `[3] <https://www.youtube.com/watch?v=qn6OqefuH08>`_) to achieve polymorphism without inheritance. Consequently, the class needs only to implement the interface which is used in the DSL and which is shown in the below example:

Example:
.. code-block:: cpp

NeoFOAM::dsl::Operator<NeoFOAM::scalar> divTerm =
Divergence(NeoFOAM::dsl::Operator<NeoFOAM::scalar>::Type::Explicit, exec, ...);

NeoFOAM::dsl::Operator<NeoFOAM::scalar> ddtTerm =
TimeTerm(NeoFOAM::dsl::Operator<NeoFOAM::scalar>::Type::Temporal, exec, ..);


To fit the specification of the EqnSystem (storage in a vector), the Operator needs to be able to be scaled:

.. code-block:: cpp

NeoFOAM::Field<NeoFOAM::scalar> scalingField(exec, nCells, 2.0);
auto sF = scalingField.span();

dsl::Operator<NeoFOAM::scalar> customTerm =
CustomTerm(dsl::Operator<NeoFOAM::scalar>::Type::Explicit, exec, nCells, 1.0);

auto constantScaledTerm = 2.0 * customTerm; // A constant scaling factor of 2 for the term.
auto fieldScaledTerm = scalingField * customTerm; // scalingField is used to scale the term.

// Operator also supports a similar syntax as OpenFOAM
auto multiScaledTerm = (scale + scale + scale + scale) * customTerm;

// Operator also supports the use of a lambda as scaling function to reduce the number of temporaries generated
auto lambdaScaledTerm =
(KOKKOS_LAMBDA(const NeoFOAM::size_t i) { return sF[i] + sF[i] + sF[i] + sF[i]; }) * customTerm;

To add a user-defined `Operator`, a new derived class must be created, inheriting from `OperatorMixin`,
and provide the definitions of the below virtual functions that are required for the `Operator` interface:

- build: build the term
- explicitOperation: perform the explicit operation
- implicitOperation: perform the implicit operation
- display: display the term
- getType: get the type of the term
- exec: get the executor
- nCells: get the number of cells
- volumeField: get the volume field

An example is given below:

.. code-block:: cpp

class CustomOperator : public dsl::OperatorMixin<NeoFOAM::scalar>
{

public:

// constructors ..
NeoFOAM::scalar read(const NeoFOAM::Input& input)
{
// ..
}

void build(const NeoFOAM::Input& input)
{
value = read(input);
termEvaluated = true;
}

std::string display() const { return "Laplacian"; }

void explicitOperation(NeoFOAM::Field<NeoFOAM::scalar>& source)
{
NeoFOAM::scalar setValue = value;
// scaleField is defined in OperatorMixin
// and accounts for the scaling of the terms
// and considers scaling by fields and scalars
auto scale = scaleField();
auto sourceField = source.span();
NeoFOAM::parallelFor(
source.exec(),
{0, source.size()},
KOKKOS_LAMBDA(const size_t i) { sourceField[i] += scale[i] * setValue; }
);
}

// other helper functions
dsl::Operator<NeoFOAM::scalar>::Type getType() const { return termType_; }

const NeoFOAM::Executor& exec() const { return exec_; }

std::size_t nCells() const { return nCells_; }

fvcc::VolumeField<NeoFOAM::scalar>* volumeField() { return nullptr; }

dsl::Operator<NeoFOAM::scalar>::Type termType_;


const NeoFOAM::Executor exec_;
std::size_t nCells_;
NeoFOAM::scalar value = 1.0;
};

The required scaling of the term is handle by the `scaleField` function, provided by `OperatorMixin`. The `scaleField` function returns the 'ScalingField' class that is used to scale by fields and scalars.

.. code-block:: cpp

template <typename ValueType>
class ScalingField
{

// the span is only used if it is defined
KOKKOS_INLINE_FUNCTION
ValueType operator[](const size_t i) const { return useSpan ? values[i] * value : value; }

}
4 changes: 0 additions & 4 deletions doc/finiteVolume/DSL.rst

This file was deleted.

2 changes: 0 additions & 2 deletions doc/finiteVolume/cellCentred/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ cellCenteredFiniteVolume
:maxdepth: 2
:glob:

DSL.rst
fields.rst
boundaryConditions.rst
operators.rst
stencil.rst
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Table of Contents
contributing
basics/index
finiteVolume/cellCentred/index
dsl/index
api/index

Compatibility with OpenFOAM
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx
sphinx-sitemap
furo
breathe
sphinxcontrib-mermaid
12 changes: 7 additions & 5 deletions include/NeoFOAM/core/demangle.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2024 NeoFOAM authors

#pragma once
// TODO For WIN builds, needs to be ifdef'ed out.
#include <cxxabi.h>
#include <string>
#include <any>
#include <iostream>

#include <any> // for bad_any_cast
#include <iostream> // for operator<<, basic_ostream, cerr, endl, ostream
#include <string> // for operator<<, string
#include <typeinfo> // for type_info

namespace NeoFOAM
{

Expand Down
8 changes: 6 additions & 2 deletions include/NeoFOAM/core/dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#include <unordered_map>
#include <any>
#include <string>
#include <iostream>
#include <vector>

#include "NeoFOAM/core/demangle.hpp"
#include "NeoFOAM/core/error.hpp"

namespace NeoFOAM
{
Expand Down Expand Up @@ -162,6 +160,12 @@ class Dictionary
*/
const std::unordered_map<std::string, std::any>& getMap() const;

/**
* @brief Checks whether the dictionary is empty
* @return A bool indicating if the dictionary is empty
*/
bool empty() const { return data_.empty(); }

private:

std::unordered_map<std::string, std::any> data_;
Expand Down
3 changes: 1 addition & 2 deletions include/NeoFOAM/core/executor/CPUExecutor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-FileCopyrightText: 2023 NeoFOAM authors
#pragma once

#include <Kokkos_Core.hpp>
#include <iostream>
#include <Kokkos_Core.hpp> // IWYU pragma: keep

namespace NeoFOAM
{
Expand Down
1 change: 0 additions & 1 deletion include/NeoFOAM/core/executor/GPUExecutor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#pragma once

#include <Kokkos_Core.hpp>
#include <iostream>

namespace NeoFOAM
{
Expand Down
1 change: 0 additions & 1 deletion include/NeoFOAM/core/executor/serialExecutor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#pragma once

#include <Kokkos_Core.hpp>
#include <iostream>

namespace NeoFOAM
{
Expand Down
File renamed without changes.
Loading
Loading