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

Add: MultiFabRegister #5230

Merged
merged 385 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
385 commits
Select commit Hold shift + click to select a range
71fa567
Remove current_fp
RemiLehe Sep 11, 2024
8260729
Fix: FFT/PSATD RZ
ax3l Sep 11, 2024
f454920
Remove current_fp
RemiLehe Sep 11, 2024
256ce1e
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
8d86875
removed Bfield_fp_external and Efield_fp_external from field type and…
marcoacc95 Sep 11, 2024
c91ef0b
`va2vm` for scalars
ax3l Sep 11, 2024
edb9954
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
5fe95f7
`a2m` helper: old vector field to `VectorField`
ax3l Sep 11, 2024
c7ff749
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
a130cb0
Efield_fp refactor WarpXRegrid and QED
JustinRayAngus Sep 11, 2024
9e11ccc
Efield_fp refactor HybridPICModel
JustinRayAngus Sep 11, 2024
4663126
Efield_fp refactor WarpXMovingWindow
JustinRayAngus Sep 11, 2024
07d21b3
Efield_cp refactor WarpXComm and WarpXMovingWindow.
JustinRayAngus Sep 11, 2024
07bb54f
Efield_fp and Efield_cp refactor of PSATDBackwardTransformEB
JustinRayAngus Sep 11, 2024
7262b46
Efield_fp and Efield_cp refactor of PSATDForwardTransformEB
JustinRayAngus Sep 11, 2024
bccd752
fixed merge issue.
JustinRayAngus Sep 11, 2024
bd75464
Efield_fp refactor of EvolveE and EvolveB. Implicit usage commented o…
JustinRayAngus Sep 11, 2024
148d6c5
Remove current_buf
RemiLehe Sep 11, 2024
98a4d96
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
fea7ed8
Move `charge_buf` to MultiFab map
EZoni Sep 11, 2024
9e96279
adding current_store to m_fields register
marcoacc95 Sep 11, 2024
91894bc
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
b4db222
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
cefb814
fix merge conflict
lucafedeli88 Sep 11, 2024
ca99dc9
fix merge conflict
lucafedeli88 Sep 11, 2024
f28b2ef
fix merge conflict
lucafedeli88 Sep 11, 2024
5a3e7ea
fix merge conflict
lucafedeli88 Sep 11, 2024
bcfa040
continue work to use field record for edge_lengths
lucafedeli88 Sep 11, 2024
db976cf
fix merge conflict
lucafedeli88 Sep 11, 2024
c101fd7
Fix conflicts
RemiLehe Sep 11, 2024
8dbe6a3
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
5534916
fix issue
lucafedeli88 Sep 11, 2024
716d958
`Efield_cax` & `Bfield_cax`
ax3l Sep 11, 2024
ef36cbe
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
a928cb1
Some RZ Updates (EvolveE/B root needs update first)
ax3l Sep 11, 2024
a41a072
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
2308972
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
13525fc
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 11, 2024
2ac3cc2
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 11, 2024
02da32d
added current_store to m_fields
marcoacc95 Sep 11, 2024
7e2d96f
Fix EB compilation
RemiLehe Sep 12, 2024
b527a25
add external E/B particle fields to new field register
lucafedeli88 Sep 11, 2024
a434195
cleanup
lucafedeli88 Sep 12, 2024
1a65e78
cleanup
lucafedeli88 Sep 12, 2024
dda73bc
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 12, 2024
93304d2
Change 1
dpgrote Sep 11, 2024
e96d034
Chage 2
dpgrote Sep 11, 2024
2d9a600
Change 3
dpgrote Sep 12, 2024
f9dfc8d
Change 4
dpgrote Sep 11, 2024
822390e
Remove current_fp
RemiLehe Sep 12, 2024
a975520
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
9633ea8
Fix compilation
RemiLehe Sep 12, 2024
cfaaa64
Fix Bfield
RemiLehe Sep 12, 2024
c838e87
Efield_fp refactor for implicit solvers.
JustinRayAngus Sep 11, 2024
da5b265
Efield_fp refactor complete
JustinRayAngus Sep 11, 2024
c5f3829
removed Bfield_fp from WarpX.cpp
JustinRayAngus Sep 12, 2024
ec9e34a
update Bfield_fp in WarpXImplicitOps
JustinRayAngus Sep 12, 2024
912abbf
Fix compilation
RemiLehe Sep 12, 2024
4013ea4
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
70e08ac
Merge branch 'hackathon-field-register' of https://github.com/ax3l/Wa…
marcoacc95 Sep 12, 2024
396f0b0
change ref to const ref.
JustinRayAngus Sep 12, 2024
dd4a0a3
Remove Efield_cp, Bfield_cp
RemiLehe Sep 12, 2024
c8f3177
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
5b90680
Remove Unused `_slice` MultiFabs.
ax3l Sep 12, 2024
b56bedf
Remove Efield_cp, Bfield_cp
RemiLehe Sep 12, 2024
e840868
Remove getFieldPointerUnchecked
RemiLehe Sep 12, 2024
5e82001
Remove isFieldInitialized
RemiLehe Sep 12, 2024
4290c0c
Magnetostatic Solver
ax3l Sep 12, 2024
40f7fe6
add area_mod to new field register
lucafedeli88 Sep 12, 2024
88da1e2
Re-introduce getFieldPointerArray
RemiLehe Sep 12, 2024
30e21b1
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
bc72939
Fix Bugs: `mf_name(name, dir, level)` Init/Alias
ax3l Sep 12, 2024
24663d1
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
a9e05af
Fix RZ error
RemiLehe Sep 12, 2024
17bc457
Cleanup
RemiLehe Sep 12, 2024
1259662
Fix SegFault for Efield_fp
RemiLehe Sep 12, 2024
7dc206c
Use ignore_unused
RemiLehe Sep 12, 2024
7a22fd5
Avoid calling get for fields that do not exist
RemiLehe Sep 12, 2024
c076b0c
Temporary solution: return nullpointer when field is not registered
RemiLehe Sep 12, 2024
e0dc73d
Fix bug when outputting the fields
RemiLehe Sep 12, 2024
c015421
Correct typo in output
RemiLehe Sep 12, 2024
e6fbb4f
Fix bug for vay deposition
RemiLehe Sep 12, 2024
3c43d11
Merge branch 'development' into hackathon-field-register
RemiLehe Sep 12, 2024
9f88e83
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2024
771ec1a
`MultiFabRegister::alias_init`: Check Alias Exists
ax3l Sep 12, 2024
6233de4
Fix typo in moving window
RemiLehe Sep 12, 2024
d5e6958
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
e198bd8
use multifabregister for ECTRhofield
lucafedeli88 Sep 12, 2024
f243375
Intermediate refactoring of ImplicitSolvers. getFieldPointerArray() r…
JustinRayAngus Sep 12, 2024
bf6b5d3
Add Python bindings
EZoni Sep 12, 2024
fe37f92
add Venl to field register
lucafedeli88 Sep 12, 2024
b5cfcc0
Fix J functor
RemiLehe Sep 12, 2024
4de536b
Update J functor
RemiLehe Sep 12, 2024
48ab69c
Add Python bindings
EZoni Sep 12, 2024
77af691
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
a2ad435
Fix PML initialization
RemiLehe Sep 12, 2024
e25d806
Add `py::arg` helper names to Python bindings
EZoni Sep 12, 2024
8c2b8e1
Fix typo
RemiLehe Sep 12, 2024
8b57465
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
0a474f8
Use new accessor for getField
RemiLehe Sep 12, 2024
84b8ec6
Correct MR typo
RemiLehe Sep 12, 2024
0b1b2a3
Fix another typo in MR
RemiLehe Sep 12, 2024
f1e156d
added distance_to_eb
lucafedeli88 Sep 12, 2024
cbfa415
Fix bug in allocation of `Efield_cax`
EZoni Sep 12, 2024
84db054
refactoring Bold in implicitSolvers to work with new format.
JustinRayAngus Sep 12, 2024
ca52cf3
setDotMask working with new format.
JustinRayAngus Sep 12, 2024
d184a42
removed getMultiLevelField from WarpX.H
JustinRayAngus Sep 12, 2024
00b6c63
`MultiFabRegister`: Start `const`-Correctness
ax3l Sep 12, 2024
c22e37e
`MultiFabRegister`: Complete `const`-Correctness
ax3l Sep 12, 2024
58d1e22
`const`-Correctness: Unbreak Python :)
ax3l Sep 12, 2024
f6c30b6
Fix MR bug
RemiLehe Sep 12, 2024
7e15d81
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
87392b0
Updates for Python fields wrapper class
dpgrote Sep 12, 2024
abcb087
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2024
16cff54
Fix typo
RemiLehe Sep 12, 2024
b0ca2f5
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
2397d98
Fix another typo
RemiLehe Sep 12, 2024
0202ebc
removing getField FlushFormatPlotFile.
JustinRayAngus Sep 12, 2024
47f51b7
removed getField and getFieldPointer funs from WarpX.
JustinRayAngus Sep 12, 2024
153aaa2
removing unused names form Fields namespace.
JustinRayAngus Sep 12, 2024
92829f6
restoring const declaration to SetDotMask
JustinRayAngus Sep 12, 2024
088f413
Fix another typo
RemiLehe Sep 12, 2024
27de140
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 12, 2024
4dc9bb0
Edoardo: Fix PML copy `Efield_fp`
ax3l Sep 13, 2024
cdbb3ad
Fix NullifyMF
dpgrote Sep 13, 2024
830a2be
Fix: Edoardo B->E Copy Paste
ax3l Sep 13, 2024
0e831f5
MultiFabRegister: Handle !Remake
ax3l Sep 13, 2024
a0a609a
Fix allocation for ECT solver
RemiLehe Sep 13, 2024
f6c314a
Efield_fp_new moved back to Efield_fp
JustinRayAngus Sep 13, 2024
396a035
Fix bug when alias is being redistributed
RemiLehe Sep 13, 2024
29bdf42
Fix RZ field functor
RemiLehe Sep 13, 2024
a5592be
Update PMLs
ax3l Sep 13, 2024
8b73153
Fix RZ Warnings
ax3l Sep 13, 2024
e7c3713
Start Reworking Evolve/Sync Calls
ax3l Sep 13, 2024
893c79c
LWFA 3D: Passes with Register on Throw
ax3l Sep 13, 2024
edb9be6
PML: DivE/B Cleaning
ax3l Sep 13, 2024
bc6d333
More DivE/DivB Cleaning
ax3l Sep 13, 2024
dc970b8
Fix compilation
RemiLehe Sep 13, 2024
3e779f3
Allow traceback and CI test
RemiLehe Sep 13, 2024
c4fff15
Fix MR test
RemiLehe Sep 13, 2024
95a61a3
Cleanup: remove ConstMap
RemiLehe Sep 13, 2024
1e426f5
Cleanup: remove ConstMap
RemiLehe Sep 13, 2024
73a0673
Fix divE cleaning in PML
RemiLehe Sep 13, 2024
55fb4fd
Some code cleanup
RemiLehe Sep 13, 2024
9a6fdee
Fix MR bug
RemiLehe Sep 13, 2024
376d16c
change vector_potential_fp to vector_potential_fp_nodal
lucafedeli88 Sep 13, 2024
c75b2c1
WarpX Bucket: Regex Raw String
ax3l Sep 13, 2024
fe8ba67
avoid relying on nullptr MF pointers for Bfield_avg_fp and Efield_avg_fp
lucafedeli88 Sep 13, 2024
f1b448e
PICMI Tests: A few Warnings
ax3l Sep 13, 2024
e42b8c4
PICMI debugging
RemiLehe Sep 13, 2024
321c0ca
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 13, 2024
b6f274c
Update for pml and remove old multifab_map reference
dpgrote Sep 13, 2024
616fb33
Add register to fluid container (#9)
marcoacc95 Sep 13, 2024
bcd8a12
HybridPICModel: Register MultiFabs
ax3l Sep 13, 2024
019e4ed
HybridPICModel: Rename MultiFabs
ax3l Sep 13, 2024
a352563
HybridPIC: Remove ClearLevel
ax3l Sep 13, 2024
c24fb1f
Register: Update name in erase error message
ax3l Sep 13, 2024
c595a39
Remove end-of-line spaces in fluid code
dpgrote Sep 13, 2024
227a979
Merge remote-tracking branch 'mainline/development' into hackathon-fi…
ax3l Sep 13, 2024
d63c10f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 13, 2024
aae5faa
`WarpXPushFieldsEM`: Clean Unused Vars
ax3l Sep 13, 2024
66009ee
Remove unused variable
dpgrote Sep 13, 2024
9bc9847
Merge branch 'development' into hackathon-field-register
RemiLehe Sep 14, 2024
9c7a3cf
Reconcile ES code with register code
RemiLehe Sep 14, 2024
8f3b973
Rename m_fluids to fluids in FluidContainer functions
RemiLehe Sep 14, 2024
1886812
Convert PML_RZ multifabs
dpgrote Sep 16, 2024
1a42aa5
Small cleanup in PML with moving window
dpgrote Sep 16, 2024
ac4c6e4
Use [[nodiscard]] in MultiFabRegister.H
dpgrote Sep 16, 2024
ead8a57
Fix for nodiscard
dpgrote Sep 16, 2024
4fe6127
Clean up errors from clang tidy
dpgrote Sep 16, 2024
f4bcea5
`MultiFabRegister`: More Doxygen Strings
ax3l Sep 17, 2024
fc9cc97
`MultiFabRegister`: Clang-Tidy
ax3l Sep 17, 2024
75187c7
address clang-tidy issues
lucafedeli88 Sep 17, 2024
7f1a047
address branch-clone issue
lucafedeli88 Sep 17, 2024
01e6f63
Fix typo in moving window
RemiLehe Sep 17, 2024
5c9f9ba
Use more uniform style in the moving window code
RemiLehe Sep 17, 2024
b43adaa
Correct typo
RemiLehe Sep 17, 2024
fe87f93
fix clang-tidy issues
lucafedeli88 Sep 17, 2024
35fa396
Fix typo bugs in `WarpX::InitFromCheckpoint`
EZoni Sep 17, 2024
2687d31
Fix typo bug in `MultiParticleContainer::Evolve`
EZoni Sep 17, 2024
a5a9895
Fix EvolvE for F_fp
dpgrote Sep 17, 2024
006db81
Fix typos in HybridPICModel
dpgrote Sep 17, 2024
cf86694
Fix typo bugs for averaged fields
EZoni Sep 17, 2024
0615220
Fix typo bugs for averaged fields (coarse patch)
EZoni Sep 17, 2024
020088c
Remove redundant using-directive
EZoni Sep 18, 2024
e0eb5bc
Fix clang-tidy error
EZoni Sep 18, 2024
c5571bd
Fix clang-tidy error
EZoni Sep 18, 2024
4f499d0
Fix clang-tidy error
EZoni Sep 18, 2024
1400de5
Fix clang-tidy error
EZoni Sep 18, 2024
1dfeb9f
Fix clang-tidy error
EZoni Sep 18, 2024
6558340
fix merge conflict
lucafedeli88 Sep 18, 2024
a20f7dd
Revert "fix merge conflict"
lucafedeli88 Sep 18, 2024
d4ea23b
fix clang-tidy issues
lucafedeli88 Sep 18, 2024
5976c62
fix-clang-tidy issues
lucafedeli88 Sep 18, 2024
ffc9454
Fix particles in PML
RemiLehe Sep 18, 2024
796c583
fix clang-tidy issue
lucafedeli88 Sep 18, 2024
4f99938
fix clang-tidy issue
lucafedeli88 Sep 18, 2024
ad69751
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
lucafedeli88 Sep 18, 2024
dd78d7c
fix bug introduced fixing clang-tidy issues
lucafedeli88 Sep 18, 2024
873b506
Apply bug fix by @RemiLehe
EZoni Sep 18, 2024
97e18c1
Merge branch 'development' of https://github.com/ECP-WarpX/WarpX
EZoni Sep 18, 2024
9a7d864
Fix merge bug
EZoni Sep 18, 2024
f146fee
Fix bug in mesh refinement with PML
RemiLehe Sep 18, 2024
4608c21
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX into…
RemiLehe Sep 18, 2024
2a5534e
Apply suggestions from code review
RemiLehe Sep 18, 2024
ede7a79
Fix for HybridPIC, fixing name passed into SyncCurrent
dpgrote Sep 18, 2024
cf76e6a
`WarpX::UpdateAuxilaryData`: Fix External E field
ax3l Sep 18, 2024
de0a3ea
Fix subcycling typo
RemiLehe Sep 18, 2024
f6ab6de
Fix another typo
RemiLehe Sep 18, 2024
7225201
Some minor refactoring
RemiLehe Sep 18, 2024
240c895
Clang-Tidy 3D
ax3l Sep 19, 2024
a167d08
fix clang-tidy issues
lucafedeli88 Sep 19, 2024
df23326
fix merge conflict
lucafedeli88 Sep 19, 2024
9f2f4e7
Fix moving window bug
RemiLehe Sep 19, 2024
7a64cc2
Revert some of the changes
RemiLehe Sep 19, 2024
4801c99
CI: MSVC Backtrace to Hang
ax3l Sep 19, 2024
c7a29c4
MSVC: Debug Further
ax3l Sep 19, 2024
95d9c72
More Docstrings
ax3l Sep 19, 2024
b35949b
CI: Windows...
ax3l Sep 19, 2024
9f7b1c9
MSVC CI: Output?
ax3l Sep 19, 2024
1a3146a
Fix more typo bugs
EZoni Sep 20, 2024
0379881
CI: Wait Longer for MSVC Run to hang
ax3l Sep 20, 2024
7a7f462
Clang-Tidy
ax3l Sep 20, 2024
593430e
Clean up FFT functions for E, B
EZoni Sep 20, 2024
7d7d060
Merge remote-tracking branch 'mainline/development' into hackathon-fi…
ax3l Sep 20, 2024
83e2e25
Cleaning: Remove Unused Helper `va2vm`
ax3l Sep 20, 2024
3a620e0
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX
EZoni Sep 20, 2024
9299019
Merge branch 'hackathon-field-register' of github.com:ax3l/WarpX
EZoni Sep 20, 2024
c2b481a
Add `has_vector`, fix bugs
EZoni Sep 20, 2024
98f9670
Clean up FFT functions for J, rho
EZoni Sep 20, 2024
54bdb71
Fix clang-tidy errors
EZoni Sep 20, 2024
bce62bb
`MultiFabRegister`: `AMREX_ENUM` Key Support
ax3l Sep 20, 2024
cb64048
`Fields.H`: Reintroduce & Move
ax3l Sep 20, 2024
dfa6653
Fix Typo: `pml_edge_lengths`
ax3l Sep 21, 2024
4b03b41
Use `FieldType` Instead of Strings
ax3l Sep 21, 2024
f8fa6e1
`MultiFabRegister`: Const & Clean
ax3l Sep 22, 2024
339e909
Clang-Tidy
ax3l Sep 22, 2024
c6439b9
Clang-Tidy RZ
ax3l Sep 23, 2024
f07e1d4
MSVC: Disable for now
ax3l Sep 23, 2024
de0f8c0
Apply suggestions from code review
RemiLehe Sep 23, 2024
9de7fbc
Remove unused function alloc_like
RemiLehe Sep 23, 2024
bff1720
Simplify templated functions alloc_init, alias_init, has
RemiLehe Sep 23, 2024
a4d3cd8
Fix compilation issues
RemiLehe Sep 23, 2024
68abffc
Additional compilation fixes
RemiLehe Sep 23, 2024
cc5443f
Remove last template
RemiLehe Sep 23, 2024
4eb99a5
`MultiFabRegister::mf_name` Keep Direction Convention
ax3l Sep 23, 2024
b795a3d
Add documentation for the fields
RemiLehe Sep 23, 2024
13a899c
Merge remote-tracking branch 'mainline/development' into hackathon-fi…
ax3l Sep 23, 2024
cbc0c82
Cleanup Tests
ax3l Sep 23, 2024
fb9e7dd
More `has_vector`
ax3l Sep 23, 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
29 changes: 17 additions & 12 deletions Source/BoundaryConditions/PML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ PML::PML (const int lev, const BoxArray& grid_ba,
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(!eb_enabled, "PML: eb_enabled is true but was not compiled in.");
#endif

using ablastr::fields::Direction;

// When `do_pml_in_domain` is true, the PML overlap with the last `ncell` of the physical domain or fine patch(es)
// (instead of extending `ncell` outside of the physical domain or fine patch(es))
// In order to implement this, we define a new reduced Box Array ensuring that it does not
Expand Down Expand Up @@ -697,12 +699,15 @@ PML::PML (const int lev, const BoxArray& grid_ba,
const int ncompe = (m_dive_cleaning) ? 3 : 2;
const int ncompb = (m_divb_cleaning) ? 3 : 2;

const amrex::BoxArray ba_Ex = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::Efield_fp, 0,0).ixType().toIntVect());
const amrex::BoxArray ba_Ey = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::Efield_fp, 0,1).ixType().toIntVect());
const amrex::BoxArray ba_Ez = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::Efield_fp, 0,2).ixType().toIntVect());
WarpX::AllocInitMultiFab(pml_E_fp[0], ba_Ex, dm, ncompe, nge, lev, "pml_E_fp[x]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_E_fp[1], ba_Ey, dm, ncompe, nge, lev, "pml_E_fp[y]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_E_fp[2], ba_Ez, dm, ncompe, nge, lev, "pml_E_fp[z]", 0.0_rt);
auto& warpx = WarpX::GetInstance();
using ablastr::fields::Direction;

const amrex::BoxArray ba_Ex = amrex::convert(ba, warpx.m_fields.get("Efield_fp",Direction{0},0)->ixType().toIntVect());
const amrex::BoxArray ba_Ey = amrex::convert(ba, warpx.m_fields.get("Efield_fp",Direction{1},0)->ixType().toIntVect());
const amrex::BoxArray ba_Ez = amrex::convert(ba, warpx.m_fields.get("Efield_fp",Direction{2},0)->ixType().toIntVect());
warpx.m_fields.alloc_init("pml_E_fp", Direction{0}, lev, ba_Ex, dm, ncompe, nge, 0.0_rt);
warpx.m_fields.alloc_init("pml_E_fp", Direction{1}, lev, ba_Ey, dm, ncompe, nge, 0.0_rt);
warpx.m_fields.alloc_init("pml_E_fp", Direction{2}, lev, ba_Ez, dm, ncompe, nge, 0.0_rt);

const amrex::BoxArray ba_Bx = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::Bfield_fp, 0,0).ixType().toIntVect());
const amrex::BoxArray ba_By = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::Bfield_fp, 0,1).ixType().toIntVect());
Expand All @@ -711,9 +716,9 @@ PML::PML (const int lev, const BoxArray& grid_ba,
WarpX::AllocInitMultiFab(pml_B_fp[1], ba_By, dm, ncompb, ngb, lev, "pml_B_fp[y]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_B_fp[2], ba_Bz, dm, ncompb, ngb, lev, "pml_B_fp[z]", 0.0_rt);

const amrex::BoxArray ba_jx = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::current_fp, 0,0).ixType().toIntVect());
const amrex::BoxArray ba_jy = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::current_fp, 0,1).ixType().toIntVect());
const amrex::BoxArray ba_jz = amrex::convert(ba, WarpX::GetInstance().getField(FieldType::current_fp, 0,2).ixType().toIntVect());
const amrex::BoxArray ba_jx = amrex::convert(ba, WarpX::GetInstance().m_fields.get("current_fp", Direction{0}, 0)->ixType().toIntVect());
const amrex::BoxArray ba_jy = amrex::convert(ba, WarpX::GetInstance().m_fields.get("current_fp", Direction{1}, 0)->ixType().toIntVect());
const amrex::BoxArray ba_jz = amrex::convert(ba, WarpX::GetInstance().m_fields.get("current_fp", Direction{2}, 0)->ixType().toIntVect());
WarpX::AllocInitMultiFab(pml_j_fp[0], ba_jx, dm, 1, ngb, lev, "pml_j_fp[x]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_j_fp[1], ba_jy, dm, 1, ngb, lev, "pml_j_fp[y]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_j_fp[2], ba_jz, dm, 1, ngb, lev, "pml_j_fp[z]", 0.0_rt);
Expand Down Expand Up @@ -864,9 +869,9 @@ PML::PML (const int lev, const BoxArray& grid_ba,
WarpX::AllocInitMultiFab( pml_G_cp, cba_G_nodal, cdm, 3, ngf, lev, "pml_G_cp", 0.0_rt);
}

const amrex::BoxArray cba_jx = amrex::convert(cba, WarpX::GetInstance().getField(FieldType::current_cp, 1,0).ixType().toIntVect());
const amrex::BoxArray cba_jy = amrex::convert(cba, WarpX::GetInstance().getField(FieldType::current_cp, 1,1).ixType().toIntVect());
const amrex::BoxArray cba_jz = amrex::convert(cba, WarpX::GetInstance().getField(FieldType::current_cp, 1,2).ixType().toIntVect());
const amrex::BoxArray cba_jx = amrex::convert(cba, WarpX::GetInstance().m_fields.get("current_cp", Direction{0}, 0)->ixType().toIntVect());
const amrex::BoxArray cba_jy = amrex::convert(cba, WarpX::GetInstance().m_fields.get("current_cp", Direction{1}, 0)->ixType().toIntVect());
const amrex::BoxArray cba_jz = amrex::convert(cba, WarpX::GetInstance().m_fields.get("current_cp", Direction{2}, 0)->ixType().toIntVect());
WarpX::AllocInitMultiFab(pml_j_cp[0], cba_jx, cdm, 1, ngb, lev, "pml_j_cp[x]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_j_cp[1], cba_jy, cdm, 1, ngb, lev, "pml_j_cp[y]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_j_cp[2], cba_jz, cdm, 1, ngb, lev, "pml_j_cp[z]", 0.0_rt);
Expand Down
10 changes: 6 additions & 4 deletions Source/BoundaryConditions/PML_RZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ PML_RZ::PML_RZ (const int lev, const amrex::BoxArray& grid_ba, const amrex::Dist
m_do_pml_in_domain(do_pml_in_domain),
m_geom(geom)
{
auto& warpx = WarpX::GetInstance();
using ablastr::fields::Direction;

const amrex::MultiFab & Er_fp = WarpX::GetInstance().getField(FieldType::Efield_fp, lev,0);
const amrex::MultiFab & Et_fp = WarpX::GetInstance().getField(FieldType::Efield_fp, lev,1);
const amrex::MultiFab & Er_fp = *warpx.m_fields.get("Efield_fp",Direction{0},lev);
const amrex::MultiFab & Et_fp = *warpx.m_fields.get("Efield_fp",Direction{1},lev);
const amrex::BoxArray ba_Er = amrex::convert(grid_ba, Er_fp.ixType().toIntVect());
const amrex::BoxArray ba_Et = amrex::convert(grid_ba, Et_fp.ixType().toIntVect());
WarpX::AllocInitMultiFab(pml_E_fp[0], ba_Er, grid_dm, Er_fp.nComp(), Er_fp.nGrowVect(), lev, "pml_E_fp[0]", 0.0_rt);
WarpX::AllocInitMultiFab(pml_E_fp[1], ba_Et, grid_dm, Et_fp.nComp(), Et_fp.nGrowVect(), lev, "pml_E_fp[1]", 0.0_rt);
warpx.m_fields.alloc_init("pml_E_fp", Direction{0}, lev, ba_Er, grid_dm, Er_fp.nComp(), Er_fp.nGrowVect(), 0.0_rt);
warpx.m_fields.alloc_init("pml_E_fp", Direction{1}, lev, ba_Et, grid_dm, Et_fp.nComp(), Et_fp.nGrowVect(), 0.0_rt);

const amrex::MultiFab & Br_fp = WarpX::GetInstance().getField(FieldType::Bfield_fp, lev,0);
const amrex::MultiFab & Bt_fp = WarpX::GetInstance().getField(FieldType::Bfield_fp, lev,1);
Expand Down
25 changes: 16 additions & 9 deletions Source/BoundaryConditions/WarpXEvolvePML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ WarpX::DampPML (const int lev, PatchType patch_type)
WARPX_PROFILE("WarpX::DampPML()");
#if (defined WARPX_DIM_RZ) && (defined WARPX_USE_FFT)
if (pml_rz[lev]) {
pml_rz[lev]->ApplyDamping(Efield_fp[lev][1].get(), Efield_fp[lev][2].get(),
Bfield_fp[lev][1].get(), Bfield_fp[lev][2].get(),
dt[lev]);
pml_rz[lev]->ApplyDamping( m_fields.get("Efield_fp",Direction{1},lev),
m_fields.get("Efield_fp",Direction{2},lev),
Bfield_fp[lev][1].get(), Bfield_fp[lev][2].get(),
dt[lev]);
}
#endif
if (pml[lev]) {
Expand Down Expand Up @@ -338,15 +339,21 @@ WarpX::DampJPML (int lev, PatchType patch_type)
void
WarpX::CopyJPML ()
{
using ablastr::fields::Direction;

for (int lev = 0; lev <= finest_level; ++lev)
{
if (pml[lev] && pml[lev]->ok()){
pml[lev]->CopyJtoPMLs({ current_fp[lev][0].get(),
current_fp[lev][1].get(),
current_fp[lev][2].get() },
{ current_cp[lev][0].get(),
current_cp[lev][1].get(),
current_cp[lev][2].get() });
pml[lev]->CopyJtoPMLs({
m_fields.get("current_fp", Direction{0}, lev),
m_fields.get("current_fp", Direction{1}, lev),
m_fields.get("current_fp", Direction{2}, lev)
}, {
m_fields.get("current_cp", Direction{0}, lev),
m_fields.get("current_cp", Direction{1}, lev),
m_fields.get("current_cp", Direction{2}, lev)
}
);
}
}
}
17 changes: 10 additions & 7 deletions Source/BoundaryConditions/WarpXFieldBoundaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ namespace

void WarpX::ApplyEfieldBoundary(const int lev, PatchType patch_type)
{
using ablastr::fields::Direction;

if (::isAnyBoundary<FieldBoundaryType::PEC>(field_boundary_lo, field_boundary_hi)) {
if (patch_type == PatchType::fine) {
PEC::ApplyPECtoEfield(
{getFieldPointer(FieldType::Efield_fp, lev, 0),
getFieldPointer(FieldType::Efield_fp, lev, 1),
getFieldPointer(FieldType::Efield_fp, lev, 2)},
{m_fields.get("Efield_fp",Direction{0},lev),
m_fields.get("Efield_fp",Direction{1},lev),
m_fields.get("Efield_fp",Direction{2},lev)},
field_boundary_lo, field_boundary_hi,
get_ng_fieldgather(), Geom(lev),
lev, patch_type, ref_ratio);
Expand Down Expand Up @@ -92,9 +94,9 @@ void WarpX::ApplyEfieldBoundary(const int lev, PatchType patch_type)

#ifdef WARPX_DIM_RZ
if (patch_type == PatchType::fine) {
ApplyFieldBoundaryOnAxis(getFieldPointer(FieldType::Efield_fp, lev, 0),
getFieldPointer(FieldType::Efield_fp, lev, 1),
getFieldPointer(FieldType::Efield_fp, lev, 2), lev);
ApplyFieldBoundaryOnAxis(m_fields.get("Efield_fp",Direction{0},lev),
m_fields.get("Efield_fp",Direction{1},lev),
m_fields.get("Efield_fp",Direction{2},lev), lev);
} else {
ApplyFieldBoundaryOnAxis(getFieldPointer(FieldType::Efield_cp, lev, 0),
getFieldPointer(FieldType::Efield_cp, lev, 1),
Expand Down Expand Up @@ -131,8 +133,9 @@ void WarpX::ApplyBfieldBoundary (const int lev, PatchType patch_type, DtType a_d
if (lev == 0) {
if (a_dt_type == DtType::FirstHalf) {
if(::isAnyBoundary<FieldBoundaryType::Absorbing_SilverMueller>(field_boundary_lo, field_boundary_hi)){
auto Efield_fp_new = m_fields.get_mr_levels_alldirs("Efield_fp",max_level); // JRA, new to prevent shadow
m_fdtd_solver_fp[0]->ApplySilverMuellerBoundary(
Efield_fp[lev], Bfield_fp[lev],
Efield_fp_new[lev], Bfield_fp[lev],
ax3l marked this conversation as resolved.
Show resolved Hide resolved
Geom(lev).Domain(), dt[lev],
field_boundary_lo, field_boundary_hi);
}
Expand Down
16 changes: 10 additions & 6 deletions Source/Diagnostics/BTDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ BTDiagnostics::DefineCellCenteredMultiFab(int lev)
void
BTDiagnostics::InitializeFieldFunctors (int lev)
{
using ablastr::fields::Direction;

// Initialize fields functors only if do_back_transformed_fields is selected
if (!m_do_back_transformed_fields) { return; }

Expand Down Expand Up @@ -579,11 +581,11 @@ BTDiagnostics::InitializeFieldFunctors (int lev)
} else if ( m_cellcenter_varnames[comp] == "Bz" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::Bfield_aux, lev, 2), lev, m_crse_ratio);
} else if ( m_cellcenter_varnames[comp] == "jx" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 0), lev, m_crse_ratio);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp",Direction{0}, lev), lev, m_crse_ratio);
} else if ( m_cellcenter_varnames[comp] == "jy" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 1), lev, m_crse_ratio);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp",Direction{1}, lev), lev, m_crse_ratio);
} else if ( m_cellcenter_varnames[comp] == "jz" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 2), lev, m_crse_ratio);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp",Direction{2}, lev), lev, m_crse_ratio);
} else if ( m_cellcenter_varnames[comp] == "rho" ){
m_cell_center_functors[lev][comp] = std::make_unique<RhoFunctor>(lev, m_crse_ratio);
}
Expand Down Expand Up @@ -656,6 +658,8 @@ void
BTDiagnostics::InitializeFieldFunctorsRZopenPMD (int lev)
{
#ifdef WARPX_DIM_RZ
using ablastr::fields::Direction;

auto & warpx = WarpX::GetInstance();
const int ncomp_multimodefab = warpx.getFieldPointer(FieldType::Efield_aux, 0,0)->nComp();
const int ncomp = ncomp_multimodefab;
Expand Down Expand Up @@ -695,11 +699,11 @@ BTDiagnostics::InitializeFieldFunctorsRZopenPMD (int lev)
} else if ( m_cellcenter_varnames_fields[comp] == "Bz" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::Bfield_aux, lev, 2), lev, m_crse_ratio, false, ncomp);
} else if ( m_cellcenter_varnames_fields[comp] == "jr" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 0), lev, m_crse_ratio, false, ncomp);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp", Direction{0}, lev), lev, m_crse_ratio, false, ncomp);
} else if ( m_cellcenter_varnames_fields[comp] == "jt" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 1), lev, m_crse_ratio, false, ncomp);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp", Direction{1}, lev), lev, m_crse_ratio, false, ncomp);
} else if ( m_cellcenter_varnames_fields[comp] == "jz" ){
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.getFieldPointer(FieldType::current_fp, lev, 2), lev, m_crse_ratio, false, ncomp);
m_cell_center_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.m_fields.get("current_fp", Direction{2}, lev), lev, m_crse_ratio, false, ncomp);
} else if ( m_cellcenter_varnames_fields[comp] == "rho" ){
m_cell_center_functors[lev][comp] = std::make_unique<RhoFunctor>(lev, m_crse_ratio, false, -1, false, ncomp);
}
Expand Down
10 changes: 6 additions & 4 deletions Source/Diagnostics/ComputeDiagFunctors/JFunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ JFunctor::JFunctor (const int dir, int lev,
void
JFunctor::operator() (amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer*/) const
{
using ablastr::fields::Direction;

auto& warpx = WarpX::GetInstance();
/** pointer to source multifab (can be multi-component) */
amrex::MultiFab* m_mf_src = warpx.getFieldPointer(FieldType::current_fp, m_lev, m_dir);
amrex::MultiFab* m_mf_src = warpx.m_fields.get("current_fp",Direction{m_dir},m_lev);

// Deposit current if no solver or the electrostatic solver is being used
if (m_deposit_current)
Expand All @@ -40,16 +42,16 @@ JFunctor::operator() (amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer*/
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > current_fp_temp;
current_fp_temp.resize(1);

const auto& current_fp_x = warpx.getField(FieldType::current_fp, m_lev,0);
const auto& current_fp_x = *warpx.m_fields.get("current_fp",Direction{0},m_lev);
current_fp_temp[0][0] = std::make_unique<amrex::MultiFab>(
current_fp_x, amrex::make_alias, 0, current_fp_x.nComp()
);

const auto& current_fp_y = warpx.getField(FieldType::current_fp, m_lev,1);
const auto& current_fp_y = *warpx.m_fields.get("current_fp",Direction{1},m_lev);
current_fp_temp[0][1] = std::make_unique<amrex::MultiFab>(
current_fp_y, amrex::make_alias, 0, current_fp_y.nComp()
);
const auto& current_fp_z = warpx.getField(FieldType::current_fp, m_lev,2);
const auto& current_fp_z = *warpx.m_fields.get("current_fp",Direction{2},m_lev);
current_fp_temp[0][2] = std::make_unique<amrex::MultiFab>(
current_fp_z, amrex::make_alias, 0, current_fp_z.nComp()
);
Expand Down
4 changes: 3 additions & 1 deletion Source/Diagnostics/ComputeDiagFunctors/JdispFunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ JdispFunctor::JdispFunctor (int dir, int lev,
void
JdispFunctor::operator() (amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer*/) const
{
using ablastr::fields::Direction;

auto& warpx = WarpX::GetInstance();
auto* hybrid_pic_model = warpx.get_pointer_HybridPICModel();

/** pointer to total simulation current (J) multifab */
amrex::MultiFab* mf_j = warpx.getFieldPointer(FieldType::current_fp, m_lev, m_dir);
amrex::MultiFab* mf_j = warpx.m_fields.get("current_fp",Direction{m_dir},m_lev);

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(hybrid_pic_model,
"Displacement current diagnostic is only implemented for the HybridPICModel.");
Expand Down
Loading
Loading