MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew > Class Template Reference

#include <fvcartesianinterpolation.h>

Inheritance diagram for FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >:
[legend]
Collaboration diagram for FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >:
[legend]

Public Types

using OldFvSolver = FvCartesianSolverXD< nDim, SysEqnOld >
 
using NewFvSolver = FvCartesianSolverXD< nDim, SysEqnNew >
 

Public Member Functions

 FvCartesianInterpolation (const MInt couplingId, OldFvSolver *oldS, NewFvSolver *newS)
 
 ~FvCartesianInterpolation ()
 
void init () override
 
void preCouple (MInt) override
 
void postCouple (MInt) override
 
- Public Member Functions inherited from Coupling
 Coupling (const MInt couplingId)
 
virtual ~Coupling ()=default
 
 Coupling (const Coupling &)=delete
 
Couplingoperator= (const Coupling &)=delete
 
MInt couplerId () const
 
virtual void init ()=0
 
virtual void finalizeSubCoupleInit (MInt solverId)=0
 
virtual void finalizeCouplerInit ()=0
 
virtual void preCouple (MInt recipeStep)=0
 
virtual void subCouple (MInt recipeStep, MInt solverId, std::vector< MBool > &solverCompleted)=0
 
virtual void postCouple (MInt recipeStep)=0
 
virtual void cleanUp ()=0
 
virtual void balancePre ()
 Load balancing. More...
 
virtual void balancePost ()
 
virtual void reinitAfterBalance ()
 
virtual void prepareAdaptation ()
 
virtual void postAdaptation ()
 
virtual void finalizeAdaptation (const MInt)
 
virtual void writeRestartFile (const MInt)
 
virtual MInt noCellDataDlb () const
 Methods to inquire coupler data during balancing. More...
 
virtual MInt cellDataTypeDlb (const MInt NotUsed(dataId)) const
 
virtual MInt cellDataSizeDlb (const MInt NotUsed(dataId), const MInt NotUsed(cellId))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MInt *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MLong *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
 
virtual void finalizeBalance (const MInt)
 
virtual MInt noCouplingTimers (const MBool NotUsed(allTimings)) const
 Number of coupling timers. More...
 
virtual void getCouplingTimings (std::vector< std::pair< MString, MFloat > > &NotUsed(timings), const MBool NotUsed(allTimings))
 Return coupling timings. More...
 
