Branch data Line data Source code
1 : : // ***************************************************************************** 2 : : /*! 3 : : \file src/PDE/DGPDE.cpp 4 : : \copyright 2012-2015 J. Bakosi, 5 : : 2016-2018 Los Alamos National Security, LLC., 6 : : 2019-2021 Triad National Security, LLC. 7 : : All rights reserved. See the LICENSE file for details. 8 : : \brief Functions common to discontinuous Galerkin PDE types 9 : : \details Functions common to discontinuous Galerkin PDE types. 10 : : */ 11 : : // ***************************************************************************** 12 : : 13 : : #include "DGPDE.hpp" 14 : : namespace inciter { 15 : : 16 : 342 : void ConfigInletBC( BCStateFn& s, 17 : : const tk::StateFn& f, 18 : : const tk::StateFn& gf ) 19 : : // ***************************************************************************** 20 : : // Extract information from input deck on inlet boundary conditions, and append 21 : : // to BC configuration vector 22 : : //! \param[inout] s BC configuration vector 23 : : //! \param[in] f Function to evaluate the left and right solution state at 24 : : //! boundaries 25 : : //! \param[in] gf Function to evaluate the left and right solution gradients 26 : : //! at boundaries 27 : : // ***************************************************************************** 28 : : { 29 : : const auto& bc = g_inputdeck.get< tag::bc >(); 30 : : std::vector< std::size_t > v; 31 [ + + ]: 684 : for (const auto& ib : bc) { 32 : : const auto& in = ib.get< tag::inlet >(); 33 [ + + ]: 342 : if (!in.empty()) { 34 [ + + ]: 66 : for (const auto& bndry : in) { 35 : : const auto& sideset = bndry.get< tag::sideset >(); 36 [ + - ][ + - ]: 33 : v.insert(v.end(), sideset.begin(), sideset.end()); 37 : 33 : s.push_back( { v, f, gf } ); 38 : : } 39 : : } 40 : : } 41 : 342 : } 42 : : 43 : : [[noreturn]] tk::StateFn::result_type 44 : 0 : invalidBC( ncomp_t, const std::vector< EOS >&, 45 : : const std::vector< tk::real >&, tk::real, tk::real, tk::real, 46 : : tk::real, const std::array< tk::real, 3>& ) 47 : : // ***************************************************************************** 48 : : //! State function for invalid/un-configured boundary conditions 49 : : //! \note The function signature must follow tk::StateFn 50 : : // ***************************************************************************** 51 : : { 52 [ - - ][ - - ]: 0 : Throw( "Invalid boundary condition set up in input file or the PDE does not " [ - - ][ - - ] [ - - ][ - - ] 53 : : "support this BC type" ); 54 : : } 55 : : 56 : : } // inciter::