Nektar++
Loading...
Searching...
No Matches
AdvTraceFluxCFEOp.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: AdvTraceFluxCFEOp.hpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Interface of the inviscid trace flux for the compressible
32// Euler equations.
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#pragma once
37
38#include <SolverCore/TraceFlux/TraceFluxOp.hpp>
39
40namespace Nektar
41{
42
43/**
44 * @brief The compressible Euler equations' inviscid trace flux.
45 *
46 * @details
47 * Holds the operator's registration name, which the generated factory
48 * declarations build their key from, the Create() a solver calls to ask for
49 * the implementation of a given Riemann solver and equation of state, and the
50 * single-shot evaluation below.
51 */
52template <typename TData>
54{
55public:
56 /**
57 * @brief Create the implementation registered for @p solverType.
58 *
59 * @param expansionList Expansion list the operator acts on.
60 * @param components Names of the field components.
61 * @param solverType Riemann solver and equation of state to use,
62 * as the generated registration spells them.
63 * @param execStr Execution space; empty takes the session's.
64 */
65 static std::shared_ptr<AdvTraceFluxCFEOp<TData>> Create(
66 const MultiRegions::ExpListSharedPtr &expansionList,
67 const std::vector<std::string> &components,
68 const std::string &solverType = "", const std::string &execStr = "")
69 {
70 return std::dynamic_pointer_cast<AdvTraceFluxCFEOp<TData>>(
71 SolverCore::TraceFluxOp<TData>::Create(expansionList, components,
72 name + solverType, execStr));
73 }
74
75 /**
76 * @brief Apply the Riemann solve to trace states given directly; for the
77 * unit tests.
78 *
79 * Runs the Riemann solve through the normals @p normals on @p fwd and
80 * @p bwd as supplied, writing @p flux. Unlike Apply() it neither gathers
81 * the states off the field nor scatters the result back, and it takes
82 * the normals it is given rather than the mesh's, which is what the
83 * Riemann unit tests need: a flux for a pair of states and a normal they
84 * chose. The name says who it is for; a solver applies the operator
85 * through Apply().
86 *
87 * @param normals Normals on the trace, one component per coordinate.
88 * @param fwd Forward-side conserved states on the trace.
89 * @param bwd Backward-side conserved states on the trace.
90 * @param flux Flux on the trace, in Cartesian components.
91 */
99
100 static inline const std::string name = "AdvTraceFluxCFE";
101
102protected:
104 const std::vector<std::string> &components)
105 : SolverCore::TraceFluxOp<TData>(expansionList, components)
106 {
107 }
108
109 ~AdvTraceFluxCFEOp() override = default;
110
111 virtual void v_ApplyUnitTest(
116};
117
118} // namespace Nektar
The compressible Euler equations' inviscid trace flux.
void ApplyUnitTest(LibUtilities::Field< TData, FieldState::Phys > &normals, LibUtilities::Field< TData, FieldState::Phys > &fwd, LibUtilities::Field< TData, FieldState::Phys > &bwd, LibUtilities::Field< TData, FieldState::Phys > &flux)
Apply the Riemann solve to trace states given directly; for the unit tests.
static const std::string name
static std::shared_ptr< AdvTraceFluxCFEOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &solverType="", const std::string &execStr="")
Create the implementation registered for solverType.
AdvTraceFluxCFEOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
virtual void v_ApplyUnitTest(LibUtilities::Field< TData, FieldState::Phys > &normals, LibUtilities::Field< TData, FieldState::Phys > &fwd, LibUtilities::Field< TData, FieldState::Phys > &bwd, LibUtilities::Field< TData, FieldState::Phys > &flux)=0
~AdvTraceFluxCFEOp() override=default
A Field represents expansion data to be operated on.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.