MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
DgBcAcousticPerturbCBC< nDim > Class Template Referencefinal

#include <dgcartesianbcacousticperturbcbc.h>

Inheritance diagram for DgBcAcousticPerturbCBC< nDim >:
[legend]
Collaboration diagram for DgBcAcousticPerturbCBC< nDim >:
[legend]

Public Types

using Base = DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >
 
- Public Types inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >
using SysEqn = DgSysEqnAcousticPerturb< nDim >
 
using SolverType = DgCartesianSolver< nDim, SysEqn >
 
using ElementCollector = maia::dg::collector::ElementCollector< nDim, SysEqn >
 
using HElementCollector = maia::dg::collector::HElementCollector< nDim, SysEqn >
 
using SurfaceCollector = maia::dg::collector::SurfaceCollector< nDim, SysEqn >
 

Public Member Functions

 DgBcAcousticPerturbCBC (SolverType &solver_, MInt bcId)
 
MString name () const override
 Returns name of boundary condition. More...
 
void apply (const MFloat time) override
 Apply method to apply boundary condition. More...
 
void applyAtSurface (const MInt surfaceId, const MFloat NotUsed(time))
 
- Public Member Functions inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >
virtual ~DgBoundaryCondition ()
 Destructor must be virtual. More...
 
void init (const MInt begin_, const MInt end_)
 Init method to initialize boundary condition for range of surfaces. More...
 
virtual void apply (const MFloat time)=0
 Apply method to apply boundary condition. More...
 
virtual MString name () const=0
 Returns name of boundary condition. More...
 
 DgBoundaryCondition (SolverType &solver_, MInt bcId)
 Constructor saves arguments to member variables. More...
 
MInt id () const
 Return boundary condition if of this boundary condition. More...
 
MInt begin () const
 Return index of first surface. More...
 
MInt end () const
 Return index of one-past-last surface. More...
 
MInt count () const
 Return number of boundary surfaces. More...
 
virtual MInt noRestartVars () const
 
virtual MInt getLocalNoNodes () const
 Return local number of nodes. More...
 
virtual MString restartVarName (const MInt NotUsed(id)) const
 Return name of restart variable. More...
 
virtual void setRestartVariable (const MInt NotUsed(id), const MFloat *const NotUsed(data))
 Copy restart variable data from pointer to boundary condition class. More...
 
virtual void getRestartVariable (const MInt NotUsed(id), MFloat *const NotUsed(data)) const
 Copy restart variable data from boundary condition class to pointer. More...
 
virtual MInt noBcElements () const
 
virtual MBool hasBcElement (const MInt NotUsed(elementId)) const
 
virtual MInt noCellDataDlb () const
 
virtual MInt cellDataTypeDlb (const MInt NotUsed(dataId)) const
 
virtual MInt cellDataSizeDlb (const MInt NotUsed(dataId), const MInt NotUsed(cellId)) const
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), MFloat *const NotUsed(data)) const
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), MInt *const NotUsed(data)) const
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MInt *const NotUsed(data))
 

Additional Inherited Members

- Protected Member Functions inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >
SolverTypesolver ()
 Return reference to solver. More...
 
SysEqnsysEqn ()
 Return reference to SysEqn object. More...
 
MFloatflux (const MInt i)
 Return pointer to surface flux. More...
 
ElementCollectorelements ()
 Return reference to elements. More...
 
MInt getElementByCellId (const MInt cellId) const
 Return element id corresponding to given cell id. More...
 
HElementCollectorhelements ()
 Return reference to h-elements. More...
 
SurfaceCollectorsurfaces ()
 Return reference to surfaces. More...
 
MBool isMpiSurface (const MInt id_) const
 Return true if surface is a MPI surface. More...
 
MBool needHElementForCell (const MInt cellId)
 Return if h-element is needed for given cell. More...
 
MInt getHElementId (const MInt elementId)
 Return h-element id for an element. More...
 
const DgInterpolationinterpolation (const MInt polyDeg, const MInt noNodes1D) const
 Return interpolation. More...
 
MInt integrationMethod () const
 Return integration method. More...
 
MInt timeIntegrationScheme () const
 Return time integration scheme. More...
 
MInt maxPolyDeg () const
 Return maximum polynomial degree. More...
 
MInt maxNoNodes1D () const
 Return maximum number of nodes. More...
 
MFloat dt () const
 Return current time step size. More...
 
MBool isRestart () const
 Return if a restart is performed. More...
 
void subTimeStepRk (const MFloat dt_, const MInt stage, const MInt totalSize, const MFloat *const rhs, MFloat *const variables, MFloat *const timeIntStorage)
 Access to time integration method. More...
 
void calcVolumeIntegral (const MInt noElements, ElementCollector &elem, F &fluxFct)
 
void resetBuffer (const MInt totalSize, MFloat *const buffer)
 
void applyJacobian (const MInt noElements, ElementCollector &elem)
 
void calcSourceTerms (const MFloat t, const MInt noElements, ElementCollector &elem, F &sourceFct)
 
void calcSurfaceIntegral (const MInt begin_, const MInt end_, ElementCollector &elem, SurfaceCollector &surf, HElementCollector &helem, const MInt noHElements)
 
void calcRegularSurfaceFlux (const MInt begin_, const MInt end_, SurfaceCollector &surf, F &riemannFct)
 

Detailed Description

template<MInt nDim>
class DgBcAcousticPerturbCBC< nDim >

