Commit Graph

171 Commits

Author SHA1 Message Date
jpekkila
cdb504e772 Added a proof-of-concept helical forcing which uses the newly introduced ScalarArrays for reading profiles. Not extensively tested. 2019-09-02 21:29:07 +03:00
jpekkila
9e57aba9b7 New feature: ScalarArray. ScalarArrays are read-only 1D arrays containing max(mx, max(my, mz)) elements. ScalarArray is a new type of uniform and can be used for storing f.ex. forcing profiles. The DSL now also supports complex numbers and some basic arithmetic (exp, multiplication) 2019-09-02 21:26:57 +03:00
Miikka Vaisala
ac92123842 Made a note about a bug in 083ff59 , just to remember that code is now more correct. 2019-09-02 18:40:38 +08:00
Miikka Vaisala
f3a36ec276 Moved definition location of AC_nx_min etc. Otherwide DSL does not compile the code correctly!!! 2019-09-02 18:29:16 +08:00
Miikka Vaisala
b4cd92da0c Now compiles and runs.
PLEASE NOTE THAT FLAGS NEED TO BE SET SEPARATELY IN simulation.cc and renderer.cc FOR LSINK and LFORCING!
2019-09-02 14:47:58 +08:00
Miikka Vaisala
02ac6c956f Desperately trying to port the new changes of DSL.
Still work to do.
2019-09-02 14:04:27 +08:00
Miikka Vaisala
6eeb225924 Merge branch 'master' into sink_20190723
Hopefully the merge isssues were resolved.
2019-09-02 11:58:48 +08:00
jpekkila
6ea02fa28e DSL now 'feature complete' with respect to what I had in mind before the summer. Users can now create multiple kernels and the library functions are generated automatically for them. The generated library functions are of the form acDeviceKernel_<name> and acNodeKernel_<name>. More features are needed though. The next features to be added at some point are 1D and 2D device constant arrays in order to support profiles for f.ex. forcing. 2019-08-27 18:19:20 +03:00
jpekkila
20138263f4 The previous attempt (dsl_feature_completeness_2019-08-23) to enable arbitrary kernel functions was a failure: we get significant performance loss (25-100%) if step_number is not passed as a template parameter to the integration kernel. Apparently the CUDA compiler cannot perform some optimizations if there is a if/else construct in a performance-critical part which cannot be evaluated at compile time. This branch keeps step_number as a template parameter but takes rest of the user parameters as uniforms (dt is no longer passed as a function parameter but as an uniform with the DSL instead). 2019-08-27 17:36:33 +03:00
Miikka Vaisala
1410e57866 Preparing isothermal collapse. 2019-08-22 18:18:30 +08:00
Miikka Vaisala
a81bc22fb6 Write now sink infor to time series. Also a bug cerrection for sink switch. 2019-08-22 11:52:02 +08:00
jpekkila
5d2b658fb0 Autoformatted the DSL files 2019-08-20 18:41:26 +03:00
JackHsu
5b686bc659 Fixed on/off switch for forcing and accretion, now forcing only happens for first 1000 steps (currently hard-coded), and accretion only happen after 1000 steps. 2019-08-20 23:12:42 +08:00
jpekkila
5b7408eb55 User config param overhaul complete, works. If I haven't missed anything, all fields and user parameters, and everything related to simulation can now be declared with the DSL. The only thing that you need to do is to fill the declared symbols with data, like with OpenGL and GLSL. 2019-08-19 18:43:16 +03:00
jpekkila
51cf1f1068 The C header is now generated from the DSL, stashing the changes just to be sure since I might overwrite something when updating the compilation scripts to work with this new scheme 2019-08-19 18:19:28 +03:00
jpekkila
bcdd827a4f Added a proper declarations for all user-specified uniform. Note: built-in uniforms are not correctly translated into CUDA 2019-08-19 17:05:56 +03:00
jpekkila
0208d55e4e Moved STENCIL_ORDER and NGHOST out of user-defined parameter as these are actually internal defines used to configure the built-in functions. Additionally, renamed all explicitly declared uniforms from dsx -> AC_dsx in the DSL in preparation for having clear connection between DSL uniforms and the library parameter handles created by the user (AcRealParam etc) 2019-08-19 16:40:47 +03:00
jpekkila
c98b74563c Added a comment 2019-08-19 16:18:24 +03:00
jpekkila
b316e51267 Added preliminary code for generating C headers with the DSL 2019-08-19 16:16:26 +03:00
Miikka Vaisala
5d93d743c7 Improved sink particle stability vie Truelove criterion. 2019-08-19 14:38:36 +08:00
Miikka Vaisala
1bfb0390ad Seemingly reasonable sink for both density and velocity. 2019-08-16 13:29:34 +08:00
Miikka Vaisala
f921840505 Changed to step function 2019-08-16 11:44:41 +08:00
Miikka Vaisala
a8fbced89d Error correction. 2019-08-16 11:36:39 +08:00
Miikka Vaisala
53bd3d4aa4 Correction factor for the equation. 2019-08-16 11:13:21 +08:00
Miikka Vaisala
60f2af0971 Renamed accretion_profile -> sink_accretion. More intuitive. 2019-08-16 09:52:12 +08:00
JackHsu
6c50c0a40e sink effetc in equations. 2019-08-15 19:23:26 +08:00
JackHsu
a5bb56873a Now resets accretion buffer at every step. 2019-08-15 17:51:39 +08:00
JackHsu
c7df5be068 tried new accretion profile, and added some to-do's. 2019-08-14 18:43:22 +08:00
JackHsu
56c51e5315 fixed the undefined error in compilation. 2019-08-13 18:36:12 +08:00
JackHsu
0587d08b01 Had some rough draft of accretion criterion. 2019-08-13 18:31:57 +08:00
JackHsu
927a5e74f2 Made accretion time-dependent now, need to come up with better accretion crition than truelove. 2019-08-13 18:06:29 +08:00
JackHsu
ff59431d65 Added modularized term for accretion range, which is some wave function, and module that'll allow time-dependent accretion. 2019-08-13 17:43:52 +08:00
JackHsu
8c7176d702 Completed function to sum VTXBUF_ACCRETION and updates mass of sink particle. Needs further work with crashing problem. 2019-08-12 19:02:22 +08:00
JackHsu
e7ff447510 Merge branch 'master' into sink_20190723
Conflicts:
	acc/mhd_solver/stencil_process.sps

