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

#include <dgcartesianbcacousticperturbrbc.h>

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

Classes

struct  Timers
 

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

 DgBcAcousticPerturbRBC (SolverType &solver_, MInt bcId)
 
 ~DgBcAcousticPerturbRBC ()
 
MString name () const override
 Returns name of boundary condition. More...
 
void init () override
 Initialize RBC. More...
 
void initTimers ()
 Initialize all timers and start the class timer. More...
 
void apply (const MFloat time) override
 Apply RBC. More...
 
void applyAtSurface (const MInt surfaceId, const MFloat NotUsed(time))
 Calculate boundary surface flux. More...
 
void calcFlux (const MFloat *nodeVars, const MFloat *q, const MInt noNodes1D, MFloat *flux_) const
 Calculates the physical fluxes in all directions for all integration points in an element. More...
 
void calcRiemann (const MFloat *nodeVarsL, const MFloat *nodeVarsR, const MFloat *stateL, const MFloat *stateR, const MInt noNodes1D, const MInt dirId, MFloat *flux_) const
 Calculates the numerical flux at a surface given two states. More...
 
void calcSource (const MFloat *nodeVars, const MFloat *u, const MInt noNodes1D, const MFloat t, const MFloat *x, MFloat *src) const
 Calculates the source terms of the RBC system. More...
 
MInt noRestartVars () const override
 
MInt getLocalNoNodes () const override
 Return local number of nodes. More...
 
MString restartVarName (const MInt id_) const override
 Return name of restart variable. More...
 
void setRestartVariable (const MInt id_, const MFloat *const data) override
 Copy restart variable data to boundary conditon. More...
 
void getRestartVariable (const MInt id_, MFloat *const data) const override
 Copy restart variable data to pointer. More...
 
MInt noBcElements () const override
 
MBool hasBcElement (const MInt elementId) const override
 Check if there is a boundary condition element associated with the given element. More...
 
MInt noCellDataDlb () const override
 Dynamic load balancing. More...
 
MInt cellDataTypeDlb (const MInt NotUsed(dataId)) const override
 
MInt cellDataSizeDlb (const MInt dataId, const MInt cellId) const override
 Solution data size for given cell and data id. More...
 
void getCellDataDlb (const MInt dataId, MFloat *const data) const override
 
void setCellDataDlb (const MInt dataId, const MFloat *const data) override
 
- 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))
 

Private Types

using ElementCollector = maia::dg::collector::ElementCollector< nDim, SysEqn >
 
using HElementCollector = maia::dg::collector::HElementCollector< nDim, SysEqn >
 
using SurfaceCollector = maia::dg::collector::SurfaceCollector< nDim, SysEqn >
 

Private Member Functions

void calcFlux1D (const MFloat *nodeVars, const MFloat *q, const MInt noNodes1D, const MInt dirId, MFloat *flux_) const
 Calculates the physical fluxes in direction 'dirId' on a surface. More...
 
void calcElementNodeVars ()
 Calculate node variables of rb-elements. More...
 
void calcSurfaceNodeVars ()
 Calculate node variables of rb-surfaces. More...
 
void calcNodeVars (const MFloat *pos, const MFloat *nodeVarsAPE, MFloat *nodeVars)
 Calculate RBC node variables at a given position. More...
 

Private Attributes

ElementCollector m_rbElements
 
std::vector< MIntm_rbElementId
 
std::vector< MIntm_rbSurfaceId
 
std::vector< MIntm_elementId
 
std::vector< MIntm_surfaceId
 
SurfaceCollector m_rbSurfaces
 
std::vector< std::pair< MInt, MInt > > m_addBndrySrfcIds
 
HElementCollector m_hRbElements
 
MFloat ** m_rbSolution = nullptr
 
MInt m_internalDataSize = -1
 
MInt m_rkStage = -1
 
std::array< MFloat, MAX_SPACE_DIMENSIONS > m_rbcReferencePos {}
 
MBool m_isInitialized = false
 
std::array< MInt, Timers::_countm_timers
 

Static Private Attributes

static const constexpr MInt s_noNodeVars = nDim + 2
 

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 DgBcAcousticPerturbRBC< nDim >

Definition at line 14 of file dgcartesianbcacousticperturbrbc.h.

Member Typedef Documentation

◆ Base

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

Definition at line 17 of file dgcartesianbcacousticperturbrbc.h.

◆ ElementCollector

template<MInt nDim>
using DgBcAcousticPerturbRBC< nDim >::ElementCollector = maia::dg::collector::ElementCollector<nDim, SysEqn>
private

Definition at line 120 of file dgcartesianbcacousticperturbrbc.h.

◆ HElementCollector

template<MInt nDim>
using DgBcAcousticPerturbRBC< nDim >::HElementCollector = maia::dg::collector::HElementCollector<nDim, SysEqn>
private

Definition at line 121 of file dgcartesianbcacousticperturbrbc.h.

◆ SurfaceCollector

template<MInt nDim>
using DgBcAcousticPerturbRBC< nDim >::SurfaceCollector = maia::dg::collector::SurfaceCollector<nDim, SysEqn>
private

Definition at line 122 of file dgcartesianbcacousticperturbrbc.h.

Constructor & Destructor Documentation

◆ DgBcAcousticPerturbRBC()

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

Definition at line 49 of file dgcartesianbcacousticperturbrbc.h.

49 : Base(solver_, bcId) {
50 // Create timers
51 // @ansgar TODO labels:DG,TIMERS this creates new timers every time DLB is performed and new RBCs are created
52 initTimers();
53 }
DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > Base
void initTimers()
Initialize all timers and start the class timer.

◆ ~DgBcAcousticPerturbRBC()

template<MInt nDim>
DgBcAcousticPerturbRBC< nDim >::~DgBcAcousticPerturbRBC ( )
inline

Definition at line 54 of file dgcartesianbcacousticperturbrbc.h.

54 {
55 // Free allocated memory
57 // Stop the class timer
58 RECORD_TIMER_STOP(m_timers[Timers::Class]);
59 }
MBool mDeallocate(T *&a)
deallocates the memory previously allocated for element 'a'
Definition: alloc.h:544
std::array< MInt, Timers::_count > m_timers

Member Function Documentation

◆ apply()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::apply ( const MFloat  time)
overridevirtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

0. Initialize:

  • Calculate RBC node variables for rb-elements and rb-surfaces.
  • Copy APE initial condition to rb-elements.