virtual void getDomainDecompositionInformation (std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
 Return information on current domain decomposition (e.g. number of coupled cells/elements/...) More...
 
void setDlbTimer (const MInt timerId)
 
void startLoadTimer (const MString &name) const
 Start the load timer of the coupler. More...
 
void stopLoadTimer (const MString &name) const
 Stop the load timer of the coupler. More...
 

Static Public Attributes

static constexpr MInt nDim = nDim_
 

Private Member Functions

OldFvSolveroldSolver () const
 
NewFvSolvernewSolver () const
 
MInt noExchangeVariables ()
 
void finalizeSubCoupleInit (MInt)
 
void finalizeCouplerInit ()
 
void subCouple (MInt, MInt, std::vector< MBool > &)
 
void cleanUp ()
 
void initData ()
 
void checkProperties ()
 
void readProperties ()
 
void transferSolverData ()
 interpolate variables from old to new More...
 
MInt a_noFvCellsOld () const
 
MInt a_noFvGridCellsOld () const
 
MInt a_noFvCellsNew () const
 
MInt a_noFvGridCellsNew () const
 

Private Attributes

OldFvSolverm_oldSolver
 
NewFvSolverm_newSolver
 
const MFloat eps = 1e-16
 
const MFloat epss = 1e-8
 
MInt m_oldSolverId
 
MInt m_newSolverId
 
MBool m_nonZonalRestart
 

Additional Inherited Members

- Protected Member Functions inherited from Coupling
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 

Detailed Description

template<MInt nDim_, class SysEqnOld, class SysEqnNew>
class FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >

Coupling class for nonZonalRestart (can be expended to a general FV-FV coupling class)

Author
Jannik Borgelt

Definition at line 30 of file fvcartesianinterpolation.h.

Member Typedef Documentation

◆ NewFvSolver

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
using FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::NewFvSolver = FvCartesianSolverXD<nDim, SysEqnNew>

Definition at line 36 of file fvcartesianinterpolation.h.

◆ OldFvSolver

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
using FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::OldFvSolver = FvCartesianSolverXD<nDim, SysEqnOld>

Definition at line 35 of file fvcartesianinterpolation.h.

Constructor & Destructor Documentation

◆ FvCartesianInterpolation()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::FvCartesianInterpolation ( const MInt  couplingId,
OldFvSolver oldS,
NewFvSolver newS 
)

◆ ~FvCartesianInterpolation()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::~FvCartesianInterpolation ( )
inline

Definition at line 39 of file fvcartesianinterpolation.h.

39{};

Member Function Documentation

◆ a_noFvCellsNew()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::a_noFvCellsNew ( ) const
inlineprivate

Definition at line 66 of file fvcartesianinterpolation.h.

66{ return newSolver().a_noCells(); }
NewFvSolver & newSolver() const
MInt a_noCells() const
Returns the number of cells.

◆ a_noFvCellsOld()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::a_noFvCellsOld ( ) const
inlineprivate

Definition at line 64 of file fvcartesianinterpolation.h.

64{ return oldSolver().a_noCells(); }
OldFvSolver & oldSolver() const

◆ a_noFvGridCellsNew()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::a_noFvGridCellsNew ( ) const
inlineprivate

Definition at line 67 of file fvcartesianinterpolation.h.

67{ return newSolver().c_noCells(); }

◆ a_noFvGridCellsOld()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::a_noFvGridCellsOld ( ) const
inlineprivate

Definition at line 65 of file fvcartesianinterpolation.h.

65{ return oldSolver().c_noCells(); }

◆ checkProperties()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::checkProperties ( )
inlineprivatevirtual

Implements Coupling.

Definition at line 59 of file fvcartesianinterpolation.h.

59{};

◆ cleanUp()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::cleanUp ( )
inlineprivatevirtual

Implements Coupling.

Definition at line 57 of file fvcartesianinterpolation.h.

57{};

◆ finalizeCouplerInit()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::finalizeCouplerInit ( )
inlineprivatevirtual

Implements Coupling.

Definition at line 55 of file fvcartesianinterpolation.h.

55{};

◆ finalizeSubCoupleInit()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::finalizeSubCoupleInit ( MInt  )
inlineprivatevirtual

Implements Coupling.

Definition at line 54 of file fvcartesianinterpolation.h.

54{};

◆ init()

template<MInt nDim, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim, SysEqnOld, SysEqnNew >::init
overridevirtual

Implements Coupling.

Definition at line 63 of file fvcartesianinterpolation.cpp.

63 {
64 TRACE();
65
68 }
69}
void transferSolverData()
interpolate variables from old to new

◆ initData()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::initData ( )
inlineprivate

Definition at line 58 of file fvcartesianinterpolation.h.

58{};

◆ newSolver()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
NewFvSolver & FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::newSolver ( ) const
inlineprivate

Definition at line 50 of file fvcartesianinterpolation.h.

50{ return *m_newSolver; }

◆ noExchangeVariables()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::noExchangeVariables ( )
inlineprivate

Definition at line 52 of file fvcartesianinterpolation.h.

52{ return nDim + 2 /*+ (MInt)m_reconstructNut*/; };

◆ oldSolver()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
OldFvSolver & FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::oldSolver ( ) const
inlineprivate

Definition at line 49 of file fvcartesianinterpolation.h.

49{ return *m_oldSolver; }

◆ postCouple()

template<MInt nDim, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim, SysEqnOld, SysEqnNew >::postCouple ( MInt  )
overridevirtual

Implements Coupling.

Definition at line 82 of file fvcartesianinterpolation.cpp.

82 {
84 for(MInt oldId = 0; oldId < a_noFvGridCellsOld(); oldId++) {
85 oldSolver().reduceData(oldId, &oldSolver().a_pvariable(0, 0), oldSolver().noVariables());
86 }
88 }
89}
MFloat reduceData(const MInt cellId, MFloat *data, const MInt dataBlockSize=1, const MBool average=true)
determines the value of 'data' in the given cell by recusively volumetric averaging among all its off...
int32_t MInt
Definition: maiatypes.h:62

◆ preCouple()

template<MInt nDim, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim, SysEqnOld, SysEqnNew >::preCouple ( MInt  )
overridevirtual

Implements Coupling.

Definition at line 72 of file fvcartesianinterpolation.cpp.

72 {
74 for(MInt oldId = 0; oldId < a_noFvGridCellsOld(); oldId++) {
75 oldSolver().reduceData(oldId, &oldSolver().a_pvariable(0, 0), oldSolver().noVariables());
76 }
78 }
79}

◆ readProperties()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::readProperties ( )
inlineprivatevirtual

Implements Coupling.

Definition at line 60 of file fvcartesianinterpolation.h.

60{};

◆ subCouple()

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::subCouple ( MInt  ,
MInt  ,
std::vector< MBool > &   
)
inlineprivatevirtual

Implements Coupling.

Definition at line 56 of file fvcartesianinterpolation.h.

56{};

◆ transferSolverData()

template<MInt nDim, class SysEqnOld , class SysEqnNew >
void FvCartesianInterpolation< nDim, SysEqnOld, SysEqnNew >::transferSolverData
private
Author
Jannik Borgelt

Definition at line 95 of file fvcartesianinterpolation.cpp.

95 {
96 TRACE();
97
98 m_log << "starting interpolate (FV)" << endl;
99
100 if(newSolver().grid().isActive()) {
101 // start from min level and go to max level
102 for(MInt newId = 0; newId < a_noFvGridCellsNew(); newId++) {
103 MInt oldId = convertIdParent(newSolver(), oldSolver(), newId);
104
105 if(oldId != -1) {
106 for(MInt varId = 0; varId < newSolver().noVariables(); varId++) {
107 newSolver().a_pvariable(newId, varId) = oldSolver().a_pvariable(oldId, varId);
108 }
109 IF_CONSTEXPR(SysEqnNew::m_noRansEquations == 0) {
110 for(MInt s = 0; s < newSolver().m_noSpecies; ++s) {
111 newSolver().a_pvariable(newId, newSolver().PV->Y[s]) =
112 (oldSolver().m_noSpecies > 0) ? oldSolver().a_pvariable(oldId, oldSolver().PV->Y[s]) : F0;
113 }
114 }
115 }
116 }
117
120
121 m_log << "finished interpolate (FV)" << endl;
122 }
123}
virtual void computeConservativeVariables()
Dispatches the computation of the conservative variables for different number of species.
SysEqn::PrimitiveVariables * PV
MInt noVariables() const override
Return the number of primitive variables.
MFloat & a_pvariable(const MInt cellId, const MInt varId)
Returns primitive variable v of the cell cellId for variables varId.
MInt convertIdParent(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id If no cell on the same level is found,...
Definition: couplingutils.h:46
InfoOutFile m_log

Member Data Documentation

◆ eps

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
const MFloat FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::eps = 1e-16
private

Definition at line 69 of file fvcartesianinterpolation.h.

◆ epss

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
const MFloat FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::epss = 1e-8
private

Definition at line 70 of file fvcartesianinterpolation.h.

◆ m_newSolver

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
NewFvSolver* FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::m_newSolver
private

Definition at line 47 of file fvcartesianinterpolation.h.

◆ m_newSolverId

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::m_newSolverId
private

Definition at line 73 of file fvcartesianinterpolation.h.

◆ m_nonZonalRestart

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MBool FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::m_nonZonalRestart
private

Definition at line 75 of file fvcartesianinterpolation.h.

◆ m_oldSolver

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
OldFvSolver* FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::m_oldSolver
private

Definition at line 46 of file fvcartesianinterpolation.h.

◆ m_oldSolverId

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::m_oldSolverId
private

Definition at line 72 of file fvcartesianinterpolation.h.

◆ nDim

template<MInt nDim_, class SysEqnOld , class SysEqnNew >
constexpr MInt FvCartesianInterpolation< nDim_, SysEqnOld, SysEqnNew >::nDim = nDim_
staticconstexpr

Definition at line 32 of file fvcartesianinterpolation.h.


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