I've mannaully resolved the conflict, only that I'm leaving int3 globalVertexIdx as is, as instructed by Miikka.
2019-08-12 14:01:19 +08:00
jpekkila
a7a7b535d6 The code generator now generates more efficient CUDA: built-in parameters are passed as const references without copying 2019-08-08 21:35:07 +03:00
jpekkila
a172abeb1f Modified the other sps files to use the new syntax. Though does not compile since there are some old/very old changes in the DSL that have not been updated to these files (f.ex. RK macro does not exist anymore, it's currently rk3) 2019-08-08 21:25:45 +03:00
jpekkila
67358fa75f Removed acc/samples as unmaintained 2019-08-08 21:22:34 +03:00
jpekkila
b53cabbc44 Made the DSL syntax less confusing: Input and output arrays are now ScalarField and VectorFields instead of scalars and vectors. C++ initializers are now also possible, removing the need to declare Fields as int or int3 which was very confusing, like "what, you assing an int value to a real, what the &^%@?" 2019-08-08 21:07:36 +03:00
JackHsu
89128af44b added update_accretion_buffer. 2019-08-08 15:53:41 +08:00
JackHsu
c1b99b2b37 made step-wise buffer update. 2019-08-08 15:03:42 +08:00
JackHsu
e5540f6278 added some vertex buffer stuff, not completed. 2019-08-08 14:08:42 +08:00
JackHsu
baac7c8d12 Merge branch 'master' into sink_20190723
Conflicts:
	acc/mhd_solver/stencil_defines.h
	src/standalone/simulation.cc
2019-08-08 12:17:28 +08:00
jpekkila
fd94b6321d Renamed globalGrid.n to globalGridN 2019-08-07 18:16:34 +03:00
jpekkila
10200e4dd5 Merge branch 'master' into node_device_interface_revision_07-23 2019-08-07 16:25:33 +03:00
jpekkila
e2f5cced1e Renamed dox -> dot 2019-08-07 16:08:03 +03:00
jpekkila
b61617ee0f Enabled upwinding by default and updated the model helical forcing with the hotfixed changes from earlier commits. Autotests kinda pass (we get 1 failure but this is likely due to inaccuracies of the trigonometric functions used in helical forcing. The error is very close to the acceptable error bound). 2019-08-07 15:53:38 +03:00
Miikka Vaisala
7fdbd76aa2 The default stencil_defines.h setting for merge. 2019-08-07 19:05:14 +08:00
Miikka Vaisala
065f20819f Merge branch 'master' into bugfix/upwind_autotest_20190807 2019-08-07 18:23:03 +08:00
JackHsu
2f14bb2a30 Finished accretion_profile function and started a draft of update_accretion_buffer. 2019-08-07 17:14:26 +08:00
Miikka Vaisala
7e6361a92a Forcing hotfix.
Will need more investigation before scientific runs. Now just something to correct the obvious bug.
2019-08-07 16:04:48 +08:00