Copy APE surface variables to rb-surfaces.

  1. Prolong RBC solution to boundary surfaces and copy to corresponding rb-surfaces (both sides).
  2. Solve RBC system.
  3. Compute APE boundary surface flux with prolonged RBC solution as outer state.

Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 480 of file dgcartesianbcacousticperturbrbc.h.

480 {
481 using namespace maia::dg::interpolation;
482 TRACE();
483
484 // Nothing to be done if there are no RBC elements
485 if(m_rbElements.size() == 0) {
486 return;
487 }
488
489 RECORD_TIMER_START(m_timers[Timers::Apply]);
490
491 // 0. Initialize node variables and set initial condition if not already done
492 const MInt* const noNodes = &m_rbElements.noNodes1D(0);
493 if(!m_isInitialized) {
494 RECORD_TIMER_START(m_timers[Timers::InitializeVars]);
495
496 // Set initial condition (same as for APE)
497 if(!isRestart()) {
498 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
499 const MInt eId = m_elementId[rbId];
500 const MInt noNodes1D = noNodes[rbId];
501 const MInt noNodesXD = ipow(noNodes1D, nDim);
502 const MInt dataSize = noNodesXD * Base::SysEqn::noVars();
503
504 // Copy element variables to rb-element
505 std::copy_n(&elements().variables(eId), dataSize, &m_rbElements.variables(rbId));
506 }
507 }
508
509 // Copy APE nodeVars to outer state of boundary surfaces
510 for(MInt srfcId = begin(); srfcId < end(); srfcId++) {
511 const MInt noNodes1D = surfaces().noNodes1D(srfcId);
512 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
513 const MInt noNodesXD = noNodes1D * noNodes1D3;
514 const MInt internalSide = surfaces().internalSideId(srfcId);
515 const MInt outerSide = (internalSide + 1) % 2;
516
517 // Copy node vars to outer surface state
518 std::copy_n(&surfaces().nodeVars(srfcId, internalSide),
519 noNodesXD * Base::SysEqn::noNodeVars(),
520 &surfaces().nodeVars(srfcId, outerSide));
521 }
522
523 // Also copy APE node vars to outer state of additional boundary surfaces
524 const MInt noAddBcIds = m_addBndrySrfcIds.size();
525 for(MInt sId = 0; sId < noAddBcIds; sId++) {
526 const MInt rbSrfcId = m_addBndrySrfcIds[sId].first;
527 const MInt srfcId = m_surfaceId[rbSrfcId];
528
529 const MInt noNodes1D = surfaces().noNodes1D(srfcId);
530 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
531 const MInt noNodesXD = noNodes1D * noNodes1D3;
532 const MInt internalSide = surfaces().internalSideId(srfcId);
533 const MInt outerSide = (internalSide + 1) % 2;
534
535 // Copy node vars to outer surface state
536 std::copy_n(&surfaces().nodeVars(srfcId, internalSide),
537 noNodesXD * Base::SysEqn::noNodeVars(),
538 &surfaces().nodeVars(srfcId, outerSide));
539 }
540
541 // Calculate RBC node variables
544
545 // Set initial Runge Kutta stage
546 m_rkStage = 0;
547
548 m_isInitialized = true;
549
550 RECORD_TIMER_STOP(m_timers[Timers::InitializeVars]);
551 }
552
553 // 1. Copy surface variables to rb-surfaces for surface flux computation
554 // For boundary surfaces: variables are later overwritten with prolonged
555 // rb-solutions
556 RECORD_TIMER_START(m_timers[Timers::CopySurfaceVars]);
557
558 for(MInt rbSId = 0; rbSId < m_rbSurfaces.size(); rbSId++) {
559 const MInt sId = m_surfaceId[rbSId];
560
561 const MInt noNodesXD = ipow(maxNoNodes1D(), nDim - 1);
562 const MInt dataSize = noNodesXD * Base::SysEqn::noVars();
563
564 std::copy_n(&surfaces().variables(sId, 0), dataSize, &m_rbSurfaces.variables(rbSId, 0));
565 std::copy_n(&surfaces().variables(sId, 1), dataSize, &m_rbSurfaces.variables(rbSId, 1));
566 }
567
568 RECORD_TIMER_STOP(m_timers[Timers::CopySurfaceVars]);
569
570 // 2.1 Prolong RBC solution to boundary surfaces
571 RECORD_TIMER_START(m_timers[Timers::Prolong]);
572
573 for(MInt srfcId = begin(); srfcId < end(); srfcId++) {
574 // Get corresponding rb-element id for boundary surface
575 const MInt rbId = m_rbElementId[srfcId - begin()];
576
577 const MInt polyDeg = m_rbElements.polyDeg(rbId);
578 const MInt noNodes1D = m_rbElements.noNodes1D(rbId);
579 const MInt orientation = surfaces().orientation(srfcId);
580 const MInt internalSide = surfaces().internalSideId(srfcId);
581 const MInt outerSide = (internalSide + 1) % 2;
582 const MInt dir = 2 * orientation + outerSide;
583
584 // Prolong to outer state of boundary surface
585 MFloat* src = &m_rbElements.variables(rbId);
586 MFloat* dest = &surfaces().variables(srfcId, outerSide);
587
589 prolongToFaceGauss<nDim, Base::SysEqn::noVars()>(src, dir, noNodes1D,
590 &interpolation(polyDeg, noNodes1D).m_LFace[0][0],
591 &interpolation(polyDeg, noNodes1D).m_LFace[1][0], dest);
593 prolongToFaceGaussLobatto<nDim, Base::SysEqn::noVars()>(src, dir, noNodes1D, dest);
594 }
595
596 const MInt rbSId = m_rbSurfaceId[srfcId - begin()];
597 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
598 const MInt noNodesXD = noNodes1D * noNodes1D3;
599 const MInt dataSize = noNodesXD * Base::SysEqn::noVars();
600
601 // Copy prolonged rbc solution to rb boundary surfaces
602 std::copy_n(dest, dataSize, &m_rbSurfaces.variables(rbSId, 0));
603 std::copy_n(dest, dataSize, &m_rbSurfaces.variables(rbSId, 1));
604 }
605
606 // 2.2 Prolong RBC solution to additional boundary surfaces
607 const MInt noAddBcIds = m_addBndrySrfcIds.size();
608 for(MInt srfcId = 0; srfcId < noAddBcIds; srfcId++) {
609 const MInt rbSrfcId = m_addBndrySrfcIds[srfcId].first;
610 const MInt rbId = m_addBndrySrfcIds[srfcId].second;
611
612 const MInt polyDeg = m_rbElements.polyDeg(rbId);
613 const MInt noNodes1D = m_rbElements.noNodes1D(rbId);
614 const MInt orientation = m_rbSurfaces.orientation(rbSrfcId);
615 const MInt internalSide = m_rbSurfaces.internalSideId(rbSrfcId);
616 const MInt outerSide = (internalSide + 1) % 2;
617 const MInt dir = 2 * orientation + outerSide;
618
619 // Prolong to left state of boundary surface
620 MFloat* src = &m_rbElements.variables(rbId);
621 MFloat* dest = &m_rbSurfaces.variables(rbSrfcId, 0);
622
624 prolongToFaceGauss<nDim, Base::SysEqn::noVars()>(src, dir, noNodes1D,
625 &interpolation(polyDeg, noNodes1D).m_LFace[0][0],
626 &interpolation(polyDeg, noNodes1D).m_LFace[1][0], dest);
628 prolongToFaceGaussLobatto<nDim, Base::SysEqn::noVars()>(src, dir, noNodes1D, dest);
629 }
630
631 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
632 const MInt dataSize = noNodes1D * noNodes1D3 * Base::SysEqn::noVars();
633
634 // Copy prolonged left state to right state
635 std::copy_n(&m_rbSurfaces.variables(rbSrfcId, 0), dataSize, &m_rbSurfaces.variables(rbSrfcId, 1));
636 }
637
638 RECORD_TIMER_STOP(m_timers[Timers::Prolong]);
639
640 // 3. Solve RBC system
641 RECORD_TIMER_START(m_timers[Timers::TimeDeriv]);
642
643 // Reset rbc-rhs
645
646 // Store rbc-solution and copy element variables to rb-elements for flux
647 // computation
648 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
649 const MInt eId = m_elementId[rbId];
650 const MInt noNodes1D = noNodes[rbId];
651 const MInt noNodesXD = ipow(noNodes1D, nDim);
652 const MInt dataSize = noNodesXD * Base::SysEqn::noVars();
653
654 // Store rb-element variables in m_rbSolution
655 std::copy_n(&m_rbElements.variables(rbId), dataSize, m_rbSolution[rbId]);
656
657 // Copy element variables to rb-element
658 std::copy_n(&elements().variables(eId), dataSize, &m_rbElements.variables(rbId));
659 }
660
661 // Calculate volume integral (with APE variables)
663
664 // Calculate surface fluxes
665 // Inner fluxes are computed with the APE variables on the surfaces
666 // Boundary fluxes use the prolonged rbc solutions for both the left and right
667 // state
669
670 // Calculate surface integral
672
673 // Apply jacobian
675
676 // Calculate source terms
678
679 // Copy rbc-solutions back to rb-elements for time integration
680 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
681 const MInt noNodes1D = noNodes[rbId];
682 const MInt noNodesXD = ipow(noNodes1D, nDim);
683 const MInt dataSize = noNodesXD * Base::SysEqn::noVars();
684
685 std::copy_n(m_rbSolution[rbId], dataSize, &m_rbElements.variables(rbId));
686 }
687
688 RECORD_TIMER_STOP(m_timers[Timers::TimeDeriv]);
689
690 // Perform rk substep
691 RECORD_TIMER_START(m_timers[Timers::RungeKuttaStep]);
694
695 // Define the number of Rk-steps according to the Scheme being used
697 m_rkStage = (m_rkStage + 1) % 5;
699 m_rkStage = (m_rkStage + 1) % 8;
701 m_rkStage = (m_rkStage + 1) % 14;
703 m_rkStage = (m_rkStage + 1) % 13;
705 m_rkStage = (m_rkStage + 1) % 7;
707 m_rkStage = (m_rkStage + 1) % 8;
708 }
709
710 RECORD_TIMER_STOP(m_timers[Timers::RungeKuttaStep]);
711
712 // 4. Apply boundary condition
713 RECORD_TIMER_START(m_timers[Timers::ApplyAtSurface]);
715 RECORD_TIMER_STOP(m_timers[Timers::ApplyAtSurface]);
716
717 RECORD_TIMER_STOP(m_timers[Timers::Apply]);
718}
void applyAtSurface(const MInt surfaceId, const MFloat NotUsed(time))
Calculate boundary surface flux.
void calcSurfaceNodeVars()
Calculate node variables of rb-surfaces.
void calcElementNodeVars()
Calculate node variables of rb-elements.
std::vector< std::pair< MInt, MInt > > m_addBndrySrfcIds
const DgInterpolation & interpolation(const MInt polyDeg, const MInt noNodes1D) const
Return interpolation.
void calcSourceTerms(const MFloat t, const MInt noElements, ElementCollector &elem, F &sourceFct)
SurfaceCollector & surfaces()
Return reference to surfaces.
ElementCollector & elements()
Return reference to elements.
void calcSurfaceIntegral(const MInt begin_, const MInt end_, ElementCollector &elem, SurfaceCollector &surf, HElementCollector &helem, const MInt noHElements)
void applyJacobian(const MInt noElements, ElementCollector &elem)
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.
void calcVolumeIntegral(const MInt noElements, ElementCollector &elem, F &fluxFct)
void resetBuffer(const MInt totalSize, MFloat *const buffer)
MInt end() const
Return index of one-past-last surface.
void calcRegularSurfaceFlux(const MInt begin_, const MInt end_, SurfaceCollector &surf, F &riemannFct)
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Definition: container.h:89
MInt & polyDeg(const MInt id)
Accessor for polynomial degree.
MFloat & variables(const MInt id, const MInt pos)
Accessor for variables.
MFloat & timeIntStorage(const MInt id)
Accessor for storage variables.
MFloat & rightHandSide(const MInt id)
Accessor for right hand side.
MInt noNodes1D(const MInt id) const
Accessor for number of nodes 1D (const version).
MInt & internalSideId(const MInt srfcId)
Accessor for internal side id.
MInt & noNodes1D(const MInt srfcId)
Accessor for number of nodes 1D.
MFloat & variables(const MInt srfcId, const MInt side)
Accessor for variables.
MInt & orientation(const MInt srfcId)
Accessor for orientation.
@ DG_INTEGRATE_GAUSS
Definition: enums.h:313
@ DG_INTEGRATE_GAUSS_LOBATTO
Definition: enums.h:313
@ DG_TIMEINTEGRATION_CARPENTER_4_5
Definition: enums.h:321
@ DG_TIMEINTEGRATION_TOULORGEC_3_7
Definition: enums.h:325
@ DG_TIMEINTEGRATION_TOULORGEC_4_8
Definition: enums.h:322
@ DG_TIMEINTEGRATION_TOULORGEF_4_8
Definition: enums.h:326
@ DG_TIMEINTEGRATION_NIEGEMANN_4_13
Definition: enums.h:324
@ DG_TIMEINTEGRATION_NIEGEMANN_4_14
Definition: enums.h:323
MInt ipow(MInt base, MInt exp)
Integer exponent function for non-negative exponents.
Definition: functions.h:317
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
void loop(Functor &&fun, Class *object, const IdType begin, const IdType end, Args... args)
Holds helper functions for the interpolation.

