From 80fed787651d44c7b8fbf278a1ec21167d968e0b Mon Sep 17 00:00:00 2001 From: Jozsef Bakosi Date: Mon, 23 Feb 2015 09:07:18 -0700 Subject: [PATCH] Add Inciter, remove Quinoa Move some of Quinoa's stuff to Breeze. We now build a new executable, inciter, which will be a test bed for shock hydrodynamics with task-based parallelism using Charm++. It does nothing yet, other than initializing the Charm++ runtime system and gracefully quitting. At this point the goals of inciter are: 1. Experiment with 3D tetrahedra unstructured grid with task-based parallelism using Charm++. 2. Learn how to implement a purely Eulerian-grid-based hydro method with Charm++. The functionality in executable, quinoa will be gradually moved to breeze, which will be the stochastic Lagrangian-particle based computational fluid dynamics tool solving the Navier-Stokes equation. --- doc/images/inciter.txt | 22 +++ src/Base/Exception.h | 10 +- src/Base/Print.h | 19 ++- src/CMakeLists.txt | 2 +- .../{Quinoa => Breeze}/InputDeck/Grammar.h | 30 ++-- .../{Quinoa => Breeze}/InputDeck/InputDeck.h | 28 ++-- .../{Quinoa => Breeze}/InputDeck/Parser.C | 14 +- .../{Quinoa => Breeze}/InputDeck/Parser.h | 26 ++-- .../{Quinoa => Breeze}/Options/Energy.h | 14 +- .../{Quinoa => Breeze}/Options/Frequency.h | 14 +- .../{Quinoa => Breeze}/Options/Hydro.h | 14 +- src/Control/{Quinoa => Breeze}/Options/Mass.h | 14 +- src/Control/{Quinoa => Breeze}/Options/Mix.h | 14 +- .../{Quinoa => Breeze}/Options/MixRate.h | 14 +- .../{Quinoa => Breeze}/Options/MonteCarlo.h | 14 +- .../{Quinoa => Breeze}/Options/Position.h | 14 +- src/Control/CMakeLists.txt | 12 +- .../{Quinoa => Inciter}/CmdLine/CmdLine.h | 34 ++--- .../{Quinoa => Inciter}/CmdLine/Grammar.h | 31 ++-- .../{Quinoa => Inciter}/CmdLine/Parser.C | 20 +-- .../{Quinoa => Inciter}/CmdLine/Parser.h | 26 ++-- src/Control/{Quinoa => Inciter}/Components.h | 14 +- src/Control/Inciter/InputDeck/Grammar.h | 66 ++++++++ src/Control/Inciter/InputDeck/InputDeck.h | 80 ++++++++++ src/Control/Inciter/InputDeck/Parser.C | 73 +++++++++ src/Control/Inciter/InputDeck/Parser.h | 37 +++++ src/Control/Inciter/Types.h | 59 +++++++ src/Control/Keywords.h | 4 +- src/Control/Options/RNG.h | 6 +- src/Control/Quinoa/Types.h | 144 ------------------ src/IO/ExodusIIMeshReader.C | 4 +- src/IO/ExodusIIMeshReader.h | 8 +- src/IO/ExodusIIMeshWriter.C | 7 +- src/IO/ExodusIIMeshWriter.h | 8 +- src/IO/GmshMeshIO.h | 6 +- src/IO/GmshMeshReader.C | 4 +- src/IO/GmshMeshReader.h | 8 +- src/IO/GmshMeshWriter.C | 4 +- src/IO/GmshMeshWriter.h | 8 +- src/IO/NetgenMeshReader.C | 4 +- src/IO/NetgenMeshReader.h | 8 +- src/IO/NetgenMeshWriter.C | 4 +- src/IO/NetgenMeshWriter.h | 8 +- src/IO/PDFWriter.C | 5 +- src/IO/STLTxtMeshReader.C | 4 +- src/IO/STLTxtMeshReader.h | 8 +- src/IO/SiloWriter.C | 6 +- src/IO/SiloWriter.h | 6 +- src/Main/CMakeLists.txt | 26 ++-- src/Main/Config.h.in | 4 +- src/Main/{Quinoa.C => Inciter.C} | 76 +++------ src/Main/{QuinoaDriver.C => InciterDriver.C} | 22 +-- src/Main/InciterDriver.h | 39 +++++ src/Main/InciterPrint.C | 34 +++++ src/Main/{QuinoaPrint.h => InciterPrint.h} | 51 ++----- src/Main/Init.h | 8 +- src/Main/MeshConv.C | 4 +- src/Main/MeshConvDriver.C | 24 +-- src/Main/QuinoaDriver.h | 36 ----- src/Main/QuinoaPrint.C | 127 --------------- src/Main/RNGTest.C | 13 +- src/Main/UnitTest.C | 12 +- src/Main/{quinoa.ci => inciter.ci} | 17 +-- src/Mesh/STLMesh.C | 4 +- src/Mesh/STLMesh.h | 6 +- src/Mesh/UnsMesh.C | 4 +- src/Mesh/UnsMesh.h | 6 +- src/UnitTest/tests/Base/Print.h | 8 +- 68 files changed, 773 insertions(+), 727 deletions(-) create mode 100644 doc/images/inciter.txt rename src/Control/{Quinoa => Breeze}/InputDeck/Grammar.h (93%) rename src/Control/{Quinoa => Breeze}/InputDeck/InputDeck.h (94%) rename src/Control/{Quinoa => Breeze}/InputDeck/Parser.C (90%) rename src/Control/{Quinoa => Breeze}/InputDeck/Parser.h (62%) rename src/Control/{Quinoa => Breeze}/Options/Energy.h (87%) rename src/Control/{Quinoa => Breeze}/Options/Frequency.h (88%) rename src/Control/{Quinoa => Breeze}/Options/Hydro.h (89%) rename src/Control/{Quinoa => Breeze}/Options/Mass.h (88%) rename src/Control/{Quinoa => Breeze}/Options/Mix.h (91%) rename src/Control/{Quinoa => Breeze}/Options/MixRate.h (88%) rename src/Control/{Quinoa => Breeze}/Options/MonteCarlo.h (91%) rename src/Control/{Quinoa => Breeze}/Options/Position.h (89%) rename src/Control/{Quinoa => Inciter}/CmdLine/CmdLine.h (87%) rename src/Control/{Quinoa => Inciter}/CmdLine/Grammar.h (81%) rename src/Control/{Quinoa => Inciter}/CmdLine/Parser.C (92%) rename src/Control/{Quinoa => Inciter}/CmdLine/Parser.h (58%) rename src/Control/{Quinoa => Inciter}/Components.h (80%) create mode 100644 src/Control/Inciter/InputDeck/Grammar.h create mode 100644 src/Control/Inciter/InputDeck/InputDeck.h create mode 100644 src/Control/Inciter/InputDeck/Parser.C create mode 100644 src/Control/Inciter/InputDeck/Parser.h create mode 100644 src/Control/Inciter/Types.h delete mode 100644 src/Control/Quinoa/Types.h rename src/Main/{Quinoa.C => Inciter.C} (69%) rename src/Main/{QuinoaDriver.C => InciterDriver.C} (80%) create mode 100644 src/Main/InciterDriver.h create mode 100644 src/Main/InciterPrint.C rename src/Main/{QuinoaPrint.h => InciterPrint.h} (63%) delete mode 100644 src/Main/QuinoaDriver.h delete mode 100644 src/Main/QuinoaPrint.C rename src/Main/{quinoa.ci => inciter.ci} (76%) diff --git a/doc/images/inciter.txt b/doc/images/inciter.txt new file mode 100644 index 00000000000..f564b68b14b --- /dev/null +++ b/doc/images/inciter.txt @@ -0,0 +1,22 @@ + ,::,` `. + .;;;'';;;: ;;# + ;;;@+ +;;; ;;;;;, ;;;;. ;;;;;, ;;;; ;;;; `;;;;;;: ;;; + :;;@` :;;' .;;;@, ,;@, ,;;;@: .;;;' .;+;. ;;;@#:';;; ;;;;' + ;;;# ;;;: ;;;' ;: ;;;' ;;;;; ;# ;;;@ ;;; ;+;;' +.;;+ ;;;# ;;;' ;: ;;;' ;#;;;` ;# ;;@ `;;+ .;#;;;. +;;;# :;;' ;;;' ;: ;;;' ;# ;;; ;# ;;;@ ;;; ;# ;;;+ +;;;# .;;; ;;;' ;: ;;;' ;# ,;;; ;# ;;;# ;;;: ;@ ;;; +;;;# .;;' ;;;' ;: ;;;' ;# ;;;; ;# ;;;' ;;;+ ;', ;;;@ +;;;+ ,;;+ ;;;' ;: ;;;' ;# ;;;' ;# ;;;' ;;;' ;':::;;;; +`;;; ;;;@ ;;;' ;: ;;;' ;# ;;;';# ;;;@ ;;;:,;+++++;;;' + ;;;; ;;;@ ;;;# .;. ;;;' ;# ;;;;# `;;+ ;;# ;# ;;;' + .;;; :;;@ ,;;+ ;+ ;;;' ;# ;;;# ;;; ;;;@ ;@ ;;;. + ';;; ;;;@, ;;;;``.;;@ ;;;' ;+ .;;# ;;; :;;@ ;;; ;;;+ + :;;;;;;;+@` ';;;;;'@ ;;;;;, ;;;; ;;+ +;;;;;;#@ ;;;;. .;;;;;; + .;;#@' `#@@@: ;::::; ;:::: ;@ '@@@+ ;:::; ;:::::: + :;;;;;;. .___ .__ __ + .;@+@';;;;;;' | | ____ ____ |__|/ |_ ___________ + ` '#''@` | |/ \_/ ___\| \ __\/ __ \_ __ \ + | | | \ \___| || | \ ___/| | \/ + |___|___| /\___ >__||__| \___ >__| + \/ \/ \/ diff --git a/src/Base/Exception.h b/src/Base/Exception.h index 1ee23cea05e..96204ef852b 100644 --- a/src/Base/Exception.h +++ b/src/Base/Exception.h @@ -2,7 +2,7 @@ /*! \file src/Base/Exception.h \author J. Bakosi - \date Tue 16 Dec 2014 12:14:26 PM MST + \date Mon 23 Feb 2015 08:00:40 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Exception class declaration \details Exception class declaration. The basic functionality provided by @@ -28,10 +28,10 @@ namespace tk { //! Throw macro that always throws an exception: //! Throw Exception with arguments passed in. Add source filename, function //! name, and line number where exception occurred. This macro facilitates a -//! throw of Quinoa::Exception that is somehwat cleaner at the point of -//! invocation than a direct throw of Exception, as it hides the file:func:line -//! arguments. Whenever is possible, it should be used via the Assert and ErrChk -//! macros defined below. +//! throw of tk::Exception that is somehwat cleaner at the point of invocation +//! than a direct throw of Exception, as it hides the file:func:line arguments. +//! Whenever is possible, it should be used via the Assert and ErrChk macros +//! defined below. #define Throw(...) \ throw tk::Exception(__VA_ARGS__, __FILE__, __PRETTY_FUNCTION__, __LINE__) diff --git a/src/Base/Print.h b/src/Base/Print.h index eac120566b8..ad56625daf2 100644 --- a/src/Base/Print.h +++ b/src/Base/Print.h @@ -2,7 +2,7 @@ /*! \file src/Base/Print.h \author J. Bakosi - \date Tue 17 Feb 2015 04:02:08 PM MST + \date Mon 23 Feb 2015 09:16:39 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief General purpose pretty printer functionality \details This file contains general purpose printer functions. Using the @@ -346,13 +346,13 @@ class Print { template< Style s = VERBOSE > std::ostream& stream() const noexcept { return s ? m_stream : m_qstream; } - //! Print Quinoa header. Text ASCII Art Generator used for executable + //! Print Inciter header. Text ASCII Art Generator used for executable //! names: http://patorjk.com/software/taag, Picture ASCII Art Generator //! used for converting the logo text "Quinoa": http://picascii.com. //! \author J. Bakosi template< Style s = VERBOSE > - void headerQuinoa() const { - stream() << R"( + void headerInciter() const { + stream() << R"( ,::,` `. .;;;'';;;: ;;# ;;;@+ +;;; ;;;;;, ;;;;. ;;;;;, ;;;; ;;;; `;;;;;;: ;;; @@ -369,9 +369,12 @@ class Print { ';;; ;;;@, ;;;;``.;;@ ;;;' ;+ .;;# ;;; :;;@ ;;; ;;;+ :;;;;;;;+@` ';;;;;'@ ;;;;;, ;;;; ;;+ +;;;;;;#@ ;;;;. .;;;;;; .;;#@' `#@@@: ;::::; ;:::: ;@ '@@@+ ;:::; ;:::::: - :;;;;;;. - .;@+@';;;;;;' - ` '#''@` )" + :;;;;;;. .___ .__ __ + .;@+@';;;;;;' | | ____ ____ |__|/ |_ ___________ + ` '#''@` | |/ \_/ ___\| \ __\/ __ \_ __ \ + | | | \ \___| || | \ ___/| | \/ + |___|___| /\___ >__||__| \___ >__| + \/ \/ \/ )" << std::endl; } @@ -398,7 +401,7 @@ class Print { ';;; ;;;@, ;;;;``.;;@ ;;;' ;+ .;;# ;;; :;;@ ;;; ;;;+ :;;;;;;;+@` ';;;;;'@ ;;;;;, ;;;; ;;+ +;;;;;;#@ ;;;;. .;;;;;; .;;#@' `#@@@: ;::::; ;:::: ;@ '@@@+ ;:::; ;:::::: - :;;;;;;. __________ _______ __________________ + :;;;;;;. __________ _______ __________________ __ .;@+@';;;;;;' \______ \\ \ / _____\__ _______ ______/ |_ ` '#''@` | _// | \/ \ ___ | |_/ __ \ / ___\ __\ | | / | \ \_\ \| |\ ___/ \___ \ | | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db71e826fe5..ce340d9174e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -74,7 +74,7 @@ execute_process( string(REGEX REPLACE "[\r\n]" "" BUILD_DATE "${BUILD_DATE}") # Set names of executables -set(QUINOA_EXECUTABLE "quinoa") +set(INCITER_EXECUTABLE "inciter") set(RNGTEST_EXECUTABLE "rngtest") set(UNITTEST_EXECUTABLE "unittest") set(MESHCONV_EXECUTABLE "meshconv") diff --git a/src/Control/Quinoa/InputDeck/Grammar.h b/src/Control/Breeze/InputDeck/Grammar.h similarity index 93% rename from src/Control/Quinoa/InputDeck/Grammar.h rename to src/Control/Breeze/InputDeck/Grammar.h index 9f6bb09f733..211d1b53060 100644 --- a/src/Control/Quinoa/InputDeck/Grammar.h +++ b/src/Control/Breeze/InputDeck/Grammar.h @@ -1,18 +1,18 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/InputDeck/Grammar.h + \file src/Control/Breeze/InputDeck/Grammar.h \author J. Bakosi - \date Fri 16 Jan 2015 06:20:53 PM MST + \date Mon 23 Feb 2015 08:46:46 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's input deck grammar definition - \details Quinoa's input deck grammar definition. We use the Parsing + \brief Breeze's input deck grammar definition + \details Breeze's input deck grammar definition. We use the Parsing Expression Grammar Template Library (PEGTL) to create the grammar and the associated parser. Credit goes to Colin Hirsch (pegtl@cohi.at) for PEGTL. Word of advice: read from the bottom up. */ //****************************************************************************** -#ifndef QuinoaInputDeckGrammar_h -#define QuinoaInputDeckGrammar_h +#ifndef BreezeInputDeckGrammar_h +#define BreezeInputDeckGrammar_h #include #include @@ -24,14 +24,14 @@ #include -namespace quinoa { +namespace breeze { extern ctr::InputDeck g_inputdeck_defaults; -//! Quinoa input deck facilitating user input for computing fluid dynamics +//! Breeze input deck facilitating user input for computing fluid dynamics namespace deck { - //! \brief PEGTLParsed type specialized to Quinoa's input deck parser + //! \brief PEGTLParsed type specialized to Breeze's input deck parser //! \details PEGTLInputDeck is practically InputDeck equipped with PEGTL //! location information so the location can be tracked during parsing. //! \author J. Bakosi @@ -41,7 +41,7 @@ namespace deck { tag::cmd, ctr::CmdLine >; - //! \brief Specialization of tk::grm::use for Quinoa's input deck parser + //! \brief Specialization of tk::grm::use for Breeze's input deck parser //! \author J. Bakosi template< typename keyword > using use = tk::grm::use< keyword, @@ -50,12 +50,12 @@ namespace deck { ctr::InputDeck::keywords3, ctr::InputDeck::keywords4 >; - // Quinoa's InputDeck state + // Breeze's InputDeck state //! Everything is stored in Stack during parsing using Stack = PEGTLInputDeck; - // Quinoa's InputDeck actions + // Breeze's InputDeck actions //! \brief Put option in state at position given by tags //! \details This is simply a wrapper around tk::grm::store_option passing the @@ -69,7 +69,7 @@ namespace deck { } }; - // Quinoa's InputDeck grammar + // Breeze's InputDeck grammar //! \brief Scan selected option //! \author J. Bakosi @@ -268,6 +268,6 @@ namespace deck { tk::grm::read_file< Stack, keywords, tk::grm::ignore > {}; } // deck:: -} // quinoa:: +} // breeze:: -#endif // QuinoaInputDeckGrammar_h +#endif // BreezeInputDeckGrammar_h diff --git a/src/Control/Quinoa/InputDeck/InputDeck.h b/src/Control/Breeze/InputDeck/InputDeck.h similarity index 94% rename from src/Control/Quinoa/InputDeck/InputDeck.h rename to src/Control/Breeze/InputDeck/InputDeck.h index 32ce0db1302..329833e42ec 100644 --- a/src/Control/Quinoa/InputDeck/InputDeck.h +++ b/src/Control/Breeze/InputDeck/InputDeck.h @@ -1,17 +1,17 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/InputDeck/InputDeck.h + \file src/Control/Breeze/InputDeck/InputDeck.h \author J. Bakosi - \date Sun 18 Jan 2015 06:48:49 AM MST + \date Mon 23 Feb 2015 08:47:27 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's input deck definition + \brief Breeze's input deck definition \details This file defines the heterogeneous stack that is used for storing the data from user input during the control file parsing of the - computational fluid dynamics tool, Quinoa. + computational fluid dynamics tool, Breeze. */ //****************************************************************************** -#ifndef QuinoaInputDeck_h -#define QuinoaInputDeck_h +#ifndef BreezeInputDeck_h +#define BreezeInputDeck_h #include @@ -19,17 +19,17 @@ #include #include -#include -#include +#include +#include -namespace quinoa { +namespace breeze { namespace ctr { -//! \brief InputDeck : Control< specialized to Quinoa >, see Types.h, +//! \brief InputDeck : Control< specialized to Breeze >, see Types.h, //! \details The stack is a tagged tuple, a hierarchical heterogeneous data //! structure where all parsed information is stored. //! \see Base/TaggedTuple.h -//! \see Control/Quinoa/Types.h +//! \see Control/Breeze/Types.h //! \author J. Bakosi class InputDeck : public tk::Control< // tag type @@ -45,7 +45,7 @@ class InputDeck : tag::error, std::vector< std::string > > { public: - //! \brief Quinoa input deck keywords + //! \brief Breeze input deck keywords //! \details Since there are more than 20 and boost::mpl only allows maxium //! 20 items in a set by default (and I don't want to mess with //! preprocessor-generated boost::mpl headers), the whole set is broken up @@ -181,6 +181,6 @@ class InputDeck : }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaInputDeck_h +#endif // BreezeInputDeck_h diff --git a/src/Control/Quinoa/InputDeck/Parser.C b/src/Control/Breeze/InputDeck/Parser.C similarity index 90% rename from src/Control/Quinoa/InputDeck/Parser.C rename to src/Control/Breeze/InputDeck/Parser.C index 4a0fd4c0447..b31b6662a43 100644 --- a/src/Control/Quinoa/InputDeck/Parser.C +++ b/src/Control/Breeze/InputDeck/Parser.C @@ -1,17 +1,17 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/InputDeck/Parser.C + \file src/Control/Breeze/InputDeck/Parser.C \author J. Bakosi - \date Fri 16 Jan 2015 06:05:03 PM MST + \date Mon 23 Feb 2015 08:47:46 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's input deck file parser + \brief Breeze's input deck file parser \details This file declares the input deck, i.e., control file, parser for - the computational fluid dynamics tool, Quinoa. + the computational fluid dynamics tool, Breeze. */ //****************************************************************************** -#include -#include +#include +#include namespace tk { namespace grm { @@ -21,7 +21,7 @@ extern tk::Print g_print; } // grm:: } // tk:: -using quinoa::InputDeckParser; +using inciter::InputDeckParser; InputDeckParser::InputDeckParser( const tk::Print& print, const ctr::CmdLine& cmdline, diff --git a/src/Control/Quinoa/InputDeck/Parser.h b/src/Control/Breeze/InputDeck/Parser.h similarity index 62% rename from src/Control/Quinoa/InputDeck/Parser.h rename to src/Control/Breeze/InputDeck/Parser.h index ee1f7451ad9..78e0ec0f74a 100644 --- a/src/Control/Quinoa/InputDeck/Parser.h +++ b/src/Control/Breeze/InputDeck/Parser.h @@ -1,28 +1,28 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/InputDeck/Parser.h + \file src/Control/Breeze/InputDeck/Parser.h \author J. Bakosi - \date Fri 16 Jan 2015 12:33:51 PM MST + \date Mon 23 Feb 2015 08:48:13 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's input deck file parser + \brief Breeze's input deck file parser \details This file declares the input deck, i.e., control file, parser for - the computational fluid dynamics tool, Quinoa. + the computational fluid dynamics tool, Breeze. */ //****************************************************************************** -#ifndef QuinoaInputDeckParser_h -#define QuinoaInputDeckParser_h +#ifndef BreezeInputDeckParser_h +#define BreezeInputDeckParser_h #include #include -#include -#include +#include +#include -namespace quinoa { +namespace inciter { -//! \brief Control file parser for Quinoa. +//! \brief Control file parser for Breeze. //! \details This class is used to interface with PEGTL, for the purpose of //! parsing the control file for the computational fluid dynamics tool, -//! Quinoa. +//! Breeze. class InputDeckParser : public tk::FileParser { public: @@ -32,6 +32,6 @@ class InputDeckParser : public tk::FileParser { ctr::InputDeck& inputdeck ); }; -} // namespace quinoa +} // namespace inciter -#endif // QuinoaInputDeckParser_h +#endif // BreezeInputDeckParser_h diff --git a/src/Control/Quinoa/Options/Energy.h b/src/Control/Breeze/Options/Energy.h similarity index 87% rename from src/Control/Quinoa/Options/Energy.h rename to src/Control/Breeze/Options/Energy.h index 2fc28a64e11..5f92dc0112c 100644 --- a/src/Control/Quinoa/Options/Energy.h +++ b/src/Control/Breeze/Options/Energy.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Energy.h + \file src/Control/Breeze/Options/Energy.h \author J. Bakosi - \date Fri 16 Jan 2015 07:54:13 PM MST + \date Mon 23 Feb 2015 08:11:16 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Energy model options \details Energy model options */ //****************************************************************************** -#ifndef QuinoaEnergyOptions_h -#define QuinoaEnergyOptions_h +#ifndef BreezeEnergyOptions_h +#define BreezeEnergyOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Energy model types @@ -54,6 +54,6 @@ class Energy : public tk::Toggle< EnergyType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaEnergyOptions_h +#endif // BreezeEnergyOptions_h diff --git a/src/Control/Quinoa/Options/Frequency.h b/src/Control/Breeze/Options/Frequency.h similarity index 88% rename from src/Control/Quinoa/Options/Frequency.h rename to src/Control/Breeze/Options/Frequency.h index d64d02948e0..d0428adf2a0 100644 --- a/src/Control/Quinoa/Options/Frequency.h +++ b/src/Control/Breeze/Options/Frequency.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Frequency.h + \file src/Control/Breeze/Options/Frequency.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:05 AM MST + \date Mon 23 Feb 2015 08:11:29 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Turbulence frequency model options \details Turbulence frequency model options */ //****************************************************************************** -#ifndef QuinoaFrequencyOptions_h -#define QuinoaFrequencyOptions_h +#ifndef BreezeFrequencyOptions_h +#define BreezeFrequencyOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Frequency model types @@ -58,6 +58,6 @@ class Frequency : public tk::Toggle< FrequencyType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaFrequencyOptions_h +#endif // BreezeFrequencyOptions_h diff --git a/src/Control/Quinoa/Options/Hydro.h b/src/Control/Breeze/Options/Hydro.h similarity index 89% rename from src/Control/Quinoa/Options/Hydro.h rename to src/Control/Breeze/Options/Hydro.h index 85b8a3278b0..b95339cf35d 100644 --- a/src/Control/Quinoa/Options/Hydro.h +++ b/src/Control/Breeze/Options/Hydro.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Hydro.h + \file src/Control/Breeze/Options/Hydro.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:09 AM MST + \date Mon 23 Feb 2015 08:11:42 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Hydro model options \details Hydro model options */ //****************************************************************************** -#ifndef QuinoaHydroOptions_h -#define QuinoaHydroOptions_h +#ifndef BreezeHydroOptions_h +#define BreezeHydroOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Hydro model types @@ -61,6 +61,6 @@ class Hydro : public tk::Toggle< HydroType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaHydroOptions_h +#endif // BreezeHydroOptions_h diff --git a/src/Control/Quinoa/Options/Mass.h b/src/Control/Breeze/Options/Mass.h similarity index 88% rename from src/Control/Quinoa/Options/Mass.h rename to src/Control/Breeze/Options/Mass.h index 8210ce3359e..3032b3125a7 100644 --- a/src/Control/Quinoa/Options/Mass.h +++ b/src/Control/Breeze/Options/Mass.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Mass.h + \file src/Control/Breeze/Options/Mass.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:14 AM MST + \date Mon 23 Feb 2015 08:11:56 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Mass model options \details Mass model options */ //****************************************************************************** -#ifndef QuinoaMassOptions_h -#define QuinoaMassOptions_h +#ifndef BreezeMassOptions_h +#define BreezeMassOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Mass model types @@ -56,6 +56,6 @@ class Mass : public tk::Toggle< MassType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaMassOptions_h +#endif // BreezeMassOptions_h diff --git a/src/Control/Quinoa/Options/Mix.h b/src/Control/Breeze/Options/Mix.h similarity index 91% rename from src/Control/Quinoa/Options/Mix.h rename to src/Control/Breeze/Options/Mix.h index a8bf0d6be17..45ba63be76d 100644 --- a/src/Control/Quinoa/Options/Mix.h +++ b/src/Control/Breeze/Options/Mix.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Mix.h + \file src/Control/Breeze/Options/Mix.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:19 AM MST + \date Mon 23 Feb 2015 08:12:10 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Mix model options \details Mix model options */ //****************************************************************************** -#ifndef QuinoaMixOptions_h -#define QuinoaMixOptions_h +#ifndef BreezeMixOptions_h +#define BreezeMixOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Mix model types @@ -68,6 +68,6 @@ class Mix : public tk::Toggle< MixType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaMixOptions_h +#endif // BreezeMixOptions_h diff --git a/src/Control/Quinoa/Options/MixRate.h b/src/Control/Breeze/Options/MixRate.h similarity index 88% rename from src/Control/Quinoa/Options/MixRate.h rename to src/Control/Breeze/Options/MixRate.h index 63db9591449..4d5a7e0b8f1 100644 --- a/src/Control/Quinoa/Options/MixRate.h +++ b/src/Control/Breeze/Options/MixRate.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/MixRate.h + \file src/Control/Breeze/Options/MixRate.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:24 AM MST + \date Mon 23 Feb 2015 08:12:25 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Turbulence frequency model options \details Turbulence frequency model options */ //****************************************************************************** -#ifndef QuinoaMixRateOptions_h -#define QuinoaMixRateOptions_h +#ifndef BreezeMixRateOptions_h +#define BreezeMixRateOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Material mix rate model types @@ -58,6 +58,6 @@ class MixRate : public tk::Toggle { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaMixRateOptions_h +#endif // BreezeMixRateOptions_h diff --git a/src/Control/Quinoa/Options/MonteCarlo.h b/src/Control/Breeze/Options/MonteCarlo.h similarity index 91% rename from src/Control/Quinoa/Options/MonteCarlo.h rename to src/Control/Breeze/Options/MonteCarlo.h index 3bdb44675e3..dea5c59bc6e 100644 --- a/src/Control/Quinoa/Options/MonteCarlo.h +++ b/src/Control/Breeze/Options/MonteCarlo.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/MonteCarlo.h + \file src/Control/Breeze/Options/MonteCarlo.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:29 AM MST + \date Mon 23 Feb 2015 08:12:44 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief MonteCarlo options \details MonteCarlo options */ //****************************************************************************** -#ifndef QuinoaMonteCarloOptions_h -#define QuinoaMonteCarloOptions_h +#ifndef BreezeMonteCarloOptions_h +#define BreezeMonteCarloOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! MonteCarlo types @@ -69,6 +69,6 @@ class MonteCarlo : public tk::Toggle< MonteCarloType > { }; } // ctr:: -} // quinoa:: +} // breeze:: -#endif // QuinoaMonteCarloOptions_h +#endif // BreezeMonteCarloOptions_h diff --git a/src/Control/Quinoa/Options/Position.h b/src/Control/Breeze/Options/Position.h similarity index 89% rename from src/Control/Quinoa/Options/Position.h rename to src/Control/Breeze/Options/Position.h index 95b9bb04285..821361818a7 100644 --- a/src/Control/Quinoa/Options/Position.h +++ b/src/Control/Breeze/Options/Position.h @@ -1,15 +1,15 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Options/Position.h + \file src/Control/Breeze/Options/Position.h \author J. Bakosi - \date Wed 21 Jan 2015 08:00:34 AM MST + \date Mon 23 Feb 2015 08:12:57 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Position model options \details Position model options */ //****************************************************************************** -#ifndef QuinoaPositionOptions_h -#define QuinoaPositionOptions_h +#ifndef BreezePositionOptions_h +#define BreezePositionOptions_h #include @@ -17,7 +17,7 @@ #include #include -namespace quinoa { +namespace breeze { namespace ctr { //! Position model types @@ -62,6 +62,6 @@ class Position : public tk::Toggle< PositionType > { }; } // ctr:: -} // quinoa::: +} // breeze::: -#endif // QuinoaPositionOptions_h +#endif // BreezePositionOptions_h diff --git a/src/Control/CMakeLists.txt b/src/Control/CMakeLists.txt index 81c19de32fe..f101532b1cf 100644 --- a/src/Control/CMakeLists.txt +++ b/src/Control/CMakeLists.txt @@ -6,17 +6,17 @@ project(Control CXX) include(charm) -#### Quinoa control ############################################################ -add_library(QuinoaControl +#### Inciter control ########################################################### +add_library(InciterControl FileParser.C StringParser.C - Quinoa/InputDeck/Parser.C - Quinoa/CmdLine/Parser.C + Inciter/InputDeck/Parser.C + Inciter/CmdLine/Parser.C ) -removeWarnings("Quinoa/InputDeck/Parser.C;Quinoa/CmdLine/Parser.C") +removeWarnings("Inciter/InputDeck/Parser.C;Inciter/CmdLine/Parser.C") -INSTALL(TARGETS QuinoaControl +INSTALL(TARGETS InciterControl RUNTIME DESTINATION bin COMPONENT Runtime LIBRARY DESTINATION lib COMPONENT Runtime ARCHIVE DESTINATION lib COMPONENT Development diff --git a/src/Control/Quinoa/CmdLine/CmdLine.h b/src/Control/Inciter/CmdLine/CmdLine.h similarity index 87% rename from src/Control/Quinoa/CmdLine/CmdLine.h rename to src/Control/Inciter/CmdLine/CmdLine.h index 006f97c2215..d045d36e7b6 100644 --- a/src/Control/Quinoa/CmdLine/CmdLine.h +++ b/src/Control/Inciter/CmdLine/CmdLine.h @@ -1,17 +1,17 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/CmdLine/CmdLine.h + \file src/Control/Inciter/CmdLine/CmdLine.h \author J. Bakosi - \date Sat 17 Jan 2015 06:52:02 AM MST + \date Mon 23 Feb 2015 08:54:56 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's command line definition + \brief Inciter's command line definition \details This file defines the heterogeneous stack that is used for storing the data from user input during the command-line parsing of the - computational fluid dynamics tool, Quinoa. + computational shock hydrodynamics tool, Inciter. */ //****************************************************************************** -#ifndef QuinoaCmdLine_h -#define QuinoaCmdLine_h +#ifndef InciterCmdLine_h +#define InciterCmdLine_h #include @@ -21,16 +21,16 @@ #include #include #include -#include +#include -namespace quinoa { -//! Quinoa control facilitating user input to internal data transfer +namespace inciter { +//! Inciter control facilitating user input to internal data transfer namespace ctr { -//! \brief CmdLine : Control< specialized to Quinoa > +//! \brief CmdLine : Control< specialized to Inciter > //! \details The stack is a tagged tuple //! \see Base/TaggedTuple.h -//! \see Control/Quinoa/Types.h +//! \see Control/Inciter/Types.h //! \author J. Bakosi class CmdLine : public tk::Control< // tag type @@ -45,7 +45,7 @@ class CmdLine : public tk::Control< tag::error, std::vector< std::string > > { public: - //! \brief Quinoa command-line keywords + //! \brief Inciter command-line keywords //! \author J. Bakosi //! \see tk::grm::use and its documentation using keywords = boost::mpl::set< kw::verbose @@ -56,9 +56,6 @@ class CmdLine : public tk::Control< , kw::control , kw::input , kw::output - , kw::pdf - , kw::glob - , kw::stat >; //! \brief Constructor: set all defaults. @@ -94,9 +91,6 @@ class CmdLine : public tk::Control< //! \author J. Bakosi CmdLine( tk::ctr::HelpFactory ctrinfo = tk::ctr::HelpFactory() ) { set< tag::io, tag::output >( "out" ); - set< tag::io, tag::pdf >( "pdf" ); - set< tag::io, tag::glob >( "glob.txt" ); - set< tag::io, tag::stat >( "stat.txt" ); set< tag::virtualization >( 0.0 ); set< tag::verbose >( false ); // Quiet output by default // Initialize help: fill from own keywords + add map passed in @@ -129,6 +123,6 @@ class CmdLine : public tk::Control< }; } // ctr:: -} // quinoa:: +} // inciter:: -#endif // QuinoaCmdLine_h +#endif // InciterCmdLine_h diff --git a/src/Control/Quinoa/CmdLine/Grammar.h b/src/Control/Inciter/CmdLine/Grammar.h similarity index 81% rename from src/Control/Quinoa/CmdLine/Grammar.h rename to src/Control/Inciter/CmdLine/Grammar.h index da5c0c754df..8343c3b6b1f 100644 --- a/src/Control/Quinoa/CmdLine/Grammar.h +++ b/src/Control/Inciter/CmdLine/Grammar.h @@ -1,46 +1,46 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/CmdLine/Grammar.h + \file src/Control/Inciter/CmdLine/Grammar.h \author J. Bakosi - \date Fri 16 Jan 2015 06:14:18 PM MST + \date Mon 23 Feb 2015 08:53:34 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's command line grammar definition + \brief Inciter's command line grammar definition \details Grammar definition for parsing the command line. We use the Parsing Expression Grammar Template Library (PEGTL) to create the grammar and the associated parser. Credit goes to Colin Hirsch (pegtl@cohi.at) for PEGTL. Word of advice: read from the bottom up. */ //****************************************************************************** -#ifndef QuinoaCmdLineGrammar_h -#define QuinoaCmdLineGrammar_h +#ifndef InciterCmdLineGrammar_h +#define InciterCmdLineGrammar_h #include #include #include -namespace quinoa { -//! Quinoa command line grammar definition +namespace inciter { +//! Inciter command line grammar definition namespace cmd { - //! PEGTLParsed type specialized to Quinoa's command line parser + //! PEGTLParsed type specialized to Inciter's command line parser //! \details PEGTLCmdLine is practically CmdLine equipped with PEGTL location //! information so the location can be tracked during parsing. //! \author J. Bakosi using PEGTLCmdLine = tk::ctr::PEGTLParsed< ctr::CmdLine, pegtl::string_input< ctr::Location > >; - //! \brief Specialization of tk::grm::use for Quinoa's command line parser + //! \brief Specialization of tk::grm::use for Inciter's command line parser //! \author J. Bakosi template< typename keyword > using use = tk::grm::use< keyword, ctr::CmdLine::keywords >; - // Quinoa's CmdLine state + // Inciter's CmdLine state //! Everything is stored in Stack during parsing //! \author J. Bakosi using Stack = PEGTLCmdLine; - // Quinoa's CmdLine grammar + // Inciter's CmdLine grammar //! \brief Match and set verbose switch (i.e., verbose or quiet output) //! \author J. Bakosi @@ -98,10 +98,7 @@ namespace cmd { helpkw, io< use< kw::control >, tag::control >, io< use< kw::input >, tag::input >, - io< use< kw::output >, tag::output >, - io< use< kw::pdf >, tag::pdf >, - io< use< kw::glob >, tag::glob >, - io< use< kw::stat >, tag::stat > > {}; + io< use< kw::output >, tag::output > > {}; //! \brief Grammar entry point: parse keywords until end of string //! \author J. Bakosi @@ -109,6 +106,6 @@ namespace cmd { tk::grm::read_string< Stack, keywords > {}; } // cmd:: -} // quinoa:: +} // inciter:: -#endif // QuinoaCmdLineGrammar_h +#endif // InciterCmdLineGrammar_h diff --git a/src/Control/Quinoa/CmdLine/Parser.C b/src/Control/Inciter/CmdLine/Parser.C similarity index 92% rename from src/Control/Quinoa/CmdLine/Parser.C rename to src/Control/Inciter/CmdLine/Parser.C index 03465ced38e..36247e56506 100644 --- a/src/Control/Quinoa/CmdLine/Parser.C +++ b/src/Control/Inciter/CmdLine/Parser.C @@ -1,21 +1,21 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/CmdLine/Parser.C + \file src/Control/Inciter/CmdLine/Parser.C \author J. Bakosi - \date Sat 17 Jan 2015 06:59:13 AM MST + \date Mon 23 Feb 2015 08:06:47 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's comamnd line parser + \brief Inciter's comamnd line parser \details This file defines the command-line argument parser for the - computational fluid dynamics tool, Quinoa. + computational shock hydrodynamics tool, Inciter. */ //****************************************************************************** #include #include -#include -#include -#include +#include +#include +#include namespace tk { namespace grm { @@ -25,13 +25,13 @@ tk::Print g_print; } // grm:: } // tk:: -namespace quinoa { +namespace inciter { extern ctr::InputDeck g_inputdeck; -} // quinoa:: +} // inciter:: -using quinoa::CmdLineParser; +using inciter::CmdLineParser; CmdLineParser::CmdLineParser( int argc, char** argv, diff --git a/src/Control/Quinoa/CmdLine/Parser.h b/src/Control/Inciter/CmdLine/Parser.h similarity index 58% rename from src/Control/Quinoa/CmdLine/Parser.h rename to src/Control/Inciter/CmdLine/Parser.h index 7559fa74ddf..7347c8792f2 100644 --- a/src/Control/Quinoa/CmdLine/Parser.h +++ b/src/Control/Inciter/CmdLine/Parser.h @@ -1,27 +1,27 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/CmdLine/Parser.h + \file src/Control/Inciter/CmdLine/Parser.h \author J. Bakosi - \date Fri 16 Jan 2015 06:17:13 PM MST + \date Mon 23 Feb 2015 08:07:23 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's command line parser + \brief Inciter's command line parser \details This file declares the command-line argument parser for the - computational fluid dynamics tool, Quinoa. + computational shock hydrodynamics tool, Inciter. */ //****************************************************************************** -#ifndef QuinoaCmdLineParser_h -#define QuinoaCmdLineParser_h +#ifndef InciterCmdLineParser_h +#define InciterCmdLineParser_h #include #include -#include +#include -namespace quinoa { +namespace inciter { -//! \brief Command-line parser for Quinoa. +//! \brief Command-line parser for Inciter. //! \details This class is used to interface with PEGTL, for the purpose of -//! parsing command-line arguments for the computational fluid dynamics tool, -//! Quinoa. +//! parsing command-line arguments for the computational shock hydrodynamics +//! tool, Inciter. //! \author J. Bakosi class CmdLineParser : public tk::StringParser { @@ -33,6 +33,6 @@ class CmdLineParser : public tk::StringParser { ctr::CmdLine& cmdline ); }; -} // quinoa:: +} // inciter:: -#endif // QuinoaCmdLineParser_h +#endif // InciterCmdLineParser_h diff --git a/src/Control/Quinoa/Components.h b/src/Control/Inciter/Components.h similarity index 80% rename from src/Control/Quinoa/Components.h rename to src/Control/Inciter/Components.h index 199aa0db5c4..067abaa15e8 100644 --- a/src/Control/Quinoa/Components.h +++ b/src/Control/Inciter/Components.h @@ -1,20 +1,20 @@ //****************************************************************************** /*! - \file src/Control/Quinoa/Components.h + \file src/Control/Inciter/Components.h \author J. Bakosi - \date Wed 14 Jan 2015 10:49:00 PM MST + \date Mon 23 Feb 2015 08:01:45 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Storage for number of components \details Storage for number of components. This is part of the input deck stack and is thus populated during the control file parsing. */ //****************************************************************************** -#ifndef QuinoaComponents_h -#define QuinoaComponents_h +#ifndef InciterComponents_h +#define InciterComponents_h #include -namespace quinoa { +namespace inciter { namespace ctr { //! Number of components of models and equations @@ -27,6 +27,6 @@ using ncomps = tk::ctr::ncomponents< >; } // ctr:: -} // quinoa:: +} // inciter:: -#endif // QuinoaComponents_h +#endif // InciterComponents_h diff --git a/src/Control/Inciter/InputDeck/Grammar.h b/src/Control/Inciter/InputDeck/Grammar.h new file mode 100644 index 00000000000..5cfa1fd2cec --- /dev/null +++ b/src/Control/Inciter/InputDeck/Grammar.h @@ -0,0 +1,66 @@ +//****************************************************************************** +/*! + \file src/Control/Inciter/InputDeck/Grammar.h + \author J. Bakosi + \date Mon 23 Feb 2015 08:57:50 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter's input deck grammar definition + \details Inciter's input deck grammar definition. We use the Parsing + Expression Grammar Template Library (PEGTL) to create the grammar and the + associated parser. Credit goes to Colin Hirsch (pegtl@cohi.at) for PEGTL. Word + of advice: read from the bottom up. +*/ +//****************************************************************************** +#ifndef InciterInputDeckGrammar_h +#define InciterInputDeckGrammar_h + +#include +#include +#include + +namespace inciter { + +extern ctr::InputDeck g_inputdeck_defaults; + +//! Inciter input deck facilitating user input for computing shock hydrodynamics +namespace deck { + + //! \brief PEGTLParsed type specialized to Inciter's input deck parser + //! \details PEGTLInputDeck is practically InputDeck equipped with PEGTL + //! location information so the location can be tracked during parsing. + //! \author J. Bakosi + using PEGTLInputDeck = + tk::ctr::PEGTLParsed< ctr::InputDeck, + pegtl::file_input< ctr::Location >, + tag::cmd, + ctr::CmdLine >; + + //! \brief Specialization of tk::grm::use for Inciter's input deck parser + //! \author J. Bakosi + template< typename keyword > + using use = tk::grm::use< keyword, + ctr::InputDeck::keywords >; + + // Inciter's InputDeck state + + //! Everything is stored in Stack during parsing + using Stack = PEGTLInputDeck; + + // Inciter's InputDeck actions + + // Inciter's InputDeck grammar + + //! \brief All keywords + //! \author J. Bakosi + struct keywords : + pegtl::sor< tk::grm::title< Stack, use > > {}; + + //! \brief Grammar entry point: parse keywords and ignores until eof + //! \author J. Bakosi + struct read_file : + tk::grm::read_file< Stack, keywords, tk::grm::ignore > {}; + +} // deck:: +} // inciter:: + +#endif // InciterInputDeckGrammar_h diff --git a/src/Control/Inciter/InputDeck/InputDeck.h b/src/Control/Inciter/InputDeck/InputDeck.h new file mode 100644 index 00000000000..05637324fe7 --- /dev/null +++ b/src/Control/Inciter/InputDeck/InputDeck.h @@ -0,0 +1,80 @@ +//****************************************************************************** +/*! + \file src/Control/Inciter/InputDeck/InputDeck.h + \author J. Bakosi + \date Mon 23 Feb 2015 08:58:02 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter's input deck definition + \details This file defines the heterogeneous stack that is used for storing + the data from user input during the control file parsing of the + computational shock hydrodynamics tool, Inciter. +*/ +//****************************************************************************** +#ifndef InciterInputDeck_h +#define InciterInputDeck_h + +#include + +#include +#include + +#include +#include +#include + +namespace inciter { +namespace ctr { + +//! \brief InputDeck : Control< specialized to Inciter >, see Types.h, +//! \details The stack is a tagged tuple, a hierarchical heterogeneous data +//! structure where all parsed information is stored. +//! \see Base/TaggedTuple.h +//! \see Control/Inciter/Types.h +//! \author J. Bakosi +class InputDeck : + public tk::Control< // tag type + tag::title, kw::title::info::expect::type, + tag::cmd, CmdLine, + tag::error, std::vector< std::string > > { + + public: + //! \brief Inciter input deck keywords + //! \details Since there are more than 20 and boost::mpl only allows maxium + //! 20 items in a set by default (and I don't want to mess with + //! preprocessor-generated boost::mpl headers), the whole set is broken up + //! into several sets each containing 20 keywords. + //! \see tk::grm::use and its documentation + using keywords = boost::mpl::set< kw::title >; + + //! \brief Constructor: set defaults + //! \details Anything not set here is initialized by the compiler using the + //! default constructor for the corresponding type. + //! \author J. Bakosi + InputDeck() { + // Initialize help: fill own keywords + const auto& ctrinfoFill = tk::ctr::Info( get< tag::cmd, tag::ctrinfo >() ); + boost::mpl::for_each< keywords >( ctrinfoFill ); + } + + /** @name Pack/Unpack: Serialize InputDeck object for Charm++ */ + ///@{ + //! \brief Pack/Unpack serialize member function + //! \param[inout] p Charm++'s PUP::er serializer object reference + //! \author J. Bakosi + void pup( PUP::er& p ) { + tk::Control< tag::title, kw::title::info::expect::type, + tag::cmd, CmdLine, + tag::error, std::vector< std::string > >::pup(p); + } + //! \brief Pack/Unpack serialize operator| + //! \param[inout] p Charm++'s PUP::er serializer object reference + //! \param[inout] i InputDeck object reference + //! \author J. Bakosi + friend void operator|( PUP::er& p, InputDeck& i ) { i.pup(p); } + //@} +}; + +} // ctr:: +} // inciter:: + +#endif // InciterInputDeck_h diff --git a/src/Control/Inciter/InputDeck/Parser.C b/src/Control/Inciter/InputDeck/Parser.C new file mode 100644 index 00000000000..fd509a9e941 --- /dev/null +++ b/src/Control/Inciter/InputDeck/Parser.C @@ -0,0 +1,73 @@ +//****************************************************************************** +/*! + \file src/Control/Inciter/InputDeck/Parser.C + \author J. Bakosi + \date Mon 23 Feb 2015 08:58:28 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter's input deck file parser + \details This file declares the input deck, i.e., control file, parser for + the computational shock hydrodynamics tool, Inciter. +*/ +//****************************************************************************** + +#include +#include + +namespace tk { +namespace grm { + +extern tk::Print g_print; + +} // grm:: +} // tk:: + +using inciter::InputDeckParser; + +InputDeckParser::InputDeckParser( const tk::Print& print, + const ctr::CmdLine& cmdline, + ctr::InputDeck& inputdeck ) : + FileParser( cmdline.get< tag::io, tag::control >() ) +//****************************************************************************** +// Constructor +//! \param[in] print Pretty printer +//! \param[in] cmd Command line stack +//! \param[inout] inputdeck Input deck stack where data is stored during parsing +//! \author J. Bakosi +//****************************************************************************** +{ + print.item("Control file", m_filename); + + // Create PEGTL file input from std::string + pegtl::file_input< ctr::Location > input( m_filename ); + + // Create PEGTLInputDeck to store parsed input deck data which derives from + // InputDeck and has location() used during parse + deck::PEGTLInputDeck id( input, cmdline ); + + // Reset parser's output stream to that of print's. This is so that mild + // warnings emitted during parsing can be output using the pretty printer. + // Usually, errors and warnings are simply accumulated during parsing and + // printed during diagnostics after the parser has finished. Howver, in some + // special cases we can provide a more user-friendly message right during + // parsing since there is more information available to construct a more + // sensible message. This is done in e.g., tk::grm::store_option. Resetting + // the global g_print, to that of passed in as the constructor argument allows + // not to have to create a new pretty printer, but use the existing one. + tk::grm::g_print.reset( print.save() ); + + // Parse control file by populating the underlying tagged tuple: + // basic_parse() below gives debug info during parsing, use it for debugging + // the parser itself, i.e., when modifying the grammar, otherwise, use + // dummy_parse() to compile faster + pegtl::dummy_parse< deck::read_file >( input, id ); + + // Echo errors and warnings accumulated during parsing + diagnostics( print, id.get< tag::error >() ); + + // Strip input deck (and its underlying tagged tuple) from PEGTL instruments + // and transfer it out + inputdeck = std::move( id ); + + // If we got here, the parser has succeeded + print.item( "Parsed control file", "success" ); +} diff --git a/src/Control/Inciter/InputDeck/Parser.h b/src/Control/Inciter/InputDeck/Parser.h new file mode 100644 index 00000000000..a2ed8393707 --- /dev/null +++ b/src/Control/Inciter/InputDeck/Parser.h @@ -0,0 +1,37 @@ +//****************************************************************************** +/*! + \file src/Control/Inciter/InputDeck/Parser.h + \author J. Bakosi + \date Mon 23 Feb 2015 08:09:45 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter's input deck file parser + \details This file declares the input deck, i.e., control file, parser for + the computational shock hydrodynamics tool, Inciter. +*/ +//****************************************************************************** +#ifndef InciterInputDeckParser_h +#define InciterInputDeckParser_h + +#include +#include +#include +#include + +namespace inciter { + +//! \brief Control file parser for Inciter. +//! \details This class is used to interface with PEGTL, for the purpose of +//! parsing the control file for the computational shock hydrodynamics tool, +//! Inciter. +class InputDeckParser : public tk::FileParser { + + public: + //! Constructor + explicit InputDeckParser( const tk::Print& print, + const ctr::CmdLine& cmdline, + ctr::InputDeck& inputdeck ); +}; + +} // namespace inciter + +#endif // InciterInputDeckParser_h diff --git a/src/Control/Inciter/Types.h b/src/Control/Inciter/Types.h new file mode 100644 index 00000000000..29953bbbf25 --- /dev/null +++ b/src/Control/Inciter/Types.h @@ -0,0 +1,59 @@ +//****************************************************************************** +/*! + \file src/Control/Incitier/Types.h + \author J. Bakosi + \date Mon 23 Feb 2015 08:52:44 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Types for Incitier's parsers + \details Types for Incitier's parsers. This file defines the components of the + tagged tuple that stores heteroegeneous objects in a hierarchical way. These + components are therefore part of the grammar stack that is filled during + parsing (both command-line argument parsing and control file parsing). +*/ +//****************************************************************************** +#ifndef IncitierTypes_h +#define IncitierTypes_h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace inciter { +namespace ctr { + +//! Discretization parameters storage +using discretization = tk::tuple::tagged_tuple< + tag::nstep, kw::nstep::info::expect::type, //!< Number of time steps + tag::term, kw::term::info::expect::type, //!< Time to terminate + tag::dt, kw::dt::info::expect::type //!< Size of time step +>; + +//! Output intervals storage +using intervals = tk::tuple::tagged_tuple< + tag::tty, kw::ttyi::info::expect::type, //!< TTY output interval + tag::dump, uint32_t, //!< Dump output interval + tag::glob, uint32_t //!< Glob output interval +>; + +//! IO parameters storage +using ios = tk::tuple::tagged_tuple< + tag::control, kw::control::info::expect::type, //!< Control filename + tag::input, std::string, //!< Input filename + tag::output, std::string //!< Output filename +>; + +//! PEGTL location type to use throughout Incitier's parsers +using Location = pegtl::ascii_location; + +} // ctr:: +} // inciter:: + +#endif // IncitierTypes_h diff --git a/src/Control/Keywords.h b/src/Control/Keywords.h index eed5c49bf5d..433c421af9a 100644 --- a/src/Control/Keywords.h +++ b/src/Control/Keywords.h @@ -2,7 +2,7 @@ /*! \file src/Control/Keywords.h \author J. Bakosi - \date Mon 09 Feb 2015 12:48:02 PM MST + \date Mon 23 Feb 2015 08:14:29 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Definition of all keywords \details This file contains the definition of all keywords, including those @@ -1985,7 +1985,7 @@ struct output_info { }; using output = keyword< output_info, o,u,t,p,u,t >; -////////// USED ONLY BY EXECUTABLE 'quinoa', NOT YET FULLY DOCUMENTED ////////// +////////// NOT YET FULLY DOCUMENTED ////////// struct mix_iem_info { static std::string name() { return "IEM"; } diff --git a/src/Control/Options/RNG.h b/src/Control/Options/RNG.h index d7e3987bd4f..6baced6ba4b 100644 --- a/src/Control/Options/RNG.h +++ b/src/Control/Options/RNG.h @@ -2,10 +2,10 @@ /*! \file src/Control/Options/RNG.h \author J. Bakosi - \date Thu 22 Jan 2015 06:59:03 AM MST + \date Mon 23 Feb 2015 08:14:49 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's random number generator options and associations - \details Quinoa's random number generator options and associations + \brief Random number generator options and associations + \details Random number generator options and associations */ //****************************************************************************** #ifndef RNGOptions_h diff --git a/src/Control/Quinoa/Types.h b/src/Control/Quinoa/Types.h deleted file mode 100644 index 154381d660c..00000000000 --- a/src/Control/Quinoa/Types.h +++ /dev/null @@ -1,144 +0,0 @@ -//****************************************************************************** -/*! - \file src/Control/Quinoa/Types.h - \author J. Bakosi - \date Thu 15 Jan 2015 09:02:47 AM MST - \copyright 2012-2015, Jozsef Bakosi. - \brief Types for Quinoa's parsers - \details Types for Quinoa's parsers. This file defines the components of the - tagged tuple that stores heteroegeneous objects in a hierarchical way. These - components are therefore part of the grammar stack that is filled during - parsing (both command-line argument parsing and control file parsing). -*/ -//****************************************************************************** -#ifndef QuinoaTypes_h -#define QuinoaTypes_h - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace quinoa { -namespace ctr { - -//! Storage of selected options -using selects = tk::tuple::tagged_tuple< - tag::montecarlo, MonteCarloType, //!< Physics - tag::position, PositionType, //!< Position model - tag::mass, MassType, //!< Mass model - tag::hydro, HydroType, //!< Hydrodynamics model - tag::energy, EnergyType, //!< Internal energy model - tag::mix, MixType, //!< Material mix model - tag::frequency, FrequencyType, //!< Turbulence frequency model - tag::mixrate, MixRateType, //!< Material mix rate model - tag::rng, std::vector< tk::ctr::RNGType >, //!< RNGs - tag::pdffiletype, tk::ctr::PDFFileType, //!< PDF output file type - tag::pdfpolicy, tk::ctr::PDFPolicyType, //!< PDF output file policy - tag::pdfctr, tk::ctr::PDFCenteringType, //!< PDF output file centering - tag::float_format, tk::ctr::TxtFloatFormatType//!< Text floating-point format ->; - -//! Discretization parameters storage -using discretization = tk::tuple::tagged_tuple< - tag::npar, kw::npar::info::expect::type, //!< Total number of particles - tag::nstep, kw::nstep::info::expect::type, //!< Number of time steps - tag::term, kw::term::info::expect::type, //!< Time to terminate - tag::dt, kw::dt::info::expect::type, //!< Size of time step - tag::binsize, std::vector< std::vector< tk::real > >, //!< PDF binsizes - tag::extent, std::vector< std::vector< tk::real > >, //!< PDF extents - tag::precision, kw::precision::info::expect::type //!< Precision in digits ->; - -//! Output intervals storage -using intervals = tk::tuple::tagged_tuple< - tag::tty, kw::ttyi::info::expect::type, //!< TTY output interval - tag::dump, uint32_t, //!< Dump output interval - tag::stat, kw::interval::info::expect::type, //!< Statistics output interval - tag::pdf, kw::interval::info::expect::type, //!< PDF output interval - tag::glob, uint32_t //!< Glob output interval ->; - -//! IO parameters storage -using ios = tk::tuple::tagged_tuple< - tag::control, kw::control::info::expect::type, //!< Control filename - tag::input, std::string, //!< Input filename - tag::output, std::string, //!< Output filename - tag::pdf, kw::pdf::info::expect::type, //!< PDF filename - tag::glob, std::string, //!< Glob filename - tag::stat, kw::stat::info::expect::type, //!< Statistics filename - tag::pdfnames, std::vector< std::string > //!< PDF identifiers ->; - -//! Position parameters storage -using PositionParameters = tk::tuple::tagged_tuple< - tag::depvar, std::vector< char > ->; - -//! Mass parameters storage -using MassParameters = tk::tuple::tagged_tuple< - tag::depvar, std::vector< char > ->; - -//! Hydro parameters storage -using HydroParameters = tk::tuple::tagged_tuple< - tag::depvar, std::vector< char > ->; - -//! Mix parameters storage -using MixParameters = tk::tuple::tagged_tuple< - tag::depvar, std::vector< char > ->; - -//! Frequency parameters storage -using FrequencyParameters = tk::tuple::tagged_tuple< - tag::depvar, std::vector< char > ->; - -//! Simplified Langevin hydro model parameters storage -using SLMParameters = tk::tuple::tagged_tuple< - tag::c0, tk::real ->; - -//! Generalized Langevin hydro model parameters storage -using GLMParameters = tk::tuple::tagged_tuple< - tag::c0, tk::real ->; - -//! Parameters storage -using parameters = tk::tuple::tagged_tuple< - #ifdef HAS_MKL - tag::rngmkl, tk::ctr::RNGMKLParameters, //!< MKL RNG parameters - #endif - tag::rngsse, tk::ctr::RNGSSEParameters, //!< RNGSSE RNG parameters - tag::position, PositionParameters, - tag::mass, MassParameters, - tag::hydro, HydroParameters, - tag::mix, MixParameters, - tag::frequency, FrequencyParameters, - tag::slm, SLMParameters, - tag::glm, GLMParameters ->; - -//! PEGTL location type to use throughout Quinoa's parsers -using Location = pegtl::ascii_location; - -} // ctr:: -} // quinoa:: - -#endif // QuinoaTypes_h diff --git a/src/IO/ExodusIIMeshReader.C b/src/IO/ExodusIIMeshReader.C index d3ec380b457..8101a3566a3 100644 --- a/src/IO/ExodusIIMeshReader.C +++ b/src/IO/ExodusIIMeshReader.C @@ -2,7 +2,7 @@ /*! \file src/IO/ExodusIIMeshReader.C \author J. Bakosi - \date Wed 28 Jan 2015 08:32:12 AM MST + \date Mon 23 Feb 2015 08:15:55 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ExodusII mesh reader \details ExodusII mesh reader class definition. Currently, this is a bare @@ -19,7 +19,7 @@ #include #include -using quinoa::ExodusIIMeshReader; +using tk::ExodusIIMeshReader; ExodusIIMeshReader::ExodusIIMeshReader( const std::string& filename, UnsMesh& mesh, diff --git a/src/IO/ExodusIIMeshReader.h b/src/IO/ExodusIIMeshReader.h index edb46227652..74b86b28dd4 100644 --- a/src/IO/ExodusIIMeshReader.h +++ b/src/IO/ExodusIIMeshReader.h @@ -2,7 +2,7 @@ /*! \file src/IO/ExodusIIMeshReader.h \author J. Bakosi - \date Wed 28 Jan 2015 10:03:16 AM MST + \date Mon 23 Feb 2015 08:15:47 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ExodusII mesh reader \details ExodusII mesh reader class declaration. Currently, this is a bare @@ -18,12 +18,12 @@ #include #include -namespace quinoa { +namespace tk { //! \brief ExodusIIMeshReader : tk::Reader //! \details Mesh reader class facilitating reading a mesh from a file in //! ExodusII format. See also http://sourceforge.net/projects/exodusii. -class ExodusIIMeshReader : public tk::Reader { +class ExodusIIMeshReader : public Reader { public: //! Constructor @@ -54,6 +54,6 @@ class ExodusIIMeshReader : public tk::Reader { int m_nnode; //!< Number of nodes }; -} // quinoa:: +} // tk:: #endif // ExodusIIMeshReader_h diff --git a/src/IO/ExodusIIMeshWriter.C b/src/IO/ExodusIIMeshWriter.C index a5b6e30c52e..95ec5655131 100644 --- a/src/IO/ExodusIIMeshWriter.C +++ b/src/IO/ExodusIIMeshWriter.C @@ -2,7 +2,7 @@ /*! \file src/IO/ExodusIIMeshWriter.C \author J. Bakosi - \date Wed 28 Jan 2015 08:32:01 AM MST + \date Mon 23 Feb 2015 08:43:08 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ExodusII mesh writer \details ExodusII mesh writer class definition. Currently, this is a bare @@ -20,7 +20,7 @@ #include #include -using quinoa::ExodusIIMeshWriter; +using tk::ExodusIIMeshWriter; ExodusIIMeshWriter::ExodusIIMeshWriter( const std::string& filename, const UnsMesh& mesh, @@ -75,8 +75,7 @@ ExodusIIMeshWriter::writeHeader() { ErrChk( ex_put_init( m_outFile, - (std::string("Written by Quinoa::") + - MESHCONV_EXECUTABLE).c_str(), + "Written by Quinoa", 3, // number of dimensions m_mesh.nnode(), m_mesh.triinpoel().size() + m_mesh.tetinpoel().size(), diff --git a/src/IO/ExodusIIMeshWriter.h b/src/IO/ExodusIIMeshWriter.h index 585c2a811f6..5f36bb8d833 100644 --- a/src/IO/ExodusIIMeshWriter.h +++ b/src/IO/ExodusIIMeshWriter.h @@ -2,7 +2,7 @@ /*! \file src/IO/ExodusIIMeshWriter.h \author J. Bakosi - \date Wed 28 Jan 2015 10:05:53 AM MST + \date Mon 23 Feb 2015 08:17:32 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ExodusII mesh writer \details ExodusII mesh writer class declaration. Currently, this is a bare @@ -18,12 +18,12 @@ #include #include -namespace quinoa { +namespace tk { //! \brief ExodusIIMeshWriter : tk::Writer //! \details Mesh reader class facilitating writing a mesh to a file in //! ExodusII format. See also http://sourceforge.net/projects/exodusii. -class ExodusIIMeshWriter : public tk::Writer { +class ExodusIIMeshWriter : public Writer { public: //! Constructor @@ -59,6 +59,6 @@ class ExodusIIMeshWriter : public tk::Writer { int m_outFile; //!< ExodusII file handle }; -} // quinoa:: +} // tk:: #endif // ExodusIIMeshWriter_h diff --git a/src/IO/GmshMeshIO.h b/src/IO/GmshMeshIO.h index 2fd57f712ac..c5a79e4bd22 100644 --- a/src/IO/GmshMeshIO.h +++ b/src/IO/GmshMeshIO.h @@ -2,7 +2,7 @@ /*! \file src/IO/GmshMeshIO.h \author J. Bakosi - \date Wed 28 Jan 2015 08:06:18 AM MST + \date Mon 23 Feb 2015 08:18:04 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Gmsh mesh reader and writer related types \details Gmsh mesh reader and writer related types. @@ -11,7 +11,7 @@ #ifndef GmshMeshIO_h #define GmshMeshIO_h -namespace quinoa { +namespace tk { //! Identifiers of supported Gmsh elements enum GmshElemType { LIN = 1, @@ -24,6 +24,6 @@ enum class GmshFileType { UNDEFINED = -1, ASCII = 0, BINARY = 1 }; -} // quinoa:: +} // tk:: #endif // GmshMeshIO_h diff --git a/src/IO/GmshMeshReader.C b/src/IO/GmshMeshReader.C index f86676ce52d..5ec4231fd2c 100644 --- a/src/IO/GmshMeshReader.C +++ b/src/IO/GmshMeshReader.C @@ -2,7 +2,7 @@ /*! \file src/IO/GmshMeshReader.C \author J. Bakosi - \date Wed 28 Jan 2015 08:20:57 AM MST + \date Mon 23 Feb 2015 08:18:19 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Gmsh mesh reader class definition \details Gmsh mesh reader class definition. Currently, this class supports @@ -17,7 +17,7 @@ #include #include -using quinoa::GmshMeshReader; +using tk::GmshMeshReader; void GmshMeshReader::read() diff --git a/src/IO/GmshMeshReader.h b/src/IO/GmshMeshReader.h index 7b8b7b5f327..3c536bd8386 100644 --- a/src/IO/GmshMeshReader.h +++ b/src/IO/GmshMeshReader.h @@ -2,7 +2,7 @@ /*! \file src/IO/GmshMeshReader.h \author J. Bakosi - \date Wed 28 Jan 2015 08:26:20 AM MST + \date Mon 23 Feb 2015 08:18:14 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Gmsh mesh reader class declaration \details Gmsh mesh reader class declaration. Currently, this class supports @@ -19,13 +19,13 @@ #include #include -namespace quinoa { +namespace tk { //! \brief GmshMeshReader : tk::Reader //! \details Mesh reader class facilitating reading a mesh from a file saved by //! the Gmsh mesh generator: http://geuz.org/gmsh. //! \author J. Bakosi -class GmshMeshReader : public tk::Reader { +class GmshMeshReader : public Reader { public: //! Constructor @@ -103,6 +103,6 @@ class GmshMeshReader : public tk::Reader { }; }; -} // quinoa:: +} // tk:: #endif // GmshMeshReader_h diff --git a/src/IO/GmshMeshWriter.C b/src/IO/GmshMeshWriter.C index 9f02ca5b79c..1716ecf2e1b 100644 --- a/src/IO/GmshMeshWriter.C +++ b/src/IO/GmshMeshWriter.C @@ -2,7 +2,7 @@ /*! \file src/IO/GmshMeshWriter.C \author J. Bakosi - \date Wed 28 Jan 2015 08:44:35 AM MST + \date Mon 23 Feb 2015 08:18:29 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Gmsh mesh writer class definition \details Gmsh mesh writer class definition. Currently, this class supports @@ -16,7 +16,7 @@ #include #include -using quinoa::GmshMeshWriter; +using tk::GmshMeshWriter; GmshMeshWriter::GmshMeshWriter( const std::string& filename, const UnsMesh& mesh, diff --git a/src/IO/GmshMeshWriter.h b/src/IO/GmshMeshWriter.h index 0255a4aa601..5f7d871a56e 100644 --- a/src/IO/GmshMeshWriter.h +++ b/src/IO/GmshMeshWriter.h @@ -2,7 +2,7 @@ /*! \file src/IO/GmshMeshWriter.h \author J. Bakosi - \date Wed 28 Jan 2015 08:43:57 AM MST + \date Mon 23 Feb 2015 08:18:39 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Gmsh mesh writer class declaration \details Gmsh mesh writer class declaration. Currently, this class supports @@ -18,12 +18,12 @@ #include #include -namespace quinoa { +namespace tk { //! \brief GmshMeshWriter : Writer //! \details Mesh writer class facilitating writing a mesh to a file readable by //! the Gmsh mesh generator: http://geuz.org/gmsh. -class GmshMeshWriter : public tk::Writer { +class GmshMeshWriter : public Writer { public: //! Constructor @@ -67,6 +67,6 @@ class GmshMeshWriter : public tk::Writer { GmshFileType m_type; //!< Mesh file type: 0:ASCII, 1:binary }; -} // quinoa:: +} // tk:: #endif // GmshMeshWriter_h diff --git a/src/IO/NetgenMeshReader.C b/src/IO/NetgenMeshReader.C index 31eebd7acdd..422824df571 100644 --- a/src/IO/NetgenMeshReader.C +++ b/src/IO/NetgenMeshReader.C @@ -2,7 +2,7 @@ /*! \file src/IO/NetgenMeshReader.C \author J. Bakosi - \date Wed 28 Jan 2015 08:58:31 AM MST + \date Mon 23 Feb 2015 08:15:31 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Netgen mesh reader class definition \details Netgen mesh reader class definition. Only supports tetrahedra. @@ -14,7 +14,7 @@ #include -using quinoa::NetgenMeshReader; +using tk::NetgenMeshReader; void NetgenMeshReader::read() diff --git a/src/IO/NetgenMeshReader.h b/src/IO/NetgenMeshReader.h index 8283d7df4de..76e4633ce3f 100644 --- a/src/IO/NetgenMeshReader.h +++ b/src/IO/NetgenMeshReader.h @@ -2,7 +2,7 @@ /*! \file src/IO/NetgenMeshReader.h \author J. Bakosi - \date Wed 28 Jan 2015 08:59:09 AM MST + \date Mon 23 Feb 2015 08:15:18 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Netgen mesh reader class declaration \details Netgen mesh reader class declaration. Only supports tetrahedra. @@ -14,13 +14,13 @@ #include #include -namespace quinoa { +namespace tk { //! \brief NetgenMeshReader : tk::Reader //! \details Mesh reader class facilitating reading a mesh from a file saved by //! the Netgen mesh generator: //! http://sourceforge.net/apps/mediawiki/netgen-mesher. -class NetgenMeshReader : public tk::Reader { +class NetgenMeshReader : public Reader { public: //! Constructor @@ -41,6 +41,6 @@ class NetgenMeshReader : public tk::Reader { UnsMesh& m_mesh; //!< Mesh object }; -} // quinoa:: +} // tk:: #endif // NetgenMeshReader_h diff --git a/src/IO/NetgenMeshWriter.C b/src/IO/NetgenMeshWriter.C index 885d5b2ee7e..3781fa0c97c 100644 --- a/src/IO/NetgenMeshWriter.C +++ b/src/IO/NetgenMeshWriter.C @@ -2,7 +2,7 @@ /*! \file src/IO/NetgenMeshWriter.C \author J. Bakosi - \date Wed 28 Jan 2015 09:01:15 AM MST + \date Mon 23 Feb 2015 08:18:55 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Netgen mesh writer class definition \details Netgen mesh writer class definition. Only supports tetrahedra. @@ -14,7 +14,7 @@ #include #include -using quinoa::NetgenMeshWriter; +using tk::NetgenMeshWriter; void NetgenMeshWriter::write() diff --git a/src/IO/NetgenMeshWriter.h b/src/IO/NetgenMeshWriter.h index 2f763dbb85b..148e7ab9914 100644 --- a/src/IO/NetgenMeshWriter.h +++ b/src/IO/NetgenMeshWriter.h @@ -2,7 +2,7 @@ /*! \file src/IO/NetgenMeshWriter.h \author J. Bakosi - \date Wed 28 Jan 2015 09:00:42 AM MST + \date Mon 23 Feb 2015 08:19:04 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Netgen mesh writer class declaration \details Netgen mesh writer class declaration. Only supports tetrahedra. @@ -16,13 +16,13 @@ #include #include -namespace quinoa { +namespace tk { //! \brief NetgenMeshWriter : tk::Writer //! Mesh reader class facilitating reading a mesh from a file saved by //! the Netgen mesh generator: //! http://sourceforge.net/apps/mediawiki/netgen-mesher. -class NetgenMeshWriter : public tk::Writer { +class NetgenMeshWriter : public Writer { public: //! Constructor @@ -43,6 +43,6 @@ class NetgenMeshWriter : public tk::Writer { const UnsMesh& m_mesh; //!< Mesh object }; -} // quinoa:: +} // tk:: #endif // NetgenMeshWriter_h diff --git a/src/IO/PDFWriter.C b/src/IO/PDFWriter.C index 99bcfcc4631..4ed4716acee 100644 --- a/src/IO/PDFWriter.C +++ b/src/IO/PDFWriter.C @@ -2,7 +2,7 @@ /*! \file src/IO/PDFWriter.C \author J. Bakosi - \date Wed 28 Jan 2015 09:23:57 AM MST + \date Mon 23 Feb 2015 08:42:45 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Univariate PDF writer \brief PDF writer class definition @@ -1092,8 +1092,7 @@ PDFWriter::writeExHdr( int outFileId, int nnode, int nelem ) const //****************************************************************************** { ErrChk( ex_put_init( outFileId, - (std::string("Written by Quinoa::") + - QUINOA_EXECUTABLE).c_str(), + "Written by Quinoa", 3, // number of dimensions nnode, // number of nodes nelem, // number of elements diff --git a/src/IO/STLTxtMeshReader.C b/src/IO/STLTxtMeshReader.C index cc8afcea8d8..554a364955c 100644 --- a/src/IO/STLTxtMeshReader.C +++ b/src/IO/STLTxtMeshReader.C @@ -2,7 +2,7 @@ /*! \file src/IO/STLTxtMeshReader.C \author J. Bakosi - \date Wed 28 Jan 2015 10:12:15 AM MST + \date Mon 23 Feb 2015 08:17:18 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ASCII STL (STereoLithography) reader class definition \details ASCII STL (STereoLithography) reader class definition. @@ -12,7 +12,7 @@ #include #include -using quinoa::STLTxtMeshReader; +using tk::STLTxtMeshReader; STLTxtMeshReader::STLTxtMeshReader( const std::string filename, STLMesh& mesh ) : Reader( filename ), m_mesh( mesh ) diff --git a/src/IO/STLTxtMeshReader.h b/src/IO/STLTxtMeshReader.h index 3b82c72a3ec..89133bde214 100644 --- a/src/IO/STLTxtMeshReader.h +++ b/src/IO/STLTxtMeshReader.h @@ -2,7 +2,7 @@ /*! \file src/IO/STLTxtMeshReader.h \author J. Bakosi - \date Wed 28 Jan 2015 10:09:45 AM MST + \date Mon 23 Feb 2015 08:17:13 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ASCII STL (STereoLithography) reader class declaration \details ASCII STL (STereoLithographu) reader class declaration. @@ -18,12 +18,12 @@ class STLMesh; -namespace quinoa { +namespace tk { //! \brief STLTxtMeshReader : tk::Reader //! \details Mesh reader class facilitating reading a mesh from a file in //! ASCII STL format. -class STLTxtMeshReader : public tk::Reader { +class STLTxtMeshReader : public Reader { public: //! Constructor @@ -67,6 +67,6 @@ class STLTxtMeshReader : public tk::Reader { STLMesh& m_mesh; //!< Mesh }; -} // quinoa:: +} // tk:: #endif // STLTxtMeshReader_h diff --git a/src/IO/SiloWriter.C b/src/IO/SiloWriter.C index c3acd5a28c1..d46b5c8d8df 100644 --- a/src/IO/SiloWriter.C +++ b/src/IO/SiloWriter.C @@ -2,7 +2,7 @@ /*! \file src/IO/SiloWriter.C \author J. Bakosi - \date Wed 28 Jan 2015 10:00:22 AM MST + \date Mon 23 Feb 2015 08:16:13 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Silo writer definition. \details Silo writer definition. This class currently only supports writing @@ -21,7 +21,7 @@ #include void -quinoa::SiloError( char* msg ) +tk::SiloError( char* msg ) //****************************************************************************** // Silo error handler //! \param[in] msg Error message @@ -38,7 +38,7 @@ quinoa::SiloError( char* msg ) Throw( ss.str() ); } -using quinoa::SiloWriter; +using tk::SiloWriter; SiloWriter::SiloWriter( const std::string& filename, const STLMesh& mesh, diff --git a/src/IO/SiloWriter.h b/src/IO/SiloWriter.h index 02bc7011f24..fc9bb04e855 100644 --- a/src/IO/SiloWriter.h +++ b/src/IO/SiloWriter.h @@ -2,7 +2,7 @@ /*! \file src/IO/SiloWriter.h \author J. Bakosi - \date Wed 28 Jan 2015 10:07:15 AM MST + \date Mon 23 Feb 2015 08:16:08 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Silo writer declaration. \details Silo writer declaration. This class currently only supports writing @@ -17,7 +17,7 @@ #include -namespace quinoa { +namespace tk { //! Silo error handler function type typedef void (*SiloErrorHandler)( char* ); @@ -53,6 +53,6 @@ class SiloWriter { DBfile* m_dbfile; //!< Silo DB file }; -} // quinoa:: +} // tk:: #endif // SiloWriter_h diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index a9d18a930ac..5128d7ab47a 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -15,30 +15,30 @@ STRING(REGEX REPLACE "" ${CHARM_COMPILER} CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}") -### Quinoa executable ########################################################## -add_executable(${QUINOA_EXECUTABLE} - QuinoaDriver.C - QuinoaPrint.C - Quinoa.C +### Inciter executable ######################################################### +add_executable(${INCITER_EXECUTABLE} + InciterDriver.C + InciterPrint.C + Inciter.C ) if(MPI_COMPILE_FLAGS) - set_target_properties(${QUINOA_EXECUTABLE} PROPERTIES + set_target_properties(${INCITER_EXECUTABLE} PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") endif() if(MPI_LINK_FLAGS) - set_target_properties(${QUINOA_EXECUTABLE} PROPERTIES + set_target_properties(${INCITER_EXECUTABLE} PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") endif() -target_link_libraries(${QUINOA_EXECUTABLE} +target_link_libraries(${INCITER_EXECUTABLE} Base IO #LinearAlgebra Mesh Statistics - QuinoaControl + InciterControl RNG #${SILO_LIBRARY} ${NEMESIS_LIBRARIES} @@ -55,11 +55,11 @@ target_link_libraries(${QUINOA_EXECUTABLE} ${BOOST_SYSTEM_LIBRARY} ) -# Add custom dependencies for Quinoa's main Charm++ module -addCharmModule( "quinoa" "${QUINOA_EXECUTABLE}" ) -removeWarnings( "QuinoaDriver.C;QuinoaPrint.C;Quinoa.C") +# Add custom dependencies for Inciter's main Charm++ module +addCharmModule( "inciter" "${INCITER_EXECUTABLE}" ) +removeWarnings( "InciterDriver.C;InciterPrint.C;Inciter.C") -INSTALL(TARGETS ${QUINOA_EXECUTABLE} +INSTALL(TARGETS ${INCITER_EXECUTABLE} RUNTIME DESTINATION bin COMPONENT Runtime LIBRARY DESTINATION lib COMPONENT Runtime ARCHIVE DESTINATION lib COMPONENT Development diff --git a/src/Main/Config.h.in b/src/Main/Config.h.in index 0482b54d8ab..7380097004e 100644 --- a/src/Main/Config.h.in +++ b/src/Main/Config.h.in @@ -2,7 +2,7 @@ /*! \file src/Main/Config.h \author J. Bakosi - \date Wed 28 Jan 2015 10:27:17 AM MST + \date Mon 23 Feb 2015 08:39:45 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief CMake header input file with information to be passed to cmake \details CMake header input file with information to be passed to cmake. See @@ -12,7 +12,7 @@ #ifndef Config_h #define Config_h -#define QUINOA_EXECUTABLE "@QUINOA_EXECUTABLE@" +#define INCITER_EXECUTABLE "@INCITER_EXECUTABLE@" #define RNGTEST_EXECUTABLE "@RNGTEST_EXECUTABLE@" #define UNITTEST_EXECUTABLE "@UNITTEST_EXECUTABLE@" #define MESHCONV_EXECUTABLE "@MESHCONV_EXECUTABLE@" diff --git a/src/Main/Quinoa.C b/src/Main/Inciter.C similarity index 69% rename from src/Main/Quinoa.C rename to src/Main/Inciter.C index 597256d1043..f2189687b82 100644 --- a/src/Main/Quinoa.C +++ b/src/Main/Inciter.C @@ -1,13 +1,14 @@ //****************************************************************************** /*! - \file src/Main/Quinoa.C + \file src/Main/Inciter.C \author J. Bakosi - \date Wed 28 Jan 2015 11:25:49 AM MST + \date Mon 23 Feb 2015 08:59:58 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa's computational fluid dynamics tool Charm++ main chare. - \details Quinoa's computational fluid dynamics tool Charm++ main chare. This - file contains the definition of the Charm++ main chare, equivalent to main() - in Charm++-land + \brief Inciter's computational shock hydrodynamics tool Charm++ main + chare. + \details Inciter's computational shock hydrodynamics tool Charm++ main + chare. This file contains the definition of the Charm++ main chare, + equivalent to main() in Charm++-land. */ //****************************************************************************** @@ -16,18 +17,18 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include //! \brief Charm handle to the main proxy, facilitates call-back to finalize, //! etc., must be in global scope, unique per executable CProxy_Main mainProxy; -//! Quinoa declarations and definitions -namespace quinoa { +//! Inciter declarations and definitions +namespace inciter { //! Global-scope data. Initialized by the main chare and distibuted to all PEs //! by the Charm++ runtime system. Though semantically not const, all these @@ -40,42 +41,15 @@ namespace quinoa { ctr::InputDeck g_inputdeck_defaults; //! Input deck filled by parser, containing all input data ctr::InputDeck g_inputdeck; -//! Random number generators selected by user -std::map< tk::ctr::RawRNGType, tk::RNG > g_rng; //! Distributor Charm++ proxy facilitating call-back to Distributor by the //! individual integrators //CProxy_Distributor g_DistributorProxy; -//! Pack/Unpack selected RNGs. This Pack/Unpack method (re-)creates the full RNG -//! stack since it needs to (re-)bind function pointers on different processing -//! elements. Therefore we circumvent Charm's usual pack/unpack for this type, -//! and thus sizing does not make sense: sizing is a no-op. We could initialize -//! the stack in RNGTestDriver's constructor and let this function re-create the -//! stack only when unpacking, but that leads to repeating the same code twice: -//! once in RNGTestDriver's constructor, once here. Another option is to use -//! this pack/unpack routine to both initially create (when packing) and to -//! re-create (when unpacking) the stack, which eliminates the need for -//! pre-creating the object in RNGTestDriver's constructor and therefore -//! eliminates the repeated code. This explains the guard for sizing: the code -//! below is called for packing only (in serial) and packing and unpacking (in -//! parallel). -inline -void operator|( PUP::er& p, std::map< tk::ctr::RawRNGType, tk::RNG >& rng ) { - if (!p.isSizing()) { - tk::RNGStack stack( - #ifdef HAS_MKL - g_inputdeck.get< tag::param, tag::rngmkl >(), - #endif - g_inputdeck.get< tag::param, tag::rngsse >() ); - rng = stack.selected( g_inputdeck.get< tag::selected, tag::rng >() ); - } -} - -} // quinoa:: +} // inciter:: //! \brief Charm++ main chare for the computational fluid dynamics executable, -//! quinoa. +//! inciter. //! \details Note that this object should not be in a namespace. class Main : public CBase_Main { @@ -105,12 +79,12 @@ class Main : public CBase_Main { m_cmdParser( msg->argc, msg->argv, tk::Print(), m_cmdline ), // Create pretty printer initializing output streams based on command line m_print( m_cmdline.get< tag::verbose >() ? std::cout : std::clog ), - // Create Quinoa driver - m_driver( tk::Main< quinoa::QuinoaDriver > + // Create Inciter driver + m_driver( tk::Main< inciter::InciterDriver > ( msg->argc, msg->argv, m_cmdline, - tk::HeaderType::QUINOA, - QUINOA_EXECUTABLE, + tk::HeaderType::INCITER, + INCITER_EXECUTABLE, m_print ) ), m_timer(1) // Start new timer measuring the total runtime { @@ -154,7 +128,7 @@ class Main : public CBase_Main { catch ( tk::Exception& qe ) { qe.handleException(); } - // Catch std::exception and transform it into Quinoa::Exception without + // Catch std::exception and transform it into tk::Exception without // file:line:func information catch ( std::exception& se ) { tk::Exception qe( se.what() ); @@ -171,10 +145,10 @@ class Main : public CBase_Main { } private: - quinoa::ctr::CmdLine m_cmdline; //!< Command line - quinoa::CmdLineParser m_cmdParser; //!< Command line parser - quinoa::QuinoaPrint m_print; //!< Pretty printer - quinoa::QuinoaDriver m_driver; //!< Driver + inciter::ctr::CmdLine m_cmdline; //!< Command line + inciter::CmdLineParser m_cmdParser; //!< Command line parser + inciter::InciterPrint m_print; //!< Pretty printer + inciter::InciterDriver m_driver; //!< Drive std::vector< tk::Timer > m_timer; //!< Timers //! Time stamps in h:m:s with labels @@ -186,4 +160,4 @@ class Main : public CBase_Main { //! which happens after the main chare constructor has finished. struct execute : CBase_execute { execute() { mainProxy.execute(); } }; -#include +#include diff --git a/src/Main/QuinoaDriver.C b/src/Main/InciterDriver.C similarity index 80% rename from src/Main/QuinoaDriver.C rename to src/Main/InciterDriver.C index dd49e5f291f..ae7e582968d 100644 --- a/src/Main/QuinoaDriver.C +++ b/src/Main/InciterDriver.C @@ -1,29 +1,29 @@ //****************************************************************************** /*! - \file src/Main/QuinoaDriver.C + \file src/Main/InciterDriver.C \author J. Bakosi - \date Wed 28 Jan 2015 11:41:14 AM MST + \date Mon 23 Feb 2015 08:32:21 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa driver - \details Quinor driver. + \brief Inciter driver + \details Inciter driver. */ //****************************************************************************** -#include -#include +#include +#include //#include -namespace quinoa { +namespace inciter { extern ctr::InputDeck g_inputdeck; //extern CProxy_Distributor g_DistributorProxy; -} // quinoa:: +} // inciter:: -using quinoa::QuinoaDriver; +using inciter::InciterDriver; -QuinoaDriver::QuinoaDriver( const QuinoaPrint& print, - const ctr::CmdLine& cmdline ) : +InciterDriver::InciterDriver( const InciterPrint& print, + const ctr::CmdLine& cmdline ) : m_print( print ) //****************************************************************************** // Constructor diff --git a/src/Main/InciterDriver.h b/src/Main/InciterDriver.h new file mode 100644 index 00000000000..dabeba80abf --- /dev/null +++ b/src/Main/InciterDriver.h @@ -0,0 +1,39 @@ +//****************************************************************************** +/*! + \file src/Main/InciterDriver.h + \author J. Bakosi + \date Mon 23 Feb 2015 09:04:59 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter driver + \details Inciter driver. +*/ +//****************************************************************************** +#ifndef InciterDriver_h +#define InciterDriver_h + +#include +#include +#include + +extern CProxy_Main mainProxy; + +namespace inciter { + +//! Inciter driver used polymorphically with tk::Driver +class InciterDriver { + + public: + //! Constructor + explicit InciterDriver( const InciterPrint& print, + const ctr::CmdLine& cmdline ); + + //! Execute driver + void execute() { mainProxy.finalize(); } + + private: + const InciterPrint& m_print; +}; + +} // inciter:: + +#endif // InciterDriver_h diff --git a/src/Main/InciterPrint.C b/src/Main/InciterPrint.C new file mode 100644 index 00000000000..95aaa5f15c9 --- /dev/null +++ b/src/Main/InciterPrint.C @@ -0,0 +1,34 @@ +//****************************************************************************** +/*! + \file src/Main/InciterPrint.C + \author J. Bakosi + \date Mon 23 Feb 2015 08:59:07 AM MST + \copyright 2012-2015, Jozsef Bakosi. + \brief Inciter-specific pretty printer functionality + \details Inciter-specific pretty printer functionality. +*/ +//****************************************************************************** + +#include + +using inciter::InciterPrint; + +void +InciterPrint::inthead( const std::string& title, + const std::string& name, + const std::string& legend, + const std::string& head ) const +//****************************************************************************** +// Print time integration header +//! \param[in] title Section title +//! \param[in] name Section name +//! \param[in] legend Legend to print +//! \param[in] head Head to append +//! \author J. Bakosi +//****************************************************************************** +{ + section( title, name ); + std::string l( legend ); + boost::replace_all( l, "\n", "\n" + m_item_indent ); + raw( m_item_indent + l + head ); +} diff --git a/src/Main/QuinoaPrint.h b/src/Main/InciterPrint.h similarity index 63% rename from src/Main/QuinoaPrint.h rename to src/Main/InciterPrint.h index 4fa466f3c54..10e0f72de99 100644 --- a/src/Main/QuinoaPrint.h +++ b/src/Main/InciterPrint.h @@ -1,31 +1,31 @@ //****************************************************************************** /*! - \file src/Main/QuinoaPrint.h + \file src/Main/InciterPrint.h \author J. Bakosi - \date Wed 28 Jan 2015 12:40:58 PM MST + \date Mon 23 Feb 2015 08:59:22 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa-specific pretty printer functionality - \details Quinoa-specific pretty printer functionality. + \brief Inciter-specific pretty printer functionality + \details Inciter-specific pretty printer functionality. */ //****************************************************************************** -#ifndef QuinoaPrint_h -#define QuinoaPrint_h +#ifndef InciterPrint_h +#define InciterPrint_h #include #include #include -#include -#include +#include +#include -namespace quinoa { +namespace inciter { extern ctr::InputDeck g_inputdeck_defaults; extern ctr::InputDeck g_inputdeck; -//! QuinoaPrint : tk::RNGPrint -class QuinoaPrint : public tk::RNGPrint { +//! InciterPrint : tk::RNGPrint +class InciterPrint : public tk::RNGPrint { public: //! Constructor @@ -33,8 +33,8 @@ class QuinoaPrint : public tk::RNGPrint { //! \param[inout] qstr Quiet stream //! \see tk::RNGPrint::RNGPrint and tk::Print::Print //! \author J. Bakosi - explicit QuinoaPrint( std::ostream& str = std::clog, - std::ostream& qstr = std::cout ) : + explicit InciterPrint( std::ostream& str = std::clog, + std::ostream& qstr = std::cout ) : RNGPrint( str, qstr ) {} //! Print control option: 'group : option' only if differs from its default @@ -83,29 +83,8 @@ class QuinoaPrint : public tk::RNGPrint { //! Print time integration header void inthead( const std::string& title, const std::string& name, const std::string& legend, const std::string& head ) const; - - //! Print statistics and PDFs - void statistics( const std::string& title ) const; - - //! Print configuration of a stack of differential equations - void diffeqs( const std::string& title, - const std::vector< std::vector< std::pair< std::string, std::string > > >& - info ) const; - - private: - //! Echo statistics container contents if differs from default - void stats( const std::string& msg ) const; - - //! Echo pdfs container contents if differs from default applying op - void pdfs( const std::string& msg, - std::function< - std::ostream& ( std::ostream&, - const std::vector< tk::ctr::Term >&, - const std::vector< tk::real >&, - const std::string&, - const std::vector< tk::real >& ) > op ) const; }; -} // quinoa:: +} // inciter:: -#endif // QuinoaPrint_h +#endif // InciterPrint_h diff --git a/src/Main/Init.h b/src/Main/Init.h index 827674cacfe..9e72b791d6c 100644 --- a/src/Main/Init.h +++ b/src/Main/Init.h @@ -2,7 +2,7 @@ /*! \file src/Main/Init.h \author J. Bakosi - \date Wed 28 Jan 2015 10:52:34 AM MST + \date Mon 23 Feb 2015 08:37:55 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Common initialization routines for main() functions for multiple exectuables @@ -27,7 +27,7 @@ namespace tk { //! Executable types for which an ascii logo is available in tk::Print -enum class HeaderType : uint8_t { QUINOA=0, +enum class HeaderType : uint8_t { INCITER=0, RNGTEST, UNITTEST, MESHCONV, @@ -86,8 +86,8 @@ static void echoHeader( const Print& print, HeaderType header ) //! \author J. Bakosi //****************************************************************************** { - if ( header == HeaderType::QUINOA ) - print.headerQuinoa(); + if ( header == HeaderType::INCITER ) + print.headerInciter(); else if ( header == HeaderType::RNGTEST ) print.headerRNGTest(); else if ( header == HeaderType::UNITTEST ) diff --git a/src/Main/MeshConv.C b/src/Main/MeshConv.C index 05a60b08447..96546c67054 100644 --- a/src/Main/MeshConv.C +++ b/src/Main/MeshConv.C @@ -2,7 +2,7 @@ /*! \file src/Main/MeshConv.C \author J. Bakosi - \date Wed 28 Jan 2015 11:15:08 AM MST + \date Mon 23 Feb 2015 08:41:14 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Mesh file converter Charm++ main chare \details Mesh file converter Charm++ main chare. This file contains the @@ -90,7 +90,7 @@ class Main : public CBase_Main { catch ( tk::Exception& qe ) { qe.handleException(); } - // Catch std::exception and transform it into Quinoa::Exception without + // Catch std::exception and transform it into tk::Exception without // file:line:func information catch ( std::exception& se ) { tk::Exception qe( se.what() ); diff --git a/src/Main/MeshConvDriver.C b/src/Main/MeshConvDriver.C index fd45ddf2d56..274d1e3ef72 100644 --- a/src/Main/MeshConvDriver.C +++ b/src/Main/MeshConvDriver.C @@ -2,7 +2,7 @@ /*! \file src/Main/MeshConvDriver.C \author J. Bakosi - \date Wed 28 Jan 2015 11:39:08 AM MST + \date Mon 23 Feb 2015 08:41:01 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Mesh converter driver \details Mesh converter driver. @@ -54,23 +54,23 @@ MeshConvDriver::execute() const std::map< MeshWriterType, std::function > writers; //! Create unstructured mesh to store mesh - quinoa::UnsMesh mesh; + tk::UnsMesh mesh; // Register mesh readers - tk::record< quinoa::GmshMeshReader >( readers, MeshReaderType::GMSH, + tk::record< tk::GmshMeshReader >( readers, MeshReaderType::GMSH, + m_input, std::ref(mesh) ); + tk::record< tk::NetgenMeshReader >( readers, MeshReaderType::NETGEN, + m_input, std::ref(mesh) ); + tk::record< tk::ExodusIIMeshReader >( readers, MeshReaderType::EXODUSII, m_input, std::ref(mesh) ); - tk::record< quinoa::NetgenMeshReader >( readers, MeshReaderType::NETGEN, - m_input, std::ref(mesh) ); - tk::record< quinoa::ExodusIIMeshReader >( readers, MeshReaderType::EXODUSII, - m_input, std::ref(mesh) ); // Register mesh writers - tk::record< quinoa::GmshMeshWriter >( writers, MeshWriterType::GMSH, + tk::record< tk::GmshMeshWriter >( writers, MeshWriterType::GMSH, + m_output, std::ref(mesh) ); + tk::record< tk::NetgenMeshWriter >( writers, MeshWriterType::NETGEN, + m_output, std::ref(mesh) ); + tk::record< tk::ExodusIIMeshWriter >( writers, MeshWriterType::EXODUSII, m_output, std::ref(mesh) ); - tk::record< quinoa::NetgenMeshWriter >( writers, MeshWriterType::NETGEN, - m_output, std::ref(mesh) ); - tk::record< quinoa::ExodusIIMeshWriter >( writers, MeshWriterType::EXODUSII, - m_output, std::ref(mesh) ); // Read in mesh tk::instantiate( readers, detectInput() )->read(); diff --git a/src/Main/QuinoaDriver.h b/src/Main/QuinoaDriver.h deleted file mode 100644 index 88ccab4521c..00000000000 --- a/src/Main/QuinoaDriver.h +++ /dev/null @@ -1,36 +0,0 @@ -//****************************************************************************** -/*! - \file src/Main/QuinoaDriver.h - \author J. Bakosi - \date Wed 28 Jan 2015 11:40:15 AM MST - \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa driver - \details Quinoa driver. -*/ -//****************************************************************************** -#ifndef QuinoaDriver_h -#define QuinoaDriver_h - -#include -#include - -namespace quinoa { - -//! Quinoa driver used polymorphically with tk::Driver -class QuinoaDriver { - - public: - //! Constructor - explicit QuinoaDriver( const QuinoaPrint& print, - const ctr::CmdLine& cmdline ); - - //! Execute driver - void execute() {} - - private: - const QuinoaPrint& m_print; -}; - -} // quinoa:: - -#endif // QuinoaDriver_h diff --git a/src/Main/QuinoaPrint.C b/src/Main/QuinoaPrint.C deleted file mode 100644 index 53d28dce2ab..00000000000 --- a/src/Main/QuinoaPrint.C +++ /dev/null @@ -1,127 +0,0 @@ -//****************************************************************************** -/*! - \file src/Main/QuinoaPrint.C - \author J. Bakosi - \date Wed 28 Jan 2015 12:03:14 PM MST - \copyright 2012-2015, Jozsef Bakosi. - \brief Quinoa-specific pretty printer functionality - \details Quinoa-specific pretty printer functionality. -*/ -//****************************************************************************** - -#include - -using quinoa::QuinoaPrint; - -void -QuinoaPrint::inthead( const std::string& title, - const std::string& name, - const std::string& legend, - const std::string& head ) const -//****************************************************************************** -// Print time integration header -//! \param[in] title Section title -//! \param[in] name Section name -//! \param[in] legend Legend to print -//! \param[in] head Head to append -//! \author J. Bakosi -//****************************************************************************** -{ - section( title, name ); - std::string l( legend ); - boost::replace_all( l, "\n", "\n" + m_item_indent ); - raw( m_item_indent + l + head ); -} - -void -QuinoaPrint::statistics( const std::string& title ) const -//****************************************************************************** -// Print statistics and PDFs -//! \param[in] title Section title -//! \author J. Bakosi -//****************************************************************************** -{ - if ( !g_inputdeck.get< tag::stat >().empty() || - !g_inputdeck.get< tag::pdf >().empty() ) - { - section( title ); - stats( "Estimated statistical moments" ); - pdfs( "PDFs", tk::ctr::pdf ); - } -} - -void -QuinoaPrint::stats( const std::string& msg ) const -//****************************************************************************** -// Echo statistics container contents if differs from default -//! \param[in] msg Message to print -//! \author J. Bakosi -//****************************************************************************** -{ - Assert( !msg.empty(), "Empty message size in QuinoaPrint::stats()." ); - const auto& c = g_inputdeck.get< tag::stat >(); - - if (!c.empty() && c != g_inputdeck_defaults.get< tag::stat >()) { - m_stream << m_item_name_fmt % m_item_indent % msg; - for (auto& v : c) m_stream << v; - m_stream << '\n'; - } -} - -void -QuinoaPrint::pdfs( const std::string& msg, - std::function< - std::ostream& ( std::ostream&, - const std::vector< tk::ctr::Term >&, - const std::vector< tk::real >&, - const std::string&, - const std::vector< tk::real >& ext ) > op ) -const -//****************************************************************************** -// Echo pdfs container contents if differs from default applying op(). -//! \param[in] msg Message to print -//! \param[in] op Functor to use -//! \details See src/Control/StatCtr.h for the definition of functions that may -//! be passed in as op. Currently, the only example is tk::ctr::pdf. -//! \author J. Bakosi -//****************************************************************************** -{ - Assert( !msg.empty(), "Empty message size in QuinoaPrint::vec()." ); - - const auto& c = g_inputdeck.get< tag::pdf >(); - const auto& b = g_inputdeck.get< tag::discr, tag::binsize >(); - const auto& n = g_inputdeck.get< tag::cmd, tag::io, tag::pdfnames >(); - const auto& x = g_inputdeck.get< tag::discr, tag::extent >(); - - Assert( (c.size() == b.size()) && - (c.size() == n.size()) && - (c.size() == x.size()), - "Number of PDFs, number of binsizes vector, number of PDF names, and " - "number of extents vector must all equal in QuinoaPrint::pdfs()." ); - - if (!c.empty() && c != g_inputdeck_defaults.get< tag::pdf >()) { - m_stream << m_item_name_fmt % m_item_indent % msg; - for (std::size_t i=0; i() ) ); - tk::ctr::PDFPolicy p; - item( p.group(), - p.name( g_inputdeck.get< tag::selected, tag::pdfpolicy >() ) ); - tk::ctr::PDFCentering e; - item( e.group(), - e.name( g_inputdeck.get< tag::selected, tag::pdfctr >() ) ); - tk::ctr::TxtFloatFormat fl; - item( fl.group(), - fl.name( g_inputdeck.get< tag::selected, tag::float_format >() ) ); - item( "Text precision in digits", - g_inputdeck.get< tag::discr, tag::precision >() ); - } -} diff --git a/src/Main/RNGTest.C b/src/Main/RNGTest.C index 1efe7f82e1b..3d5c19217e9 100644 --- a/src/Main/RNGTest.C +++ b/src/Main/RNGTest.C @@ -2,13 +2,12 @@ /*! \file src/Main/RNGTest.C \author J. Bakosi - \date Wed 28 Jan 2015 11:22:58 AM MST + \date Mon 23 Feb 2015 08:38:25 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief RNGTest: Quinoa's random number generator test suite's Charm++ main - chare. - \details RNGTest: Quinoa's random number generator test suite's Charm++ main - chare. This file contains the definition of the Charm++ main chare, - equivalent to main() in Charm++-land. + \brief RNGTest's random number generator test suite's Charm++ main chare. + \details RNGTest's random number generator test suite's Charm++ main chare. + This file contains the definition of the Charm++ main chare, equivalent to + main() in Charm++-land. */ //****************************************************************************** @@ -194,7 +193,7 @@ class Main : public CBase_Main { catch ( tk::Exception& qe ) { qe.handleException(); } - // Catch std::exception and transform it into Quinoa::Exception without + // Catch std::exception and transform it into tk::Exception without // file:line:func information catch ( std::exception& se ) { tk::Exception qe( se.what() ); diff --git a/src/Main/UnitTest.C b/src/Main/UnitTest.C index 355b3548546..7843ebe802c 100644 --- a/src/Main/UnitTest.C +++ b/src/Main/UnitTest.C @@ -2,12 +2,12 @@ /*! \file src/Main/UnitTest.C \author J. Bakosi - \date Wed 18 Feb 2015 06:52:47 PM MST + \date Mon 23 Feb 2015 08:39:24 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief UnitTest: Quinoa's unit test suite Charm++ main chare. - \details UnitTest: Quinoa's unit test suite Charm++ main chare. This file - contains the definition of the Charm++ main chare, equivalent to main() in - Charm++-land. + \brief UnitTest's unit test suite Charm++ main chare. + \details UnitTest's unit test suite Charm++ main chare. This file contains + the definition of the Charm++ main chare, equivalent to main() in Charm++- + land. */ //****************************************************************************** @@ -165,7 +165,7 @@ class Main : public CBase_Main { catch ( tk::Exception& qe ) { qe.handleException(); } - // Catch std::exception and transform it into Quinoa::Exception without + // Catch std::exception and transform it into tk::Exception without // file:line:func information catch ( std::exception& se ) { tk::Exception qe( se.what() ); diff --git a/src/Main/quinoa.ci b/src/Main/inciter.ci similarity index 76% rename from src/Main/quinoa.ci rename to src/Main/inciter.ci index 4e3ecdb1a81..1f1431b2156 100644 --- a/src/Main/quinoa.ci +++ b/src/Main/inciter.ci @@ -1,31 +1,30 @@ //****************************************************************************** /*! - \file src/Main/quinoa.ci + \file src/Main/inciter.ci \author J. Bakosi - \date Wed 28 Jan 2015 11:29:03 AM MST + \date Mon 23 Feb 2015 09:00:13 AM MST \copyright 2012-2015, Jozsef Bakosi. - \brief Charm++ module interface file for quinoa - \details Charm++ module interface file for the computational fluid dynamics - tool, quinoa. + \brief Charm++ module interface file for inciter + \details Charm++ module interface file for the computational shock + hydrodynamics tool, inciter. \see http://charm.cs.illinois.edu/manuals/html/charm++/manual.html */ //****************************************************************************** -mainmodule quinoa { +mainmodule inciter { // extern module integrator; readonly CProxy_Main mainProxy; - namespace quinoa { + namespace inciter { // Order important: inputdeck stores parsed data, rngs instantiated based on // user-defined parameters from input deck readonly ctr::InputDeck g_inputdeck_defaults; readonly ctr::InputDeck g_inputdeck; - readonly std::map< tk::ctr::RawRNGType, tk::RNG > g_rng; - } // quinoa:: + } // inciter:: mainchare Main { entry Main( CkArgMsg* msg ); diff --git a/src/Mesh/STLMesh.C b/src/Mesh/STLMesh.C index c37403d8b10..f06c0e44e92 100644 --- a/src/Mesh/STLMesh.C +++ b/src/Mesh/STLMesh.C @@ -2,7 +2,7 @@ /*! \file src/Mesh/STLMesh.C \author J. Bakosi - \date Wed 28 Jan 2015 01:00:42 PM MST + \date Mon 23 Feb 2015 08:20:40 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief ASCII STL (STereoLithography) mesh class definition \details ASCII STL (STereoLithography) mesh class definition. @@ -13,7 +13,7 @@ #include -using quinoa::STLMesh; +using tk::STLMesh; void STLMesh::alloc( const size_t nnode ) diff --git a/src/Mesh/STLMesh.h b/src/Mesh/STLMesh.h index 71395616c67..8d38e840db1 100644 --- a/src/Mesh/STLMesh.h +++ b/src/Mesh/STLMesh.h @@ -2,7 +2,7 @@ /*! \file src/Mesh/STLMesh.h \author J. Bakosi - \date Wed 28 Jan 2015 01:00:30 PM MST + \date Mon 23 Feb 2015 08:20:37 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief STL (STereoLithography) mesh class declaration \details STL (STereoLithography) mesh class declaration. @@ -16,7 +16,7 @@ #include -namespace quinoa { +namespace tk { //! STLMesh class STLMesh { @@ -54,6 +54,6 @@ class STLMesh { size_t m_nnodes; //!< Number of nodes }; -} // quinoa:: +} // tk:: #endif // STLMesh_h diff --git a/src/Mesh/UnsMesh.C b/src/Mesh/UnsMesh.C index c24b9f6d919..c214697e461 100644 --- a/src/Mesh/UnsMesh.C +++ b/src/Mesh/UnsMesh.C @@ -2,7 +2,7 @@ /*! \file src/Mesh/UnsMesh.C \author J. Bakosi - \date Wed 28 Jan 2015 01:08:26 PM MST + \date Mon 23 Feb 2015 08:20:29 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief 3D unstructured mesh class definition \details 3D unstructured mesh class definition. This mesh class currently @@ -15,7 +15,7 @@ #include -using quinoa::UnsMesh; +using tk::UnsMesh; void UnsMesh::echoElemSets( const tk::Print& print ) const diff --git a/src/Mesh/UnsMesh.h b/src/Mesh/UnsMesh.h index fe92f13ca85..3132ad076fd 100644 --- a/src/Mesh/UnsMesh.h +++ b/src/Mesh/UnsMesh.h @@ -2,7 +2,7 @@ /*! \file src/Mesh/UnsMesh.h \author J. Bakosi - \date Wed 28 Jan 2015 01:07:58 PM MST + \date Mon 23 Feb 2015 08:20:26 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief 3D unstructured mesh class declaration \details 3D unstructured mesh class declaration. This mesh class currently @@ -18,7 +18,7 @@ #include #include -namespace quinoa { +namespace tk { //! 3D unstructured mesh class class UnsMesh { @@ -143,6 +143,6 @@ class UnsMesh { std::vector< std::vector< int > > m_tettag; //!< Tetrahedron tags }; -} // quinoa:: +} // tk:: #endif // UnsMesh_h diff --git a/src/UnitTest/tests/Base/Print.h b/src/UnitTest/tests/Base/Print.h index fce5b5edf7a..247e548496e 100644 --- a/src/UnitTest/tests/Base/Print.h +++ b/src/UnitTest/tests/Base/Print.h @@ -2,7 +2,7 @@ /*! \file src/UnitTest/tests/Base/Print.h \author J. Bakosi - \date Tue 17 Feb 2015 04:50:53 PM MST + \date Mon 23 Feb 2015 08:21:04 AM MST \copyright 2012-2015, Jozsef Bakosi. \brief Unit tests for Base/Print.h \details Unit tests for Base/Print.h @@ -282,11 +282,11 @@ void Print_object::test< 23 >() { quiet.str(), "12; 12; 12; 12; 12; " ); } -//! Test that tk::Print::headerQuinoa() does not throw an exception +//! Test that tk::Print::headerInciter() does not throw an exception template<> template<> void Print_object::test< 24 >() { - set_test_name( "headerQuinoa() does not throw" ); - prv.headerQuinoa(); + set_test_name( "headerInciter() does not throw" ); + prv.headerInciter(); } //! Test that tk::Print::headerRNGTest() does not throw an exception