Quinoa all test code coverage report
Current view: top level - Control/Inciter/InputDeck - LuaParser.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 494 642 76.9 %
Date: 2025-03-07 14:11:04 Functions: 6 6 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1131 3934 28.7 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Inciter/InputDeck/LuaParser.cpp
       4                 :            :   \copyright 2019-2021 Triad National Security, LLC.
       5                 :            :              All rights reserved. See the LICENSE file for details.
       6                 :            :   \brief     Inciter's lua input deck file parser
       7                 :            :   \details   This file defines the input deck, i.e., control file, parser for
       8                 :            :     the computational shock hydrodynamics tool, Inciter.
       9                 :            : */
      10                 :            : // *****************************************************************************
      11                 :            : 
      12                 :            : #include <ostream>
      13                 :            : #include <type_traits>
      14                 :            : 
      15                 :            : #include "QuinoaConfig.hpp"
      16                 :            : 
      17                 :            : #include "NoWarning/pegtl.hpp"
      18                 :            : 
      19                 :            : #include "Print.hpp"
      20                 :            : #include "Exception.hpp"
      21                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      22                 :            : #include "Inciter/InputDeck/LuaParser.hpp"
      23                 :            : #include "PDE/MultiMat/MultiMatIndexing.hpp"
      24                 :            : #include "PDE/MultiSpecies/MultiSpeciesIndexing.hpp"
      25                 :            : 
      26                 :            : namespace tk {
      27                 :            : namespace grm {
      28                 :            : 
      29                 :            :   //! \brief Case-insensitive character comparison functor
      30                 :            :   struct CaseInsensitiveCharLess {
      31                 :            :     //! Function call operator
      32                 :            :     //! \param[in] lhs Left character of the comparitor operand
      33                 :            :     //! \param[in] rhs Right character of the comparitor operand
      34                 :            :     //! \return Boolean indicating the result of the comparison
      35                 :            :     bool operator() ( char lhs, char rhs ) const {
      36 [ -  + ][ -  + ]:          3 :       return std::tolower( lhs ) < std::tolower( rhs );
                 [ +  - ]
      37                 :            :     }
      38                 :            :   };
      39                 :            : 
      40                 :            :   //! \brief Parser-lifetime storage for dependent variables selected.
      41                 :            :   //! \details Used to track the dependent variable of differential equations
      42                 :            :   //!   (i.e., models) assigned during parsing. It needs to be case insensitive
      43                 :            :   //!   since we only care about whether the variable is selected or not and not
      44                 :            :   //!   whether it denotes a full variable (upper case) or a fluctuation (lower
      45                 :            :   //!   case). This is true for both inserting variables into the set as well as
      46                 :            :   //!   at matching terms of products in parsing requested statistics.
      47                 :            :   static std::set< char, CaseInsensitiveCharLess > depvars;
      48                 :            : 
      49                 :            : } // grm::
      50                 :            : } // tk::
      51                 :            : 
      52                 :            : using inciter::LuaParser;
      53                 :            : 
      54                 :        193 : LuaParser::LuaParser( const tk::Print& /*print*/,
      55                 :            :                       const ctr::CmdLine& cmdline,
      56                 :            :                       ctr::InputDeck& inputdeck ) :
      57                 :        193 :   m_filename( cmdline.get< tag::io, tag::control >() )
      58                 :            : // *****************************************************************************
      59                 :            : //  Constructor
      60                 :            : // //! \param[in] print Pretty printer
      61                 :            : //! \param[in] cmdline Command line stack
      62                 :            : //! \param[in,out] inputdeck Input deck stack where data is stored during
      63                 :            : //!    parsing
      64                 :            : // *****************************************************************************
      65                 :            : {
      66                 :            :   // Make sure there is a filename
      67                 :            :   Assert( !m_filename.empty(), "No filename specified" );
      68                 :            : 
      69                 :            :   // Local file stream handle
      70         [ +  - ]:        386 :   std::ifstream q;
      71                 :            : 
      72                 :            :   // Check if file exists, throw exception if it does not
      73         [ +  - ]:        193 :   q.open( m_filename, std::ifstream::in );
      74 [ -  + ][ -  - ]:        193 :   ErrChk( q.good(), "Failed to open file: " + m_filename );
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      75                 :            : 
      76                 :            :   // Attempt to read a character, throw if it fails
      77                 :            :   // It is curious that on some systems opening a directory instead of a file
      78                 :            :   // with the above ifstream::open() call does not set the failbit. Thus we get
      79                 :            :   // here fine, so we try to read a character from it. If it is a directory or
      80                 :            :   // an empty file the read will fail, so we throw. Read more at: http://
      81                 :            :   // stackoverflow.com/questions/9591036/
      82                 :            :   // ifstream-open-doesnt-set-error-bits-when-argument-is-a-directory.
      83         [ +  - ]:        193 :   q.get();
      84 [ -  + ][ -  - ]:        193 :   ErrChk( q.good(), "Failed to read from file: " + m_filename );
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      85                 :            : 
      86                 :            :   // Close it
      87         [ +  - ]:        193 :   q.close();
      88 [ -  + ][ -  - ]:        193 :   ErrChk( !q.fail(), "Failed to close file: " + m_filename );
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      89                 :            : 
      90                 :            :   // Create InputDeck (a tagged tuple) to store parsed input
      91         [ +  - ]:        193 :   ctr::InputDeck ideck( cmdline );
      92                 :            : 
      93                 :            :   // Read lua file into sol object
      94         [ +  - ]:        386 :   sol::state lua_deck;
      95 [ +  - ][ +  - ]:        193 :   lua_deck.open_libraries(sol::lib::base);
      96         [ +  - ]:        193 :   lua_deck.script_file(m_filename);
      97                 :            : 
      98                 :            :   // Store inputdeck parameters from sol object into tagged tuple
      99         [ +  - ]:        386 :   storeInputDeck(lua_deck["inciter"], ideck);
     100                 :            : 
     101                 :            :   inputdeck = std::move( ideck );
     102                 :        193 : }
     103                 :            : 
     104                 :            : void
     105                 :        193 : LuaParser::storeInputDeck(
     106                 :            :   const sol::table& lua_ideck,
     107                 :            :   ctr::InputDeck& gideck )
     108                 :            : // *****************************************************************************
     109                 :            : //  Store lua inputdeck in custom struct
     110                 :            : //! \param[in] lua_ideck Lua inputdeck parsed by sol2
     111                 :            : //! \param[in,out] gideck Inciter's inputdeck storage
     112                 :            : // *****************************************************************************
     113                 :            : {
     114                 :            :   // TODO: explore replacing storeIfSpecd() and storeOptIfSpecd with sol::get_or()
     115                 :            : 
     116 [ +  - ][ +  - ]:        579 :   storeIfSpecd< std::string >(
         [ +  - ][ -  + ]
         [ -  + ][ +  - ]
                 [ -  - ]
     117                 :            :     lua_ideck, "title", gideck.get< tag::title >(), "No title");
     118                 :            : 
     119                 :            :   // time stepping options
     120                 :            :   // ---------------------------------------------------------------------------
     121 [ +  - ][ +  - ]:        579 :   storeIfSpecd< uint64_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     122                 :            :     lua_ideck, "nstep", gideck.get< tag::nstep >(),
     123                 :            :     std::numeric_limits< uint64_t >::max());
     124 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     125                 :            :     lua_ideck, "term", gideck.get< tag::term >(),
     126                 :            :     std::numeric_limits< tk::real >::max());
     127 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     128                 :            :     lua_ideck, "t0", gideck.get< tag::t0 >(), 0.0);
     129 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     130                 :            :     lua_ideck, "dt", gideck.get< tag::dt >(), 0.0);
     131 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     132                 :            :     lua_ideck, "cfl", gideck.get< tag::cfl >(), 0.0);
     133 [ +  - ][ +  - ]:        579 :   storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     134                 :            :     lua_ideck, "ttyi", gideck.get< tag::ttyi >(), 1);
     135 [ +  - ][ +  - ]:        579 :   storeIfSpecd< bool >(
         [ -  + ][ +  - ]
                 [ -  - ]
     136                 :            :     lua_ideck, "steady_state", gideck.get< tag::steady_state >(), false);
     137 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     138                 :            :     lua_ideck, "residual", gideck.get< tag::residual >(), 1.0e-8);
     139 [ +  - ][ +  - ]:        579 :   storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     140                 :            :     lua_ideck, "rescomp", gideck.get< tag::rescomp >(), 1);
     141 [ +  - ][ +  - ]:        772 :   storeIfSpecd< uint32_t >(
         [ +  - ][ +  - ]
                 [ -  - ]
     142                 :            :     lua_ideck, "imex_runge_kutta", gideck.get< tag::imex_runge_kutta >(), 0);
     143 [ +  - ][ +  - ]:        579 :   storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     144                 :            :     lua_ideck, "imex_maxiter", gideck.get< tag::imex_maxiter >(), 50);
     145 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     146                 :            :     lua_ideck, "imex_reltol", gideck.get< tag::imex_reltol >(), 1.0e-02);
     147 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ -  - ]
     148                 :            :     lua_ideck, "imex_abstol", gideck.get< tag::imex_abstol >(), 1.0e-04);
     149                 :            : 
     150 [ +  + ][ -  + ]:        193 :   if (gideck.get< tag::dt >() < 1e-12 && gideck.get< tag::cfl >() < 1e-12)
     151 [ -  - ][ -  - ]:          0 :     Throw("No time step calculation policy has been selected in the "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     152                 :            :       "preceeding block. Use keyword 'dt' to set a constant or 'cfl' to set an "
     153                 :            :       "adaptive time step size calculation policy.");
     154                 :            : 
     155                 :            :   // partitioning/reordering options
     156                 :            :   // ---------------------------------------------------------------------------
     157                 :            :   storeOptIfSpecd< tk::ctr::PartitioningAlgorithmType,
     158 [ +  - ][ +  - ]:        579 :     tk::ctr::PartitioningAlgorithm >(
         [ -  + ][ +  - ]
                 [ -  - ]
     159                 :            :     lua_ideck, "partitioning", gideck.get< tag::partitioning >(),
     160                 :            :     tk::ctr::PartitioningAlgorithmType::RCB);
     161 [ +  - ][ +  - ]:        579 :   storeIfSpecd< bool >(
         [ -  + ][ +  - ]
                 [ -  - ]
     162                 :            :     lua_ideck, "pelocal_reorder", gideck.get< tag::pelocal_reorder >(),
     163                 :            :     false);
     164 [ +  - ][ +  - ]:        772 :   storeIfSpecd< bool >(
         [ +  - ][ +  - ]
                 [ -  - ]
     165                 :            :     lua_ideck, "operator_reorder", gideck.get< tag::operator_reorder >(),
     166                 :            :     false);
     167                 :            : 
     168                 :            :   // discretization scheme options
     169                 :            :   // ---------------------------------------------------------------------------
     170                 :            :   using inciter::ctr::SchemeType;
     171 [ +  - ][ +  - ]:        579 :   storeOptIfSpecd< SchemeType, inciter::ctr::Scheme >(
         [ -  + ][ +  - ]
                 [ -  - ]
     172                 :            :     lua_ideck, "scheme", gideck.get< tag::scheme >(), SchemeType::ALECG);
     173 [ +  - ][ +  - ]:        579 :   storeOptIfSpecd< inciter::ctr::LimiterType, inciter::ctr::Limiter >(
         [ -  + ][ +  - ]
                 [ -  - ]
     174                 :            :     lua_ideck, "limiter", gideck.get< tag::limiter >(),
     175                 :            :     inciter::ctr::LimiterType::NOLIMITER);
     176 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     177                 :            :     lua_ideck, "cweight", gideck.get< tag::cweight >(), 1.0);
     178 [ +  - ][ +  - ]:        772 :   storeIfSpecd< tk::real >(
         [ +  - ][ +  - ]
                 [ -  - ]
     179                 :            :     lua_ideck, "shock_detector_coeff",
     180                 :            :     gideck.get< tag::shock_detector_coeff >(), 1.0);
     181 [ +  - ][ +  - ]:        579 :   storeIfSpecd< bool >(
         [ -  + ][ +  - ]
                 [ -  - ]
     182                 :            :     lua_ideck, "accuracy_test", gideck.get< tag::accuracy_test >(), false);
     183 [ +  - ][ +  - ]:        772 :   storeIfSpecd< bool >(
         [ +  - ][ +  - ]
                 [ -  - ]
     184                 :            :     lua_ideck, "limsol_projection", gideck.get< tag::limsol_projection >(),
     185                 :            :     true);
     186 [ +  - ][ +  - ]:        579 :   storeIfSpecd< tk::real >(
         [ -  + ][ -  - ]
     187                 :            :     lua_ideck, "lowspeed_kp", gideck.get< tag::lowspeed_kp >(), 0.0);
     188                 :            : 
     189                 :            :   // configure solutions DOFs
     190                 :        193 :   auto scheme = gideck.get< tag::scheme >();
     191                 :            :   auto& ndof = gideck.get< tag::ndof >();
     192                 :            :   auto& rdof = gideck.get< tag::rdof >();
     193                 :        193 :   ndof = rdof = 1;
     194         [ +  + ]:        193 :   if (scheme == SchemeType::P0P1 || scheme == SchemeType::FV) {
     195                 :         29 :     ndof = 1; rdof = 4;
     196         [ +  + ]:        164 :   } else if (scheme == SchemeType::DGP1) {
     197                 :         17 :     ndof = rdof = 4;
     198         [ +  + ]:        147 :   } else if (scheme == SchemeType::DGP2) {
     199                 :          8 :     ndof = rdof = 10;
     200         [ +  + ]:        139 :   } else if (scheme == SchemeType::PDG) {
     201                 :         12 :     ndof = rdof = 10;
     202                 :         12 :     gideck.get< tag::pref, tag::pref >() = true;
     203                 :        127 :   } else if (scheme != SchemeType::DG &&
     204 [ +  + ][ -  + ]:        127 :       scheme != SchemeType::ALECG &&
     205                 :            :       scheme != SchemeType::OversetFE) {
     206 [ -  - ][ -  - ]:          0 :     Throw("Scheme type not configured in configure_scheme");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     207                 :            :   }
     208                 :            : 
     209                 :            :   // PDE options
     210                 :            :   // ---------------------------------------------------------------------------
     211                 :            : 
     212                 :        193 :   char depvar_cnt = 'a';
     213                 :        193 :   gideck.get< tag::depvar >().resize(1);
     214                 :            : 
     215                 :            :   // check transport
     216         [ +  + ]:        193 :   if (lua_ideck["transport"].valid()) {
     217                 :            : 
     218 [ +  - ][ +  - ]:        276 :     checkBlock< inciter::ctr::transportList::Keys >(lua_ideck["transport"],
         [ -  + ][ -  - ]
     219                 :            :       "transport");
     220                 :            : 
     221         [ +  - ]:         92 :     gideck.get< tag::pde >() = inciter::ctr::PDEType::TRANSPORT;
     222 [ +  - ][ +  - ]:        276 :     storeIfSpecd< std::size_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     223                 :            :       lua_ideck["transport"], "ncomp",
     224                 :            :       gideck.get< tag::transport, tag::ncomp >(), 1);
     225 [ +  - ][ +  - ]:        276 :     storeIfSpecd< int >(
         [ -  + ][ +  - ]
                 [ -  - ]
     226                 :            :       lua_ideck["transport"], "intsharp",
     227                 :            :       gideck.get< tag::transport, tag::intsharp >(), 0);
     228 [ +  - ][ +  - ]:        276 :     storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     229                 :            :       lua_ideck["transport"], "intsharp_param",
     230                 :            :       gideck.get< tag::transport, tag::intsharp_param >(), 1.8);
     231 [ +  - ][ +  - ]:        276 :     storeOptIfSpecd< inciter::ctr::ProblemType, inciter::ctr::Problem >(
         [ -  + ][ -  - ]
     232                 :            :       lua_ideck["transport"], "problem",
     233                 :            :       gideck.get< tag::transport, tag::problem >(),
     234                 :            :       inciter::ctr::ProblemType::USER_DEFINED);
     235 [ +  - ][ +  - ]:        276 :     storeVecIfSpecd< tk::real >(
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     236                 :            :       lua_ideck["transport"], "diffusivity",
     237                 :            :       gideck.get< tag::transport, tag::diffusivity >(), {0.0, 0.0, 0.0});
     238 [ +  - ][ +  - ]:        276 :     storeVecIfSpecd< tk::real >(
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     239                 :            :       lua_ideck["transport"], "u0",
     240                 :            :       gideck.get< tag::transport, tag::u0 >(), {0.0, 0.0, 0.0});
     241 [ +  - ][ +  - ]:        276 :     storeVecIfSpecd< tk::real >(
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     242                 :            :       lua_ideck["transport"], "lambda",
     243                 :            :       gideck.get< tag::transport, tag::lambda >(), {0.0, 0.0, 0.0});
     244         [ +  - ]:         92 :     gideck.get< tag::depvar >()[0] = 'c';
     245 [ +  - ][ +  - ]:        276 :     storeOptIfSpecd< inciter::ctr::FluxType, inciter::ctr::Flux >(
         [ -  + ][ +  - ]
                 [ -  - ]
     246                 :            :       lua_ideck, "flux", gideck.get< tag::flux >(),
     247                 :            :       inciter::ctr::FluxType::UPWIND);
     248 [ +  - ][ +  - ]:        276 :     storeOptIfSpecd< inciter::ctr::PhysicsType, inciter::ctr::Physics >(
         [ -  + ][ -  - ]
     249                 :            :       lua_ideck["transport"], "physics",
     250                 :            :       gideck.get< tag::transport, tag::physics >(),
     251                 :            :       inciter::ctr::PhysicsType::ADVECTION);
     252                 :            : 
     253                 :            :     // store number of equations in PDE system
     254                 :         92 :     gideck.get< tag::ncomp >() =
     255                 :         92 :       gideck.get< tag::transport, tag::ncomp >();
     256                 :            :   }
     257                 :            : 
     258                 :            :   // check compflow
     259         [ +  + ]:        193 :   if (lua_ideck["compflow"].valid()) {
     260                 :            : 
     261 [ +  - ][ +  - ]:        189 :     checkBlock< inciter::ctr::compflowList::Keys >(lua_ideck["compflow"],
         [ -  + ][ -  - ]
     262                 :            :       "compflow");
     263                 :            : 
     264         [ +  - ]:         63 :     gideck.get< tag::pde >() = inciter::ctr::PDEType::COMPFLOW;
     265 [ +  - ][ +  - ]:        189 :     storeOptIfSpecd< inciter::ctr::ProblemType, inciter::ctr::Problem >(
         [ -  + ][ +  - ]
                 [ -  - ]
     266                 :            :       lua_ideck["compflow"], "problem",
     267                 :            :       gideck.get< tag::compflow, tag::problem >(),
     268                 :            :       inciter::ctr::ProblemType::USER_DEFINED);
     269 [ +  - ][ +  - ]:        189 :     storeOptIfSpecd< inciter::ctr::PhysicsType, inciter::ctr::Physics >(
         [ -  + ][ +  - ]
                 [ -  - ]
     270                 :            :       lua_ideck["compflow"], "physics",
     271                 :            :       gideck.get< tag::compflow, tag::physics >(),
     272                 :            :       inciter::ctr::PhysicsType::EULER);
     273                 :            : 
     274                 :            :     // problem parameters for MMS
     275 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "alpha",
         [ -  + ][ +  - ]
                 [ -  - ]
     276                 :            :       gideck.get< tag::compflow, tag::alpha >(), 0.0);
     277 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "beta",
         [ -  + ][ +  - ]
                 [ -  - ]
     278                 :            :       gideck.get< tag::compflow, tag::beta >(), 0.0);
     279 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "betax",
         [ -  + ][ +  - ]
                 [ -  - ]
     280                 :            :       gideck.get< tag::compflow, tag::betax >(), 0.0);
     281 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "betay",
         [ -  + ][ +  - ]
                 [ -  - ]
     282                 :            :       gideck.get< tag::compflow, tag::betay >(), 0.0);
     283 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "betaz",
         [ -  + ][ +  - ]
                 [ -  - ]
     284                 :            :       gideck.get< tag::compflow, tag::betaz >(), 0.0);
     285 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "r0",
         [ -  + ][ +  - ]
                 [ -  - ]
     286                 :            :       gideck.get< tag::compflow, tag::r0 >(), 0.0);
     287 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "p0",
         [ -  + ][ +  - ]
                 [ -  - ]
     288                 :            :       gideck.get< tag::compflow, tag::p0 >(), 0.0);
     289 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "ce",
         [ -  + ][ +  - ]
                 [ -  - ]
     290                 :            :       gideck.get< tag::compflow, tag::ce >(), 0.0);
     291 [ +  - ][ +  - ]:        189 :     storeIfSpecd< tk::real >(lua_ideck["compflow"], "kappa",
         [ -  + ][ -  - ]
     292                 :            :       gideck.get< tag::compflow, tag::kappa >(), 0.0);
     293                 :            : 
     294         [ +  - ]:         63 :     gideck.get< tag::depvar >()[0] = 'a';
     295 [ +  - ][ +  - ]:        189 :     storeOptIfSpecd< inciter::ctr::FluxType, inciter::ctr::Flux >(
         [ -  + ][ -  - ]
     296                 :            :       lua_ideck, "flux", gideck.get< tag::flux >(),
     297                 :            :       inciter::ctr::FluxType::HLLC);
     298                 :            : 
     299                 :            :     // store number of equations in PDE system
     300                 :         63 :     gideck.get< tag::ncomp >() = 5;
     301                 :            :   }
     302                 :            : 
     303                 :            :   // check multimat
     304         [ +  + ]:        193 :   if (lua_ideck["multimat"].valid()) {
     305                 :            : 
     306 [ +  - ][ +  - ]:         96 :     checkBlock< inciter::ctr::multimatList::Keys >(lua_ideck["multimat"],
         [ -  + ][ -  - ]
     307                 :            :       "multimat");
     308                 :            : 
     309         [ +  - ]:         32 :     gideck.get< tag::pde >() = inciter::ctr::PDEType::MULTIMAT;
     310 [ +  - ][ +  - ]:         96 :     storeIfSpecd< std::size_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     311                 :            :       lua_ideck["multimat"], "nmat",
     312                 :            :       gideck.get< tag::multimat, tag::nmat >(), 2);
     313 [ +  - ][ +  - ]:         96 :     storeIfSpecd< uint64_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     314                 :            :       lua_ideck["multimat"], "prelax",
     315                 :            :       gideck.get< tag::multimat, tag::prelax >(), 1);
     316 [ +  - ][ +  - ]:        128 :     storeIfSpecd< tk::real >(
         [ +  - ][ +  - ]
                 [ -  - ]
     317                 :            :       lua_ideck["multimat"], "prelax_timescale",
     318                 :            :       gideck.get< tag::multimat, tag::prelax_timescale >(), 0.25);
     319 [ +  - ][ +  - ]:         96 :     storeIfSpecd< int >(
         [ -  + ][ +  - ]
                 [ -  - ]
     320                 :            :       lua_ideck["multimat"], "intsharp",
     321                 :            :       gideck.get< tag::multimat, tag::intsharp >(), 0);
     322 [ +  - ][ +  - ]:         96 :     storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     323                 :            :       lua_ideck["multimat"], "intsharp_param",
     324                 :            :       gideck.get< tag::multimat, tag::intsharp_param >(), 1.8);
     325 [ +  - ][ +  - ]:         96 :     storeIfSpecd< uint64_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     326                 :            :       lua_ideck["multimat"], "rho0constraint",
     327                 :            :       gideck.get< tag::multimat, tag::rho0constraint >(), 1);
     328 [ +  - ][ +  - ]:         96 :     storeIfSpecd< int >(
         [ -  + ][ +  - ]
                 [ -  - ]
     329                 :            :       lua_ideck["multimat"], "dt_sos_massavg",
     330                 :            :       gideck.get< tag::multimat, tag::dt_sos_massavg >(), 0);
     331 [ +  - ][ +  - ]:         96 :     storeOptIfSpecd< inciter::ctr::ProblemType, inciter::ctr::Problem >(
         [ -  + ][ +  - ]
                 [ -  - ]
     332                 :            :       lua_ideck["multimat"], "problem",
     333                 :            :       gideck.get< tag::multimat, tag::problem >(),
     334                 :            :       inciter::ctr::ProblemType::USER_DEFINED);
     335 [ +  - ][ +  - ]:         96 :     storeOptIfSpecd< inciter::ctr::PhysicsType, inciter::ctr::Physics >(
         [ -  + ][ -  - ]
     336                 :            :       lua_ideck["multimat"], "physics",
     337                 :            :       gideck.get< tag::multimat, tag::physics >(),
     338                 :            :       inciter::ctr::PhysicsType::EULER);
     339         [ +  - ]:         32 :     gideck.get< tag::depvar >()[0] = 'a';
     340 [ +  - ][ +  - ]:         96 :     storeOptIfSpecd< inciter::ctr::FluxType, inciter::ctr::Flux >(
         [ -  + ][ -  - ]
     341                 :            :       lua_ideck, "flux", gideck.get< tag::flux >(),
     342                 :            :       inciter::ctr::FluxType::AUSM);
     343                 :            : 
     344                 :            :     // number of equations in PDE system are determined based on materials
     345                 :            :   }
     346                 :            : 
     347                 :            :   // check multispecies
     348         [ +  + ]:        193 :   if (lua_ideck["multispecies"].valid()) {
     349                 :            : 
     350 [ +  - ][ +  - ]:         18 :     checkBlock< inciter::ctr::multispeciesList::Keys >(lua_ideck["multispecies"],
         [ -  + ][ -  - ]
     351                 :            :       "multispecies");
     352                 :            : 
     353         [ +  - ]:          6 :     gideck.get< tag::pde >() = inciter::ctr::PDEType::MULTISPECIES;
     354 [ +  - ][ +  - ]:         18 :     storeIfSpecd< std::size_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     355                 :            :       lua_ideck["multispecies"], "nspec",
     356                 :            :       gideck.get< tag::multispecies, tag::nspec >(), 1);
     357 [ +  - ][ +  - ]:         18 :     storeOptIfSpecd< inciter::ctr::ProblemType, inciter::ctr::Problem >(
         [ -  + ][ +  - ]
                 [ -  - ]
     358                 :            :       lua_ideck["multispecies"], "problem",
     359                 :            :       gideck.get< tag::multispecies, tag::problem >(),
     360                 :            :       inciter::ctr::ProblemType::USER_DEFINED);
     361 [ +  - ][ +  - ]:         18 :     storeOptIfSpecd< inciter::ctr::PhysicsType, inciter::ctr::Physics >(
         [ -  + ][ -  - ]
     362                 :            :       lua_ideck["multispecies"], "physics",
     363                 :            :       gideck.get< tag::multispecies, tag::physics >(),
     364                 :            :       inciter::ctr::PhysicsType::EULER);
     365         [ +  - ]:          6 :     gideck.get< tag::depvar >()[0] = 'a';
     366 [ +  - ][ +  - ]:         18 :     storeOptIfSpecd< inciter::ctr::FluxType, inciter::ctr::Flux >(
         [ -  + ][ -  - ]
     367                 :            :       lua_ideck, "flux", gideck.get< tag::flux >(),
     368                 :            :       inciter::ctr::FluxType::AUSM);
     369                 :            : 
     370                 :            :     // store number of equations in PDE system
     371                 :            :     // nspec: species mass conservation equations,
     372                 :            :     // 3: momentum equations,
     373                 :            :     // 1: total energy equation.
     374                 :          6 :     gideck.get< tag::ncomp >() =
     375                 :          6 :       gideck.get< tag::multispecies, tag::nspec >() + 3 + 1;
     376                 :            :   }
     377                 :            : 
     378                 :            :   // number of species, for future use
     379                 :            :   std::size_t nspec(1);
     380         [ +  + ]:        193 :   if (gideck.get< tag::pde >() == inciter::ctr::PDEType::MULTISPECIES)
     381                 :          6 :     nspec = gideck.get< tag::multispecies, tag::nspec >();
     382                 :            : 
     383                 :            :   // add depvar to deck::depvars so it can be selected as outvar later
     384                 :        193 :   tk::grm::depvars.insert( gideck.get< tag::depvar >()[0] );
     385                 :            : 
     386                 :            :   // Assemble material blocks
     387                 :            :   // ---------------------------------------------------------------------------
     388                 :            : 
     389                 :            :   // solid counters
     390                 :            :   std::size_t tmat(0), imatcntr(0), mtypei(0), isolcntr(0);
     391                 :            :   bool is_solid(false);
     392                 :            :   std::set< std::size_t > matidset;
     393                 :            : 
     394                 :            :   // material vector
     395 [ +  - ][ +  + ]:        193 :   if (lua_ideck["material"].valid()) {
     396                 :            : 
     397                 :            :     // size material map vectors
     398                 :            :     std::size_t nmat(1);
     399         [ +  + ]:        101 :     if (gideck.get< tag::pde >() == inciter::ctr::PDEType::MULTIMAT)
     400                 :         32 :       nmat = gideck.get< tag::multimat, tag::nmat >();
     401         [ +  - ]:        101 :     gideck.get< tag::matidxmap, tag::eosidx >().resize(nmat);
     402         [ +  - ]:        101 :     gideck.get< tag::matidxmap, tag::matidx >().resize(nmat);
     403         [ +  - ]:        101 :     gideck.get< tag::matidxmap, tag::solidx >().resize(nmat);
     404                 :            : 
     405                 :            :     // size material vector appropriately
     406                 :            :     // size of the material vector is the number of distinct types of materials
     407                 :            :     sol::table sol_mat = lua_ideck["material"];
     408 [ +  - ][ +  - ]:        101 :     gideck.get< tag::material >().resize(sol_mat.size());
     409                 :            :     // species vector size is one, since all species are only of one type for now
     410         [ +  - ]:        101 :     gideck.get< tag::species >().resize(1);
     411                 :            : 
     412                 :            :     // store material properties
     413         [ +  + ]:        202 :     for (std::size_t i=0; i<gideck.get< tag::material >().size(); ++i) {
     414                 :            : 
     415 [ +  - ][ +  - ]:        303 :       checkBlock< inciter::ctr::materialList::Keys >(sol_mat[i+1], "material");
         [ +  - ][ -  + ]
                 [ -  - ]
     416                 :            : 
     417         [ +  - ]:        101 :       auto& mati_deck = gideck.get< tag::material >()[i];
     418                 :            :       // eos
     419 [ +  - ][ +  - ]:        303 :       storeOptIfSpecd< inciter::ctr::MaterialType, inciter::ctr::Material >(
         [ -  + ][ -  - ]
     420                 :            :         sol_mat[i+1], "eos", mati_deck.get< tag::eos >(),
     421                 :            :         inciter::ctr::MaterialType::STIFFENEDGAS);
     422                 :            : 
     423                 :            :       // material ids in this eos (default is for compflow i.e. single mat)
     424 [ +  - ][ +  - ]:        303 :       storeVecIfSpecd< uint64_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     425                 :            :         sol_mat[i+1], "id", mati_deck.get< tag::id >(),
     426         [ +  - ]:        101 :         std::vector< uint64_t >(1,1));
     427                 :            : 
     428                 :            :       // Track total number of materials in multiple material blocks (eos's)
     429                 :        101 :       tmat += mati_deck.get< tag::id >().size();
     430                 :            : 
     431                 :            :       // Check for repeating user specified material ids
     432         [ +  + ]:        254 :       for (auto midx : mati_deck.get< tag::id >()) {
     433                 :            :         if (!matidset.count(midx))
     434                 :            :           matidset.insert(midx);
     435                 :            :         else
     436 [ -  - ][ -  - ]:          0 :           Throw("Repeating material id specified");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     437                 :            :       }
     438                 :            : 
     439         [ +  - ]:        101 :       std::size_t ntype = mati_deck.get< tag::id >().size();
     440                 :            :       // cv
     441 [ +  - ][ +  + ]:        101 :       if (!sol_mat[i+1]["cv"].valid())
     442 [ +  - ][ -  + ]:        150 :         sol_mat[i+1]["cv"] = std::vector< tk::real >(ntype, 717.5);
                 [ -  - ]
     443 [ +  - ][ +  - ]:        303 :       checkStoreMatProp(sol_mat[i+1], "cv", ntype, mati_deck.get< tag::cv >());
         [ -  + ][ -  - ]
     444                 :            : 
     445                 :            :       // reset solid-marker
     446                 :            :       is_solid = false;
     447                 :            : 
     448                 :            :       // Stiffened-gas materials
     449         [ +  + ]:        101 :       if (mati_deck.get< tag::eos >() ==
     450                 :            :         inciter::ctr::MaterialType::STIFFENEDGAS) {
     451                 :            :         // gamma
     452 [ +  - ][ +  - ]:        285 :         checkStoreMatProp(sol_mat[i+1], "gamma", ntype,
         [ -  + ][ +  - ]
                 [ -  - ]
     453                 :            :           mati_deck.get< tag::gamma >());
     454                 :            : 
     455                 :            :         // pstiff
     456 [ +  - ][ +  + ]:         95 :         if (!sol_mat[i+1]["pstiff"].valid())
     457 [ +  - ][ -  + ]:        184 :           sol_mat[i+1]["pstiff"] = std::vector< tk::real >(ntype, 0.0);
                 [ -  - ]
     458 [ +  - ][ +  - ]:        285 :         checkStoreMatProp(sol_mat[i+1], "pstiff", ntype,
         [ -  + ][ +  - ]
                 [ -  - ]
     459                 :            :           mati_deck.get< tag::pstiff >());
     460                 :            : 
     461                 :            :         // mu (dynamic viscosity) and 'viscous' keyword
     462 [ +  - ][ +  - ]:         95 :         if (!sol_mat[i+1]["mu"].valid())
     463 [ +  - ][ -  + ]:        190 :           sol_mat[i+1]["mu"] = std::vector< tk::real >(ntype, 0.0);
                 [ -  - ]
     464                 :          0 :         else gideck.get< tag::multimat, tag::viscous >() = true;
     465 [ +  - ][ +  - ]:        285 :         checkStoreMatProp(sol_mat[i+1], "mu", ntype, mati_deck.get< tag::mu >());
         [ -  + ][ -  - ]
     466                 :            :       }
     467                 :            :       // Small-shear solid materials
     468         [ -  + ]:          6 :       else if (mati_deck.get< tag::eos >() ==
     469                 :            :         inciter::ctr::MaterialType::SMALLSHEARSOLID) {
     470                 :            :         // gamma
     471 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "gamma", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     472                 :            :           mati_deck.get< tag::gamma >());
     473                 :            : 
     474                 :            :         // pstiff
     475 [ -  - ][ -  - ]:          0 :         if (!sol_mat[i+1]["pstiff"].valid())
     476 [ -  - ][ -  - ]:          0 :           sol_mat[i+1]["pstiff"] = std::vector< tk::real >(ntype, 0.0);
                 [ -  - ]
     477 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "pstiff", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     478                 :            :           mati_deck.get< tag::pstiff >());
     479                 :            : 
     480                 :            :         // mu
     481 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "mu", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     482                 :            :           mati_deck.get< tag::mu >());
     483                 :            : 
     484                 :            :         // yield_stress
     485 [ -  - ][ -  - ]:          0 :         if (!sol_mat[i+1]["yield_stress"].valid())
     486                 :            :           sol_mat[i+1]["yield_stress"] =
     487 [ -  - ][ -  - ]:          0 :             std::vector< tk::real >(ntype, 300.0e+06);
                 [ -  - ]
     488 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "yield_stress", ntype,
         [ -  - ][ -  - ]
     489                 :            :           mati_deck.get< tag::yield_stress >());
     490                 :            : 
     491                 :            :         // assign solid
     492                 :            :         is_solid = true;
     493                 :            :       }
     494                 :            :       // Godunov-Romenski aluminum materials
     495         [ -  + ]:          6 :       else if (mati_deck.get< tag::eos >() ==
     496                 :            :         inciter::ctr::MaterialType::GODUNOVROMENSKIALUMINUM) {
     497                 :            :         // gamma
     498 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "gamma", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     499                 :            :           mati_deck.get< tag::gamma >());
     500                 :            : 
     501                 :            :         // mu
     502 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "mu", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     503                 :            :           mati_deck.get< tag::mu >());
     504                 :            : 
     505                 :            :         // yield_stress
     506 [ -  - ][ -  - ]:          0 :         if (!sol_mat[i+1]["yield_stress"].valid())
     507                 :            :           sol_mat[i+1]["yield_stress"] =
     508 [ -  - ][ -  - ]:          0 :             std::vector< tk::real >(ntype, 300.0e+06);
                 [ -  - ]
     509 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "yield_stress", ntype,
         [ -  - ][ -  - ]
     510                 :            :           mati_deck.get< tag::yield_stress >());
     511                 :            : 
     512                 :            :         // assign solid
     513                 :            :         is_solid = true;
     514                 :            :       }
     515                 :            :       // JWL materials
     516         [ -  + ]:          6 :       else if (mati_deck.get< tag::eos >() == inciter::ctr::MaterialType::JWL) {
     517                 :            :         // w_gru
     518 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "w_gru", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     519                 :            :           mati_deck.get< tag::w_gru >());
     520                 :            : 
     521                 :            :         // a_jwl
     522 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "A_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     523                 :            :           mati_deck.get< tag::A_jwl >());
     524                 :            : 
     525                 :            :         // b_jwl
     526 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "B_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     527                 :            :           mati_deck.get< tag::B_jwl >());
     528                 :            : 
     529                 :            :         // R1_jwl
     530 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "R1_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     531                 :            :           mati_deck.get< tag::R1_jwl >());
     532                 :            : 
     533                 :            :         // R2_jwl
     534 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "R2_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     535                 :            :           mati_deck.get< tag::R2_jwl >());
     536                 :            : 
     537                 :            :         // rho0_jwl
     538 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "rho0_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     539                 :            :           mati_deck.get< tag::rho0_jwl >());
     540                 :            : 
     541                 :            :         // de_jwl
     542 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "de_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     543                 :            :           mati_deck.get< tag::de_jwl >());
     544                 :            : 
     545                 :            :         // Pr_jwl
     546 [ -  - ][ -  - ]:          0 :         checkStoreMatProp(sol_mat[i+1], "Pr_jwl", ntype,
         [ -  - ][ -  - ]
                 [ -  - ]
     547                 :            :           mati_deck.get< tag::Pr_jwl >());
     548                 :            : 
     549                 :            :         // rhor_jwl
     550 [ -  - ][ -  - ]:          0 :         if (sol_mat[i+1]["rhor_jwl"].valid()) {
     551 [ -  - ][ -  - ]:          0 :           checkStoreMatProp(sol_mat[i+1], "rhor_jwl", ntype,
         [ -  - ][ -  - ]
     552                 :            :             mati_deck.get< tag::rhor_jwl >());
     553                 :            :         }
     554                 :            :         // Tr_jwl
     555 [ -  - ][ -  - ]:          0 :         else if (sol_mat[i+1]["Tr_jwl"].valid()) {
     556 [ -  - ][ -  - ]:          0 :           checkStoreMatProp(sol_mat[i+1], "Tr_jwl", ntype,
         [ -  - ][ -  - ]
     557                 :            :             mati_deck.get< tag::Tr_jwl >());
     558                 :            :         }
     559                 :            :         else
     560 [ -  - ][ -  - ]:          0 :           Throw("Either reference density or reference temperature must be "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     561                 :            :             "specified for JWL equation of state (EOS).");
     562                 :            :       }
     563                 :            :       // Thermally-perfect gas materials
     564         [ +  - ]:          6 :       else if (mati_deck.get< tag::eos >() ==
     565                 :            :         inciter::ctr::MaterialType::THERMALLYPERFECTGAS) {
     566                 :            : 
     567 [ +  - ][ -  + ]:          6 :         if (!lua_ideck["species"].valid())
                 [ -  - ]
     568 [ -  - ][ -  - ]:          0 :           Throw("Species block must be specified for thermally perfect gas");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     569                 :            :         sol::table sol_spc = lua_ideck["species"];
     570                 :            : 
     571                 :            :         // We have assumed that nmat == 1 always for multi species, and that
     572                 :            :         // all species are of a single type, so that the outer species vector
     573                 :            :         // is of size one
     574                 :          6 :         auto& spci_deck = gideck.get< tag::species >()[0];
     575                 :            : 
     576                 :            :         // species ids (default is for single species)
     577 [ +  - ][ +  - ]:         18 :         storeVecIfSpecd< uint64_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     578                 :            :           sol_spc[i+1], "id", spci_deck.get< tag::id >(),
     579 [ +  - ][ +  - ]:         12 :           std::vector< uint64_t >(1,1));
                 [ -  - ]
     580                 :            : 
     581                 :            :         Assert(nspec == spci_deck.get< tag::id >().size(),
     582                 :            :           "Number of ids in species-block not equal to number of species");
     583                 :            : 
     584                 :            :         // gamma
     585 [ +  - ][ +  - ]:         18 :         checkStoreMatProp(sol_spc[i+1], "gamma", nspec,
         [ -  + ][ +  - ]
                 [ -  - ]
     586                 :            :           spci_deck.get< tag::gamma >());
     587                 :            :         // R
     588 [ +  - ][ +  - ]:         18 :         checkStoreMatProp(sol_spc[i+1], "R", nspec,
         [ -  + ][ +  - ]
                 [ -  - ]
     589                 :            :           spci_deck.get< tag::R >());
     590                 :            :         // cp_coeff
     591 [ +  - ][ +  - ]:         18 :         checkStoreMatPropVecVec(sol_spc[i+1], "cp_coeff", nspec, 3, 8,
         [ -  + ][ +  - ]
                 [ -  - ]
     592                 :            :           spci_deck.get< tag::cp_coeff >());
     593                 :            :         // t_range
     594 [ +  - ][ +  - ]:         18 :         checkStoreMatPropVec(sol_spc[i+1], "t_range", nspec, 4,
         [ -  + ][ +  - ]
                 [ -  - ]
     595                 :            :           spci_deck.get< tag::t_range >());
     596                 :            :         // dH_ref
     597 [ +  - ][ +  - ]:         18 :         checkStoreMatProp(sol_spc[i+1], "dH_ref", nspec,
         [ -  + ][ +  - ]
                 [ -  - ]
     598                 :            :           spci_deck.get< tag::dH_ref >());
     599                 :            :       }
     600                 :            : 
     601                 :            :       // Generate mapping between material index and eos parameter index
     602                 :            :       auto& eosmap = gideck.get< tag::matidxmap, tag::eosidx >();
     603                 :            :       auto& idxmap = gideck.get< tag::matidxmap, tag::matidx >();
     604                 :            :       auto& solidxmap = gideck.get< tag::matidxmap, tag::solidx >();
     605         [ +  + ]:        254 :       for (auto midx : mati_deck.get< tag::id >()) {
     606                 :        153 :         midx -= 1;
     607         [ -  + ]:        153 :         eosmap[midx] = mtypei;
     608                 :        153 :         idxmap[midx] = imatcntr;
     609         [ -  + ]:        153 :         if (is_solid) {
     610                 :            :           // add to solid-counter
     611                 :          0 :           ++isolcntr;
     612                 :          0 :           solidxmap[midx] = isolcntr;
     613                 :            :         }
     614                 :        153 :         ++imatcntr;
     615                 :            :       }
     616                 :            :       // end of materials for this eos, thus reset index counter
     617                 :            :       imatcntr = 0;
     618                 :            :       // increment material-type/eos-type index counter
     619                 :            :       ++mtypei;
     620                 :            :     }
     621                 :            : 
     622                 :            :     // Error checking on material ids
     623                 :            :     // -------------------------------------------------------------------------
     624                 :            : 
     625                 :            :     // Total number of materials
     626         [ -  + ]:        101 :     if (tmat != nmat) 
     627 [ -  - ][ -  - ]:          0 :       Throw("The total number of materials in all the material blocks (" +
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     628                 :            :         std::to_string(tmat) +
     629                 :            :         ") is not equal to the number of materials specified 'nmat'.");
     630                 :            : 
     631                 :            :     // Contiguous and 1-based material ids
     632         [ -  + ]:        101 :     if (*matidset.begin() != 1)
     633 [ -  - ][ -  - ]:          0 :       Throw("Material ids specified in material blocks not one-based. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     634                 :            :         "Material ids must begin with one.");
     635                 :            :     std::size_t icount(1);
     636         [ +  + ]:        254 :     for (auto midx : matidset) {
     637         [ -  + ]:        153 :       if (midx != icount)
     638 [ -  - ][ -  - ]:          0 :         Throw("Material ids specified in material blocks have a gap. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     639                 :            :           "Material ids must be contiguous.");
     640                 :        153 :       ++icount;
     641                 :            :     }
     642                 :            : 
     643                 :            :     // Set up number of PDEs for multimat
     644         [ +  + ]:        101 :     if (gideck.get< tag::pde >() == inciter::ctr::PDEType::MULTIMAT) {
     645                 :         32 :       auto ntot = nmat + nmat + 3 + nmat;
     646                 :            :       // if solid EOS, add components
     647                 :            :       const auto& solidx = gideck.get< tag::matidxmap, tag::solidx >();
     648         [ +  + ]:        116 :       for (std::size_t i=0; i<solidx.size(); ++i) {
     649         [ -  + ]:         84 :         if (solidx[i] > 0)
     650                 :          0 :           ntot += 9;
     651                 :            :       }
     652                 :         32 :       gideck.get< tag::ncomp >() = ntot;
     653                 :            :     }
     654                 :            :   }
     655                 :            : 
     656                 :            :   // Mesh specification block (for overset)
     657                 :            :   // ---------------------------------------------------------------------------
     658 [ +  - ][ +  + ]:        193 :   if (lua_ideck["mesh"].valid()) {
     659                 :            :     const sol::table& lua_mesh = lua_ideck["mesh"];
     660                 :            :     auto& mesh_deck = gideck.get< tag::mesh >();
     661 [ +  - ][ +  - ]:         11 :     mesh_deck.resize(lua_mesh.size());
     662                 :            : 
     663         [ +  + ]:         23 :     for (std::size_t i=0; i<mesh_deck.size(); ++i) {
     664                 :            : 
     665 [ +  - ][ +  - ]:         36 :       checkBlock< inciter::ctr::meshList::Keys >(lua_mesh[i+1], "mesh");
         [ +  - ][ -  + ]
                 [ -  - ]
     666                 :            : 
     667                 :            :       // filename
     668 [ +  - ][ +  - ]:         48 :       storeIfSpecd< std::string >(lua_mesh[i+1], "filename",
         [ +  - ][ -  + ]
         [ -  + ][ -  - ]
     669         [ +  - ]:         12 :         mesh_deck[i].get< tag::filename >(), "");
     670                 :            : 
     671                 :            :       // location
     672 [ +  - ][ +  - ]:         48 :       storeVecIfSpecd< tk::real >(lua_mesh[i+1], "location",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     673         [ +  - ]:         12 :         mesh_deck[i].get< tag::location >(), {0.0, 0.0, 0.0});
     674         [ -  + ]:         12 :       if (mesh_deck[i].get< tag::location >().size() != 3)
     675 [ -  - ][ -  - ]:          0 :         Throw("Mesh location requires 3 coordinates.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     676                 :            : 
     677                 :            :       // orientation
     678 [ +  - ][ +  - ]:         48 :       storeVecIfSpecd< tk::real >(lua_mesh[i+1], "orientation",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     679         [ +  - ]:         12 :         mesh_deck[i].get< tag::orientation >(), {0.0, 0.0, 0.0});
     680         [ -  + ]:         12 :       if (mesh_deck[i].get< tag::orientation >().size() != 3)
     681 [ -  - ][ -  - ]:          0 :         Throw("Mesh orientation requires 3 rotation angles.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     682                 :            : 
     683                 :            :       // mass
     684 [ +  - ][ +  - ]:         36 :       storeIfSpecd< tk::real >(lua_mesh[i+1], "mass",
         [ +  - ][ -  + ]
                 [ -  - ]
     685                 :            :         mesh_deck[i].get< tag::mass >(), 0.0);
     686                 :            : 
     687                 :            :       // Transfer object
     688         [ +  + ]:         12 :       if (i > 0) {
     689 [ +  - ][ -  - ]:          1 :         gideck.get< tag::transfer >().emplace_back( 0, i );
     690                 :            : 
     691                 :            :         // assign depvar
     692                 :          1 :         ++depvar_cnt;
     693         [ +  - ]:          1 :         gideck.get< tag::depvar >().push_back(depvar_cnt);
     694                 :            : 
     695                 :            :         // add depvar to deck::depvars so it can be selected as outvar later
     696                 :            :         tk::grm::depvars.insert(depvar_cnt);
     697                 :            :       }
     698                 :            :     }
     699                 :            :   }
     700                 :            :   else {
     701                 :            :     // TODO: remove double-specification of defaults
     702                 :            :     auto& mesh_deck = gideck.get< tag::mesh >();
     703         [ +  - ]:        182 :     mesh_deck.resize(1);
     704         [ +  - ]:        182 :     mesh_deck[0].get< tag::filename >() =
     705                 :            :       gideck.get< tag::cmd, tag::io, tag::input >();
     706         [ +  - ]:        182 :     mesh_deck[0].get< tag::location >() = {0.0, 0.0, 0.0};
     707         [ +  - ]:        182 :     mesh_deck[0].get< tag::orientation >() = {0.0, 0.0, 0.0};
     708                 :        182 :     mesh_deck[0].get< tag::mass >() = 0.0;
     709                 :            :   }
     710                 :            : 
     711                 :            :   Assert(gideck.get< tag::mesh >().size() == gideck.get< tag::depvar >().size(),
     712                 :            :     "Number of depvar not equal to the number of meshes.");
     713                 :            : 
     714                 :            :   // Rigid body motion block for overset meshes
     715                 :            :   // ---------------------------------------------------------------------------
     716 [ +  - ][ -  + ]:        193 :   if (lua_ideck["rigid_body_motion"].valid()) {
     717                 :            : 
     718                 :            :     Assert(gideck.get< tag::mesh >().size() > 1,
     719                 :            :       "Multiple meshes (overset) needed for rigid body motion.");
     720                 :            : 
     721                 :            :     // check that rigid body mass is provided
     722         [ -  - ]:          0 :     const auto mesh_deck = gideck.get< tag::mesh >();
     723         [ -  - ]:          0 :     for (std::size_t i=1; i<mesh_deck.size(); ++i) {
     724                 :            :       Assert(mesh_deck[i].get< tag::mass >() > 1e-10,
     725                 :            :         "Mass of body required for overset meshes with rigid body motion.");
     726                 :            :     }
     727                 :            : 
     728                 :            :     auto& rbm_deck = gideck.get< tag::rigid_body_motion >();
     729                 :            : 
     730         [ -  - ]:          0 :     rbm_deck.get< tag::rigid_body_movt >() = true;
     731                 :            : 
     732                 :            :     // degrees of freedom
     733 [ -  - ][ -  - ]:          0 :     storeIfSpecd< std::size_t >(
         [ -  - ][ -  - ]
     734                 :            :       lua_ideck["rigid_body_motion"], "rigid_body_dof",
     735                 :            :       rbm_deck.get< tag::rigid_body_dof >(), 3);
     736 [ -  - ][ -  - ]:          0 :     if (rbm_deck.get< tag::rigid_body_dof >() != 3 &&
     737                 :            :       rbm_deck.get< tag::rigid_body_dof >() != 6)
     738 [ -  - ][ -  - ]:          0 :       Throw("Only 3 or 6 rigid body DOFs supported.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     739                 :            : 
     740                 :            :     // symmetry plane
     741 [ -  - ][ -  - ]:          0 :     storeIfSpecd< std::size_t >(
         [ -  - ][ -  - ]
     742                 :            :       lua_ideck["rigid_body_motion"], "symmetry_plane",
     743                 :            :       rbm_deck.get< tag::symmetry_plane >(), 0);
     744         [ -  - ]:          0 :     if (rbm_deck.get< tag::symmetry_plane >() > 3)
     745 [ -  - ][ -  - ]:          0 :       Throw("Rigid body motion symmetry plane must be 1(x), 2(y), or 3(z).");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     746         [ -  - ]:          0 :     if (rbm_deck.get< tag::symmetry_plane >() == 0 &&
     747         [ -  - ]:          0 :       rbm_deck.get< tag::rigid_body_dof >() == 3)
     748 [ -  - ][ -  - ]:          0 :       Throw(
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     749                 :            :         "Rigid body motion symmetry plane must be specified for 3 DOF motion.");
     750                 :            :     // reset to 0-based indexing
     751                 :          0 :     rbm_deck.get< tag::symmetry_plane >() -= 1;
     752                 :            :   }
     753                 :            :   else {
     754                 :            :     // TODO: remove double-specification of defaults
     755                 :            :     auto& rbm_deck = gideck.get< tag::rigid_body_motion >();
     756                 :        193 :     rbm_deck.get< tag::rigid_body_movt >() = false;
     757                 :        193 :     rbm_deck.get< tag::rigid_body_dof >() = 0;
     758                 :        193 :     rbm_deck.get< tag::symmetry_plane >() = 0;
     759                 :            :   }
     760                 :            : 
     761                 :            :   // Field output block
     762                 :            :   // ---------------------------------------------------------------------------
     763 [ +  - ][ +  - ]:        193 :   if (lua_ideck["field_output"].valid()) {
     764                 :            : 
     765 [ +  - ][ +  - ]:        579 :     checkBlock< inciter::ctr::fieldOutputList::Keys >(lua_ideck["field_output"],
         [ -  + ][ +  - ]
                 [ -  - ]
     766                 :            :       "field_output");
     767                 :            : 
     768                 :            :     auto& fo_deck = gideck.get< tag::field_output >();
     769                 :            : 
     770                 :            :     // interval iteration
     771 [ +  - ][ +  - ]:        579 :     storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     772                 :            :       lua_ideck["field_output"], "interval",
     773                 :            :       fo_deck.get< tag::interval >(),
     774                 :            :       std::numeric_limits< uint32_t >::max());
     775                 :            : 
     776                 :            :     // interval physical time
     777 [ +  - ][ +  - ]:        579 :     storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     778                 :            :       lua_ideck["field_output"], "time_interval",
     779                 :            :       fo_deck.get< tag::time_interval >(),
     780                 :            :       std::numeric_limits< tk::real >::max());
     781                 :            : 
     782                 :            :     // interval time range
     783 [ +  - ][ +  - ]:        579 :     storeVecIfSpecd< tk::real >(
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
     784                 :            :       lua_ideck["field_output"], "time_range",
     785                 :            :       fo_deck.get< tag::time_range >(), {});
     786                 :            : 
     787                 :            :     // refined mesh field output
     788 [ +  - ][ +  - ]:        579 :     storeIfSpecd< bool >(
         [ -  + ][ -  - ]
     789                 :            :       lua_ideck["field_output"], "refined", fo_deck.get< tag::refined >(),
     790                 :            :       false);
     791         [ +  - ]:        193 :     gideck.get< tag::cmd, tag::io, tag::refined >() = fo_deck.get< tag::refined >();
     792                 :            : 
     793                 :            :     // filetype
     794 [ +  - ][ +  - ]:        579 :     storeOptIfSpecd< tk::ctr::FieldFileType, tk::ctr::FieldFile >(
         [ -  + ][ +  - ]
                 [ -  - ]
     795                 :            :       lua_ideck["field_output"], "filetype", fo_deck.get< tag::filetype >(),
     796                 :            :       tk::ctr::FieldFileType::EXODUSII);
     797                 :            : 
     798                 :            :     // sidesets for field output
     799 [ +  - ][ +  - ]:        579 :     storeVecIfSpecd< uint64_t >(
         [ -  + ][ -  + ]
         [ +  + ][ -  - ]
     800                 :            :       lua_ideck["field_output"], "sideset", fo_deck.get< tag::sideset >(), {});
     801                 :            : 
     802                 :            :     // Assign outvar
     803                 :            :     auto& foutvar = fo_deck.get< tag::outvar >();
     804                 :            :     std::size_t nevar(0), nnvar(0), tensorcompvar(0);
     805                 :            :     std::size_t nmat(1);
     806         [ +  + ]:        193 :     if (gideck.get< tag::pde >() == inciter::ctr::PDEType::MULTIMAT)
     807                 :         32 :       nmat = gideck.get< tag::multimat, tag::nmat >();
     808                 :            : 
     809                 :            :     // elem aliases
     810                 :        193 :     std::vector< std::string > elemalias;
     811 [ +  - ][ +  + ]:        193 :     if (lua_ideck["field_output"]["elemvar"].valid())
     812         [ +  - ]:        178 :       nevar = sol::table(lua_ideck["field_output"]["elemvar"]).size();
     813 [ +  - ][ +  - ]:        579 :     storeVecIfSpecd< std::string >(
         [ -  + ][ -  - ]
     814                 :            :       lua_ideck["field_output"], "elemalias", elemalias,
     815 [ +  - ][ +  - ]:        386 :       std::vector< std::string >(nevar, ""));
         [ -  + ][ +  - ]
                 [ -  - ]
     816                 :            : 
     817                 :            :     // node aliases
     818                 :        193 :     std::vector< std::string > nodealias;
     819 [ +  - ][ +  + ]:        193 :     if (lua_ideck["field_output"]["nodevar"].valid())
     820         [ +  - ]:         78 :       nnvar = sol::table(lua_ideck["field_output"]["nodevar"]).size();
     821 [ +  - ][ +  - ]:        579 :     storeVecIfSpecd< std::string >(
         [ -  + ][ -  - ]
     822                 :            :       lua_ideck["field_output"], "nodealias", nodealias,
     823 [ +  - ][ +  - ]:        386 :       std::vector< std::string >(nnvar, ""));
         [ -  + ][ -  - ]
     824                 :            : 
     825                 :            :     // error check on aliases
     826         [ -  + ]:        193 :     if (elemalias.size() != nevar)
     827 [ -  - ][ -  - ]:          0 :       Throw("elemalias should have the same size as elemvar.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     828         [ -  + ]:        193 :     if (nodealias.size() != nnvar)
     829 [ -  - ][ -  - ]:          0 :       Throw("nodealias should have the same size as nodevar.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     830                 :            : 
     831                 :            :     // element variables
     832 [ +  - ][ +  + ]:        193 :     if (lua_ideck["field_output"]["elemvar"].valid()) {
     833         [ +  + ]:        510 :       for (std::size_t i=0; i<nevar; ++i) {
     834         [ +  - ]:        421 :         std::string varname(lua_ideck["field_output"]["elemvar"][i+1]);
     835         [ +  - ]:        421 :         std::string alias(elemalias[i]);
     836                 :            :         // add extra outvars for tensor components
     837                 :            :         if (varname.find("_tensor") != std::string::npos) tensorcompvar += 8;
     838         [ +  - ]:        421 :         addOutVar(varname, alias, gideck.get< tag::depvar >(), nmat,
     839                 :            :           nspec, gideck.get< tag::pde >(), tk::Centering::ELEM, foutvar);
     840                 :            :       }
     841                 :            :     }
     842                 :            : 
     843                 :            :     // node variables
     844 [ +  - ][ +  + ]:        193 :     if (lua_ideck["field_output"]["nodevar"].valid()) {
     845         [ +  + ]:        252 :       for (std::size_t i=0; i<nnvar; ++i) {
     846         [ +  - ]:        213 :         std::string varname(lua_ideck["field_output"]["nodevar"][i+1]);
     847         [ +  - ]:        213 :         std::string alias(nodealias[i]);
     848                 :            :         // add extra outvars for tensor components
     849                 :            :         if (varname.find("_tensor") != std::string::npos) tensorcompvar += 8;
     850         [ +  - ]:        213 :         addOutVar(varname, alias, gideck.get< tag::depvar >(), nmat,
     851                 :            :           nspec, gideck.get< tag::pde >(), tk::Centering::NODE, foutvar);
     852                 :            :       }
     853                 :            :     }
     854                 :            : 
     855                 :            :     Assert(foutvar.size() == (nevar + nnvar + tensorcompvar),
     856                 :            :       "Incorrectly sized outvar vector.");
     857                 :            :   }
     858                 :            :   else {
     859                 :            :     // TODO: remove double-specification of defaults
     860                 :            :     auto& fo_deck = gideck.get< tag::field_output >();
     861                 :          0 :     fo_deck.get< tag::interval >() =
     862                 :            :       std::numeric_limits< uint32_t >::max();
     863         [ -  - ]:          0 :     fo_deck.get< tag::time_interval >() =
     864                 :            :       std::numeric_limits< tk::real >::max();
     865                 :            :     fo_deck.get< tag::time_range >() = {};
     866                 :          0 :     fo_deck.get< tag::refined >() = false;
     867         [ -  - ]:          0 :     fo_deck.get< tag::filetype >() = tk::ctr::FieldFileType::EXODUSII;
     868                 :            :     fo_deck.get< tag::sideset >() = {};
     869                 :            :   }
     870                 :            : 
     871                 :            :   // Diagnostics output block
     872                 :            :   // ---------------------------------------------------------------------------
     873 [ +  - ][ +  + ]:        193 :   if (lua_ideck["diagnostics"].valid()) {
     874                 :            : 
     875 [ +  - ][ +  - ]:        312 :     checkBlock< inciter::ctr::diagnosticsList::Keys >(lua_ideck["diagnostics"],
         [ -  + ][ +  - ]
                 [ -  - ]
     876                 :            :       "diagnostics");
     877                 :            : 
     878                 :            :     auto& diag_deck = gideck.get< tag::diagnostics >();
     879                 :            : 
     880                 :            :     // interval iteration
     881 [ +  - ][ +  - ]:        312 :     storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     882                 :            :       lua_ideck["diagnostics"], "interval",
     883                 :            :       diag_deck.get< tag::interval >(), 1);
     884                 :            : 
     885                 :            :     // error norm
     886 [ +  - ][ +  - ]:        312 :     storeOptIfSpecd< tk::ctr::ErrorType, tk::ctr::Error >(
         [ -  + ][ +  - ]
                 [ -  - ]
     887                 :            :       lua_ideck["diagnostics"], "error", diag_deck.get< tag::error >(),
     888                 :            :       tk::ctr::ErrorType::L2);
     889                 :            : 
     890                 :            :     // float format
     891 [ +  - ][ +  - ]:        312 :     storeOptIfSpecd< tk::ctr::TxtFloatFormatType, tk::ctr::TxtFloatFormat >(
         [ -  + ][ -  - ]
     892                 :            :       lua_ideck["diagnostics"], "format", diag_deck.get< tag::format >(),
     893                 :            :       tk::ctr::TxtFloatFormatType::DEFAULT);
     894                 :            : 
     895                 :            :     // precision
     896 [ +  - ][ +  - ]:        312 :     storeIfSpecd< std::streamsize >(
         [ -  + ][ -  - ]
     897                 :            :       lua_ideck["diagnostics"], "precision",
     898                 :            :       diag_deck.get< tag::precision >(), std::cout.precision());
     899                 :            :   }
     900                 :            :   else {
     901                 :            :     // TODO: remove double-specification of defaults
     902                 :            :     auto& diag_deck = gideck.get< tag::diagnostics >();
     903                 :         89 :     diag_deck.get< tag::interval >() = 1;
     904                 :         89 :     diag_deck.get< tag::error >() = tk::ctr::ErrorType::L2;
     905                 :         89 :     diag_deck.get< tag::format >() = tk::ctr::TxtFloatFormatType::DEFAULT;
     906                 :         89 :     diag_deck.get< tag::precision >() = std::cout.precision();
     907                 :            :   }
     908                 :            : 
     909                 :            :   // History output block
     910                 :            :   // ---------------------------------------------------------------------------
     911 [ +  - ][ +  + ]:        193 :   if (lua_ideck["history_output"].valid()) {
     912                 :            : 
     913 [ +  - ][ +  - ]:         12 :     checkBlock< inciter::ctr::historyOutputList::Keys >(
         [ -  + ][ +  - ]
                 [ -  - ]
     914                 :            :       lua_ideck["history_output"], "history_output");
     915                 :            : 
     916                 :            :     auto& hist_deck = gideck.get< tag::history_output >();
     917                 :            : 
     918                 :            :     // interval iteration
     919 [ +  - ][ +  - ]:         12 :     storeIfSpecd< uint32_t >(
         [ -  + ][ +  - ]
                 [ -  - ]
     920                 :            :       lua_ideck["history_output"], "interval",
     921                 :            :       hist_deck.get< tag::interval >(),
     922                 :            :       std::numeric_limits< uint32_t >::max());
     923                 :            : 
     924                 :            :     // interval time
     925 [ +  - ][ +  - ]:         12 :     storeIfSpecd< tk::real >(
         [ -  + ][ +  - ]
                 [ -  - ]
     926                 :            :       lua_ideck["history_output"], "time_interval",
     927                 :            :       hist_deck.get< tag::time_interval >(),
     928                 :            :       std::numeric_limits< tk::real >::max());
     929                 :            : 
     930                 :            :     // interval time range
     931 [ +  - ][ +  - ]:         12 :     storeVecIfSpecd< tk::real >(
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
     932                 :            :       lua_ideck["history_output"], "time_range",
     933                 :            :       hist_deck.get< tag::time_range >(), {});
     934                 :            : 
     935                 :            :     // point probes
     936 [ +  - ][ +  - ]:          4 :     if (lua_ideck["history_output"]["point"].valid()) {
     937                 :            :       const sol::table& sol_pt = lua_ideck["history_output"]["point"];
     938 [ +  - ][ +  - ]:          4 :       hist_deck.get< tag::point >().resize(sol_pt.size());
     939                 :            : 
     940         [ +  + ]:         12 :       for (std::size_t i=0; i<hist_deck.get< tag::point >().size(); ++i) {
     941                 :            :         auto& pti = hist_deck.get< tag::point >()[i];
     942 [ +  - ][ +  - ]:         24 :         storeIfSpecd< std::string >(
         [ +  - ][ -  + ]
         [ -  + ][ +  - ]
                 [ -  - ]
     943         [ +  - ]:          8 :           sol_pt[i+1], "id", pti.get< tag::id >(), "p");
     944 [ +  - ][ +  - ]:         24 :         storeVecIfSpecd< tk::real >(
         [ -  + ][ -  + ]
         [ -  - ][ -  - ]
     945                 :            :           sol_pt[i+1], "coord", pti.get< tag::coord >(), {});
     946                 :            :       }
     947                 :            :     }
     948                 :            : 
     949                 :            :     // float format
     950 [ +  - ][ +  - ]:         12 :     storeOptIfSpecd< tk::ctr::TxtFloatFormatType, tk::ctr::TxtFloatFormat >(
         [ -  + ][ -  - ]
     951                 :            :       lua_ideck["history_output"], "format", hist_deck.get< tag::format >(),
     952                 :            :       tk::ctr::TxtFloatFormatType::DEFAULT);
     953                 :            : 
     954                 :            :     // precision
     955 [ +  - ][ +  - ]:         12 :     storeIfSpecd< std::streamsize >(
         [ -  + ][ -  - ]
     956                 :            :       lua_ideck["history_output"], "precision",
     957                 :            :       hist_deck.get< tag::precision >(), std::cout.precision());
     958                 :            : 
     959                 :            :     // error check point
     960         [ +  + ]:         12 :     for (std::size_t i=0; i<hist_deck.get< tag::point >().size(); ++i) {
     961         [ -  + ]:          8 :       if (hist_deck.get< tag::point >()[i].get< tag::coord >().size() != 3)
     962 [ -  - ][ -  - ]:          0 :       Throw("Three reals required for point coordinates in history_output.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
     963                 :            :     }
     964                 :            :   }
     965                 :            :   else {
     966                 :            :     // TODO: remove double-specification of defaults
     967                 :            :     auto& hist_deck = gideck.get< tag::history_output >();
     968                 :        189 :     hist_deck.get< tag::interval >() =
     969                 :            :       std::numeric_limits< uint32_t >::max();
     970         [ +  - ]:        189 :     hist_deck.get< tag::time_interval >() =
     971                 :            :       std::numeric_limits< tk::real >::max();
     972                 :            :     hist_deck.get< tag::time_range >() = {};
     973         [ +  - ]:        189 :     hist_deck.get< tag::precision >() = std::cout.precision();
     974         [ +  - ]:        189 :     hist_deck.get< tag::point >().resize(0);
     975                 :            :   }
     976                 :            : 
     977                 :            :   // ALE block
     978                 :            :   // ---------------------------------------------------------------------------
     979         [ +  - ]:        193 :   gideck.get< tag::ale, tag::ale >() = false;
     980 [ +  - ][ +  + ]:        193 :   if (lua_ideck["ale"].valid()) {
     981                 :            :     auto& ale_deck = gideck.get< tag::ale >();
     982         [ +  - ]:         10 :     ale_deck.get< tag::ale >() = true;
     983                 :            : 
     984                 :            :     // Mesh velocity smoother
     985                 :            :     storeOptIfSpecd< inciter::ctr::MeshVelocitySmootherType,
     986 [ +  - ][ +  - ]:         30 :       inciter::ctr::MeshVelocitySmoother >(lua_ideck["ale"], "smoother",
         [ -  + ][ +  - ]
                 [ -  - ]
     987                 :            :       ale_deck.get< tag::smoother >(), inciter::ctr::MeshVelocitySmootherType::NONE);
     988                 :            : 
     989                 :            :     // Mesh velocity
     990                 :            :     storeOptIfSpecd< inciter::ctr::MeshVelocityType,
     991 [ +  - ][ +  - ]:         30 :       inciter::ctr::MeshVelocity >(lua_ideck["ale"], "mesh_velocity",
         [ -  + ][ -  - ]
     992                 :            :       ale_deck.get< tag::mesh_velocity >(), inciter::ctr::MeshVelocityType::SINE);
     993                 :            : 
     994                 :            :     // Mesh motion direction
     995 [ +  - ][ +  - ]:         30 :     storeVecIfSpecd< std::size_t >(lua_ideck["ale"], "mesh_motion",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
     996                 :            :       ale_deck.get< tag::mesh_motion >(), { 0, 1, 2 });
     997                 :            : 
     998                 :            :     // Mesh force
     999 [ +  - ][ +  - ]:         40 :     storeVecIfSpecd< tk::real >(lua_ideck["ale"], "meshforce",
         [ +  - ][ -  + ]
         [ +  - ][ +  - ]
                 [ -  - ]
    1000                 :            :       ale_deck.get< tag::meshforce >(), { 0, 0, 0, 0 });
    1001                 :            : 
    1002                 :            :     // Dirichlet
    1003 [ +  - ][ +  - ]:         30 :     storeVecIfSpecd< std::size_t >(lua_ideck["ale"], "dirichlet",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1004                 :            :       ale_deck.get< tag::dirichlet >(), {});
    1005                 :            : 
    1006                 :            :     // Symmetry
    1007 [ +  - ][ +  - ]:         30 :     storeVecIfSpecd< std::size_t >(lua_ideck["ale"], "symmetry",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1008                 :            :       ale_deck.get< tag::symmetry >(), {});
    1009                 :            : 
    1010                 :            :     // Move sidesets with user defined function
    1011 [ +  - ][ +  + ]:         10 :     if (lua_ideck["ale"]["move"].valid()) {
    1012                 :            :       const sol::table& sol_mv = lua_ideck["ale"]["move"];
    1013 [ +  - ][ +  - ]:          2 :       ale_deck.get< tag::move >().resize(sol_mv.size());
    1014                 :            : 
    1015         [ +  + ]:          4 :       for (std::size_t i=0; i<ale_deck.get< tag::move >().size(); ++i) {
    1016                 :            :         auto& mvi = ale_deck.get< tag::move >()[i];
    1017 [ +  - ][ +  - ]:          6 :         storeOptIfSpecd< tk::ctr::UserTableType, tk::ctr::UserTable >(
         [ -  + ][ +  - ]
                 [ -  - ]
    1018         [ +  - ]:          2 :           sol_mv[i+1], "fntype", mvi.get< tag::fntype >(),
    1019                 :            :           tk::ctr::UserTableType::POSITION);
    1020 [ +  - ][ +  - ]:          6 :         storeVecIfSpecd< uint64_t >(
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1021                 :            :           sol_mv[i+1], "sideset", mvi.get< tag::sideset >(), {});
    1022 [ +  - ][ +  - ]:          6 :         storeVecIfSpecd< tk::real >(
         [ -  + ][ -  + ]
         [ -  - ][ -  - ]
    1023                 :            :           sol_mv[i+1], "fn", mvi.get< tag::fn >(), {});
    1024                 :            : 
    1025                 :            :         // error checking on user-def function
    1026         [ +  - ]:          2 :         if (mvi.get< tag::fn >().size() % 4 != 0)
    1027 [ -  - ][ -  - ]:          0 :           Throw("Incomplete user-defined function for ALE sideset movement. An "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1028                 :            :           "R->R^3 function is expected, the number of descrete entries must be "
    1029                 :            :           "divisible by 4: one 'column' for the abscissa, and 3 for the "
    1030                 :            :           "ordinate.");
    1031                 :            :       }
    1032                 :            :     }
    1033                 :            : 
    1034                 :            :     // dv-CFL
    1035 [ +  - ][ +  - ]:         30 :     storeIfSpecd< tk::real >(lua_ideck["ale"], "dvcfl", ale_deck.get< tag::dvcfl >(),
         [ -  + ][ +  - ]
                 [ -  - ]
    1036                 :            :       0.01);
    1037                 :            : 
    1038                 :            :     // Vorticity multiplier
    1039 [ +  - ][ +  - ]:         30 :     storeIfSpecd< tk::real >(lua_ideck["ale"], "vortmult",
         [ -  + ][ +  - ]
                 [ -  - ]
    1040                 :            :       ale_deck.get< tag::vortmult >(), 0.0);
    1041                 :            : 
    1042                 :            :     // Mesh velocity max iterations
    1043 [ +  - ][ +  - ]:         30 :     storeIfSpecd< std::size_t >(lua_ideck["ale"], "maxit",
         [ -  + ][ +  - ]
                 [ -  - ]
    1044                 :            :       ale_deck.get< tag::maxit >(), 5);
    1045                 :            : 
    1046                 :            :     // Mesh velocity max iterations
    1047 [ +  - ][ +  - ]:         30 :     storeIfSpecd< tk::real >(lua_ideck["ale"], "tolerance",
         [ -  + ][ -  - ]
    1048                 :            :       ale_deck.get< tag::tolerance >(), 1e-2);
    1049                 :            :   }
    1050                 :            : 
    1051                 :            :   // AMR block
    1052                 :            :   // ---------------------------------------------------------------------------
    1053                 :        193 :   gideck.get< tag::amr, tag::amr >() = false;
    1054         [ +  - ]:        193 :   gideck.get< tag::amr, tag::maxlevels >() = 2; // this is needed for outref
    1055 [ +  - ][ +  + ]:        193 :   if (lua_ideck["amr"].valid()) {
    1056                 :            :     auto& amr_deck = gideck.get< tag::amr >();
    1057         [ +  - ]:         20 :     amr_deck.get< tag::amr >() = true;
    1058                 :            : 
    1059                 :            :     // Initial refinement toggle
    1060 [ +  - ][ +  - ]:         60 :     storeIfSpecd< bool >(lua_ideck["amr"], "t0ref", amr_deck.get< tag::t0ref >(),
         [ -  + ][ +  - ]
                 [ -  - ]
    1061                 :            :       false);
    1062                 :            : 
    1063                 :            :     // Mesh refinement during time-stepping toggle
    1064 [ +  - ][ +  - ]:         60 :     storeIfSpecd< bool >(lua_ideck["amr"], "dtref", amr_deck.get< tag::dtref >(),
         [ -  + ][ +  - ]
                 [ -  - ]
    1065                 :            :       false);
    1066                 :            : 
    1067                 :            :     // Uniform mesh refinement during time-stepping toggle
    1068 [ +  - ][ +  - ]:         60 :     storeIfSpecd< bool >(lua_ideck["amr"], "dtref_uniform",
         [ -  + ][ +  - ]
                 [ -  - ]
    1069                 :            :       amr_deck.get< tag::dtref_uniform >(), false);
    1070                 :            : 
    1071                 :            :     // Mesh refinement frequency during time-stepping toggle
    1072 [ +  - ][ +  - ]:         60 :     storeIfSpecd< std::size_t >(lua_ideck["amr"], "dtfreq",
         [ -  + ][ +  - ]
                 [ -  - ]
    1073                 :            :       amr_deck.get< tag::dtfreq >(), 3);
    1074                 :            : 
    1075                 :            :     // Maximum AMR levels
    1076 [ +  - ][ +  - ]:         60 :     storeIfSpecd< std::size_t >(lua_ideck["amr"], "maxlevels",
         [ -  + ][ +  - ]
                 [ -  - ]
    1077                 :            :       amr_deck.get< tag::maxlevels >(), 2);
    1078                 :            : 
    1079                 :            :     // Initial AMR steps
    1080 [ +  - ][ +  - ]:         60 :     storeOptVecIfSpecd< inciter::ctr::AMRInitialType, inciter::ctr::AMRInitial >(
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1081                 :            :       lua_ideck["amr"], "initial", amr_deck.get< tag::initial >(), {});
    1082                 :            : 
    1083                 :            :     // Initial AMR coordinate based
    1084 [ +  - ][ +  + ]:         20 :     if (lua_ideck["amr"]["coords"].valid()) {
    1085                 :            :       auto rmax = std::numeric_limits< tk::real >::max() / 100;
    1086                 :            : 
    1087 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "xminus",
         [ -  + ][ +  - ]
                 [ -  - ]
    1088                 :            :         amr_deck.get< tag::coords, tag::xminus >(), rmax);
    1089 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "xplus",
         [ -  + ][ +  - ]
                 [ -  - ]
    1090                 :            :         amr_deck.get< tag::coords, tag::xplus >(), -rmax);
    1091                 :            : 
    1092 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "yminus",
         [ -  + ][ +  - ]
                 [ -  - ]
    1093                 :            :         amr_deck.get< tag::coords, tag::yminus >(), rmax);
    1094 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "yplus",
         [ -  + ][ +  - ]
                 [ -  - ]
    1095                 :            :         amr_deck.get< tag::coords, tag::yplus >(), -rmax);
    1096                 :            : 
    1097 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "zminus",
         [ -  + ][ +  - ]
                 [ -  - ]
    1098                 :            :         amr_deck.get< tag::coords, tag::zminus >(), rmax);
    1099 [ +  - ][ +  - ]:          3 :       storeIfSpecd< tk::real >(lua_ideck["amr"]["coords"], "zplus",
         [ -  + ][ -  - ]
    1100                 :            :         amr_deck.get< tag::coords, tag::zplus >(), -rmax);
    1101                 :            :     }
    1102                 :            : 
    1103                 :            :     // Initial AMR edgelist based
    1104 [ +  - ][ +  - ]:         60 :     storeVecIfSpecd< std::size_t >(lua_ideck["amr"], "edgelist",
         [ -  + ][ -  + ]
                 [ -  - ]
    1105                 :            :       amr_deck.get< tag::edgelist >(), {});
    1106         [ -  + ]:         20 :     if (amr_deck.get< tag::edgelist >().size() % 2 != 0)
    1107 [ -  - ][ -  - ]:          0 :       Throw("The number of edge-nodes, marking edges as pairs of nodes, used "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1108                 :            :         "for explicit tagging of edges for initial mesh refineoment, is odd "
    1109                 :            :         "(it must be even).");
    1110                 :            : 
    1111                 :            :     // Error type for AMR
    1112 [ +  - ][ +  - ]:         60 :     storeOptIfSpecd< inciter::ctr::AMRErrorType, inciter::ctr::AMRError >(
         [ -  + ][ +  - ]
                 [ -  - ]
    1113                 :            :       lua_ideck["amr"], "error", amr_deck.get< tag::error >(),
    1114                 :            :       inciter::ctr::AMRErrorType::JUMP);
    1115                 :            : 
    1116                 :            :     // Tolerances for refine/de-refine
    1117 [ +  - ][ +  - ]:         60 :     storeIfSpecd< tk::real >(lua_ideck["amr"], "tol_refine",
         [ -  + ][ +  - ]
                 [ -  - ]
    1118                 :            :       amr_deck.get< tag::tol_refine >(), 0.2);
    1119 [ +  - ][ +  - ]:         60 :     storeIfSpecd< tk::real >(lua_ideck["amr"], "tol_derefine",
         [ -  + ][ -  - ]
    1120                 :            :       amr_deck.get< tag::tol_derefine >(), 0.05);
    1121                 :            :   }
    1122                 :            : 
    1123                 :            :   // p-refinement block
    1124                 :            :   // ---------------------------------------------------------------------------
    1125         [ +  - ]:        193 :   gideck.get< tag::pref, tag::pref >() = false;
    1126 [ +  - ][ +  + ]:        193 :   if (lua_ideck["pref"].valid()) {
    1127                 :            :     auto& pref_deck = gideck.get< tag::pref >();
    1128         [ +  - ]:         12 :     pref_deck.get< tag::pref >() = true;
    1129                 :            : 
    1130                 :            :     // p-ref indicator type
    1131                 :            :     storeOptIfSpecd< inciter::ctr::PrefIndicatorType,
    1132 [ +  - ][ +  - ]:         36 :       inciter::ctr::PrefIndicator >(lua_ideck["pref"], "indicator",
         [ -  + ][ +  - ]
                 [ -  - ]
    1133                 :            :       pref_deck.get< tag::indicator >(),
    1134                 :            :       inciter::ctr::PrefIndicatorType::SPECTRAL_DECAY);
    1135                 :            : 
    1136                 :            :     // p-ref max degrees-of-freedom per cell
    1137 [ +  - ][ +  - ]:         36 :     storeIfSpecd< std::size_t >(lua_ideck["pref"], "ndofmax",
         [ -  + ][ +  - ]
                 [ -  - ]
    1138                 :            :       pref_deck.get< tag::ndofmax >(), 10);
    1139                 :            : 
    1140                 :            :     // p-ref tolerance
    1141 [ +  - ][ +  - ]:         36 :     storeIfSpecd< tk::real >(lua_ideck["pref"], "tolref",
         [ -  + ][ -  - ]
    1142                 :            :       pref_deck.get< tag::tolref >(), 0.5);
    1143                 :            : 
    1144                 :            :     // error checking on the tolerance
    1145 [ +  - ][ -  + ]:         12 :     if (pref_deck.get< tag::tolref >() < 0.0 || pref_deck.get< tag::tolref >() > 1.0)
    1146 [ -  - ][ -  - ]:          0 :       Throw("The p-refinement tolerance must be a real number "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1147                 :            :         "between 0.0 and 1.0, both inclusive.");
    1148                 :            :   }
    1149                 :            : 
    1150                 :            :   // Boundary conditions block
    1151                 :            :   // ---------------------------------------------------------------------------
    1152 [ +  - ][ +  + ]:        193 :   if (lua_ideck["bc"].valid()) {
    1153                 :            :     std::set< std::size_t > totalmesh;
    1154                 :            :     const sol::table& sol_bc = lua_ideck["bc"];
    1155                 :            :     auto& bc_deck = gideck.get< tag::bc >();
    1156 [ +  - ][ +  - ]:        143 :     bc_deck.resize(sol_bc.size());
    1157                 :            : 
    1158         [ +  + ]:        287 :     for (std::size_t i=0; i<bc_deck.size(); ++i) {
    1159                 :            : 
    1160 [ +  - ][ +  - ]:        432 :       checkBlock< inciter::ctr::bcList::Keys >(sol_bc[i+1], "bc");
         [ +  - ][ -  + ]
                 [ -  - ]
    1161                 :            : 
    1162 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< std::size_t >(sol_bc[i+1], "mesh",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
    1163         [ +  - ]:        144 :         bc_deck[i].get< tag::mesh >(), {1});
    1164                 :            :       // collect meshes for error checking
    1165                 :            :       totalmesh.insert(bc_deck[i].get< tag::mesh >().begin(),
    1166                 :        144 :         bc_deck[i].get< tag::mesh >().end());
    1167                 :            : 
    1168 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "dirichlet",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1169         [ +  - ]:        144 :         bc_deck[i].get< tag::dirichlet >(), {});
    1170                 :            : 
    1171 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "symmetry",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1172         [ +  - ]:        144 :         bc_deck[i].get< tag::symmetry >(), {});
    1173                 :            : 
    1174 [ +  - ][ +  + ]:        144 :       if (sol_bc[i+1]["inlet"].valid()) {
    1175                 :          9 :         const sol::table& sol_inbc = sol_bc[i+1]["inlet"];
    1176         [ +  - ]:          9 :         auto& inbc_deck = bc_deck[i].get< tag::inlet >();
    1177 [ +  - ][ +  - ]:          9 :         inbc_deck.resize(sol_inbc.size());
    1178                 :            : 
    1179         [ +  + ]:         18 :         for (std::size_t j=0; j<inbc_deck.size(); ++j) {
    1180 [ +  - ][ +  - ]:         27 :           storeVecIfSpecd< uint64_t >(sol_inbc[j+1], "sideset",
         [ +  - ][ -  + ]
         [ -  + ][ -  - ]
    1181                 :            :             inbc_deck[j].get< tag::sideset >(), {});
    1182                 :            : 
    1183 [ +  - ][ +  - ]:         27 :           storeVecIfSpecd< tk::real >(sol_inbc[j+1], "velocity",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
                 [ -  - ]
    1184         [ +  - ]:          9 :             inbc_deck[j].get< tag::velocity >(), {0.0, 0.0, 0.0});
    1185         [ -  + ]:          9 :           if (inbc_deck[j].get< tag::velocity >().size() != 3)
    1186 [ -  - ][ -  - ]:          0 :             Throw("Inlet velocity requires 3 components.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1187                 :            : 
    1188 [ +  - ][ +  - ]:         27 :           storeIfSpecd< tk::real >(sol_inbc[j+1], "pressure",
         [ -  + ][ -  - ]
    1189                 :            :             inbc_deck[j].get< tag::pressure >(), 0.0);
    1190                 :            : 
    1191 [ +  - ][ +  - ]:         27 :           storeIfSpecd< tk::real >(sol_inbc[j+1], "temperature",
         [ -  + ][ -  - ]
    1192         [ +  - ]:          9 :             inbc_deck[j].get< tag::temperature >(), 0.0);
    1193                 :            : 
    1194 [ +  - ][ +  - ]:         27 :           storeIfSpecd< std::size_t >(sol_inbc[j+1], "materialid",
         [ -  + ][ -  - ]
    1195         [ +  - ]:          9 :             inbc_deck[j].get< tag::materialid >(), 1);
    1196                 :            :         }
    1197                 :            :       }
    1198                 :            : 
    1199 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "outlet",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1200         [ +  - ]:        144 :         bc_deck[i].get< tag::outlet >(), {});
    1201                 :            : 
    1202 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "farfield",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1203         [ +  - ]:        144 :         bc_deck[i].get< tag::farfield >(), {});
    1204                 :            : 
    1205 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "extrapolate",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1206         [ +  - ]:        144 :         bc_deck[i].get< tag::extrapolate >(), {});
    1207                 :            : 
    1208 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< uint64_t >(sol_bc[i+1], "noslipwall",
         [ -  + ][ -  + ]
         [ +  - ][ -  - ]
    1209         [ +  - ]:        144 :         bc_deck[i].get< tag::noslipwall >(), {});
    1210                 :            : 
    1211                 :            :       // Time-dependent BC
    1212 [ +  - ][ +  + ]:        144 :       if (sol_bc[i+1]["timedep"].valid()) {
    1213                 :          2 :         const sol::table& sol_tdbc = sol_bc[i+1]["timedep"];
    1214         [ +  - ]:          2 :         auto& tdbc_deck = bc_deck[i].get< tag::timedep >();
    1215 [ +  - ][ +  - ]:          2 :         tdbc_deck.resize(sol_tdbc.size());
    1216                 :            : 
    1217         [ +  + ]:          4 :         for (std::size_t j=0; j<tdbc_deck.size(); ++j) {
    1218 [ +  - ][ +  - ]:          6 :           storeVecIfSpecd< uint64_t >(sol_tdbc[j+1], "sideset",
         [ +  - ][ -  + ]
         [ -  + ][ +  - ]
                 [ -  - ]
    1219                 :            :             tdbc_deck[j].get< tag::sideset >(), {});
    1220 [ +  - ][ +  - ]:          6 :           storeVecIfSpecd< tk::real >(sol_tdbc[j+1], "fn",
         [ -  + ][ -  + ]
         [ -  - ][ -  - ]
    1221         [ +  - ]:          2 :             tdbc_deck[j].get< tag::fn >(), {});
    1222                 :            : 
    1223                 :            :           // error checking on user-def function
    1224         [ +  - ]:          2 :           if (tdbc_deck[j].get< tag::fn >().size() % 6 != 0)
    1225 [ -  - ][ -  - ]:          0 :             Throw("Incomplete user-defined function for time-dependent BC. An "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1226                 :            :             "R->R^5 function is expected, the number of descrete entries must "
    1227                 :            :             "be divisible by 6: one 'column' for the abscissa, and 5 for the "
    1228                 :            :             "ordinate.");
    1229                 :            :         }
    1230                 :            :       }
    1231                 :            : 
    1232                 :            :       // Stagnation point
    1233 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< tk::real >(sol_bc[i+1], "stag_point",
         [ -  + ][ -  + ]
                 [ -  - ]
    1234         [ +  - ]:        144 :         bc_deck[i].get< tag::stag_point >(), {});
    1235         [ +  + ]:        144 :       if (!bc_deck[i].get< tag::stag_point >().empty() &&
    1236         [ +  - ]:          1 :         bc_deck[i].get< tag::stag_point >().size() % 3 != 0)
    1237 [ -  - ][ -  - ]:          0 :         Throw("BC stagnation point requires 3 coordinate values for each "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1238                 :            :           "point. Thus, this vector must be divisible by 3.");
    1239                 :            : 
    1240                 :            :       // Stagnation radius
    1241 [ +  - ][ +  - ]:        432 :       storeIfSpecd< tk::real >(sol_bc[i+1], "radius",
         [ -  + ][ -  - ]
    1242                 :            :         bc_deck[i].get< tag::radius >(), 0.0);
    1243                 :            : 
    1244                 :            :       // Velocity for inlet/farfield
    1245 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< tk::real >(sol_bc[i+1], "velocity",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
    1246         [ +  - ]:        144 :         bc_deck[i].get< tag::velocity >(), {0.0, 0.0, 0.0});
    1247         [ -  + ]:        144 :       if (bc_deck[i].get< tag::velocity >().size() != 3)
    1248 [ -  - ][ -  - ]:          0 :         Throw("BC velocity requires 3 components.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1249                 :            : 
    1250                 :            :       // Pressure for inlet/outlet/farfield
    1251 [ +  - ][ +  - ]:        432 :       storeIfSpecd< tk::real >(sol_bc[i+1], "pressure",
         [ -  + ][ -  - ]
    1252                 :            :         bc_deck[i].get< tag::pressure >(), 0.0);
    1253                 :            : 
    1254                 :            :       // Density for inlet/outlet/farfield
    1255 [ +  - ][ +  - ]:        432 :       storeIfSpecd< tk::real >(sol_bc[i+1], "density",
         [ -  + ][ -  - ]
    1256         [ +  - ]:        144 :         bc_deck[i].get< tag::density >(), 0.0);
    1257                 :            : 
    1258                 :            :       // Temperature for inlet/outlet/farfield
    1259 [ +  - ][ +  - ]:        432 :       storeIfSpecd< tk::real >(sol_bc[i+1], "temperature",
         [ -  + ][ -  - ]
    1260         [ +  - ]:        144 :         bc_deck[i].get< tag::temperature >(), 0.0);
    1261                 :            : 
    1262                 :            :       // Mass fractions for inlet/farfield
    1263 [ +  - ][ +  - ]:        432 :       storeVecIfSpecd< tk::real >(sol_bc[i+1], "mass_fractions",
         [ -  + ][ +  - ]
                 [ -  - ]
    1264         [ +  - ]:        144 :         bc_deck[i].get< tag::mass_fractions >(),
    1265 [ +  - ][ -  - ]:        144 :         std::vector< tk::real >(nspec, 1.0/static_cast<tk::real>(nspec)));
    1266         [ -  + ]:        144 :       if (bc_deck[i].get< tag::mass_fractions >().size() != nspec)
    1267 [ -  - ][ -  - ]:          0 :         Throw("BC mass fraction has incorrect number of species. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1268                 :            :           "Expected " + std::to_string(nspec));
    1269                 :            : 
    1270                 :            :       // Material-id for inlet/outlet/farfield
    1271 [ +  - ][ +  - ]:        432 :       storeIfSpecd< std::size_t >(sol_bc[i+1], "materialid",
         [ -  + ][ -  - ]
    1272                 :            :         bc_deck[i].get< tag::materialid >(), 1);
    1273                 :            :     }
    1274                 :            : 
    1275                 :            :     // error checking on number of meshes
    1276         [ -  + ]:        143 :     if (totalmesh.size() != gideck.get< tag::mesh >().size())
    1277 [ -  - ][ -  - ]:          0 :       Throw("Total meshes (" + std::to_string(gideck.get< tag::mesh >().size()) +
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1278                 :            :         ") not equal to the meshes on which BC's are specified (" +
    1279                 :            :         std::to_string(totalmesh.size()));
    1280                 :            : 
    1281                 :            :     // error checking on mesh ids
    1282                 :            :     std::size_t ic(1);
    1283         [ +  + ]:        287 :     for (const auto& im : totalmesh) {
    1284 [ -  + ][ -  - ]:        144 :       if (im != ic) Throw("Non-contiguous mesh ids in BC-mesh");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1285                 :        144 :       ++ic;
    1286                 :            :     }
    1287                 :            :   }
    1288 [ +  + ][ -  + ]:         50 :   else if (gideck.get< tag::scheme >() == inciter::ctr::SchemeType::ALECG ||
    1289                 :            :            gideck.get< tag::scheme >() == inciter::ctr::SchemeType::OversetFE)
    1290         [ +  - ]:         50 :     gideck.get< tag::bc >().resize(1);
    1291                 :            :   // error checking for unspecified BC's
    1292                 :            :   else
    1293 [ -  - ][ -  - ]:          0 :     Throw("No boundary conditions specified in input file.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1294                 :            : 
    1295                 :            :   // Initial condition block
    1296                 :            :   // ---------------------------------------------------------------------------
    1297 [ +  - ][ +  + ]:        193 :   if (lua_ideck["ic"].valid()) {
    1298                 :            :     auto& ic_deck = gideck.get< tag::ic >();
    1299                 :            : 
    1300 [ +  - ][ +  - ]:         45 :     checkBlock< inciter::ctr::icList::Keys >(lua_ideck["ic"], "ic");
         [ -  + ][ +  - ]
                 [ -  - ]
    1301                 :            : 
    1302                 :            :     // background IC values
    1303 [ +  - ][ +  - ]:         45 :     storeIfSpecd< std::size_t >(lua_ideck["ic"], "materialid",
         [ -  + ][ +  - ]
                 [ -  - ]
    1304                 :            :       ic_deck.get< tag::materialid >(), 1);
    1305                 :            : 
    1306 [ +  - ][ +  - ]:         45 :     storeIfSpecd< tk::real >(lua_ideck["ic"], "pressure",
         [ -  + ][ +  - ]
                 [ -  - ]
    1307                 :            :       ic_deck.get< tag::pressure >(), 0.0);
    1308                 :            : 
    1309 [ +  - ][ +  - ]:         45 :     storeIfSpecd< tk::real >(lua_ideck["ic"], "temperature",
         [ -  + ][ -  - ]
    1310                 :            :       ic_deck.get< tag::temperature >(), 0.0);
    1311                 :            : 
    1312 [ +  - ][ +  - ]:         45 :     storeVecIfSpecd< tk::real >(lua_ideck["ic"], "mass_fractions",
         [ -  + ][ +  - ]
                 [ -  - ]
    1313                 :            :       ic_deck.get< tag::mass_fractions >(),
    1314         [ +  - ]:         15 :       std::vector< tk::real >(nspec, 1.0/static_cast<tk::real>(nspec)));
    1315         [ -  + ]:         15 :     if (ic_deck.get< tag::mass_fractions >().size() != nspec)
    1316 [ -  - ][ -  - ]:          0 :       Throw("IC mass fraction has incorrect number of species. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1317                 :            :         "Expected " + std::to_string(nspec));
    1318                 :            : 
    1319 [ +  - ][ +  - ]:         45 :     storeIfSpecd< tk::real >(lua_ideck["ic"], "density",
         [ -  + ][ +  - ]
                 [ -  - ]
    1320                 :            :       ic_deck.get< tag::density >(), 0.0);
    1321                 :            : 
    1322 [ +  - ][ +  - ]:         45 :     storeIfSpecd< tk::real >(lua_ideck["ic"], "energy",
         [ -  + ][ -  - ]
    1323                 :            :       ic_deck.get< tag::energy >(), 0.0);
    1324                 :            : 
    1325 [ +  - ][ +  - ]:         45 :     storeVecIfSpecd< tk::real >(lua_ideck["ic"], "velocity",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
    1326                 :            :       ic_deck.get< tag::velocity >(), {0.0, 0.0, 0.0});
    1327         [ -  + ]:         15 :     if (ic_deck.get< tag::velocity >().size() != 3)
    1328 [ -  - ][ -  - ]:          0 :       Throw("Velocity in IC requires 3 components.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1329                 :            : 
    1330                 :            :     // IC box
    1331 [ +  - ][ +  + ]:         15 :     if (lua_ideck["ic"]["box"].valid()) {
    1332                 :            :       const sol::table& lua_box = lua_ideck["ic"]["box"];
    1333                 :            :       auto& box_deck = ic_deck.get< tag::box >();
    1334 [ +  - ][ +  - ]:          8 :       box_deck.resize(lua_box.size());
    1335                 :            : 
    1336         [ +  + ]:         17 :       for (std::size_t i=0; i<box_deck.size(); ++i) {
    1337                 :            : 
    1338 [ +  - ][ +  - ]:         27 :         checkBlock< inciter::ctr::boxList::Keys >(lua_box[i+1], "box");
         [ +  - ][ -  + ]
                 [ -  - ]
    1339                 :            : 
    1340 [ +  - ][ +  - ]:         27 :         storeIfSpecd< std::size_t >(lua_box[i+1], "materialid",
         [ -  + ][ -  - ]
    1341         [ +  - ]:          9 :           box_deck[i].get< tag::materialid >(), 1);
    1342                 :            : 
    1343 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "volume",
         [ -  + ][ -  - ]
    1344         [ +  - ]:          9 :           box_deck[i].get< tag::volume >(), 0.0);
    1345                 :            : 
    1346 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "mass",
         [ -  + ][ -  - ]
    1347         [ +  - ]:          9 :           box_deck[i].get< tag::mass >(), 0.0);
    1348                 :            : 
    1349 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "density",
         [ -  + ][ -  - ]
    1350         [ +  - ]:          9 :           box_deck[i].get< tag::density >(), 0.0);
    1351                 :            : 
    1352 [ +  - ][ +  - ]:         27 :         storeVecIfSpecd< tk::real >(lua_box[i+1], "velocity",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
    1353         [ +  - ]:          9 :           box_deck[i].get< tag::velocity >(), {0.0, 0.0, 0.0});
    1354         [ -  + ]:          9 :         if (box_deck[i].get< tag::velocity >().size() != 3)
    1355 [ -  - ][ -  - ]:          0 :           Throw("Velocity in IC box requires 3 components.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1356                 :            : 
    1357 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "pressure",
         [ -  + ][ -  - ]
    1358                 :            :           box_deck[i].get< tag::pressure >(), 0.0);
    1359                 :            : 
    1360 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "energy",
         [ -  + ][ -  - ]
    1361         [ +  - ]:          9 :           box_deck[i].get< tag::energy >(), 0.0);
    1362                 :            : 
    1363 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "energy_content",
         [ -  + ][ -  - ]
    1364         [ +  - ]:          9 :           box_deck[i].get< tag::energy_content >(), 0.0);
    1365                 :            : 
    1366 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "temperature",
         [ -  + ][ -  - ]
    1367         [ +  - ]:          9 :           box_deck[i].get< tag::temperature >(), 0.0);
    1368                 :            : 
    1369 [ +  - ][ +  - ]:         27 :         storeVecIfSpecd< tk::real >(lua_box[i+1], "mass_fractions",
         [ -  + ][ +  - ]
                 [ -  - ]
    1370         [ +  - ]:          9 :           box_deck[i].get< tag::mass_fractions >(),
    1371         [ +  - ]:          9 :           std::vector< tk::real >(nspec, 1.0/static_cast<tk::real>(nspec)));
    1372         [ -  + ]:          9 :         if (box_deck[i].get< tag::mass_fractions >().size() != nspec)
    1373 [ -  - ][ -  - ]:          0 :           Throw("IC box mass fraction has incorrect number of species. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1374                 :            :             "Expected " + std::to_string(nspec));
    1375                 :            : 
    1376 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "xmin",
         [ -  + ][ -  - ]
    1377                 :            :           box_deck[i].get< tag::xmin >(), 0.0);
    1378                 :            : 
    1379 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "xmax",
         [ -  + ][ -  - ]
    1380         [ +  - ]:          9 :           box_deck[i].get< tag::xmax >(), 0.0);
    1381                 :            : 
    1382 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "ymin",
         [ -  + ][ -  - ]
    1383         [ +  - ]:          9 :           box_deck[i].get< tag::ymin >(), 0.0);
    1384                 :            : 
    1385 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "ymax",
         [ -  + ][ -  - ]
    1386         [ +  - ]:          9 :           box_deck[i].get< tag::ymax >(), 0.0);
    1387                 :            : 
    1388 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "zmin",
         [ -  + ][ -  - ]
    1389         [ +  - ]:          9 :           box_deck[i].get< tag::zmin >(), 0.0);
    1390                 :            : 
    1391 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "zmax",
         [ -  + ][ -  - ]
    1392         [ +  - ]:          9 :           box_deck[i].get< tag::zmax >(), 0.0);
    1393                 :            : 
    1394 [ +  - ][ +  - ]:         27 :         storeVecIfSpecd< tk::real >(lua_box[i+1], "orientation",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
    1395         [ +  - ]:          9 :           box_deck[i].get< tag::orientation >(), {0.0, 0.0, 0.0});
    1396         [ -  + ]:          9 :         if (box_deck[i].get< tag::orientation >().size() != 3)
    1397 [ -  - ][ -  - ]:          0 :           Throw("Orientation in IC box requires 3 rotation angles.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1398                 :            : 
    1399 [ +  - ][ +  - ]:         27 :         storeOptIfSpecd< inciter::ctr::InitiateType, inciter::ctr::Initiate >(
         [ -  + ][ -  - ]
    1400                 :            :           lua_box[i+1], "initiate", box_deck[i].get< tag::initiate >(),
    1401                 :            :           inciter::ctr::InitiateType::IMPULSE);
    1402                 :            : 
    1403 [ +  - ][ +  - ]:         27 :         storeVecIfSpecd< tk::real >(lua_box[i+1], "point",
         [ +  - ][ -  + ]
         [ +  - ][ -  - ]
                 [ -  - ]
    1404         [ +  - ]:          9 :           box_deck[i].get< tag::point >(), {0.0, 0.0, 0.0});
    1405         [ -  + ]:          9 :         if (box_deck[i].get< tag::point >().size() != 3)
    1406 [ -  - ][ -  - ]:          0 :           Throw("Point in IC box requires 3 coordinates.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1407                 :            : 
    1408 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "init_time",
         [ -  + ][ -  - ]
    1409                 :            :           box_deck[i].get< tag::init_time >(), 0.0);
    1410                 :            : 
    1411 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "front_width",
         [ -  + ][ -  - ]
    1412         [ +  - ]:          9 :           box_deck[i].get< tag::front_width >(), 0.0);
    1413                 :            : 
    1414 [ +  - ][ +  - ]:         27 :         storeIfSpecd< tk::real >(lua_box[i+1], "front_speed",
         [ -  + ][ -  - ]
    1415         [ +  - ]:          9 :           box_deck[i].get< tag::front_speed >(), 0.0);
    1416                 :            :       }
    1417                 :            :     }
    1418                 :            : 
    1419                 :            :     // IC mesh-block
    1420 [ +  - ][ -  + ]:         15 :     if (lua_ideck["ic"]["meshblock"].valid()) {
    1421                 :            :       const sol::table& lua_meshblock = lua_ideck["ic"]["meshblock"];
    1422                 :            :       auto& mblk_deck = ic_deck.get< tag::meshblock >();
    1423 [ -  - ][ -  - ]:          0 :       mblk_deck.resize(lua_meshblock.size());
    1424                 :            : 
    1425         [ -  - ]:          0 :       for (std::size_t i=0; i<mblk_deck.size(); ++i) {
    1426                 :            : 
    1427 [ -  - ][ -  - ]:          0 :         checkBlock< inciter::ctr::meshblockList::Keys >(lua_meshblock[i+1],
         [ -  - ][ -  - ]
                 [ -  - ]
    1428                 :            :           "meshblock");
    1429                 :            : 
    1430 [ -  - ][ -  - ]:          0 :         storeIfSpecd< std::size_t >(lua_meshblock[i+1], "blockid",
         [ -  - ][ -  - ]
    1431         [ -  - ]:          0 :           mblk_deck[i].get< tag::blockid >(), 0);
    1432         [ -  - ]:          0 :         if (mblk_deck[i].get< tag::blockid >() == 0)
    1433 [ -  - ][ -  - ]:          0 :           Throw("Each IC mesh block must specify the mesh block id.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1434                 :            : 
    1435 [ -  - ][ -  - ]:          0 :         storeIfSpecd< std::size_t >(lua_meshblock[i+1], "materialid",
         [ -  - ][ -  - ]
    1436                 :            :           mblk_deck[i].get< tag::materialid >(), 1);
    1437                 :            : 
    1438 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "energy_content",
         [ -  - ][ -  - ]
    1439         [ -  - ]:          0 :           mblk_deck[i].get< tag::energy_content >(), 0.0);
    1440                 :            : 
    1441 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "volume",
         [ -  - ][ -  - ]
    1442         [ -  - ]:          0 :           mblk_deck[i].get< tag::volume >(), 0.0);
    1443         [ -  - ]:          0 :         if (mblk_deck[i].get< tag::energy_content >() > 0.0 &&
    1444         [ -  - ]:          0 :           mblk_deck[i].get< tag::volume >() < 1e-12)
    1445 [ -  - ][ -  - ]:          0 :           Throw("Mesh block volume must be specified, if energy content is "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1446                 :            :             "used to initialize block");
    1447                 :            : 
    1448 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "mass",
         [ -  - ][ -  - ]
    1449                 :            :           mblk_deck[i].get< tag::mass >(), 0.0);
    1450                 :            : 
    1451 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "density",
         [ -  - ][ -  - ]
    1452         [ -  - ]:          0 :           mblk_deck[i].get< tag::density >(), 0.0);
    1453                 :            : 
    1454 [ -  - ][ -  - ]:          0 :         storeVecIfSpecd< tk::real >(lua_meshblock[i+1], "velocity",
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1455         [ -  - ]:          0 :           mblk_deck[i].get< tag::velocity >(), {0.0, 0.0, 0.0});
    1456         [ -  - ]:          0 :         if (mblk_deck[i].get< tag::velocity >().size() != 3)
    1457 [ -  - ][ -  - ]:          0 :           Throw("Velocity in IC meshblock requires 3 components.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1458                 :            : 
    1459 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "pressure",
         [ -  - ][ -  - ]
    1460                 :            :           mblk_deck[i].get< tag::pressure >(), 0.0);
    1461                 :            : 
    1462 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "energy",
         [ -  - ][ -  - ]
    1463         [ -  - ]:          0 :           mblk_deck[i].get< tag::energy >(), 0.0);
    1464                 :            : 
    1465 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "temperature",
         [ -  - ][ -  - ]
    1466         [ -  - ]:          0 :           mblk_deck[i].get< tag::temperature >(), 0.0);
    1467                 :            : 
    1468 [ -  - ][ -  - ]:          0 :         storeVecIfSpecd< tk::real >(lua_meshblock[i+1], "mass_fractions",
         [ -  - ][ -  - ]
                 [ -  - ]
    1469         [ -  - ]:          0 :           mblk_deck[i].get< tag::mass_fractions >(),
    1470         [ -  - ]:          0 :           std::vector< tk::real >(nspec, 1.0/static_cast<tk::real>(nspec)));
    1471         [ -  - ]:          0 :         if (mblk_deck[i].get< tag::mass_fractions >().size() != nspec)
    1472 [ -  - ][ -  - ]:          0 :           Throw("IC meshblock mass fraction has incorrect number of species. "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1473                 :            :             "Expected " + std::to_string(nspec));
    1474                 :            : 
    1475 [ -  - ][ -  - ]:          0 :         storeOptIfSpecd< inciter::ctr::InitiateType, inciter::ctr::Initiate >(
         [ -  - ][ -  - ]
    1476                 :            :           lua_meshblock[i+1], "initiate", mblk_deck[i].get< tag::initiate >(),
    1477                 :            :           inciter::ctr::InitiateType::IMPULSE);
    1478                 :            : 
    1479 [ -  - ][ -  - ]:          0 :         storeVecIfSpecd< tk::real >(lua_meshblock[i+1], "point",
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1480         [ -  - ]:          0 :           mblk_deck[i].get< tag::point >(), {0.0, 0.0, 0.0});
    1481         [ -  - ]:          0 :         if (mblk_deck[i].get< tag::point >().size() != 3)
    1482 [ -  - ][ -  - ]:          0 :           Throw("Point in IC meshblock requires 3 coordinates.");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1483                 :            : 
    1484 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "init_time",
         [ -  - ][ -  - ]
    1485                 :            :           mblk_deck[i].get< tag::init_time >(), 0.0);
    1486                 :            : 
    1487 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "front_width",
         [ -  - ][ -  - ]
    1488         [ -  - ]:          0 :           mblk_deck[i].get< tag::front_width >(), 0.0);
    1489                 :            : 
    1490 [ -  - ][ -  - ]:          0 :         storeIfSpecd< tk::real >(lua_meshblock[i+1], "front_speed",
         [ -  - ][ -  - ]
    1491         [ -  - ]:          0 :           mblk_deck[i].get< tag::front_speed >(), 0.0);
    1492                 :            :       }
    1493                 :            :     }
    1494                 :            :   }
    1495                 :            :   else {
    1496                 :            :     // TODO: remove double-specification of defaults
    1497                 :            :     auto& ic_deck = gideck.get< tag::ic >();
    1498                 :        178 :     ic_deck.get< tag::materialid >() = 1;
    1499                 :        178 :     ic_deck.get< tag::pressure >() = 0.0;
    1500                 :        178 :     ic_deck.get< tag::temperature >() = 1.0;
    1501                 :        178 :     ic_deck.get< tag::density >() = 0.0;
    1502                 :        178 :     ic_deck.get< tag::energy >() = 0.0;
    1503         [ +  - ]:        178 :     ic_deck.get< tag::velocity >() = {0.0, 0.0, 0.0};
    1504                 :            :     ic_deck.get< tag::mass_fractions >() =
    1505         [ +  - ]:        356 :       std::vector< tk::real >(nspec, 1.0/static_cast<tk::real>(nspec));
    1506                 :            :   }
    1507                 :        193 : }
    1508                 :            : 
    1509                 :            : void
    1510                 :        404 : LuaParser::checkStoreMatProp(
    1511                 :            :   const sol::table table,
    1512                 :            :   const std::string key,
    1513                 :            :   std::size_t vecsize,
    1514                 :            :   std::vector< tk::real >& storage )
    1515                 :            : // *****************************************************************************
    1516                 :            : //  Check and store material property into inpudeck storage
    1517                 :            : //! \param[in] table Sol-table which contains said property
    1518                 :            : //! \param[in] key Key for said property in Sol-table
    1519                 :            : //! \param[in] vecsize Number of said property in Sol-table (based on number of
    1520                 :            : //!   materials that are of the same eos type
    1521                 :            : //! \param[in,out] storage Storage space in inputdeck where said property is
    1522                 :            : //!   to be stored
    1523                 :            : // *****************************************************************************
    1524                 :            : {
    1525                 :            :   // check validity of table
    1526 [ +  - ][ -  + ]:        808 :   if (!table[key].valid())
    1527 [ -  - ][ -  - ]:          0 :     Throw("Material property '" + key + "' not specified");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1528 [ +  - ][ -  + ]:        808 :   if (sol::table(table[key]).size() != vecsize)
         [ -  + ][ -  - ]
    1529 [ -  - ][ -  - ]:          0 :     Throw("Incorrect number of '" + key + "'s specified. Expected " +
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1530                 :            :       std::to_string(vecsize));
    1531                 :            : 
    1532                 :            :   // store values from table to inputdeck
    1533 [ +  - ][ -  + ]:        808 :   storeVecIfSpecd< tk::real >(table, key, storage,
         [ +  - ][ -  - ]
                 [ -  - ]
    1534         [ +  - ]:        404 :     std::vector< tk::real >(vecsize, 0.0));
    1535                 :        404 : }
    1536                 :            : 
    1537                 :            : void
    1538                 :          6 : LuaParser::checkStoreMatPropVec(
    1539                 :            :   const sol::table table,
    1540                 :            :   const std::string key,
    1541                 :            :   std::size_t nspec,
    1542                 :            :   std::size_t vecsize,
    1543                 :            :   std::vector<std::vector< tk::real >>& storage )
    1544                 :            : // *****************************************************************************
    1545                 :            : //  Check and store material property vector into inpudeck storage
    1546                 :            : //! \param[in] table Sol-table which contains said property
    1547                 :            : //! \param[in] key Key for said property in Sol-table
    1548                 :            : //! \param[in] nspec Number of species
    1549                 :            : //! \param[in] vecsize Number of said property in Sol-table (based on number of
    1550                 :            : //!   coefficients for the defined species)
    1551                 :            : //! \param[in,out] storage Storage space in inputdeck where said property is
    1552                 :            : //!   to be stored
    1553                 :            : // *****************************************************************************
    1554                 :            : {
    1555                 :            :   // check validity of table
    1556 [ +  - ][ -  + ]:         12 :   if (!table[key].valid())
    1557 [ -  - ][ -  - ]:          0 :     Throw("Material property '" + key + "' not specified");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1558 [ +  - ][ -  + ]:         12 :   if (sol::table(table[key]).size() != nspec)
         [ -  + ][ -  - ]
    1559 [ -  - ][ -  - ]:          0 :     Throw("Incorrect number of '" + key + "' vectors specified. Expected " +
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1560                 :            :       std::to_string(nspec) + " vectors");
    1561                 :            : 
    1562                 :          6 :   storage.resize(nspec);
    1563                 :            : 
    1564                 :            :   const auto& tableentry = table[key];
    1565         [ +  + ]:         15 :   for (std::size_t k=0; k < nspec; k++) {
    1566 [ +  - ][ +  - ]:         27 :     if (sol::table(tableentry[k+1]).size() != vecsize)
         [ -  + ][ +  - ]
                 [ -  - ]
    1567 [ -  - ][ -  - ]:          0 :       Throw("Incorrect number of '" + key + "' entries in vector of species "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1568                 :            :         + std::to_string(k+1) + " specified. Expected " +
    1569                 :            :         std::to_string(vecsize));
    1570                 :            : 
    1571                 :            :     // store values from table to inputdeck
    1572         [ +  + ]:         45 :     for (std::size_t i=0; i<vecsize; ++i)
    1573 [ +  - ][ +  - ]:         72 :       storage[k].push_back(tableentry[k+1][i+1]);
         [ -  + ][ -  + ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1574                 :            :   }
    1575                 :          6 : }
    1576                 :            : 
    1577                 :            : void
    1578                 :          6 : LuaParser::checkStoreMatPropVecVec(
    1579                 :            :   const sol::table table,
    1580                 :            :   const std::string key,
    1581                 :            :   std::size_t nspec,
    1582                 :            :   std::size_t vecsize1,
    1583                 :            :   std::size_t vecsize2,
    1584                 :            :   std::vector<std::vector<std::vector< tk::real >>>& storage )
    1585                 :            : // *****************************************************************************
    1586                 :            : //  Check and store material property vector into inpudeck storage
    1587                 :            : //! \param[in] table Sol-table which contains said property
    1588                 :            : //! \param[in] key Key for said property in Sol-table
    1589                 :            : //! \param[in] nspec Number of species
    1590                 :            : //! \param[in] vecsize1 Outer number of said property in Sol-table (based on
    1591                 :            : //!   number of coefficients for the defined species)
    1592                 :            : //! \param[in] vecsize2 Inner number of said property in Sol-table (based on
    1593                 :            : //!   number of coefficients for the defined species)
    1594                 :            : //! \param[in,out] storage Storage space in inputdeck where said property is
    1595                 :            : //!   to be stored
    1596                 :            : // *****************************************************************************
    1597                 :            : {
    1598                 :            :   // check validity of table
    1599 [ +  - ][ -  + ]:         12 :   if (!table[key].valid())
    1600 [ -  - ][ -  - ]:          0 :     Throw("Material property '" + key + "' not specified");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1601 [ +  - ][ -  + ]:         12 :   if (sol::table(table[key]).size() != nspec)
         [ -  + ][ -  - ]
    1602 [ -  - ][ -  - ]:          0 :     Throw("Incorrect number of '" + key + "' vectors specified. Expected " +
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1603                 :            :       std::to_string(nspec) + " vectors");
    1604                 :            : 
    1605                 :          6 :   storage.resize(nspec);
    1606                 :            : 
    1607                 :            :   const auto& tableentry = table[key];
    1608         [ +  + ]:         15 :   for (std::size_t k=0; k < nspec; k++) {
    1609 [ +  - ][ +  - ]:         27 :     if (sol::table(tableentry[k+1]).size() != vecsize1)
         [ -  + ][ +  - ]
                 [ -  - ]
    1610 [ -  - ][ -  - ]:          0 :       Throw("Incorrect outer number of '" + key + "' entries in vector of species "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1611                 :            :         + std::to_string(k+1) + " specified. Expected " +
    1612                 :            :         std::to_string(vecsize1));
    1613                 :            : 
    1614                 :            :     // store values from table to inputdeck
    1615         [ +  + ]:         36 :     for (std::size_t i=0; i<vecsize1; ++i) {
    1616 [ +  - ][ +  - ]:         81 :       if (sol::table(tableentry[k+1][i+1]).size() != vecsize2)
         [ -  + ][ -  + ]
         [ -  + ][ -  - ]
         [ -  - ][ -  - ]
    1617 [ -  - ][ -  - ]:          0 :         Throw("Incorrect inner number of '" + key + "' entries in vector of species "
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1618                 :            :           + std::to_string(k+1) + " specified. Expected " +
    1619                 :            :           std::to_string(vecsize2));
    1620                 :            :       std::vector< tk::real > temp_storage;
    1621         [ +  + ]:        243 :       for (std::size_t j=0; j<vecsize2; j++)
    1622 [ +  - ][ +  - ]:        432 :         temp_storage.push_back(tableentry[k+1][i+1][j+1]);
         [ -  + ][ -  + ]
         [ -  + ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1623         [ +  - ]:         27 :       storage[k].push_back(temp_storage);
    1624                 :            :     }
    1625                 :            :   }
    1626                 :          6 : }
    1627                 :            : 
    1628                 :            : void
    1629                 :        634 : LuaParser::addOutVar(
    1630                 :            :   const std::string& varname,
    1631                 :            :   const std::string& alias,
    1632                 :            :   std::vector< char >& depv,
    1633                 :            :   std::size_t nmat,
    1634                 :            :   std::size_t nspec,
    1635                 :            :   inciter::ctr::PDEType pde,
    1636                 :            :   tk::Centering c,
    1637                 :            :   std::vector< inciter::ctr::OutVar >& foutvar )
    1638                 :            : // *****************************************************************************
    1639                 :            : //  Check and store field output variables
    1640                 :            : //! \param[in] varname Name of variable requested
    1641                 :            : //! \param[in] alias User specified alias for output
    1642                 :            : //! \param[in] depv List of depvars
    1643                 :            : //! \param[in] nmat Number of materials configured
    1644                 :            : //! \param[in] nspec Number of species configured
    1645                 :            : //! \param[in] pde Type of PDE configured
    1646                 :            : //! \param[in] c Variable centering requested
    1647                 :            : //! \param[in,out] foutvar Input deck storage where output vars are stored
    1648                 :            : // *****************************************************************************
    1649                 :            : {
    1650                 :            :   // index-based quantity specification
    1651                 :            :   // ----------------------------------
    1652         [ +  + ]:        634 :   if (varname.length() == 2) {
    1653                 :         77 :     auto qty = varname.at(0);
    1654 [ +  - ][ -  + ]:        154 :     auto j = std::stoul(std::string{varname.at(1)}) - 1;
    1655                 :            : 
    1656         [ +  + ]:         77 :     if (pde == inciter::ctr::PDEType::MULTIMAT) {
    1657                 :            :     // multimat/matvar quantities
    1658         [ -  + ]:         28 :       if (qty == 'D') {  // density
    1659                 :            :         foutvar.emplace_back(
    1660 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias, inciter::densityIdx(nmat,j)) );
         [ -  - ][ -  - ]
                 [ -  - ]
    1661                 :            :       }
    1662         [ +  - ]:         28 :       else if (qty == 'F') {  // volume fraction
    1663                 :            :         foutvar.emplace_back(
    1664 [ +  - ][ +  - ]:         28 :           inciter::ctr::OutVar(c, varname, alias, inciter::volfracIdx(nmat,j)) );
         [ +  - ][ -  + ]
                 [ -  - ]
    1665                 :            :       }
    1666         [ -  - ]:          0 :       else if (qty == 'M') {  // momentum
    1667                 :            :         foutvar.emplace_back(
    1668 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias, inciter::momentumIdx(nmat,j)) );
         [ -  - ][ -  - ]
                 [ -  - ]
    1669                 :            :       }
    1670         [ -  - ]:          0 :       else if (qty == 'E') {  // specific total energy
    1671                 :            :         foutvar.emplace_back(
    1672 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias, inciter::energyIdx(nmat,j)) );
         [ -  - ][ -  - ]
                 [ -  - ]
    1673                 :            :       }
    1674         [ -  - ]:          0 :       else if (qty == 'U') {  // velocity (primitive)
    1675                 :            :         foutvar.emplace_back(
    1676 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias, inciter::velocityIdx(nmat,j)) );
         [ -  - ][ -  - ]
                 [ -  - ]
    1677                 :            :       }
    1678         [ -  - ]:          0 :       else if (qty == 'P') {  // material pressure (primitive)
    1679                 :            :         foutvar.emplace_back(
    1680 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias, inciter::pressureIdx(nmat,j)) );
         [ -  - ][ -  - ]
                 [ -  - ]
    1681                 :            :       }
    1682                 :            :       else {
    1683                 :            :         // error out if incorrect matvar used
    1684 [ -  - ][ -  - ]:          0 :         Throw("field_output: matvar " + varname + " not found");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1685                 :            :       }
    1686                 :            :     }
    1687         [ +  + ]:         49 :     else if (pde == inciter::ctr::PDEType::MULTISPECIES) {
    1688                 :            :     // multispecies/matvar quantities
    1689         [ +  - ]:         12 :       if (qty == 'D') {  // density
    1690                 :            :         foutvar.emplace_back(
    1691 [ +  - ][ +  - ]:         24 :           inciter::ctr::OutVar(c, varname, alias,
         [ -  + ][ -  - ]
    1692         [ +  - ]:         12 :             inciter::multispecies::densityIdx(nspec,j)) );
    1693                 :            :       }
    1694         [ -  - ]:          0 :       else if (qty == 'M') {  // momentum
    1695                 :            :         foutvar.emplace_back(
    1696 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias,
         [ -  - ][ -  - ]
    1697         [ -  - ]:          0 :             inciter::multispecies::momentumIdx(nspec,j)) );
    1698                 :            :       }
    1699         [ -  - ]:          0 :       else if (qty == 'E') {  // specific total energy
    1700                 :            :         foutvar.emplace_back(
    1701 [ -  - ][ -  - ]:          0 :           inciter::ctr::OutVar(c, varname, alias,
         [ -  - ][ -  - ]
    1702         [ -  - ]:          0 :             inciter::multispecies::energyIdx(nspec,j)) );
    1703                 :            :       }
    1704                 :            :       else {
    1705                 :            :         // error out if incorrect matvar used
    1706 [ -  - ][ -  - ]:          0 :         Throw("field_output: matvar " + varname + " not found");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
    1707                 :            :       }
    1708                 :            :     }
    1709                 :            :     else {
    1710                 :            :     // quantities specified by depvar
    1711         [ +  + ]:         84 :       for (const auto& id : depv)
    1712         [ +  + ]:         47 :         if (std::tolower(qty) == id) {
    1713 [ +  - ][ +  - ]:         37 :           foutvar.emplace_back( inciter::ctr::OutVar(c, varname, alias, j) );
         [ +  - ][ -  + ]
                 [ -  - ]
    1714                 :            :         }
    1715                 :            :     }
    1716                 :            :   }
    1717                 :            :   // analytic quantity specification
    1718                 :            :   // -------------------------------
    1719         [ +  + ]:        557 :   else if (varname.find("analytic") != std::string::npos) {
    1720 [ +  - ][ +  - ]:         58 :     foutvar.emplace_back( inciter::ctr::OutVar(c, varname, alias, 0) );
         [ +  - ][ -  + ]
                 [ -  - ]
    1721                 :            :   }
    1722                 :            :   // name-based tensor quantity specification
    1723                 :            :   // ----------------------------------------
    1724         [ -  + ]:        499 :   else if (varname.find("_tensor") != std::string::npos) {
    1725                 :            :     std::string namet(varname);
    1726                 :            :     // remove the "_tensor" from the varname
    1727         [ -  - ]:          0 :     for (std::size_t i=0; i<7; ++i) namet.pop_back();
    1728                 :            : 
    1729         [ -  - ]:          0 :     for (std::size_t i=1; i<=3; ++i) {
    1730         [ -  - ]:          0 :       for (std::size_t j=1; j<=3; ++j) {
    1731 [ -  - ][ -  - ]:          0 :         std::string tij(namet + std::to_string(i) + std::to_string(j));
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
    1732 [ -  - ][ -  - ]:          0 :         foutvar.emplace_back( inciter::ctr::OutVar(c, tij, alias, 0, tij) );
         [ -  - ][ -  - ]
    1733                 :            :       }
    1734                 :            :     }
    1735                 :            :   }
    1736                 :            :   // name-based quantity specification
    1737                 :            :   // ---------------------------------
    1738                 :            :   else {
    1739         [ +  - ]:        499 :     foutvar.emplace_back( inciter::ctr::OutVar(c, varname, alias, 0, varname) );
    1740                 :            :   }
    1741                 :        634 : }

Generated by: LCOV version 1.14