◆ applyAtSurface()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::applyAtSurface ( const MInt  surfaceId,
const MFloat   NotUsedtime 
)
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

Definition at line 726 of file dgcartesianbcacousticperturbrbc.h.

726 {
727 // TRACE();
728
729 MFloat* nodeVarsL = &surfaces().nodeVars(surfaceId, 0);
730 MFloat* nodeVarsR = &surfaces().nodeVars(surfaceId, 1);
731 MFloat* stateL = &surfaces().variables(surfaceId, 0);
732 MFloat* stateR = &surfaces().variables(surfaceId, 1);
733 const MInt noNodes1D = surfaces().noNodes1D(surfaceId);
734 const MInt dirId = surfaces().orientation(surfaceId);
735
736 // The boundary state contains the prolonged rbc-solution and the same node
737 // variables as the inner state
738 MFloat* f = flux(surfaceId);
739 sysEqn().calcRiemann(nodeVarsL, nodeVarsR, stateL, stateR, noNodes1D, dirId, f);
740}
MFloat * flux(const MInt i)
Return pointer to surface flux.
void calcRiemann(const MFloat *nodeVarsL, const MFloat *nodeVarsR, const MFloat *stateL, const MFloat *stateR, const MInt noNodes1D, const MInt dirId, MFloat *flux) const
Calculates the numerical flux at a surface given two states (left and right).
MFloat & nodeVars(const MInt srfcId, const MInt side)
Accessor for node variables.

