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

FsGrid & fieldsolver refactoring #1099

Open
wants to merge 254 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
78ffd38
Capitalize enumerators: fsgrid was clashing with namespace fsgrid. Ot…
cscjlan Nov 21, 2024
5d6ae17
Add FsGrids collection object; Simplify datareduction and reduce code…
cscjlan Nov 22, 2024
fdd93fd
Change vector to span
cscjlan Nov 27, 2024
62f34ae
Move debug check to a separate function
cscjlan Nov 29, 2024
db88c6a
Move repeated code to a function
cscjlan Nov 29, 2024
2b00f09
Get grid spacing from technical grid
cscjlan Nov 29, 2024
8af4c4b
Move rhom limits calculation to a function
cscjlan Nov 29, 2024
0de400a
Simplify rhom clamping
cscjlan Nov 29, 2024
96ae075
Simplify p11, p22, p33 calculation
cscjlan Nov 29, 2024
d9c5d75
Make variables const
cscjlan Nov 29, 2024
342d3f4
Pass grid spacing to wavespeed functions directly
cscjlan Nov 29, 2024
42432cf
Move wave speeds to a separate struct; Add functions for it to reduce…
cscjlan Nov 29, 2024
d134911
Move function to struct
cscjlan Nov 29, 2024
669b892
Make const variables const
cscjlan Nov 29, 2024
eaac9e1
clang-format the file to ease merging
cscjlan Feb 13, 2025
754dfae
Move calculation to a lambda to reduce repetition
cscjlan Nov 29, 2024
3881066
Move variable closer to where it's used; Remove unnecessary access
cscjlan Nov 29, 2024
d579b2a
Remove code duplication by adding a struct & and a function
cscjlan Nov 29, 2024
7cf4dd3
Replace function with an operator() call
cscjlan Nov 29, 2024
55ce687
Replace redundant function calls
cscjlan Nov 29, 2024
9f70203
Reorder computation to have similar things close to each other
cscjlan Nov 29, 2024
c376206
Simplify resistive term computation
cscjlan Nov 29, 2024
a934b15
Change wavespeed funcs to use spans
cscjlan Dec 3, 2024
5a88e1f
Move field coefficient computation to a struct
cscjlan Dec 3, 2024
c1e3241
Add rhom and p11, p22, p33 computation to FieldCoeffs
cscjlan Dec 3, 2024
0add003
Remove comment
cscjlan Dec 3, 2024
32a7ff0
Simplify computation
cscjlan Dec 4, 2024
8452108
Combine terms
cscjlan Dec 4, 2024
34ef810
Change function to static
cscjlan Dec 4, 2024
169805c
Change order of parameters; Change const Real& to Real
cscjlan Dec 4, 2024
01257f0
Change pointers to const refs
cscjlan Dec 4, 2024
f856292
Use FsStencil and span instead of FsGrid to index values
cscjlan Dec 4, 2024
23a0633
Add electric field spans
cscjlan Dec 4, 2024
07966aa
Group arrays for each cardinal direction together
cscjlan Dec 4, 2024
6b14d27
Replace FsGrid accesses with spans
cscjlan Dec 4, 2024
8c3f399
Fix debug check & use stencil
cscjlan Dec 4, 2024
f017c5d
Replace localIDFromCellCoordinates with stencil funcs
cscjlan Dec 4, 2024
6d2d6bd
Give gridspacing as a param; No need for any of the grids
cscjlan Dec 4, 2024
13b6511
Change grids to spans
cscjlan Dec 4, 2024
198ae6b
clang-format the file to ease merging
cscjlan Feb 13, 2025
2711d89
Change function to use span & stencil
cscjlan Dec 4, 2024
cb1baca
Replace fsgrids with spans
cscjlan Dec 4, 2024
ace01f1
Combine three functions to one
cscjlan Dec 4, 2024
c0183db
clang-format the file to ease merging
cscjlan Feb 13, 2025
b0c045b
Move cerr output to outer function; format the file with clang-format
cscjlan Dec 4, 2024
00673a2
Function returns a value, doesn't assing it
cscjlan Dec 4, 2024
83c2d54
Change fsgrids to spans
cscjlan Dec 4, 2024
74d226d
Change function to lambda
cscjlan Dec 4, 2024
e5fbbea
Swap fsgrid to span & stencil
cscjlan Dec 4, 2024
4666e76
Simplify function; Pass spans & stencil instead of fsgrid
cscjlan Dec 4, 2024
14e06ff
Fix bug: multiplier should be 1.0 for dperb, not half
cscjlan Dec 5, 2024
f2350ff
Fix bug: use bgb from this cell, not neighbour
cscjlan Dec 5, 2024
e2d51d0
Remove unused variable
cscjlan Dec 5, 2024
fe8fd24
Rename variables
cscjlan Dec 5, 2024
5da9d6c
clang-format the file to ease merging
cscjlan Feb 13, 2025
06e2a59
Add a high-level JXB function. clang-format
cscjlan Dec 5, 2024
ec61f2e
Reroute functions through a higher level one
cscjlan Dec 5, 2024
6d0ac16
Compute hallRhoq with a lambda and call it four times
cscjlan Dec 5, 2024
c20ed91
Compute EHall with a lambda
cscjlan Dec 5, 2024
45a7516
Simplify hallterm computation
cscjlan Dec 5, 2024
9ee5f67
Pass gridSpacing to JXB; cache bgb values
cscjlan Dec 5, 2024
3a610be
Compute rhoq universally by a lambda
cscjlan Dec 5, 2024
55b4ecc
Move y and z term 1 computation to x function
cscjlan Dec 5, 2024
0bf4d20
Unify Hall term computation
cscjlan Dec 5, 2024
a47d38e
Change pointers to const refs; Replace at() with [] indexing
cscjlan Dec 9, 2024
ce7b187
Replace fsgrid with span for calculateEdgeHallTermComponents
cscjlan Dec 9, 2024
e12cda2
Replace fsgrids with spans for EHall sysboundary func
cscjlan Dec 9, 2024
4bd2cd8
Move code from loop to a function; Rename function
cscjlan Dec 9, 2024
295472d
Change pointer to ref
cscjlan Dec 9, 2024
f6e2a44
Simplify volume computation
cscjlan Dec 9, 2024
7077d5d
Replace fsgrid with spans for reconstructionCoefficients
cscjlan Dec 9, 2024
15c9d22
Add const to spans; Remove unnecessary arguments & MPI communication;…
cscjlan Dec 10, 2024
f082daa
Volume uses spans intead of fsgrids
cscjlan Dec 10, 2024
a661dbc
clang-format the file to ease merging
cscjlan Feb 13, 2025
c83d742
clang-format the file; Remove unused parameters; Change ref to value
cscjlan Dec 10, 2024
ac147b9
Simplify computation
cscjlan Dec 10, 2024
21e3ec9
Split function to three
cscjlan Dec 10, 2024
e34aa44
Simplify x computation
cscjlan Dec 10, 2024
8819597
Unify component functions to a single one
cscjlan Dec 10, 2024
c8916d8
Replace fsgrid with span
cscjlan Dec 10, 2024
e7db6dd
clang-format the file to ease merging
cscjlan Feb 13, 2025
a9c88b0
Add lambda to reduce repetition
cscjlan Dec 10, 2024
2d52d8b
Unify bfield component index
cscjlan Dec 13, 2024
a18ce45
Use bitfield variable
cscjlan Dec 13, 2024
ee087ac
Cache values, reduce repetition
cscjlan Dec 13, 2024
e73c68e
Cache b field components
cscjlan Dec 13, 2024
fdd5033
Move repeting code to a lambda
cscjlan Dec 13, 2024
a8f5cf9
Reduce repetition by unifying similar branches
cscjlan Dec 13, 2024
44cfe42
Remove now-redundant lambdas
cscjlan Dec 13, 2024
5fe76ac
Use spans intead of fsgrids; Replace triple loop with loop over indices
cscjlan Dec 13, 2024
a0d812b
Simplify return statements
cscjlan Dec 13, 2024
e0280d4
Simplify indexing, remove array
cscjlan Dec 13, 2024
b609d8b
Move computation to a lambda
cscjlan Dec 13, 2024
9a19d58
Replace grid with span
cscjlan Dec 13, 2024
e397dad
Replace i, j, k with stencil i, j, k
cscjlan Dec 13, 2024
b797a58
Ionosphere and Copysphere had almost exactly the same implementation:…
cscjlan Dec 13, 2024
f426c09
Replace switch with a bit shift
cscjlan Dec 13, 2024
385c0d6
Simplify double loop to a single loop
cscjlan Dec 13, 2024
a73a6b6
Replace fsgrid with span
cscjlan Dec 13, 2024
2c55b3e
Replace fsgrids with spans for magnetic field computations
cscjlan Dec 13, 2024
a837471
Add derivatives communication back
cscjlan Dec 13, 2024
fcee8c0
Fix debug check
cscjlan Dec 13, 2024
595c5fb
clang-format the file to ease merging
cscjlan Feb 13, 2025
d127e2b
Take reference to value, not some weird pointer stuff
cscjlan Dec 13, 2024
005905a
Combine identical switch arms
cscjlan Dec 13, 2024
d016b4e
Combine equal if checks; Remove unused parameter
cscjlan Dec 13, 2024
7778665
Change pointer to ref and at to operator[]
cscjlan Dec 16, 2024
3f32dd8
clang-format the file to ease merging
cscjlan Feb 13, 2025
9e6531b
Make constexpr things constexpr
cscjlan Dec 16, 2024
fde0f74
Get technical only once and use it multiple times
cscjlan Dec 16, 2024
8b4ed43
Change constrexpr to constexpr static
cscjlan Dec 16, 2024
0873029
Replace repetition with an array and a lambda
cscjlan Dec 16, 2024
84d9140
Change variable name; Cache boolean variable; Move repeting computati…
cscjlan Dec 16, 2024
1a1e382
Move y and z moments computation to lambda; Fix bug where y component…
cscjlan Dec 16, 2024
8611c31
Move computation to a lambda
cscjlan Dec 16, 2024
384e174
Add lambda for computing derivative; Add static arrays for perB indic…
cscjlan Dec 16, 2024
87f0532
Move computation to a lambda
cscjlan Dec 16, 2024
7de51ab
Move second derivative computation to a lambda
cscjlan Dec 16, 2024
1efe849
Compute moments for all components in a loop
cscjlan Dec 16, 2024
3b6844b
Move perB computation to a loop
cscjlan Dec 16, 2024
d3d92d7
Reduce repetition with a for loop
cscjlan Dec 16, 2024
ee9d037
Replace FsGrids with spans
cscjlan Dec 16, 2024
04d4713
Replace fsgrids with spans
cscjlan Dec 16, 2024
d53c703
Replace fsgrids with spans
cscjlan Dec 16, 2024
232143a
Move lambda to a function; Change vol derivatives to use spans instea…
cscjlan Dec 16, 2024
dfc48a8
Reduce repetition by using a lambda; Replace fsgrids with spans
cscjlan Dec 16, 2024
6089f25
clang-format the file to ease merging
cscjlan Feb 13, 2025
d0ce5d2
Replace get with stencil indexing
cscjlan Dec 16, 2024
b7fa0ab
clang-format the file to ease merging
cscjlan Feb 13, 2025
2059321
Replace fsgrid getting with stencil based span indexing
cscjlan Dec 16, 2024
89f6c0f
clang-format the file to ease merging
cscjlan Feb 13, 2025
681a53e
clang-format the file
cscjlan Dec 16, 2024
08d65da
Replace fsgrid getting with span indexing
cscjlan Dec 16, 2024
675bd87
Make const non const; Change the order of headers, as that is imporan…
cscjlan Dec 16, 2024
d0050d2
clang-format the file to ease merging
cscjlan Feb 13, 2025
9cbcf07
clang-format the file
cscjlan Dec 16, 2024
c55e5a6
Replace fsgrid with span
cscjlan Dec 16, 2024
48d4888
Replace c-arrays with std::array; Rename variables; Replace pointers …
cscjlan Dec 16, 2024
d7f78b9
Replace fsgrid with span
cscjlan Dec 16, 2024
26db467
Replace fsgrid with span; Add technicalGrid to function parameters
cscjlan Dec 16, 2024
8523931
Replace fsgrid with span; Add technicalGrid to function parameters
cscjlan Dec 16, 2024
b005976
clang-format the file to ease merging
cscjlan Feb 13, 2025
368b7c1
Replace fsgrid get with stencil & span
cscjlan Dec 16, 2024
d3198c8
clang-format the file to ease merging
cscjlan Feb 13, 2025
42fe3f5
Replace fsgrid get with span and stencil indexing
cscjlan Dec 16, 2024
04e17c2
clang-format the file to ease merging
cscjlan Feb 13, 2025
590d2f4
Replace fsgrid get with span & stencil indexing
cscjlan Dec 16, 2024
7c963ea
clang-format the file to ease merging
cscjlan Feb 13, 2025
c90c6f5
Replace fsgrid get with stencil & span
cscjlan Dec 16, 2024
1f860b8
clang-format the file to ease merging
cscjlan Feb 13, 2025
86ff7fd
Replace fsgrid get with span & stencil indexing
cscjlan Dec 16, 2024
72ed152
clang-format the file to ease merging
cscjlan Feb 13, 2025
697bb3e
Replace fsgrid get with span & stencil
cscjlan Dec 16, 2024
becd23f
clang-format the file to ease merging
cscjlan Feb 13, 2025
428aa41
Replace localIDFromCellCoordinates with stencil
cscjlan Dec 17, 2024
88677bd
Replace get with stencil & span
cscjlan Dec 17, 2024
9a83da2
Update submodule
cscjlan Dec 17, 2024
44302e5
Cache some stencil variables
cscjlan Dec 17, 2024
fb04a03
Cache stencil index
cscjlan Dec 17, 2024
20a5332
Make BVOL derivatives computation simpler
cscjlan Dec 17, 2024
74f312e
Update submodule
cscjlan Dec 18, 2024
1e74b80
Update submodule
cscjlan Dec 18, 2024
5d0a6e2
Switch switch to an if
cscjlan Dec 19, 2024
054ec3d
Simplify duplicated grids
trossi Dec 17, 2024
5a4f167
Use parallel_for from fsgrid
trossi Dec 17, 2024
52c7123
Update ghost cells via technical grid
trossi Dec 17, 2024
70dc343
Use parallel_for interface
trossi Dec 17, 2024
b2fb90e
Update submodule
trossi Dec 18, 2024
20e73f9
Move if checks outside lambdas
cscjlan Dec 19, 2024
1870eed
Change for loop with array to a repeated lambda invocation
cscjlan Dec 19, 2024
23d95ae
Change for loop to a repeated lambda invocation
cscjlan Dec 19, 2024
66b0d48
Change for loops to repeated lambda invocations
cscjlan Dec 19, 2024
9a85a21
Make perb computation more explicit
cscjlan Dec 19, 2024
585f55f
Add helper struct for caching data
cscjlan Dec 19, 2024
66055d2
Make pressure e computation more explicit
cscjlan Dec 19, 2024
532ed0a
Make moment derivative computation more explicit
cscjlan Dec 19, 2024
40ba2a9
Replace repeated statement with a simple for loop
cscjlan Dec 19, 2024
13c2183
Move lambdas closer to where they're used
cscjlan Dec 19, 2024
a0ef6c2
Split calculateDerivatives to two functions
cscjlan Dec 19, 2024
df3ce11
Refactor derivatives to do check outside lambda
cscjlan Dec 19, 2024
be0dda2
Move if checks out of lambda
cscjlan Dec 19, 2024
a502350
Rename variable
cscjlan Dec 20, 2024
f3f19ef
Change value to reference
cscjlan Dec 20, 2024
5b46ee0
Change value to reference
cscjlan Dec 20, 2024
41ac536
Rename variable; Take it from technicalGrid
cscjlan Dec 20, 2024
1c247d0
Change value to reference
cscjlan Dec 20, 2024
392522d
Split one loop to three
cscjlan Dec 20, 2024
c7db005
Replace reference to array with a pointer to first element to circumv…
cscjlan Dec 20, 2024
2b982a6
Go back to older version of derivatives
cscjlan Dec 20, 2024
2cc9855
Reduce repetition by using a function
cscjlan Dec 20, 2024
ec6264f
Change function to a lamda
cscjlan Dec 20, 2024
831c9a2
Separate x, y and z from each other
cscjlan Dec 20, 2024
88be6c1
Add non-refactored version that uses stencil & span
cscjlan Dec 20, 2024
705024c
Remove obsolete version
cscjlan Dec 20, 2024
f5e73b7
Update submodule
cscjlan Dec 27, 2024
eded22c
Fix bugs: RKCase check was opposite of what it was supposed to be; Ch…
cscjlan Jan 8, 2025
b97f293
Change updateGhostCells calls to use technicalGrid with a span of data
cscjlan Jan 8, 2025
afc38ad
Remove const: updateGhostCells needs to modify things
cscjlan Jan 8, 2025
9a3399b
Change calculateDerivativesSimple to take in spans
cscjlan Jan 9, 2025
c55a98a
Change calculateBVOLDerivativesSimple to take in spans
cscjlan Jan 9, 2025
cc5caa5
Change calculateCurvatureSimple to take in spans
cscjlan Jan 9, 2025
a178eba
Change FsGrids to spans
cscjlan Jan 9, 2025
afd6a3f
Replace FsGrid with span
cscjlan Jan 9, 2025
ce3b1d4
Replace FsGrid with span for calculateUpwindedElectricFieldSimple
cscjlan Jan 9, 2025
2133ea3
Replace FsGrid with span for calculateGradPeTermSimple
cscjlan Jan 9, 2025
1058471
Replace FsGrid with span for calculateHallTermSimple
cscjlan Jan 9, 2025
29309f9
Replace FsGrid with span for propagateMagneticFieldSimple
cscjlan Jan 9, 2025
d8a27ad
Replace FsGrid with span for calculateVolumeAveragedFieldsSimple
cscjlan Jan 9, 2025
aab4db5
Replace FsGrid with span for propagateFields
cscjlan Jan 9, 2025
aff096d
Replace FsGrid with span for sysboundary files
cscjlan Jan 9, 2025
d3b32a1
Replace std::span with fsgrid::FsData
cscjlan Jan 10, 2025
0ba6463
Replace FsGrid with FsData for others except technicalGrid; Pass argu…
cscjlan Jan 10, 2025
a80315e
Go back to span from FsData for most cases
cscjlan Jan 13, 2025
8f9e126
Fix compile errors related to FsData/span
cscjlan Jan 13, 2025
4b93059
Change permutation order to what it was originally, to check floating…
cscjlan Jan 13, 2025
e204b27
Add timers to parallel_for calls; Stop some timers that were started …
cscjlan Jan 13, 2025
d332b20
Remove commented out code
cscjlan Jan 13, 2025
df92f8c
Update submodule, add return type to lambdas
cscjlan Jan 13, 2025
538fdfe
Add comments
cscjlan Jan 14, 2025
e8c5ff2
Change order of parallel_for arguments
cscjlan Jan 14, 2025
b26ec2f
Make constexpr array also static
cscjlan Jan 14, 2025
dac9241
Replace technicalGrid with technical & fsgrid
cscjlan Jan 15, 2025
fd09e64
Change technicalGrid to fsgrid & technical
cscjlan Jan 15, 2025
bd5c283
Remove getData calls
cscjlan Jan 15, 2025
b9e1ce6
Replace technicalGrid with technical and fsgrid
cscjlan Jan 15, 2025
91d54ee
Update submodule
cscjlan Jan 15, 2025
7c98f2d
Define a less verbose type and use it
cscjlan Jan 15, 2025
526c2ca
Rename fsgrids to fieldSolverData
cscjlan Jan 15, 2025
5d3739f
Fix Alfven.cpp after merge
cscjlan Feb 14, 2025
3b30d9b
Add overrides to Alfven.h
cscjlan Feb 14, 2025
ba6ca7d
Add override to Diffusion
cscjlan Feb 14, 2025
0ca5d8c
Add overrides to Dispersion.h
cscjlan Feb 14, 2025
2d1a769
Fix Distributions.cpp after git merge
cscjlan Feb 14, 2025
4c0faa6
Add overrides to Distributions.h
cscjlan Feb 14, 2025
5ab0f3b
Add overrides to Firehose.h
cscjlan Feb 14, 2025
1a9ce3d
Fix git merges
cscjlan Feb 14, 2025
3d06e06
Remove project file that's removed in dev
cscjlan Feb 14, 2025
708b1e5
Add overrides to headers
cscjlan Feb 17, 2025
eb0001b
Fix git merge issues
cscjlan Feb 17, 2025
b12310c
Fix git merge issues
cscjlan Feb 17, 2025
e41b7e6
Add braces
cscjlan Feb 17, 2025
38cdd69
Add overrides back to header files
cscjlan Feb 17, 2025
ae4ee6a
Fix git merge issue
cscjlan Feb 17, 2025
4c24f9e
Fix git merge issue
cscjlan Feb 17, 2025
f4cf0a6
Update fsgrid accessing
cscjlan Feb 17, 2025
b65f466
Rename misleading coordinate names
cscjlan Feb 17, 2025
58445e7
Update submodule
cscjlan Feb 17, 2025
728c12c
Update submodule
cscjlan Feb 17, 2025
4ecd402
Change grids to spans for a function behind ifdef
cscjlan Feb 17, 2025
ca2f7af
Change struct to class in typedef
cscjlan Feb 17, 2025
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
Prev Previous commit
Next Next commit
Add overrides to Firehose.h
  • Loading branch information
