Permalink
Browse files

initial import

  • Loading branch information...
0 parents commit f537dac66a4d076d4c9c6f62563e1e63ffc85864 Sylwester Arabas committed Nov 15, 2011
Showing with 19,721 additions and 0 deletions.
  1. +86 −0 CMakeLists.txt
  2. +674 −0 COPYING
  3. +50 −0 README
  4. +21 −0 common.hpp.in
  5. +12 −0 demo/demo_1d.gpi
  6. +33 −0 demo/demo_2d.pro
  7. +1,716 −0 doc/Doxyfile
  8. +128 −0 doc/html/adv_8hpp.html
  9. +130 −0 doc/html/adv_8hpp_source.html
  10. +127 −0 doc/html/adv__leapfrog_8hpp.html
  11. +130 −0 doc/html/adv__leapfrog_8hpp_source.html
  12. +165 −0 doc/html/adv__mpdata_8hpp.html
  13. +158 −0 doc/html/adv__mpdata_8hpp_source.html
  14. +127 −0 doc/html/adv__upstream_8hpp.html
  15. +135 −0 doc/html/adv__upstream_8hpp_source.html
  16. +123 −0 doc/html/annotated.html
  17. BIN doc/html/bc_s.png
  18. +115 −0 doc/html/classadv-members.html
  19. +255 −0 doc/html/classadv.html
  20. BIN doc/html/classadv.png
  21. +115 −0 doc/html/classadv__leapfrog-members.html
  22. +270 −0 doc/html/classadv__leapfrog.html
  23. BIN doc/html/classadv__leapfrog.png
  24. +117 −0 doc/html/classadv__mpdata-members.html
  25. +339 −0 doc/html/classadv__mpdata.html
  26. BIN doc/html/classadv__mpdata.png
  27. +115 −0 doc/html/classadv__upstream-members.html
  28. +275 −0 doc/html/classadv__upstream.html
  29. BIN doc/html/classadv__upstream.png
  30. +119 −0 doc/html/classdom-members.html
  31. +460 −0 doc/html/classdom.html
  32. BIN doc/html/classdom.png
  33. +125 −0 doc/html/classdom__parallel-members.html
  34. +478 −0 doc/html/classdom__parallel.html
  35. BIN doc/html/classdom__parallel.png
  36. +121 −0 doc/html/classdom__parallel__openmp-members.html
  37. +298 −0 doc/html/classdom__parallel__openmp.html
  38. BIN doc/html/classdom__parallel__openmp.png
  39. +139 −0 doc/html/classdom__serial-members.html
  40. +935 −0 doc/html/classdom__serial.html
  41. BIN doc/html/classdom__serial.png
  42. +116 −0 doc/html/classes.html
  43. +112 −0 doc/html/classout-members.html
  44. +197 −0 doc/html/classout.html
  45. BIN doc/html/classout.png
  46. +115 −0 doc/html/classout__gnuplot-members.html
  47. +287 −0 doc/html/classout__gnuplot.html
  48. BIN doc/html/classout__gnuplot.png
  49. +116 −0 doc/html/classout__netcdf-members.html
  50. +350 −0 doc/html/classout__netcdf.html
  51. BIN doc/html/classout__netcdf.png
  52. BIN doc/html/closed.png
  53. +126 −0 doc/html/dom_8hpp.html
  54. +147 −0 doc/html/dom_8hpp_source.html
  55. +129 −0 doc/html/dom__parallel_8hpp.html
  56. +189 −0 doc/html/dom__parallel_8hpp_source.html
  57. +128 −0 doc/html/dom__parallel__openmp_8hpp.html
  58. +149 −0 doc/html/dom__parallel__openmp_8hpp_source.html
  59. +129 −0 doc/html/dom__serial_8hpp.html
  60. +273 −0 doc/html/dom__serial_8hpp_source.html
  61. +835 −0 doc/html/doxygen.css
  62. BIN doc/html/doxygen.png
  63. +123 −0 doc/html/files.html
  64. BIN doc/html/ftv2blank.png
  65. BIN doc/html/ftv2doc.png
  66. BIN doc/html/ftv2folderclosed.png
  67. BIN doc/html/ftv2folderopen.png
  68. BIN doc/html/ftv2lastnode.png
  69. BIN doc/html/ftv2link.png
  70. BIN doc/html/ftv2mlastnode.png
  71. BIN doc/html/ftv2mnode.png
  72. BIN doc/html/ftv2node.png
  73. BIN doc/html/ftv2plastnode.png
  74. BIN doc/html/ftv2pnode.png
  75. BIN doc/html/ftv2splitbar.png
  76. BIN doc/html/ftv2vertline.png
  77. +399 −0 doc/html/functions.html
  78. +285 −0 doc/html/functions_func.html
  79. +189 −0 doc/html/functions_vars.html
  80. +125 −0 doc/html/globals.html
  81. +116 −0 doc/html/globals_defs.html
  82. +122 −0 doc/html/globals_func.html
  83. +186 −0 doc/html/hierarchy.html
  84. +226 −0 doc/html/icicle_8cpp.html
  85. +184 −0 doc/html/icicle_8cpp_source.html
  86. +102 −0 doc/html/index.html
  87. +112 −0 doc/html/installdox
  88. +54 −0 doc/html/jquery.js
  89. +250 −0 doc/html/model_8hpp.html
  90. +221 −0 doc/html/model_8hpp_source.html
  91. BIN doc/html/nav_f.png
  92. BIN doc/html/nav_h.png
  93. +123 −0 doc/html/navtree.css
  94. +299 −0 doc/html/navtree.js
  95. BIN doc/html/open.png
  96. +126 −0 doc/html/out_8hpp.html
  97. +123 −0 doc/html/out_8hpp_source.html
  98. +174 −0 doc/html/out__gnuplot_8hpp.html
  99. +159 −0 doc/html/out__gnuplot_8hpp_source.html
  100. +128 −0 doc/html/out__netcdf_8hpp.html
  101. +175 −0 doc/html/out__netcdf_8hpp_source.html
  102. +81 −0 doc/html/resize.js
  103. +85 −0 doc/html/search/all_61.html
  104. +29 −0 doc/html/search/all_62.html
  105. +32 −0 doc/html/search/all_63.html
  106. +88 −0 doc/html/search/all_64.html
  107. +26 −0 doc/html/search/all_65.html
  108. +44 −0 doc/html/search/all_66.html
  109. +26 −0 doc/html/search/all_68.html
  110. +53 −0 doc/html/search/all_69.html
  111. +26 −0 doc/html/search/all_6a.html
  112. +26 −0 doc/html/search/all_6b.html
  113. +32 −0 doc/html/search/all_6c.html
  114. +37 −0 doc/html/search/all_6d.html
  115. +55 −0 doc/html/search/all_6e.html
  116. +81 −0 doc/html/search/all_6f.html
  117. +38 −0 doc/html/search/all_70.html
  118. +43 −0 doc/html/search/all_72.html
  119. +31 −0 doc/html/search/all_73.html
  120. +37 −0 doc/html/search/all_74.html
  121. +26 −0 doc/html/search/all_76.html
  122. +26 −0 doc/html/search/all_78.html
  123. +26 −0 doc/html/search/all_79.html
  124. +26 −0 doc/html/search/all_7a.html
  125. +38 −0 doc/html/search/all_7e.html
  126. +40 −0 doc/html/search/classes_61.html
  127. +40 −0 doc/html/search/classes_64.html
  128. +35 −0 doc/html/search/classes_6f.html
  129. BIN doc/html/search/close.png
  130. +26 −0 doc/html/search/defines_66.html
  131. +40 −0 doc/html/search/files_61.html
  132. +40 −0 doc/html/search/files_64.html
  133. +25 −0 doc/html/search/files_69.html
  134. +25 −0 doc/html/search/files_6d.html
  135. +35 −0 doc/html/search/files_6f.html
  136. +38 −0 doc/html/search/functions_61.html
  137. +29 −0 doc/html/search/functions_62.html
  138. +32 −0 doc/html/search/functions_63.html
  139. +48 −0 doc/html/search/functions_64.html
  140. +26 −0 doc/html/search/functions_66.html
  141. +26 −0 doc/html/search/functions_68.html
  142. +36 −0 doc/html/search/functions_69.html
  143. +26 −0 doc/html/search/functions_6c.html
  144. +32 −0 doc/html/search/functions_6d.html
  145. +31 −0 doc/html/search/functions_6e.html
  146. +49 −0 doc/html/search/functions_6f.html
  147. +37 −0 doc/html/search/functions_72.html
  148. +31 −0 doc/html/search/functions_73.html
  149. +31 −0 doc/html/search/functions_74.html
  150. +38 −0 doc/html/search/functions_7e.html
  151. BIN doc/html/search/mag_sel.png
  152. +12 −0 doc/html/search/nomatches.html
  153. +240 −0 doc/html/search/search.css
  154. +736 −0 doc/html/search/search.js
  155. BIN doc/html/search/search_l.png
  156. BIN doc/html/search/search_m.png
  157. BIN doc/html/search/search_r.png
  158. +29 −0 doc/html/search/variables_61.html
  159. +26 −0 doc/html/search/variables_64.html
  160. +26 −0 doc/html/search/variables_65.html
  161. +35 −0 doc/html/search/variables_66.html
  162. +32 −0 doc/html/search/variables_69.html
  163. +26 −0 doc/html/search/variables_6a.html
  164. +26 −0 doc/html/search/variables_6b.html
  165. +26 −0 doc/html/search/variables_6c.html
  166. +44 −0 doc/html/search/variables_6e.html
  167. +26 −0 doc/html/search/variables_6f.html
  168. +38 −0 doc/html/search/variables_70.html
  169. +26 −0 doc/html/search/variables_72.html
  170. +26 −0 doc/html/search/variables_74.html
  171. +26 −0 doc/html/search/variables_76.html
  172. +26 −0 doc/html/search/variables_78.html
  173. +26 −0 doc/html/search/variables_79.html
  174. +26 −0 doc/html/search/variables_7a.html
  175. BIN doc/html/tab_a.png
  176. BIN doc/html/tab_b.png
  177. BIN doc/html/tab_h.png
  178. BIN doc/html/tab_s.png
  179. +59 −0 doc/html/tabs.css
  180. +80 −0 icicle.cpp
  181. +26 −0 include/adv.hpp
  182. +26 −0 include/adv_leapfrog.hpp
  183. +54 −0 include/adv_mpdata.hpp
  184. +31 −0 include/adv_upstream.hpp
  185. +43 −0 include/dom.hpp
  186. +85 −0 include/dom_parallel.hpp
  187. +45 −0 include/dom_parallel_openmp.hpp
  188. +169 −0 include/dom_serial.hpp
  189. +117 −0 include/model.hpp
  190. +19 −0 include/out.hpp
  191. +60 −0 include/out_gnuplot.hpp
  192. +71 −0 include/out_netcdf.hpp
  193. +1 −0 tests/CMakeLists.txt
  194. +39 −0 tests/courant_one_1D.sh