◆ calcElementNodeVars()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcElementNodeVars
private
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

Calculate all node variables on the rb-elements using the node variables on the 'normal' elements.

Definition at line 942 of file dgcartesianbcacousticperturbrbc.h.

942 {
943 TRACE();
944
945 // Loop over rb-elements
946 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
947 const MInt eId = m_elementId[rbId]; // Corresponding element id
948 const MInt noNodesXD = m_rbElements.noNodesXD(rbId);
949 const MFloat* coordinates = &m_rbElements.nodeCoordinates(rbId);
950
951 for(MInt pId = 0; pId < noNodesXD; pId++) {
952 calcNodeVars(&coordinates[pId * nDim],
953 &elements().nodeVars(eId) + pId * Base::SysEqn::noNodeVars(),
954 &m_rbElements.nodeVars(rbId) + pId * s_noNodeVars);
955 }
956 }
957}
static const constexpr MInt s_noNodeVars
void calcNodeVars(const MFloat *pos, const MFloat *nodeVarsAPE, MFloat *nodeVars)
Calculate RBC node variables at a given position.
MInt noNodesXD(const MInt id) const
Accessor for number of nodes XD (const version).
MFloat & nodeCoordinates(const MInt id)
Accessor for node coordinates.
MFloat & nodeVars(const MInt id)
Accessor for node variables.

◆ calcFlux()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcFlux ( const MFloat nodeVars,
const MFloat q,
const MInt  noNodes1D,
MFloat flux_ 
) const
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

Note: for argument description, see DgSysEqnAcousticPerturb::calcFlux.

Definition at line 751 of file dgcartesianbcacousticperturbrbc.h.

754 {
755 // TRACE();
756
757 const MInt noVars = Base::SysEqn::noVars();
758 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
759 const MFloatTensor U(const_cast<MFloat*>(q), noNodes1D, noNodes1D, noNodes1D3, noVars);
760 const MFloatTensor coeff(const_cast<MFloat*>(nodeVars), noNodes1D, noNodes1D, noNodes1D3, s_noNodeVars);
761
762 MFloatTensor f(flux_, noNodes1D, noNodes1D, noNodes1D3, nDim, noVars);
763
764 // The following flux equations are calculated here (if 2D, consider all
765 // z-components to be zero and sin(theta)=1):
766 // vg: speed of wave propagation
767 // theta, phi: angles in cylindrical coordinates
768
769 // Flux in x-direction:
770 // f1 = vg*sin(theta)*cos(phi)
771 // f_x(CV[u]) = f1*u
772 // f_x(CV[v]) = f1*v
773 // f_x(CV[w]) = f1*w
774 // f_x(CV[p]) = f1*p
775
776 // Flux in y-direction:
777 // f2 = vg*sin(theta)*sin(phi)
778 // f_y(CV[u]) = f2*u
779 // f_y(CV[v]) = f2*v
780 // f_y(CV[w]) = f2*w
781 // f_y(CV[p]) = f2*p
782
783 // Flux in z-direction:
784 // f3 = vg*cos(theta)
785 // f_z(CV[u]) = f3*u
786 // f_z(CV[v]) = f3*v
787 // f_z(CV[w]) = f3*w
788 // f_z(CV[p]) = f3*p
789
790 for(MInt i = 0; i < noNodes1D; i++) {
791 for(MInt j = 0; j < noNodes1D; j++) {
792 for(MInt k = 0; k < noNodes1D3; k++) {
793 for(MInt d = 0; d < nDim; d++) {
794 for(MInt var = 0; var < noVars; var++) {
795 f(i, j, k, d, var) = coeff(i, j, k, d) * U(i, j, k, var);
796 }
797 }
798 }
799 }
800 }
801}

◆ calcFlux1D()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcFlux1D ( const MFloat nodeVars,
const MFloat q,
const MInt  noNodes1D,
const MInt  dirId,
MFloat flux_ 
) const
private
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