Definition at line 13 of file dgcartesianbcacousticperturbcbc.h.

Member Typedef Documentation

◆ Base

template<MInt nDim>
using DgBcAcousticPerturbCBC< nDim >::Base = DgBoundaryCondition<nDim, DgSysEqnAcousticPerturb<nDim> >

Definition at line 16 of file dgcartesianbcacousticperturbcbc.h.

Constructor & Destructor Documentation

◆ DgBcAcousticPerturbCBC()

template<MInt nDim>
DgBcAcousticPerturbCBC< nDim >::DgBcAcousticPerturbCBC ( SolverType solver_,
MInt  bcId 
)
inline

Definition at line 27 of file dgcartesianbcacousticperturbcbc.h.

27: Base(solver_, bcId) {}
DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > Base

Member Function Documentation

◆ apply()

template<MInt nDim>
void DgBcAcousticPerturbCBC< nDim >::apply ( const MFloat  time)
inlineoverridevirtual

Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 30 of file dgcartesianbcacousticperturbcbc.h.

30 {
32 }
void applyAtSurface(const MInt surfaceId, const MFloat NotUsed(time))
MInt end() const
Return index of one-past-last surface.
void loop(Functor &&fun, Class *object, const IdType begin, const IdType end, Args... args)

◆ applyAtSurface()

template<MInt nDim>
void DgBcAcousticPerturbCBC< nDim >::applyAtSurface ( const MInt  surfaceId,
const MFloat   NotUsedtime 
)

Definition at line 39 of file dgcartesianbcacousticperturbcbc.h.

39 {
40 // Storing the surface-information and define the inner state
41 MFloat* nodeVarsL = &surfaces().nodeVars(surfaceId, 0);
42 MFloat* nodeVarsR = &surfaces().nodeVars(surfaceId, 1);
43 MFloat* stateL = &surfaces().variables(surfaceId, 0);
44 MFloat* stateR = &surfaces().variables(surfaceId, 1);
45 // TODO labels:DG,totest This might not work for all cases
46 MFloat* innerNodeVars = (surfaces().internalSideId(surfaceId) != 1) ? nodeVarsL : nodeVarsR;
47 MFloat* boundaryNodeVars = (surfaces().internalSideId(surfaceId) != 1) ? nodeVarsR : nodeVarsL;
48 MFloat* innerState = (surfaces().nghbrElementIds(surfaceId, 0) == -1) ? stateR : stateL;
49 MFloat* boundaryState = (surfaces().nghbrElementIds(surfaceId, 0) == -1) ? stateL : stateR;
50
51 // Collect data for flux-computation
52 const MInt dirId = surfaces().orientation(surfaceId);
53 const MInt noNodes1D = surfaces().noNodes1D(surfaceId);
54 const MInt noNodesXD = surfaces().noNodesXD(surfaceId);
55 MFloat* f = flux(surfaceId);
56
57 switch(id()) {
58 // CBC OutFlow
59 case 301: {
60 std::fill_n(&boundaryState[0], noNodesXD * Base::SysEqn::noVars(), 0.0);
61 std::fill_n(&boundaryNodeVars[0], noNodesXD * Base::SysEqn::noNodeVars(), 0.0);
62 // Set default node vars of boundary state that are not zero
63 for(MInt i = 0; i < noNodesXD; i++) {
64 MFloat* const nodeVars = &boundaryNodeVars[i * Base::SysEqn::noNodeVars()];
65 // Set default density
66 nodeVars[Base::SysEqn::CV::RHO0] = 1.0;
67 // Set default speed of sound
68 nodeVars[Base::SysEqn::CV::C0] = 1.0;
69 }
70 sysEqn().calcRiemannRoe(nodeVarsL, nodeVarsR, stateL, stateR, noNodes1D, dirId, f);
71 break;
72 }
73
74 // "periodic" extension of domain for 1D test
75 case 304: {
76 sysEqn().calcRiemannRoe(innerNodeVars, innerNodeVars, innerState, innerState, noNodes1D, dirId, f);
77 break;
78 }
79
80 default: {
81 TERMM(1, "Bad boundary condition id for CBC boundary conditions");
82 break;
83 }
84 }
85}
SurfaceCollector & surfaces()
Return reference to surfaces.
MFloat * flux(const MInt i)
Return pointer to surface flux.
void calcRiemannRoe(const MFloat *nodeVarsL, const MFloat *nodeVarsR, const MFloat *stateL, const MFloat *stateR, const MInt noNodes1D, const MInt dirId, MFloat *flux) const
MInt & internalSideId(const MInt srfcId)
Accessor for internal side id.
MInt & noNodes1D(const MInt srfcId)
Accessor for number of nodes 1D.
MFloat & nodeVars(const MInt srfcId, const MInt side)
Accessor for node variables.
MInt & nghbrElementIds(const MInt srfcId, const MInt side)
Accessor for neighbor element ids.
MInt noNodesXD(const MInt srfcId) const
Accessor for number of nodes XD (const version).
MFloat & variables(const MInt srfcId, const MInt side)
Accessor for variables.
MInt & orientation(const MInt srfcId)
Accessor for orientation.
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52

◆ name()

template<MInt nDim>
MString DgBcAcousticPerturbCBC< nDim >::name ( ) const
inlineoverridevirtual

Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 28 of file dgcartesianbcacousticperturbcbc.h.

28{ return "CBC"; }

The documentation for this class was generated from the following file: