-
Notifications
You must be signed in to change notification settings - Fork 11
Slab force update #215
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
base: devel
Are you sure you want to change the base?
Slab force update #215
Changes from 10 commits
3f24325
85864fa
db8878b
3d55d75
aeb39a2
c8af8b3
a5149ed
5cffd92
ca731d4
08fc515
bd75f99
69a25c4
f23f427
4d7f43b
c84a843
7e45975
a3aaefe
b7ed7eb
875571d
09b429c
1c8a6d4
0efa0b3
4452ee4
e327ca3
626973e
37f6071
c883db1
7c487bc
dc2ae45
f7e7be4
a5a780b
bab8d36
86baa99
3766f97
f047d3e
8e25b53
f036c51
e39cfc8
6590d59
a111a90
7b4f5d7
d87a355
5e9e60b
5dbe30a
0cc1bc5
227e859
8ff45d1
5e3b42f
c0a233a
ec6e853
f871e26
dd0280b
ac21815
11beb18
8531aa9
8525a20
42b19ee
6b6b5a9
973f789
65c43da
32b4f7f
48055b3
9a8b385
3d42eed
bba264b
dba16fa
6964b52
feab837
9d68774
635bae9
27b9174
77c2784
8d0f415
c06ae53
55ab549
a2f2074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #pragma once | ||
|
|
||
| #include <iostream> | ||
|
|
||
| namespace __EXP__ | ||
| { | ||
| // Runtime parser for "X.Y.Z" format | ||
|
The9Cat marked this conversation as resolved.
Outdated
|
||
|
|
||
| /* Example usage: | ||
|
|
||
| #define VERSION_STR "2.4.12" | ||
| static constexpr EXPversion current_v = EXP_parse_version(VERSION_STR); | ||
|
|
||
| int main() { | ||
| static_assert(current_v.major == 2, "Major version mismatch"); | ||
| std::cout << "Parsed: " << current_v.major << "." << current_v.minor << "\n"; | ||
| return 0;} | ||
| */ | ||
|
|
||
|
|
||
| struct EXPversion | ||
| { | ||
| int major, minor, patch; | ||
| }; | ||
|
|
||
| // Compile-time parser for "X.Y.Z" format | ||
| constexpr EXPversion EXP_parse_version(const char* str) | ||
| { | ||
| EXPversion v = {0, 0, 0}; | ||
| int* target = &v.major; | ||
| int current = 0; | ||
|
|
||
| // Scan the version string until we hit a dot, then move to the next target | ||
| for (int i = 0; str[i] != '\0'; ++i) { | ||
| if (str[i] == '.') { | ||
| *target = current; | ||
| if (target == &v.major) target = &v.minor; | ||
| else if (target == &v.minor) target = &v.patch; | ||
| current = 0; | ||
| } else { | ||
| // Add the current digit to the current version component | ||
| current = current * 10 + (str[i] - '0'); | ||
| } | ||
| } | ||
| *target = current; | ||
| return v; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,9 +17,38 @@ | |
| #include <cudaMappingConstants.cuH> | ||
| #endif | ||
|
|
||
| /*! This routine computes the potential, acceleration and density | ||
| using expansion periodic in X & Y and outgoing vacuum boundary | ||
| condtions in Z */ | ||
| /** @class SlabSL | ||
| @brief This routine computes the potential, acceleration and density | ||
| using expansion periodic in X & Y and outgoing vacuum boundary | ||
| condtions in Z | ||
|
The9Cat marked this conversation as resolved.
Outdated
|
||
|
|
||
| @details **YAML configuration** | ||
|
|
||
| @param nmaxx is the maximum order of the expansion in x (default 6) | ||
|
|
||
| @param nmaxy is the maximum order of the expansion in y (default 6) | ||
|
|
||
| @param nmaxz is the maximum order of the expansion in z (default 6) | ||
|
|
||
| @param nminx is the minimum order of the expansion in x (default 0) | ||
|
|
||
| @param nminy is the minimum order of the expansion in y (default 0) | ||
|
|
||
| @param hslab is the scale height of the slab (default 0.2) | ||
|
|
||
| @param zmax is the maximum z for the slab (default 10.0) | ||
|
|
||
| @param ngrid is the number of grid points in z for the | ||
| Sturm-Liouville solver (default 1000) | ||
|
|
||
| @param type is the type of slab to solve for (default | ||
| "isothermal", must be "isothermal", "parabolic", or "constant") | ||
|
|
||
| @param self_consistent set to true allows the particles to evolve | ||
| under the time-dependent basis expansion. For a basis fixed in time to | ||
| the initial time: set to false. | ||
|
|
||
| */ | ||
|
Comment on lines
+25
to
+70
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot apply changes based on this feedback
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
| class SlabSL : public PotAccel | ||
| { | ||
|
|
||
|
|
@@ -47,6 +76,9 @@ private: | |
| //! Current coefficient tensor | ||
| std::vector<coefType> expccof, expccofP; | ||
|
|
||
| //! Coefficient tensor for frozen potential (if self_consistent=false) | ||
| coefType expcofF; | ||
|
|
||
| int nminx, nminy; | ||
| int nmaxx, nmaxy, nmaxz; | ||
| double zmax, hslab; | ||
|
|
@@ -120,6 +152,12 @@ private: | |
|
|
||
| #endif | ||
|
|
||
| //! Flag self_consitency | ||
|
The9Cat marked this conversation as resolved.
Outdated
|
||
| bool self_consistent = true; | ||
|
|
||
| //! Flag whether coefficients have been initialized for the first time | ||
| bool firstime_coef = true; | ||
|
|
||
| //! Default number of grid points for SLGridSlab | ||
| int ngrid = 1000; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,6 @@ | |
|
|
||
| */ | ||
|
|
||
| #define VERSION 0.1 | ||
|
|
||
| #include <iostream> | ||
| #include <iomanip> | ||
| #include <sstream> | ||
|
|
@@ -366,8 +364,7 @@ decode_switches (int argc, char **argv) | |
| "R:" /* runit */ | ||
| "N:" /* number */ | ||
| "S:" /* seed */ | ||
| "h" /* help */ | ||
| "V", /* version */ | ||
| "h", /* help */ | ||
| long_options, (int *) 0)) != EOF) | ||
|
Comment on lines
-357
to
369
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot apply changes based on this feedback
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored |
||
| { | ||
| switch (c) | ||
|
|
@@ -399,10 +396,6 @@ decode_switches (int argc, char **argv) | |
| case 'S': /* --seed */ | ||
| S = atoi(optarg); | ||
| break; | ||
| case 'V': | ||
| cout << program_name << " " << VERSION << endl; | ||
| exit (0); | ||
|
|
||
| case 'h': | ||
| usage (0); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.