The flux is obtained by the projection of the speed of wave propagation on the given direction multiplied with the variables. Note: for argument description, see DgSysEqnAcousticPerturb::calcFlux1D.

Definition at line 813 of file dgcartesianbcacousticperturbrbc.h.

814 {
815 // TRACE();
816
817 const MInt noVars = Base::SysEqn::noVars();
818 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
819 const MFloatTensor U(const_cast<MFloat*>(q), noNodes1D, noNodes1D3, noVars);
820 const MFloatTensor coeff(const_cast<MFloat*>(nodeVars), noNodes1D, noNodes1D3, s_noNodeVars);
821 MFloatTensor f(flux_, noNodes1D, noNodes1D3, noVars);
822
823 for(MInt i = 0; i < noNodes1D; i++) {
824 for(MInt j = 0; j < noNodes1D3; j++) {
825 for(MInt var = 0; var < noVars; var++) {
826 f(i, j, var) = coeff(i, j, dirId) * U(i, j, var);
827 }
828 }
829 }
830}

◆ calcNodeVars()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcNodeVars ( const MFloat pos,
const MFloat nodeVarsAPE,
MFloat nodeVars 
)
private
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

The 'nDim + 2' RBC node variables are computed at a given position with the corresponding mean velocities. The first nDim node variables contain the projection of the speed of wave propagation from the acoustic source region onto the Cartesian coordinate directions. These are the needed coefficients for the flux computations in the corresponding directions. At position 'nDim + 1' the speed of wave propagation is stored, which is needed for the Riemann solver. The last entry contains the source term coefficient which is given by the ratio of the speed of wave propagation and the distance to the reference position (2D: with factor of 1/2).

Parameters
[in]posposition where to calculate the node variables.
[in]nodeVarsAPEnode variables of the APE-system at given position.
[out]nodeVarscomputed RBC node variables.

Definition at line 1011 of file dgcartesianbcacousticperturbrbc.h.

1011 {
1012 // Mean speed of sound
1013 const MFloat c = nodeVarsAPE[Base::SysEqn::CV::C0];
1014
1015 IF_CONSTEXPR(nDim == 2) { // 2D
1016 const MFloat x = pos[0];
1017 const MFloat y = pos[1];
1018
1019 const MFloat x0 = m_rbcReferencePos[0];
1020 const MFloat y0 = m_rbcReferencePos[1];
1021
1022 // Inverse distance of given position and reference position
1023 const MFloat rInv = 1.0 / sqrt(POW2(x - x0) + POW2(y - y0));
1024
1025 // Orientation of given position with respect to the reference position
1026 const MFloat cosPhi = (x - x0) * rInv;
1027 const MFloat sinPhi = (y - y0) * rInv;
1028
1029 // Mean velocities
1030 const MFloat u0 = nodeVarsAPE[Base::SysEqn::CV::U0];
1031 const MFloat v0 = nodeVarsAPE[Base::SysEqn::CV::V0];
1032
1033 // Speed of wave propagation
1034 //
1035 // v_g = u0 * cos(phi) + v0 * sin(phi)
1036 // + sqrt(c^2 - (-u0 * sin(phi) + v0 * cos(phi))^2)
1037 //
1038 // c: mean sound speed
1039 // u0, v0: mean velocities
1040 // phi: angle between given position and reference position
1041 //
1042 // Reference: see 3D case
1043 const MFloat vg = u0 * cosPhi + v0 * sinPhi + sqrt(POW2(c) - POW2(-u0 * sinPhi + v0 * cosPhi));
1044
1045 // Projection of speed of wave propagation in both Cartesian coordinate
1046 // directions (coefficients for flux computation)
1047 nodeVars[0] = vg * cosPhi;
1048 nodeVars[1] = vg * sinPhi;
1049
1050 // Speed of wave propagation (needed in calcRiemann)
1051 nodeVars[2] = vg;
1052
1053 // Source term coefficient
1054 nodeVars[3] = 0.5 * vg * rInv;
1055 }
1056 else { // 3D
1057 const MFloat x = pos[0];
1058 const MFloat y = pos[1];
1059 const MFloat z = pos[2];
1060
1061 const MFloat x0 = m_rbcReferencePos[0];
1062 const MFloat y0 = m_rbcReferencePos[1];
1063 const MFloat z0 = m_rbcReferencePos[2];
1064
1065 // Inverse distance of given position and reference position
1066 const MFloat rInv = 1.0 / sqrt(POW2(x - x0) + POW2(y - y0) + POW2(z - z0));
1067
1068 // Inverse distance in x-y-plane of given position and reference position
1069 const MFloat r2Inv = 1.0 / sqrt(POW2(x - x0) + POW2(y - y0));
1070
1071 // Orientation of given position with respect to the reference position
1072 // (spherical coordinates (r, theta, phi))
1073 const MFloat cosPhi = (x - x0) * r2Inv;
1074 const MFloat sinPhi = (y - y0) * r2Inv;
1075 const MFloat cosTheta = (z - z0) * rInv;
1076 const MFloat sinTheta = sqrt(1 - POW2(cosTheta));
1077
1078 // Mean velocities
1079 const MFloat u0 = nodeVarsAPE[Base::SysEqn::CV::UU0[0]];
1080 const MFloat v0 = nodeVarsAPE[Base::SysEqn::CV::UU0[1]];
1081 const MFloat w0 = nodeVarsAPE[Base::SysEqn::CV::UU0[2]];
1082
1083 // Speed of wave propagation in radial direction
1084 const MFloat u_er = u0 * sinTheta * cosPhi + v0 * sinTheta * sinPhi + w0 * cosTheta;
1085
1086 // Speed of wave propagation in theta direction
1087 const MFloat u_et = u0 * cosTheta * cosPhi + v0 * cosTheta * sinPhi + w0 * (-sinTheta);
1088
1089 // Speed of wave propagation in phi direction
1090 const MFloat u_ep = u0 * (-sinPhi) + v0 * cosPhi;
1091
1092 // Speed of wave propagation
1093 //
1094 // v_g = u_m*e_r + sqrt(c^2 - (u_m*e_t)^2 - (u_m*e_p)^2)
1095 //
1096 // u_m: mean flow velocity vector u_m = [u0, v0, w0]'
1097 // e_r: unit vector in radial direction
1098 // e_r = [sin(phi)*cos(theta), sin(theta)*sin(phi), cos(theta)]'
1099 // e_t: unit vector in theta direction
1100 // e_t = [cos(theta)*cos(phi), cos(theta)*sin(phi), -sin(theta)]'
1101 // e_p: unit vector in phi direction
1102 // e_p = [-sin(phi), cos(phi), 0]'
1103 // c: mean sound speed
1104 //
1105 // Reference: C .Bogey, C. Bailly; Three-dimensional non-reflective boundary
1106 // conditions for acoustic simulations: far field formulation and validation
1107 // test cases, Eqns. (1) and (2)
1108 const MFloat vg = u_er + sqrt(POW2(c) - POW2(u_et) - POW2(u_ep));
1109
1110 // Projection of speed of wave propagation in all Cartesian coordinate
1111 // directions (coefficients for flux computation)
1112 nodeVars[0] = vg * sinTheta * cosPhi;
1113 nodeVars[1] = vg * sinTheta * sinPhi;
1114 nodeVars[2] = vg * cosTheta;
1115
1116 // Speed of wave propagation (needed in calcRiemann)
1117 nodeVars[3] = vg;
1118
1119 // Source term coefficient
1120 nodeVars[4] = vg * rInv;
1121 }
1122}
std::array< MFloat, MAX_SPACE_DIMENSIONS > m_rbcReferencePos
constexpr Real POW2(const Real x)
Definition: functions.h:119
define array structures

◆ calcRiemann()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcRiemann ( const MFloat nodeVarsL,
const MFloat nodeVarsR,
const MFloat stateL,
const MFloat stateR,
const MInt  noNodes1D,
const MInt  dirId,
MFloat flux_ 
) const
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

The numerical flux is calculated using the local Lax-Friedrichs flux scheme. Note: for argument description, see DgSysEqnAcousticPerturb::calcRiemann.

Definition at line 879 of file dgcartesianbcacousticperturbrbc.h.

885 {
886 // TRACE();
887
888 const MInt noVars = Base::SysEqn::noVars();
889 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
890 const MFloatTensor uL(const_cast<MFloat*>(stateL), noNodes1D, noNodes1D3, noVars);
891 const MFloatTensor uR(const_cast<MFloat*>(stateR), noNodes1D, noNodes1D3, noVars);
892
893#ifndef _OPENMP
894 MFloatScratchSpace maxLambda(noNodes1D, noNodes1D3, AT_, "maxLambda");
895#else
896 MFloatTensor maxLambda(noNodes1D, noNodes1D3);
897#endif
898
899 // Left and right node variables
900 const MFloatTensor cL(const_cast<MFloat*>(nodeVarsL), noNodes1D, noNodes1D3, s_noNodeVars);
901 const MFloatTensor cR(const_cast<MFloat*>(nodeVarsR), noNodes1D, noNodes1D3, s_noNodeVars);
902
903 // Calculate maximum eigenvalue from speed of sound propagation
904 for(MInt i = 0; i < noNodes1D; i++) {
905 for(MInt j = 0; j < noNodes1D3; j++) {
906 maxLambda(i, j) = std::max(fabs(cL(i, j, nDim)), fabs(cR(i, j, nDim)));
907 }
908 }
909
910#ifndef _OPENMP
911 MFloatScratchSpace fluxL(noNodes1D, noNodes1D3, noVars, AT_, "fluxL");
912 MFloatScratchSpace fluxR(noNodes1D, noNodes1D3, noVars, AT_, "fluxR");
913#else
914 MFloatTensor fluxL(noNodes1D, noNodes1D3, noVars);
915 MFloatTensor fluxR(noNodes1D, noNodes1D3, noVars);
916#endif
917
918 // Calculate flux from left and right state
919 calcFlux1D(nodeVarsL, stateL, noNodes1D, dirId, &fluxL[0]);
920 calcFlux1D(nodeVarsR, stateR, noNodes1D, dirId, &fluxR[0]);
921
922 // Solve Riemann problem
923 MFloatTensor riemann(flux_, noNodes1D, noNodes1D3, noVars);
924 for(MInt i = 0; i < noNodes1D; i++) {
925 for(MInt j = 0; j < noNodes1D3; j++) {
926 for(MInt n = 0; n < noVars; n++) {
927 riemann(i, j, n) = 0.5 * ((fluxL(i, j, n) + fluxR(i, j, n)) - maxLambda(i, j) * (uR(i, j, n) - uL(i, j, n)));
928 }
929 }
930 }
931}
void calcFlux1D(const MFloat *nodeVars, const MFloat *q, const MInt noNodes1D, const MInt dirId, MFloat *flux_) const
Calculates the physical fluxes in direction 'dirId' on a surface.
This class is a ScratchSpace.
Definition: scratch.h:758

◆ calcSource()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcSource ( const MFloat nodeVars,
const MFloat u,
const MInt  noNodes1D,
const MFloat  t,
const MFloat x,
MFloat src 
) const
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

The RBC source terms are given by: 2D: S = vg/(2*r)*U 3D: S = vg/r*U Note: for argument description, see DgSysEqnAcousticPerturb::calcSource.

Definition at line 843 of file dgcartesianbcacousticperturbrbc.h.

848 {
849 // TRACE();
850
851 const MInt noVars = Base::SysEqn::noVars();
852
853 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
854 MFloatTensor s(src, noNodes1D, noNodes1D, noNodes1D3, noVars);
855
856 const MFloatTensor U(const_cast<MFloat*>(u), noNodes1D, noNodes1D, noNodes1D3, noVars);
857 const MFloatTensor coeff(const_cast<MFloat*>(nodeVars), noNodes1D, noNodes1D, noNodes1D3, nDim + 2);
858
859 for(MInt i = 0; i < noNodes1D; i++) {
860 for(MInt j = 0; j < noNodes1D; j++) {
861 for(MInt k = 0; k < noNodes1D3; k++) {
862 for(MInt var = 0; var < noVars; var++) {
863 s(i, j, k, var) = coeff(i, j, k, nDim + 1) * U(i, j, k, var);
864 }
865 }
866 }
867 }
868}

◆ calcSurfaceNodeVars()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::calcSurfaceNodeVars
private
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13

Calculate all node variables on the rb-surfaces using the node variables on the 'normal' surfaces.

Definition at line 968 of file dgcartesianbcacousticperturbrbc.h.

