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

Fix: Ablastr PoissonSolver Constant #4090

Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jul 18, 2023

Seen in ImpactX:

build/_deps/fetchedablastr-src/Source/ablastr/fields/PoissonSolver.H:163:31: error: use of undeclared identifier 'PhysConst'
        rho[lev]->mult(-1._rt/PhysConst::ep0); // TODO: when do we "un-multiply" this? We need to document this side-effect!
                                   ^

Seen in ImpactX:
```
build/_deps/fetchedablastr-src/Source/ablastr/fields/PoissonSolver.H:163:31: error: use of undeclared identifier 'PhysConst'
        rho[lev]->mult(-1._rt/PhysConst::ep0); // TODO: when do we "un-multiply" this? We need to document this side-effect!
                                   ^
```
@ax3l ax3l requested a review from lucafedeli88 July 18, 2023 05:57
@ax3l ax3l added bug Something isn't working bug: affects latest release Bug also exists in latest release version component: ABLASTR components shared with other PIC codes labels Jul 18, 2023
ax3l added a commit to ax3l/impactx that referenced this pull request Jul 18, 2023
@ax3l ax3l requested a review from EZoni July 18, 2023 06:08
ax3l added a commit to ECP-WarpX/impactx that referenced this pull request Jul 18, 2023
* Release 23.07

Prepare the July release of ImpactX.

* FIx: PoissonSolve.cpp Constant

```
impactx/src/particles/spacecharge/PoissonSolve.cpp:106:36: error: use of undeclared identifier 'PhysConst'
            rho[lev].mult(-1._rt * PhysConst::ep0);
                                   ^
```

* [Workaround] ABLASTR 23.07 Poisson eps0

Workaround for
  ECP-WarpX/WarpX#4090
in ABLASTR 23.07
ax3l added a commit to ax3l/impactx that referenced this pull request Jul 18, 2023
@@ -160,7 +160,8 @@ computePhi (amrex::Vector<amrex::MultiFab*> const & rho,
// scale rho appropriately; also determine if rho is zero everywhere
amrex::Real max_norm_b = 0.0;
for (int lev=0; lev<=finest_level; lev++) {
rho[lev]->mult(-1._rt/PhysConst::ep0); // TODO: when do we "un-multiply" this? We need to document this side-effect!
using namespace ablastr::constant::SI;
Copy link
Member

Choose a reason for hiding this comment

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

Does the using-declaration need to be inside the for loop over levels?

Copy link
Member

Choose a reason for hiding this comment

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

I would suggest placing the using declaration at the beginning of the function rather then in the for loop.

Copy link
Member Author

@ax3l ax3l Jul 20, 2023

Choose a reason for hiding this comment

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

The using declaration is performance neutral and the only type we need is inside this loop. Thus, I would not pollute the whole scope of the body of the function just yet and keep it localized here.

Copy link
Member

Choose a reason for hiding this comment

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

Ok! you have convinced me

@lucafedeli88 lucafedeli88 merged commit 37cbbbf into ECP-WarpX:development Jul 20, 2023
32 checks passed
ax3l added a commit to ax3l/impactx that referenced this pull request Aug 9, 2023
ax3l added a commit to ax3l/impactx that referenced this pull request Aug 9, 2023
ax3l added a commit to ECP-WarpX/impactx that referenced this pull request Aug 11, 2023
* Release 23.08

Prepare the August release of ImpactX.

* PoissonSolve: Remove ABLASTR Workaround

Remove the workaround for
  ECP-WarpX/WarpX#4090

* Examples: New AMReX Multi-Line Continuation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: ABLASTR components shared with other PIC codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants