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

DSL implementation stack #102

merged 136 commits into from
Nov 26, 2024

Conversation

greole
Copy link
Contributor

@greole greole commented Jul 11, 2024

This PR adds the basic implementation of the NeoFOAM DSL. Its primary design constraint is that should work as simple text replacement to OpenFOAMs DSL.
For example:

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

if (piso.momentumPredictor())
{
  solve(UEqn == -fvc::grad(p));
}

would be implementable as

Equation UEqn
(
  implicit::ddt(U)
  + implicit::div(phi, U)
  - implicit::laplacian(nu, U)
  ==
- explicit::grad(p)
);

if (piso.momentumPredictor())
{
  solve(UEqn, U, controlDict);
}

The actual implementation is done within the following PRs.

TODO:

  • Split equation into expressions, equations. (renamed equation to expression for now)

prior

@greole greole changed the title initial commit DSL implementation stack Jul 11, 2024
@greole greole added this to the 0.1 Release milestone Aug 29, 2024
@@ -33,9 +33,84 @@ void computeDiv(
size_t nInternalFaces = mesh.nInternalFaces();
const auto surfV = mesh.cellVolumes().span();

// check if the executor is GPU
if (std::holds_alternative<SerialExecutor>(exec))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch doesn't seem right. Can't we just use NeoFOAM::parallelFor here?

@@ -32,7 +32,7 @@ void computeGrad(

const auto surfV = mesh.cellVolumes().span();

if (std::holds_alternative<CPUExecutor>(exec))
if (std::holds_alternative<SerialExecutor>(exec))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace logic just by a parallelFor?

@greole greole merged commit deba2bc into main Nov 26, 2024
12 checks passed
@HenningScheufler HenningScheufler added enhancement New feature or request dsl labels Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsl enhancement New feature or request full-ci a label that triggers the full ci pipeline ready-for-review Set this label to indicate that the PR is ready for review stack
Projects
Development

Successfully merging this pull request may close these issues.

3 participants