968 {
969 TRACE();
970
971 // Loop over rb-surfaces
972 for(MInt rbSId = 0; rbSId < m_rbSurfaces.size(); rbSId++) {
973 const MInt sId = m_surfaceId[rbSId];
974 const MFloat* coordinates = &m_rbSurfaces.nodeCoords(rbSId);
975 const MInt noNodesXD = m_rbSurfaces.noNodesXD(rbSId);
976
977 for(MInt pId = 0; pId < noNodesXD; pId++) {
978 calcNodeVars(&coordinates[pId * nDim],
979 &((&surfaces().nodeVars(sId, 0))[pId * Base::SysEqn::noNodeVars()]),
980 &((&m_rbSurfaces.nodeVars(rbSId, 0))[pId * s_noNodeVars]));
981
982 calcNodeVars(&coordinates[pId * nDim],
983 &((&surfaces().nodeVars(sId, 1))[pId * Base::SysEqn::noNodeVars()]),
984 &((&m_rbSurfaces.nodeVars(rbSId, 1))[pId * s_noNodeVars]));
985 }
986 }
987}
MInt noNodesXD(const MInt srfcId) const
Accessor for number of nodes XD (const version).
MFloat & nodeCoords(const MInt srfcId)
Accessor for node coordinates.

◆ cellDataSizeDlb()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::cellDataSizeDlb ( const MInt  dataId,
const MInt  cellId 
) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de

Definition at line 1221 of file dgcartesianbcacousticperturbrbc.h.

1221 {
1222 TRACE();
1223
1224 // Only the variables need to be considered
1225 if(dataId < 0 || dataId > Base::SysEqn::noVars()) {
1226 TERMM(1, "Invalid dataId.");
1227 }
1228
1229 // Get element id and find corresponding RB-element (if there is one)
1230 const MInt elementId = getElementByCellId(cellId);
1231 auto rbElemIt = std::find(m_elementId.begin(), m_elementId.end(), elementId);
1232
1233 MInt dataSize = 0;
1234 if(rbElemIt != m_elementId.end()) {
1235 // Compute rb-element id
1236 const MInt rbId = std::distance(m_elementId.begin(), rbElemIt);
1237 const MInt noNodesXD = m_rbElements.noNodesXD(rbId);
1238
1239 dataSize = noNodesXD;
1240 }
1241
1242 return dataSize;
1243}
MInt getElementByCellId(const MInt cellId) const
Return element id corresponding to given cell id.

◆ cellDataTypeDlb()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::cellDataTypeDlb ( const MInt   NotUseddataId) const
inlineoverridevirtual

Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 98 of file dgcartesianbcacousticperturbrbc.h.

98 {
99 return MFLOAT; // Note: assumes there are not MInt to communicate
100 }
@ MFLOAT
Definition: enums.h:269

◆ getCellDataDlb()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::getCellDataDlb ( const MInt  dataId,
MFloat *const  data 
) const
inlineoverride

Definition at line 106 of file dgcartesianbcacousticperturbrbc.h.

106{ getRestartVariable(dataId, data); }
void getRestartVariable(const MInt id_, MFloat *const data) const override
Copy restart variable data to pointer.

◆ getLocalNoNodes()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::getLocalNoNodes
overridevirtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-01-12

Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 1130 of file dgcartesianbcacousticperturbrbc.h.

1130 {
1131 TRACE();
1132
1133 MInt localNoNodes = 0;
1134 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
1135 const MInt noNodesXD = m_rbElements.noNodesXD(rbId);
1136
1137 localNoNodes += noNodesXD;
1138 }
1139
1140 return localNoNodes;
1141}

◆ getRestartVariable()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::getRestartVariable ( const MInt  id_,
MFloat *const  data 
) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-01-12
Parameters
[in]id_Variable id.
[in]dataPointer to store restart variable data.

Definition at line 1197 of file dgcartesianbcacousticperturbrbc.h.

1197 {
1198 TRACE();
1199 RECORD_TIMER_START(m_timers[Timers::GetRestartVars]);
1200
1201 // Copy variables to data buffer (in ascending cell/element id order)
1202 MInt offset = 0;
1203 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
1204 const MInt noNodesXD = m_rbElements.noNodesXD(rbId);
1205
1206 for(MInt n = 0; n < noNodesXD; n++) {
1207 data[offset + n] = m_rbElements.variables(rbId, n * Base::SysEqn::noVars() + id_);
1208 }
1209
1210 offset += noNodesXD;
1211 }
1212
1213 RECORD_TIMER_STOP(m_timers[Timers::GetRestartVars]);
1214}

◆ hasBcElement()

template<MInt nDim>
MBool DgBcAcousticPerturbRBC< nDim >::hasBcElement ( const MInt  elementId) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de

Definition at line 1250 of file dgcartesianbcacousticperturbrbc.h.

1250 {
1251 TRACE();
1252
1253 return std::find(m_elementId.begin(), m_elementId.end(), elementId) != m_elementId.end();
1254}

◆ init()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::init
overridevirtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-12-13
  1. Create rb-elements for all elements along the boundary.
  2. Create needed h-rb-elements.
  3. Create rb-surfaces for all rb-elements.
  4. Initialize h-rb-elements and create missing h-refined surfaces.

Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 209 of file dgcartesianbcacousticperturbrbc.h.

◆ initTimers()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::initTimers
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-01-24

Definition at line 438 of file dgcartesianbcacousticperturbrbc.h.

438 {
439 TRACE();
440
441 // Create timer group & timer for solver, and start the timer
442 NEW_TIMER_GROUP_NOCREATE(m_timers[Timers::TimerGroup],
443 "DgBcAcousticPerturbRBC (solverId = " + std::to_string(solver().solverId())
444 + ", bcId = " + std::to_string(id()) + ")");
445 NEW_TIMER_NOCREATE(m_timers[Timers::Class], "total object lifetime", m_timers[Timers::TimerGroup]);
446 RECORD_TIMER_START(m_timers[Timers::Class]);
447
448 // Create regular solver-wide timers
449 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Init], "init", m_timers[Timers::Class]);
450
451 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Apply], "apply", m_timers[Timers::Class]);
452 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::InitializeVars], "initializeVars", m_timers[Timers::Apply]);
453 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CopySurfaceVars], "copySurfaceVars", m_timers[Timers::Apply]);
454 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Prolong], "prolong", m_timers[Timers::Apply]);
455 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::TimeDeriv], "timeDeriv", m_timers[Timers::Apply]);
456 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::RungeKuttaStep], "RungeKuttaStep", m_timers[Timers::Apply]);
457 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ApplyAtSurface], "applyAtSurface", m_timers[Timers::Apply]);
458
459 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SetRestartVars], "setRestartVars", m_timers[Timers::Class]);
460 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::GetRestartVars], "getRestartVars", m_timers[Timers::Class]);
461}

◆ name()

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

Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 61 of file dgcartesianbcacousticperturbrbc.h.

61{ return "radiation boundary condition"; }

◆ noBcElements()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::noBcElements ( ) const
inlineoverridevirtual

◆ noCellDataDlb()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::noCellDataDlb ( ) const
inlineoverridevirtual

◆ noRestartVars()

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::noRestartVars ( ) const
inlineoverridevirtual

Return number of restart variables that need to be stored/loaded. If a derived class does not need additional restart variables, it may omit an implementation.

Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.

Definition at line 84 of file dgcartesianbcacousticperturbrbc.h.

84{ return Base::SysEqn::noVars(); };

◆ restartVarName()

template<MInt nDim>
MString DgBcAcousticPerturbRBC< nDim >::restartVarName ( const MInt  id_) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-01-12
Parameters
[in]id_Requested variable id.

Definition at line 1151 of file dgcartesianbcacousticperturbrbc.h.

1151 {
1152 TRACE();
1153
1154 std::stringstream varName;
1155 varName << "bc" << id() << "_" << Base::SysEqn::consVarNames(id_);
1156
1157 return varName.str();
1158}
MInt id() const
Return boundary condition if of this boundary condition.

◆ setCellDataDlb()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::setCellDataDlb ( const MInt  dataId,
const MFloat *const  data 
)
inlineoverride

Definition at line 109 of file dgcartesianbcacousticperturbrbc.h.

109{ setRestartVariable(dataId, data); }
void setRestartVariable(const MInt id_, const MFloat *const data) override
Copy restart variable data to boundary conditon.

◆ setRestartVariable()

template<MInt nDim>
void DgBcAcousticPerturbRBC< nDim >::setRestartVariable ( const MInt  id_,
const MFloat *const  data 
)
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-01-12
Parameters
[in]id_Variable id.
[in]dataPointer to restart variable data.

Definition at line 1169 of file dgcartesianbcacousticperturbrbc.h.

1169 {
1170 TRACE();
1171 RECORD_TIMER_START(m_timers[Timers::SetRestartVars]);
1172
1173 // Copy variables to rb elements (in ascending cell/element id order)
1174 MInt offset = 0;
1175 for(MInt rbId = 0; rbId < m_rbElements.size(); rbId++) {
1176 const MInt noNodesXD = m_rbElements.noNodesXD(rbId);
1177 MFloat* const vars = &m_rbElements.variables(rbId);
1178 for(MInt n = 0; n < noNodesXD; n++) {
1179 vars[n * Base::SysEqn::noVars() + id_] = data[offset + n];
1180 }
1181
1182 offset += noNodesXD;
1183 }
1184
1185 RECORD_TIMER_STOP(m_timers[Timers::SetRestartVars]);
1186}

Member Data Documentation

◆ m_addBndrySrfcIds

template<MInt nDim>
std::vector<std::pair<MInt, MInt> > DgBcAcousticPerturbRBC< nDim >::m_addBndrySrfcIds
private

Definition at line 144 of file dgcartesianbcacousticperturbrbc.h.

◆ m_elementId

template<MInt nDim>
std::vector<MInt> DgBcAcousticPerturbRBC< nDim >::m_elementId
private

Definition at line 134 of file dgcartesianbcacousticperturbrbc.h.

◆ m_hRbElements

template<MInt nDim>
HElementCollector DgBcAcousticPerturbRBC< nDim >::m_hRbElements
private

Definition at line 148 of file dgcartesianbcacousticperturbrbc.h.

◆ m_internalDataSize

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::m_internalDataSize = -1
private

Definition at line 154 of file dgcartesianbcacousticperturbrbc.h.

◆ m_isInitialized

template<MInt nDim>
MBool DgBcAcousticPerturbRBC< nDim >::m_isInitialized = false
private

Definition at line 163 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbcReferencePos

template<MInt nDim>
std::array<MFloat, MAX_SPACE_DIMENSIONS> DgBcAcousticPerturbRBC< nDim >::m_rbcReferencePos {}
private

Definition at line 160 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbElementId

template<MInt nDim>
std::vector<MInt> DgBcAcousticPerturbRBC< nDim >::m_rbElementId
private

Definition at line 129 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbElements

template<MInt nDim>
ElementCollector DgBcAcousticPerturbRBC< nDim >::m_rbElements
private

Definition at line 126 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbSolution

template<MInt nDim>
MFloat** DgBcAcousticPerturbRBC< nDim >::m_rbSolution = nullptr
private

Definition at line 151 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbSurfaceId

template<MInt nDim>
std::vector<MInt> DgBcAcousticPerturbRBC< nDim >::m_rbSurfaceId
private

Definition at line 131 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rbSurfaces

template<MInt nDim>
SurfaceCollector DgBcAcousticPerturbRBC< nDim >::m_rbSurfaces
private

Definition at line 140 of file dgcartesianbcacousticperturbrbc.h.

◆ m_rkStage

template<MInt nDim>
MInt DgBcAcousticPerturbRBC< nDim >::m_rkStage = -1
private

Definition at line 157 of file dgcartesianbcacousticperturbrbc.h.

◆ m_surfaceId

template<MInt nDim>
std::vector<MInt> DgBcAcousticPerturbRBC< nDim >::m_surfaceId
private

Definition at line 136 of file dgcartesianbcacousticperturbrbc.h.

◆ m_timers

template<MInt nDim>
std::array<MInt, Timers::_count> DgBcAcousticPerturbRBC< nDim >::m_timers
private

Definition at line 191 of file dgcartesianbcacousticperturbrbc.h.

◆ s_noNodeVars

template<MInt nDim>
const constexpr MInt DgBcAcousticPerturbRBC< nDim >::s_noNodeVars = nDim + 2
staticconstexprprivate

Definition at line 166 of file dgcartesianbcacousticperturbrbc.h.


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