@@ -0,0 +1,86 @@
+## @file
+# @author Sylwester Arabas (University of Warsaw) <slayoo@igf.fuw.edu.pl>
+# @date November 2011
+# @section LICENSE
+# GPL v3 (see the COPYING file or http://www.gnu.org/licenses/)
+
+cmake_minimum_required(VERSION 2.6) # for simplified if-constructs
+project(icicle CXX)
+add_executable(icicle icicle.cpp)
+enable_testing()
+add_subdirectory(tests)
+set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "common.hpp;Makefile;CMakeCache.txt;cmake_install.cmake;CMakeFiles;Testing;CTestTestfile.cmake;tests/Makefile;tests/CMakeCache.txt;tests/cmake_install.cmake;tests/CMakeFiles;tests/Testing;tests/CTestTestfile.cmake;doc/Makefile;doc/CMakeCache.txt;doc/cmake_install.cmake;doc/CMakeFiles;doc/Testing;doc/CTestTestfile.cmake")
+include (CheckCXXSourceCompiles)
+
+
+#### Boost units (mandatory)
+check_cxx_source_compiles("#include <boost/units/systems/si.hpp>\n int main() {}" Find_Boost_Units)
+if(NOT Find_Boost_Units)
+ message(FATAL_ERROR "Boost.Units not found! (cf. CMakeFiles/CMakeError.log)")
+endif()
+
+
+#### Boost lexical cast (mandatory)
+check_cxx_source_compiles("#include <boost/lexical_cast.hpp>\n int main() {}" Find_Boost_Lexical_Cast)
+if(NOT Find_Boost_Lexical_Cast)
+ message(FATAL_ERROR "Boost.lexical_cast not found! (cf. CMakeFiles/CMakeError.log)")
+endif()
+
+
+#### Blitz (mandatory)
+check_cxx_source_compiles("#include <blitz/array.h>\n int main() {}" Find_Blitz)
+if(NOT Find_Blitz)
+ message(FATAL_ERROR "Blitz++ not found! (cf. CMakeFiles/CMakeError.log)")
+endif()
+
+
+#### Boost program options (mandatory)
+set(CMAKE_REQUIRED_LIBRARIES "-lboost_program_options")
+check_cxx_source_compiles(
+ "#include <boost/program_options.hpp>\n int main() { boost::program_options::options_description d; }"
+ Find_Boost_Program_Options
+)
+if(NOT Find_Boost_Program_Options)
+ message(FATAL_ERROR "Boost.Program_Options not found! (cf. CMakeFiles/CMakeError.log)")
+endif()
+set(LINK_FLAGS "${LINK_FLAGS} -lboost_program_options")
+
+
+#### OpenMP (optional)
+set(TMP ${CMAKE_CXX_FLAGS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+check_cxx_source_compiles("#include <omp.h>\n int main() { omp_set_num_threads(2); }" Find_OpenMP)
+if(NOT Find_OpenMP)
+ message(WARNING "OpenMP not found (cf. CMakeFiles/CMakeError.log) - OpenMP parallelisation will not be available.")
+ set(CMAKE_CXX_FLAGS ${TMP})
+else()
+ set(HAVE_OPENMP ${Find_OpenMP})
+endif()
+
+
+### NetCDF (optional)
+#TODO handle -DNETCDF=no
+set(TMP ${CMAKE_REQUIRED_LIBRARIES})
+set(CMAKE_REQUIRED_LIBRARIES "-lnetcdf_c++")
+check_cxx_source_compiles(
+ "#include <netcdfcpp.h>\n int main() { NcFile *f; }"
+ found
+)
+if(NOT found)
+ message(WARNING "NetCDF not found! (cf. CMakeFiles/CMakeError.log) - NetCDF output will not be available.")
+ set(CMAKE_REQUIRED_LIBRARIES ${TMP})
+else()
+ set(HAVE_NETCDF ${found})
+endif()
+set(LINK_FLAGS "${LINK_FLAGS} -lnetcdf_c++")
+
+set_target_properties(icicle PROPERTIES LINK_FLAGS ${LINK_FLAGS})
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/common.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/common.hpp)
+
+find_package(Doxygen)
+if (DOXYGEN_FOUND)
+ #add_subdirectory(doc) (FIXME - cmake-controlled doc build)
+else()
+ message(WARNING "Doxygent not found - 'make doc' will not be available.")
+endif()
674 COPYING

Large diffs are not rendered by default.

Oops, something went wrong.
50 README
@@ -0,0 +1,50 @@
+--------------------------- ICICLE ---------------------------
+
+- outline: TODO
+- author: Sylwester Arabas et al. (University of Warsaw)
+- license: GPLv3 (cf. COPYING or http://www.gnu.org/licenses/)
+
+--------------------------------------------------------------
+* requirements:
+ - cmake .............................. http://www.cmake.org/
+ - C++ compiler, e.g.
+ - clang++ (no OpenMP as of '11) ... http://clang.llvm.org/
+ - g++ (GCC >= 4.2 for OpenMP) ........ http://gcc.gnu.org/
+ - ...
+ - Blitz++ library ............ http://blitz.sourceforge.net/
+ - Boost C++ libraries, incl.: ........ http://www.boost.org/
+ - Boost headers (Units, Program_options, Conversion)
+
+* optional libraries:
+ - Boost C++ libraries, incl.: ........ http://www.boost.org/
+ - Boost headers & shared libs (Thread, MPI, Serialization)
+ - NetCDF C++ library ... http://www.unidata.ucar.edu/netcdf/
+ - MPI libraries with C++ bindings (optional), e.g.:
+ - Open MPI ...................... http://www.open-mpi.org/
+ (with --enable-mpi-threads if MPI+threads is to be used)
+ - MPICH ............... http://www.mcs.anl.gov/mpi/mpich2/
+ - LAM/MPI ........................ http://www.lam-mpi.org/
+ (not tested yet - FIXME, LAM/MPI authors "encourage all
+ users to try migrating to Open MPI")
+
+--------------------------------------------------------------
+* in-tree compilation / tests / clean-up:
+ $ cmake . [-DCMAKE_BUILD_TYPE=Release|Debug|...]
+ $ make
+ $ make test
+ $ make clean
+
+ CMake honors the CXX env. var, so one may use e.g.
+ $ export CXX=openmpic++
+
+--------------------------------------------------------------
+* usage:
+ $ ./icicle --help
+ $ ./icicle ... --dom serial
+ $ ./icicle ... --dom threads --nsdom N
+ $ ./icicle ... --dom openmp --nsdom N
+ $ [open]mpirun -np N ./icicle ... --dom mpi --nsdom N
+
+--------------------------------------------------------------
+* developers' documentation draft:
+ - see doc/doxygen/html/index.html
@@ -0,0 +1,21 @@
+/** @file
+ * @author Sylwester Arabas (University of Warsaw) <slayoo@igf.fuw.edu.pl>
+ * @date November 2011
+ * @section LICENSE
+ * GPL v3 (see the COPYING file or http://www.gnu.org/licenses/)
+ */
+#ifndef COMMON_H
+# define COMMON_H
+
+// compile-time options
+#cmakedefine HAVE_OPENMP 1
+#cmakedefine HAVE_NETCDF 1
+
+// overloading the default d-tor with a virtual one (enforces execution of child d-tors)
+class root { public: virtual ~root() {} };
+
+// error reporting
+# define error_macro(msg) { cerr << "-- error: " << msg << endl; throw exception(); }
+# define warning_macro(msg) { cerr << "-- warning: " << msg << endl; }
+
+#endif
@@ -0,0 +1,12 @@
+## @file
+# @author Sylwester Arabas (University of Warsaw) <slayoo@igf.fuw.edu.pl>
+# @date November 2011
+# @section LICENSE
+# GPL v3 (see the COPYING file or http://www.gnu.org/licenses/)
+
+set xlabel "x [grid cell number]"
+set ylabel "t [imestep number]"
+opts = '--bits 32 --nx 40 --ny 1 --nz 1 --nt 60 --dt 1 --dx 1 --dy 1 --dz 1 --u .3 --v 0 --w 0 --adv leapfrog --dom serial --out gnuplot'
+if (strlen("$0") == 0) print "default options were used: " . opts; else opts = "$0"
+set title opts
+splot "< ../icicle ".opts using 0:-2:1 notitle with lines palette
@@ -0,0 +1,33 @@
+;; @file
+; @author Sylwester Arabas (University of Warsaw) <slayoo@igf.fuw.edu.pl>
+; @date November 2011
+; @section LICENSE
+; GPL v3 (see the COPYING file or http://www.gnu.org/licenses/)
+; @section DESCRIPTION
+; example usage:
+; GDL> demo_2D, nx=20, nz=30, u=.2, w=.3, nt=100, adv='upstream'
+
+pro demo_2D, nx=nx, nz=nz, u=u, w=w, nt=nt, adv=adv
+ spawn, 'rm -f demo_2d.nc'
+ spawn, '../icicle' + $
+ ' --bits 32 --dt 1 --dx 1 --dy 1 --dz 1 --v 0 --ny 1' + $
+ ' --nt ' + strmid(nt, 2) + $
+ ' --nx ' + strmid(nx, 2) + $
+ ' --nz ' + strmid(nz, 2) + $
+ ' --u ' + strmid(u, 2) + $
+ ' --w ' + strmid(w, 2) + $
+ ' --adv ' + adv + $
+ ' --dom openmp --nsd 2' + $
+ ' --out netcdf --outfile demo_2d.nc'
+ a = ncdf_open('demo_2d.nc')
+ scl = 20
+ window, xsize=scl*nx, ysize=scl*nz
+ loadct, 1
+ i=0l
+ while 1 do begin ; infinite loop
+ ncdf_varget, a, 'psi', p, offset=[0,0,0,i++ mod nt], count=[nz, 1, nx, 1]
+ p = reform(p[*,0,*,0]) ; removing dimensions of size one
+ p = rotate(p, 4)
+ tvscl, rebin(p, scl*nx, scl*nz, /sample)
+ endwhile
+end
Oops, something went wrong.

0 comments on commit f537dac

Please sign in to comment.