cscjlan committed Feb 14, 2025
commit 5ab0f3bf2efb7be8178fc8aabe4a2273faf6e7de
16 changes: 9 additions & 7 deletions projects/Firehose/Firehose.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ namespace projects {
Firehose();
virtual ~Firehose();

virtual bool initialize(void);
virtual bool initialize(void) override;
static void addParameters(void);
virtual void getParameters(void);
virtual void setProjectBField(std::span<std::array<Real, fsgrids::bfield::N_BFIELD>> perb,
std::span<std::array<Real, fsgrids::bgbfield::N_BGB>> bgb,
std::span<fsgrids::technical> technical, FieldSolverGrid &fsgrid);
virtual void getParameters(void) override;
virtual void setProjectBField(
std::span<std::array<Real, fsgrids::bfield::N_BFIELD>> perb,
std::span<std::array<Real, fsgrids::bgbfield::N_BGB>> bgb,
std::span<fsgrids::technical> technical, FieldSolverGrid &fsgrid
) override;

virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell,
const uint popID,
const uint nRequested) const;
const uint nRequested) const override;
Real profile(creal top, creal bottom, creal x) const;
virtual void calcCellParameters(spatial_cell::SpatialCell* cell,creal& t);
virtual void calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) override;

Real Bx;
Real By;
Expand Down