MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
CouplingLsFv< nDim_, SysEqn > Class Template Reference

#include <lsfv.h>

Inheritance diagram for CouplingLsFv< nDim_, SysEqn >:
[legend]
Collaboration diagram for CouplingLsFv< nDim_, SysEqn >:
[legend]

Public Types

using LsSolver = LsCartesianSolver< nDim >
 
using FvCartesianSolver = FvCartesianSolverXD< nDim, SysEqn >
 
using Cell = typename maia::grid::tree::Tree< nDim >::Cell
 
- Public Types inherited from CouplingLS< nDim_ >
using solverType = LsCartesianSolver< nDim >
 

Public Member Functions

 CouplingLsFv (const MInt couplingId, LsSolver *ls, FvCartesianSolver *fv)
 
void init () override
 
void preCouple (MInt) override
 
void subCouple (MInt, MInt, std::vector< MBool > &) override
 
void postCouple (MInt recipeStep=0) override
 
void finalizeCouplerInit () override
 
void finalizeSubCoupleInit (MInt) override
 
void postAdaptation () override
 finalizeAdaptation More...
 
void cleanUp () override
 
- Public Member Functions inherited from CouplingLS< nDim_ >
 CouplingLS (const MInt couplingId, solverType *b)
 
solverTypelsSolver () const
 
MInt a_noLsCells () const
 
MFloat a_outsideGValue () const
 
MInt a_noG0Cells (MInt set) const
 
MInt a_noBandCells (MInt set) const
 
MInt a_maxGCellLevel (const MInt setId) const
 
MFloata_levelSetFunctionG (const MInt cellId, const MInt setId)
 
MInt a_bodyIdG (const MInt cellId, const MInt set) const
 
MInta_bodyIdG (const MInt cellId, const MInt set)
 
MFloat a_coordinateG (const MInt gCellId, const MInt dim) const
 
MInt a_G0CellId (const MInt id, const MInt set) const
 
MFloat a_normalVectorG (const MInt gCellId, const MInt dim, const MInt set) const
 
MFloat a_curvatureG (const MInt gCellId, const MInt set) const
 
MBool a_inBandG (MInt gcellId, MInt set) const
 
MInt a_potentialGapCellClose (MInt gcellId) const
 
MBool a_nearGapG (const MInt gcellId) const
 
MInt a_bodyToSet (const MInt bodyId) const
 
MInt a_noEmbeddedBodies () const
 
MInt a_noSets () const
 
MInt a_maxnoSets () const
 
MInt a_startSet () const
 
MFloata_extensionVelocityG (const MInt cellId, const MInt dim, const MInt setId)
 
- 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

void initData ()
 Initialize coupling-class-specific Data. More...
 
void checkProperties () override
 Checks property-data which is read in by both ls-and Fv-Solver. More...
 
void readProperties () override
 
void returnStep_semiLagrange ()
 mimics the behaviour of the rungeKuttaStep() methods with respect to increasing time More...
 
void transferGapCellProperty ()
 Sets the gapcell-property. More...
 
void testGapProperty ()
 transfers the LevelSetValues from the levelset to the moving boundary Part More...
 
void computeGCellTimeStep ()
 computes the gcell time step More...
 
void computeBodyProperties (MInt returnMode, MFloat *bodyData, MInt body, MFloat time)
 
void testCoupling ()
 transfers the LevelSetValues from the levelset to the moving boundary Part More...
 
void setLsInList (MIntScratchSpace &)
 
void transferLevelSetValues ()
 Sets the Levelset-Values in fvSolver. More...
 
MInt ls2fvId (const MInt lsId)
 
MInt ls2fvIdParent (const MInt lsId)
 
MInt fv2lsId (const MInt fvId)
 
MInt fv2lsIdParent (const MInt fvId)
 
MInt noLevelSetFieldData ()
 
MFloat interpolateLevelSet (MInt cellId, MFloat *point, MInt set)
 
MBool returnStep ()
 mimics the behaviour of the rungeKuttaStep() methods with respect to increasing time More...
 
MFloat lsTimeStep () const
 
MFloat crankAngle (MFloat)
 help-function for engine calculations which returns the crank-angle for a given time More...
 
MFloat a_meanCoord (MInt dir) const
 
MFloat a_UInfinity () const
 
MFloat a_TInfinity () const
 
MFloat a_Ma () const
 
MFloat a_time () const
 
MFloat a_timeRef () const
 
MFloat a_physicalTime () const
 
MInt a_noFvCells () const
 
MInt a_noFvGridCells () const
 
MInt a_G0CellId (MInt id, MInt set) const
 
MInt a_RKStep () const
 
MInt a_noRKSteps () const
 
- Private Member Functions inherited from CouplingFv< nDim_, SysEqn >
 CouplingFv (const MInt couplingId, std::vector< FvCartesianSolverXD< nDim, SysEqn > * > fvSolvers, const MInt noSolvers)
 
 CouplingFv (const MInt couplingId, Solver *solvers)
 
 CouplingFv (const CouplingFv &)=delete
 
 ~CouplingFv () override=default
 
CouplingFvoperator= (const CouplingFv &)=delete
 
MInt noSolvers () const
 
solverTypefvSolver (const MInt solverId=0) const
 
MInt a_noFvCells () const
 
MInt a_noFvGridCells () const
 
- Private 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...
 
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 

Private Attributes

MInt m_bandWidthRef
 
MInt m_bandWidthRefMax
 
MInt m_fvSolverId
 
MInt m_lsSolverId
 
MInt m_G0regionId
 
MFloat m_initialCrankAngle
 
MIntm_hadGapCells {}
 
MIntm_hasGapCells {}
 
MFloat m_cfl
 
MFloat m_maxVelocity
 
MInt m_timeStepMethod
 
MString m_solverMethod
 
MBool m_static_computeBodyProperties_first = true
 
MFloat m_static_computeBodyProperties_amplitude [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_freqFactor [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_initialBodyCenter [m_maxNoEmbeddedBodies *3] {}
 
MFloat m_static_computeBodyProperties_Strouhal {}
 
MFloat m_static_computeBodyProperties_mu [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_mu2 [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_liftStartAngle1 [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_liftEndAngle1 [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_liftStartAngle2 [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_liftEndAngle2 [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_circleStartAngle [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_normal [m_maxNoEmbeddedBodies *3] {}
 
MInt m_static_computeBodyProperties_bodyToFunction [m_maxNoEmbeddedBodies] {}
 
MFloat m_static_computeBodyProperties_omega {}
 
MFloat m_static_computeBodyProperties_rotAngle {}
 
MBool m_static_crankAngle_first = true
 
MFloat m_static_crankAngle_Strouhal
 
- Private Attributes inherited from CouplingFv< nDim_, SysEqn >
std::vector< solverType * > m_fvSolvers
 

Static Private Attributes

static constexpr const MInt m_maxNoEmbeddedBodies = 20
 

Friends

class FvCartesianSolverXD< nDim, SysEqn >
 
class LsCartesianSolver< nDim >
 

Additional Inherited Members

- Protected Member Functions inherited from Coupling
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 
- Private Types inherited from CouplingFv< nDim_, SysEqn >
using solverType = FvCartesianSolverXD< nDim, SysEqn >
 

Detailed Description

template<MInt nDim_, class SysEqn>
class CouplingLsFv< nDim_, SysEqn >

Definition at line 27 of file lsfv.h.

Member Typedef Documentation

◆ Cell

template<MInt nDim_, class SysEqn >
using CouplingLsFv< nDim_, SysEqn >::Cell = typename maia::grid::tree::Tree<nDim>::Cell

Definition at line 43 of file lsfv.h.

◆ FvCartesianSolver

template<MInt nDim_, class SysEqn >
using CouplingLsFv< nDim_, SysEqn >::FvCartesianSolver = FvCartesianSolverXD<nDim, SysEqn>

Definition at line 39 of file lsfv.h.

◆ LsSolver

template<MInt nDim_, class SysEqn >
using CouplingLsFv< nDim_, SysEqn >::LsSolver = LsCartesianSolver<nDim>

Definition at line 37 of file lsfv.h.

Constructor & Destructor Documentation

◆ CouplingLsFv()

template<MInt nDim, class SysEqn >
CouplingLsFv< nDim, SysEqn >::CouplingLsFv ( const MInt  couplingId,
LsSolver ls,
FvCartesianSolver fv 
)

Definition at line 26 of file lsfv.cpp.

27 : Coupling(couplingId), CouplingLS<nDim>(couplingId, ls), CouplingFv<nDim, SysEqn>(couplingId, fv) {
28 TRACE();
29
30 initData();
33
34 for(MInt dir = 0; dir < nDim; dir++) {
35 lsSolver().a_meanCoord(dir) = a_meanCoord(dir);
36 }
37}
solverType & lsSolver() const
Definition: coupling.h:188
void checkProperties() override
Checks property-data which is read in by both ls-and Fv-Solver.
Definition: lsfv.cpp:137
static constexpr MInt nDim
Definition: lsfv.h:29
MFloat a_meanCoord(MInt dir) const
Definition: lsfv.h:156
void readProperties() override
void initData()
Initialize coupling-class-specific Data.
Definition: lsfv.cpp:120
int32_t MInt
Definition: maiatypes.h:62

Member Function Documentation

◆ a_G0CellId()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::a_G0CellId ( MInt  id,
MInt  set 
) const
inlineprivate

Definition at line 167 of file lsfv.h.

167{ return lsSolver().a_G0CellId(id, set); }

◆ a_Ma()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_Ma ( ) const
inlineprivate

Definition at line 160 of file lsfv.h.

160{ return fvSolver().a_Ma(); }
solverType & fvSolver(const MInt solverId=0) const
Definition: coupling.h:386
MFloat & a_Ma()
Returns the Mach number of the solver.

◆ a_meanCoord()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_meanCoord ( MInt  dir) const
inlineprivate

Definition at line 156 of file lsfv.h.

156{ return fvSolver().m_meanCoord[dir]; }

◆ a_noFvCells()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::a_noFvCells ( ) const
inlineprivate

Definition at line 165 of file lsfv.h.

165{ return fvSolver().a_noCells(); }
MInt a_noCells() const
Returns the number of cells.

◆ a_noFvGridCells()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::a_noFvGridCells ( ) const
inlineprivate

Definition at line 166 of file lsfv.h.

166{ return fvSolver().c_noCells(); }

◆ a_noRKSteps()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::a_noRKSteps ( ) const
inlineprivate

Definition at line 169 of file lsfv.h.

◆ a_physicalTime()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_physicalTime ( ) const
inlineprivate

Definition at line 164 of file lsfv.h.

◆ a_RKStep()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::a_RKStep ( ) const
inlineprivate

Definition at line 168 of file lsfv.h.

◆ a_time()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_time ( ) const
inlineprivate

Definition at line 162 of file lsfv.h.

162{ return fvSolver().m_time; }

◆ a_timeRef()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_timeRef ( ) const
inlineprivate

Definition at line 163 of file lsfv.h.

163{ return fvSolver().m_timeRef; }

◆ a_TInfinity()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_TInfinity ( ) const
inlineprivate

Definition at line 159 of file lsfv.h.

◆ a_UInfinity()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::a_UInfinity ( ) const
inlineprivate

Definition at line 158 of file lsfv.h.

◆ checkProperties()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::checkProperties
overrideprivatevirtual
Author
Tim Wegmann

Implements Coupling.

Definition at line 137 of file lsfv.cpp.

137 {
138 TRACE();
139
140 ASSERT(lsSolver().a_maxGCellLevel() == fvSolver().maxRefinementLevel(), "");
141}
MInt a_maxGCellLevel(const MInt setId) const
Definition: coupling.h:197

◆ cleanUp()

template<MInt nDim_, class SysEqn >
void CouplingLsFv< nDim_, SysEqn >::cleanUp ( )
inlineoverridevirtual

Implements Coupling.

Definition at line 119 of file lsfv.h.

119{};

◆ computeBodyProperties()

template<MInt nDim_, class SysEqn >
void CouplingLsFv< nDim_, SysEqn >::computeBodyProperties ( MInt  returnMode,
MFloat bodyData,
MInt  body,
MFloat  time 
)
private

◆ computeGCellTimeStep()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::computeGCellTimeStep
private
Author
Daniel Hartmann, Tim Wegmann

Definition at line 214 of file lsfv.cpp.

214 {
215 TRACE();
216
217 if(m_timeStepMethod < 6 || m_timeStepMethod > 8) {
220 mTerm(1, AT_, "Computation with pure LVS not possible with timeStepMethod other than 6 ,7 or 8! Please check!");
221 }
222 }
223
224 ASSERT(m_cfl > 0, "Couldn't read cfl property for the ls-solver timestepping!");
225
226 if(m_timeStepMethod == 8) {
227 lsSolver().m_timeStep = m_cfl * lsSolver().m_gCellDistance;
228
229 } else if(m_timeStepMethod == 6) {
230 lsSolver().m_timeStep = m_cfl * lsSolver().m_gCellDistance;
231 fvSolver().forceTimeStep(lsSolver().m_timeStep / a_timeRef());
232
233 } else if(m_timeStepMethod == 7) {
234 lsSolver().m_timeStep = m_cfl * lsSolver().m_gCellDistance / m_maxVelocity;
235 fvSolver().forceTimeStep(lsSolver().m_timeStep / a_timeRef());
236
237 } else {
239 }
240}
MFloat lsTimeStep() const
Definition: lsfv.h:153
MFloat m_cfl
Definition: lsfv.h:75
MString m_solverMethod
Definition: lsfv.h:78
MFloat m_maxVelocity
Definition: lsfv.h:76
MFloat a_timeRef() const
Definition: lsfv.h:163
MInt m_timeStepMethod
Definition: lsfv.h:77
void forceTimeStep(const MFloat dt)
Force time step externally.
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
Definition: enums.cpp:20
@ MAIA_RUNGE_KUTTA_LEVELSET
Definition: enums.h:66
@ MAIA_SEMI_LAGRANGE_LEVELSET
Definition: enums.h:67
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29

◆ crankAngle()

template<MInt nDim, class SysEqn >
MFloat CouplingLsFv< nDim, SysEqn >::crankAngle ( MFloat  elapsedTime)
private
Author
Tim Wegmann

Definition at line 1886 of file lsfv.cpp.

1886 {
1887 TRACE();
1888
1891
1892 if(first) {
1893 Strouhal = Context::getSolverProperty<MFloat>("Strouhal", m_lsSolverId, AT_, &Strouhal);
1894 first = false;
1895 }
1896
1897 const MFloat mu2 = Strouhal * F2 * PI;
1898 MFloat cad = mu2 * elapsedTime;
1899 const MInt maxNoCycles = 20;
1900
1901 for(MInt cycle = maxNoCycles; cycle > 0; cycle--) {
1902 if(cad >= 4 * PI * cycle) cad = cad - 4 * PI * cycle;
1903 }
1904 cad = cad * 180 / PI;
1905
1906 // consider initial crank angle
1907 cad = cad + m_initialCrankAngle;
1908
1909 return cad;
1910}
MInt m_lsSolverId
Definition: lsfv.h:67
MFloat m_initialCrankAngle
Definition: lsfv.h:70
MFloat m_static_crankAngle_Strouhal
Definition: lsfv.h:102
MBool m_static_crankAngle_first
Definition: lsfv.h:101
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58

◆ finalizeCouplerInit()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::finalizeCouplerInit
overridevirtual

\initializes the coupler in context of the unified run loop

Author
Thomas Lürkens

Implements Coupling.

Definition at line 59 of file lsfv.cpp.

59 {
60 for(MInt s = 0; s < lsSolver().m_noSets; s++) {
61 fvSolver().m_levelSetValues[s].resize(fvSolver().a_noCells());
62 fvSolver().m_curvatureG[s].resize(fvSolver().a_noCells());
63 }
64
68}
void computeGCellTimeStep()
computes the gcell time step
Definition: lsfv.cpp:214
void transferGapCellProperty()
Sets the gapcell-property.
Definition: lsfv.cpp:433
void transferLevelSetValues()
Sets the Levelset-Values in fvSolver.
Definition: lsfv.cpp:398
std::vector< MFloat > * m_curvatureG
std::vector< MFloat > * m_levelSetValues

◆ finalizeSubCoupleInit()

template<MInt nDim_, class SysEqn >
void CouplingLsFv< nDim_, SysEqn >::finalizeSubCoupleInit ( MInt  )
inlineoverridevirtual

Implements Coupling.

Definition at line 117 of file lsfv.h.

117{};

◆ fv2lsId()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::fv2lsId ( const MInt  fvId)
inlineprivate

Definition at line 134 of file lsfv.h.

134 {
135 // TODO labels:COUPLER,FVMB Is this check needed? This functions should never be called for these modes i guess..
136 if(fvSolver().m_levelSetMb && fvSolver().m_constructGField) {
137 return -1;
138 }
139 return convertId(fvSolver(), lsSolver(), fvId);
140 };
MInt convertId(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id on the same-level only!
Definition: couplingutils.h:21

◆ fv2lsIdParent()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::fv2lsIdParent ( const MInt  fvId)
inlineprivate

Definition at line 141 of file lsfv.h.

141 {
142 // TODO labels:COUPLER,FVMB Is this check needed? This functions should never be called for these modes i guess..
143 if(fvSolver().m_levelSetMb && fvSolver().m_constructGField) {
144 return -1;
145 }
146 return convertIdParent(fvSolver(), lsSolver(), fvId);
147 };
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

◆ init()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::init
overridevirtual

\initializes the coupler in context of the unified run loop

Author
Thomas Lürkens

Implements Coupling.

Definition at line 43 of file lsfv.cpp.

43 {
44 mAlloc(fvSolver().m_levelSetValues, lsSolver().m_noSets, "fvSolver().m_levelSetValues", AT_);
45 mAlloc(fvSolver().m_curvatureG, lsSolver().m_noSets, "fvSolver().m_curvatureG", AT_);
46
47 // set the time in the lsSolver:
48 lsSolver().m_time = -99;
50 // transferGapCellProperty();
51 // computeGCellTimeStep();
52 return;
53}
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
Definition: alloc.h:173
MFloat a_time() const
Definition: lsfv.h:162

◆ initData()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::initData
private
Author
Tim Wegmann

Definition at line 120 of file lsfv.cpp.

120 {
121 TRACE();
122
123 // solver-specific data:
126
127 if(lsSolver().m_closeGaps) {
128 mAlloc(m_hadGapCells, lsSolver().m_noGapRegions, "m_hadGapCells", 0, AT_);
129 mAlloc(m_hasGapCells, lsSolver().m_noGapRegions, "m_hasGapCells", 0, AT_);
130 }
131}
MInt * m_hasGapCells
Definition: lsfv.h:73
MInt m_fvSolverId
Definition: lsfv.h:66
MInt * m_hadGapCells
Definition: lsfv.h:72
const MInt m_solverId
a unique solver identifier
Definition: solver.h:90

◆ interpolateLevelSet()

template<MInt nDim, class SysEqn >
MFloat CouplingLsFv< nDim, SysEqn >::interpolateLevelSet ( MInt  cellId,
MFloat point,
MInt  set 
)
private

Definition at line 268 of file lsfv.cpp.

268 {
269 MInt interpolationCells[8] = {0, 0, 0, 0, 0, 0, 0, 0};
270 MInt position = 0;
271
272 position = lsSolver().setUpLevelSetInterpolationStencil(cellId, interpolationCells, point);
273
274 // Interpolate level set
275 if(position > -1) {
276 return lsSolver().interpolateLevelSet(interpolationCells, point, set);
277 } else {
278 return lsSolver().a_levelSetFunctionG(cellId, set);
279 }
280}

◆ ls2fvId()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::ls2fvId ( const MInt  lsId)
inlineprivate

Definition at line 132 of file lsfv.h.

132{ return convertId(lsSolver(), fvSolver(), lsId); };

◆ ls2fvIdParent()

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::ls2fvIdParent ( const MInt  lsId)
inlineprivate

Definition at line 133 of file lsfv.h.

133{ return convertIdParent(lsSolver(), fvSolver(), lsId); };

◆ lsTimeStep()

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::lsTimeStep ( ) const
inlineprivate

Definition at line 153 of file lsfv.h.

153{ return fvSolver().m_timeStep; }

◆ noLevelSetFieldData()

template<MInt nDim, class SysEqn >
MInt CouplingLsFv< nDim, SysEqn >::noLevelSetFieldData
private

Definition at line 284 of file lsfv.cpp.

284 {
286 ASSERT(fvSolver().m_levelSet, "");
287
288 if(lsSolver().m_writeOutAllLevelSetFunctions) {
290 } else {
292 }
293 if(lsSolver().m_writeOutAllCurvatures) {
295 } else {
297 }
298
299 return noLevelSetFieldData;
300}
MInt a_noSets() const
Definition: coupling.h:222
MInt noLevelSetFieldData()
Definition: lsfv.cpp:284

◆ postAdaptation()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::postAdaptation
overridevirtual
Author
Jannik Borgelt

Reimplemented from Coupling.

Definition at line 102 of file lsfv.cpp.

102 {
103 TRACE();
104
105 for(MInt s = 0; s < lsSolver().m_noSets; s++) {
106 fvSolver().m_levelSetValues[s].clear();
107 fvSolver().m_levelSetValues[s].resize(fvSolver().a_noCells());
108 fvSolver().m_curvatureG[s].clear();
109 fvSolver().m_curvatureG[s].resize(fvSolver().a_noCells());
110 }
111
113}

◆ postCouple()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::postCouple ( MInt  recipeStep = 0)
overridevirtual

\ postCouple routine in context of the unified run loop

Author
Thomas Lürkens

Implements Coupling.

Definition at line 86 of file lsfv.cpp.

86 {
88
92
93 if(!lsSolver().m_combustion && !lsSolver().m_levelSetMb && !lsSolver().m_semiLagrange && !lsSolver().m_LSSolver) {
94 returnStep();
95 }
96}
MBool returnStep()
mimics the behaviour of the rungeKuttaStep() methods with respect to increasing time
Definition: lsfv.cpp:246
void testCoupling()
transfers the LevelSetValues from the levelset to the moving boundary Part
Definition: lsfv.cpp:583

◆ preCouple()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::preCouple ( MInt  )
overridevirtual

\ preCouple routine in context of the unified run loop

Author
Jannik Borgelt

Implements Coupling.

Definition at line 74 of file lsfv.cpp.

74 {
75 if(!lsSolver().m_combustion && !lsSolver().m_levelSetMb) {
76 if(lsSolver().m_semiLagrange) {
78 }
79 }
80}
void returnStep_semiLagrange()
mimics the behaviour of the rungeKuttaStep() methods with respect to increasing time
Definition: lsfv.cpp:259

◆ readProperties()

template<MInt nDim_, class SysEqn >
void CouplingLsFv< nDim_, SysEqn >::readProperties ( )
overrideprivatevirtual

Implements Coupling.

◆ returnStep()

template<MInt nDim, class SysEqn >
MBool CouplingLsFv< nDim, SysEqn >::returnStep
private
Author
Tim Wegmann

Definition at line 246 of file lsfv.cpp.

246 {
247 TRACE();
248
251
252 return true;
253}

◆ returnStep_semiLagrange()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::returnStep_semiLagrange
private
Author
Tim Wegmann

Definition at line 259 of file lsfv.cpp.

259 {
260 TRACE();
261
264}

◆ setLsInList()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::setLsInList ( MIntScratchSpace )
private

Definition at line 304 of file lsfv.cpp.

304 {
305 TRACE();
306
307 cerr0 << "Setting Sensors for Fv-Solver adaptation!" << endl;
308
309 MInt bandWidthRef = m_bandWidthRef;
310 MInt bandWidthRefmax = m_bandWidthRefMax;
311
312 MIntScratchSpace sendBufferSize(fvSolver().grid().noNeighborDomains(), AT_, "sendBufferSize");
313 MIntScratchSpace receiveBufferSize(fvSolver().grid().noNeighborDomains(), AT_, "receiveBufferSize");
314 MInt listCount = 0;
315 MIntScratchSpace inList(a_noFvGridCells(), AT_, "inList");
316 for(MInt c = 0; c < a_noFvGridCells(); c++)
317 inList[c] = 0;
318
319 // 2) add the g0-Cells and all parents to the list:
320 MInt endSet = a_noSets();
321 if(lsSolver().m_buildCollectedLevelSetFunction) {
322 endSet = 1;
323 }
324
325 for(MInt set = 0; set < endSet; set++) {
326 for(MInt id = 0; id < lsSolver().a_noG0Cells(set); id++) {
327 MInt fvCellId = ls2fvIdParent(a_G0CellId(id, set));
328 if(fvCellId < 0) continue;
329 if(fvSolver().a_isHalo(fvCellId)) continue;
330 inList[fvCellId] = 1;
331 listCount++;
332 MInt parentId = fvSolver().c_parentId(fvCellId);
333 while(parentId > -1) {
334 if(parentId < a_noFvGridCells()) inList[parentId] = 1;
335 parentId = fvSolver().c_parentId(parentId);
336 }
337 }
338 }
339
340 // Exchange the listCount on all Domains
341 MPI_Allreduce(&listCount, &listCount, 1, MPI_INT, MPI_SUM, fvSolver().mpiComm(), AT_, "listCount", "listCount");
342
343 if(listCount == 0) {
344 if(fvSolver().domainId() == 0) cerr << "No G0-Cells found!" << endl;
345 }
346
347 fvSolver().exchangeData(&inList[0], 1);
348
349 for(MInt level = fvSolver().minLevel(); level < fvSolver().maxRefinementLevel(); level++) {
350 if(level == fvSolver().maxRefinementLevel() - 1) bandWidthRef = bandWidthRefmax;
351
352 // 4) Loop over the number of revinement-grid-cells and add those to the list:
353 for(MInt loopMarker = 1; loopMarker < bandWidthRef; loopMarker++) {
354 for(MInt cellId = 0; cellId < a_noFvGridCells(); cellId++) {
355 if(fvSolver().a_level(cellId) != level) continue;
356 if(inList[cellId] != loopMarker) continue;
357
358 // direct neighbor
359 for(MInt n = 0; n < fvSolver().m_noDirs; n++) {
360 MInt nghbrId = fvSolver().c_neighborId(cellId, n, false);
361 if(nghbrId < 0) continue;
362 if(inList[nghbrId] == 0) inList[nghbrId] = loopMarker + 1;
363
364 // diagonal neighbors
365 if(n == 0 || n == 1) {
366 for(MInt nn = 2; nn < fvSolver().m_noDirs; nn++) {
367 MInt nghbrId2 = fvSolver().c_neighborId(nghbrId, nn, false);
368 if(nghbrId2 < 0) continue;
369 if(inList[nghbrId2] == 0) inList[nghbrId2] = loopMarker + 1;
370 }
371 }
372 if(n == 4 || n == 5) {
373 for(MInt nn = 2; nn < 4; nn++) {
374 MInt nghbrId2 = fvSolver().c_neighborId(nghbrId, nn, false);
375 if(nghbrId2 < 0) continue;
376 if(inList[nghbrId2] == 0) inList[nghbrId2] = loopMarker + 1;
377
378 for(MInt nnn = 0; nnn < 1; nnn++) {
379 MInt nghbrId3 = fvSolver().c_neighborId(nghbrId2, nnn, false);
380 if(nghbrId3 < 0) continue;
381 if(inList[nghbrId3] == 0) inList[nghbrId3] = loopMarker + 1;
382 }
383 }
384 }
385 }
386 }
387
388 fvSolver().exchangeData(&inList[0], 1);
389 }
390 }
391}
MInt m_bandWidthRef
Definition: lsfv.h:63
MInt a_noFvGridCells() const
Definition: lsfv.h:166
MInt m_bandWidthRefMax
Definition: lsfv.h:64
MInt a_G0CellId(MInt id, MInt set) const
Definition: lsfv.h:167
MInt ls2fvIdParent(const MInt lsId)
Definition: lsfv.h:133
MLong c_neighborId(const MInt cellId, const MInt dir, const MBool assertNeighborState=true) const
Returns the grid neighbor id of the grid cell cellId dir.
MLong c_parentId(const MInt cellId) const
Returns the grid parent id of the cell cellId.
static constexpr const MInt m_noDirs
MInt & a_level(const MInt cellId)
Returns the level of the cell from the fvcellcollector cellId.
This class is a ScratchSpace.
Definition: scratch.h:758
MInt maxRefinementLevel() const
void exchangeData(T *data, const MInt dataBlockSize=1)
Exchange memory in 'data' assuming a solver size of 'dataBlockSize' per cell.
std::ostream cerr0
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce
void const MInt cellId
Definition: collector.h:239

◆ subCouple()

template<MInt nDim_, class SysEqn >
void CouplingLsFv< nDim_, SysEqn >::subCouple ( MInt  ,
MInt  ,
std::vector< MBool > &   
)
inlineoverridevirtual

Implements Coupling.

Definition at line 114 of file lsfv.h.

114{};

◆ testCoupling()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::testCoupling
private
Author
Tim Wegmann

Definition at line 583 of file lsfv.cpp.

583 {
584 TRACE();
585
586 if(lsSolver().m_constructGField) return;
587
588 for(MInt fc = 0; fc < a_noFvGridCells(); fc++) {
589 ASSERT(fvSolver().grid().tree().solver2grid(fc) >= 0, "");
590 ASSERT(fvSolver().grid().solverFlag(fvSolver().grid().tree().solver2grid(fc), m_fvSolverId), "");
591#ifdef COUPLING_DEBUG_
592 if(lsSolver().grid().solverFlag(fvSolver().grid().tree().solver2grid(fc), m_lsSolverId)) {
593 ASSERT(ls2fvId(fv2lsId(fc)) == fc,
594 to_string(fc) + " " + to_string(fv2lsId(fc)) + " " + to_string(ls2fvId(fv2lsId(fc))));
595 }
596#endif
597 }
598 for(MInt cellId = 0; cellId < a_noLsCells(); cellId++) {
599 ASSERT(lsSolver().grid().tree().solver2grid(cellId) >= 0, "");
600 ASSERT(lsSolver().grid().solverFlag(lsSolver().grid().tree().solver2grid(cellId), m_lsSolverId), "");
601#ifdef COUPLING_DEBUG_
602 if(fvSolver().grid().solverFlag(lsSolver().grid().tree().solver2grid(cellId), m_fvSolverId)) {
603 ASSERT(fv2lsId(ls2fvId(cellId)) == cellId,
604 to_string(cellId) + " " + to_string(ls2fvId(cellId)) + " " + to_string(fv2lsId(ls2fvId(cellId))));
605 }
606#endif
607 }
608
609 if(!lsSolver().m_levelSetMb) return;
610
611
612#ifdef COUPLING_DEBUG_
613 for(MInt fc = 0; fc < a_noFvGridCells(); fc++) {
614 for(MInt dir = 0; dir < nDim; dir++) {
615 if(lsSolver().grid().solverFlag(fvSolver().grid().tree().solver2grid(fc), m_lsSolverId)) {
616 ASSERT(abs(fvSolver().c_coordinate(fc, dir) - a_coordinateG(fv2lsId(fc), dir)) < 0.00000001, "");
617 }
618 }
619 }
620#endif
621}
MInt a_noLsCells() const
Definition: coupling.h:191
MFloat a_coordinateG(const MInt gCellId, const MInt dim) const
Definition: coupling.h:207
MInt ls2fvId(const MInt lsId)
Definition: lsfv.h:132
MInt fv2lsId(const MInt fvId)
Definition: lsfv.h:134
constexpr GridProxy & grid() const

◆ testGapProperty()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::testGapProperty
private
Author
Tim Wegmann

Definition at line 560 of file lsfv.cpp.

560 {
561 TRACE();
562
563 if(!lsSolver().m_closeGaps) return;
564 if((lsSolver().m_levelSetMb) && fvSolver().m_constructGField) return;
565
566#ifdef COUPLING_DEBUG_
567 for(MInt fc = 0; fc < a_noFvGridCells(); fc++) {
568 if(fvSolver().a_isGapCell(fc) || fvSolver().a_wasGapCell(fc)) {
569 MInt gc = lsSolver().grid().tree().grid2solver(fvSolver().grid().tree().solver2grid(fc));
570 ASSERT(gc > -1, "");
571 ASSERT(lsSolver().a_potentialGapCellClose(gc) > 0
572 && lsSolver().a_potentialGapCellClose(gc) <= fvSolver().m_noEmbeddedBodies,
573 "");
574 }
575 }
576#endif
577}
MInt a_potentialGapCellClose(MInt gcellId) const
Definition: coupling.h:218
MBool a_isGapCell(const MInt cellId) const
Returns isGapCell of the cell cellId.
maia::fv::cell::BitsetType::reference a_wasGapCell(const MInt cellId)
Returns wasGapCell of the cell cellId.

◆ transferGapCellProperty()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::transferGapCellProperty
private
Author
Tim Wegmann

Definition at line 433 of file lsfv.cpp.

433 {
434 TRACE();
435
436 if(!lsSolver().m_closeGaps) return;
437 if(lsSolver().m_noGapRegions <= 0) return;
438 if((lsSolver().m_levelSetMb) && fvSolver().m_constructGField) return;
439
440#ifdef COUPLING_DEBUG_
441 testCoupling();
442#endif
443
444 // 1) reset has/had Gap-Cells
445 for(MInt region = 0; region < lsSolver().m_noGapRegions; region++) {
446 m_hadGapCells[region] = 0;
447 m_hasGapCells[region] = 0;
448 }
449
450 // 2) set a_wasGapCell, m_hadGapCells and initialize a_isGapCell
451 for(MInt fc = 0; fc < a_noFvGridCells(); fc++) {
452 if(fvSolver().a_isGapCell(fc)) {
453 MInt lsId = fv2lsId(fc);
454 ASSERT(lsId > -1, "");
455 // skip G0-regions
456 if(m_G0regionId > -1 && a_potentialGapCellClose(lsId) == m_G0regionId) continue;
457 MInt regionId = a_potentialGapCellClose(lsId) - 2;
458 ASSERT(a_potentialGapCellClose(lsId) > 0 && a_potentialGapCellClose(lsId) <= lsSolver().m_noEmbeddedBodies, "");
459 if(regionId > -1 && regionId < lsSolver().m_noGapRegions && globalTimeStep > 0) {
460 // don't set hadGapCells during initialisation, so that initGapClosure is still called
461 // at the first timeStep!
462 m_hadGapCells[regionId]++;
463 }
464 }
465 if(globalTimeStep > 0) {
467 } else {
468 fvSolver().a_wasGapCell(fc) = false;
469 }
470 fvSolver().a_isGapCell(fc) = false;
471 }
472
473 for(MInt fc = a_noFvGridCells(); fc < a_noFvCells(); fc++) {
474 if(globalTimeStep > 0) {
476 } else {
477 fvSolver().a_wasGapCell(fc) = false;
478 }
479 fvSolver().a_isGapCell(fc) = false;
480 }
481
482 // 4) set a_isGapCell and hasGapCells
483 for(MInt gCellId = 0; gCellId < lsSolver().a_noCells(); gCellId++) {
484 if(a_nearGapG(gCellId)) {
485 MInt fvId = ls2fvId(gCellId);
486 if(fvId < 0) {
487 ASSERT(abs(abs(a_levelSetFunctionG(gCellId, 0)) - a_outsideGValue()) < 0.000001,
488 "ERROR, no fv-Cell found for relevant Gap-Cells!");
489 }
490 if(a_potentialGapCellClose(gCellId) > 0 && a_potentialGapCellClose(gCellId) <= lsSolver().m_noEmbeddedBodies) {
491 fvSolver().a_isGapCell(fvId) = true;
492 MInt regionId = a_potentialGapCellClose(gCellId) - 2;
493 if(regionId > -1 && regionId < lsSolver().m_noGapRegions) {
494 m_hasGapCells[regionId]++;
495 }
496 }
497 }
498 }
500
501 // set isGapCell for g0regionId:
502 if(m_G0regionId > -1) {
503 MInt noG0regionCells = 0;
504 for(MInt gCellId = 0; gCellId < lsSolver().a_noCells(); gCellId++) {
505 if(lsSolver().a_potentialGapCellClose(gCellId) == m_G0regionId && lsSolver().a_gapWidth(gCellId) > 0) {
506 MInt fvId = ls2fvId(gCellId);
507 if(fvId < 0) {
508 ASSERT(abs(abs(a_levelSetFunctionG(gCellId, 0)) - a_outsideGValue()) < 0.000001,
509 "ERROR, no fv-Cell found for relevant Gap-Cells!");
510 }
511 noG0regionCells++;
512 fvSolver().a_isGapCell(fvId) = true;
513 ASSERT(!lsSolver().a_nearGapG(gCellId), "");
514 }
515 }
516#if defined COUPLING_DEBUG_ || !defined NDEBUG
517 MPI_Allreduce(MPI_IN_PLACE, &noG0regionCells, 1, MPI_INT, MPI_SUM, fvSolver().mpiComm(), AT_, "INPLACE",
518 "noG0regionCells");
519 if(lsSolver().domainId() == 0) {
520 cerr << " No of g0-region Cells " << noG0regionCells << endl;
521 }
522#endif
523 }
524
525
526 // at the beginning of the restart
527 if(lsSolver().m_restart && globalTimeStep == fvSolver().m_restartTimeStep) {
528 for(MInt fc = a_noFvGridCells(); fc < a_noFvCells(); fc++) {
530 }
531 for(MInt region = 0; region < lsSolver().m_noGapRegions; region++) {
532 m_hadGapCells[region] = m_hasGapCells[region];
533 }
534 }
535
536 // 3) exchange hadGapCells and hasGapCells for all regions
537 MPI_Allreduce(MPI_IN_PLACE, &m_hadGapCells[0], lsSolver().m_noGapRegions, MPI_INT, MPI_SUM, fvSolver().mpiComm(), AT_,
538 "INPLACE", "m_hadGapCells");
539
540 MPI_Allreduce(MPI_IN_PLACE, &m_hasGapCells[0], lsSolver().m_noGapRegions, MPI_INT, MPI_SUM, fvSolver().mpiComm(), AT_,
541 "INPLACE", "m_hasGapCells");
542
544
545#if defined COUPLING_DEBUG_ || !defined NDEBUG
546 for(MInt region = 0; region < lsSolver().m_noGapRegions; region++) {
547 if(lsSolver().domainId() == 0) {
548 cerr << globalTimeStep << " region " << region << " has " << m_hasGapCells[region] << " had "
549 << m_hadGapCells[region] << endl;
550 }
551 }
552#endif
553}
MBool a_nearGapG(const MInt gcellId) const
Definition: coupling.h:219
MFloat a_outsideGValue() const
Definition: coupling.h:192
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt setId)
Definition: coupling.h:199
void testGapProperty()
transfers the LevelSetValues from the levelset to the moving boundary Part
Definition: lsfv.cpp:560
MInt a_noFvCells() const
Definition: lsfv.h:165
MInt m_G0regionId
Definition: lsfv.h:69
void exchangeGapInfo()
exchanges the Gap-Information with the solver-own communicators!
virtual MInt domainId() const
Return the domainId (rank)
Definition: solver.h:383
MInt globalTimeStep

◆ transferLevelSetValues()

template<MInt nDim, class SysEqn >
void CouplingLsFv< nDim, SysEqn >::transferLevelSetValues
private
Author
Jannik Borgelt

Definition at line 398 of file lsfv.cpp.

398 {
399 TRACE();
400
401 fvSolver().a_noSets() = a_noSets();
403
404 for(MInt s = 0; s < lsSolver().m_noSets; s++) {
405 fvSolver().m_levelSetValues[s].resize(fvSolver().a_noCells());
406 }
407
408 for(MInt s = 0; s < lsSolver().m_noSets; s++) {
409 for(MInt fc = 0; fc < a_noFvCells(); fc++) {
410 MInt lsId = fv2lsIdParent(fc);
412 if(lsId > -1) {
413 fvSolver().a_curvatureG(fc, s) = lsSolver().a_curvatureG(lsId, 0);
414 if(fvSolver().a_isInterface(fc)) {
415 // Interplate levelset for cut-cells
416 MFloat point[nDim];
417 for(MInt d = 0; d < nDim; d++) {
418 point[d] = fvSolver().a_coordinate(fc, d);
419 }
421 } else {
422 fvSolver().a_levelSetFunction(fc, s) = lsSolver().a_levelSetFunctionG(fv2lsIdParent(fc), s);
423 }
424 }
425 }
426 }
427}
MFloat interpolateLevelSet(MInt cellId, MFloat *point, MInt set)
Definition: lsfv.cpp:268
MInt fv2lsIdParent(const MInt fvId)
Definition: lsfv.h:141
MInt & a_noLevelSetFieldData()
Returns the noSets for fv-CellId cellId and set.
MFloat & a_levelSetFunction(const MInt cellId, const MInt set)
Returns the levelSet-value for fv-CellId cellId and set.
MFloat & a_curvatureG(const MInt cellId, const MInt set)
Returns the curvature-value for fv-CellId cellId and set.
MInt & a_noSets()
Returns the noSets for fv-CellId cellId and set.
MFloat & a_coordinate(const MInt cellId, const MInt dir)
Returns the coordinate of the cell from the fvcellcollector cellId for dimension dir.

Friends And Related Function Documentation

◆ FvCartesianSolverXD< nDim, SysEqn >

template<MInt nDim_, class SysEqn >
friend class FvCartesianSolverXD< nDim, SysEqn >
friend

Definition at line 29 of file lsfv.h.

◆ LsCartesianSolver< nDim >

template<MInt nDim_, class SysEqn >
friend class LsCartesianSolver< nDim >
friend

Definition at line 29 of file lsfv.h.

Member Data Documentation

◆ m_bandWidthRef

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_bandWidthRef
private

Definition at line 63 of file lsfv.h.

◆ m_bandWidthRefMax

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_bandWidthRefMax
private

Definition at line 64 of file lsfv.h.

◆ m_cfl

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_cfl
private

Definition at line 75 of file lsfv.h.

◆ m_fvSolverId

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_fvSolverId
private

Definition at line 66 of file lsfv.h.

◆ m_G0regionId

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_G0regionId
private

Definition at line 69 of file lsfv.h.

◆ m_hadGapCells

template<MInt nDim_, class SysEqn >
MInt* CouplingLsFv< nDim_, SysEqn >::m_hadGapCells {}
private

Definition at line 72 of file lsfv.h.

◆ m_hasGapCells

template<MInt nDim_, class SysEqn >
MInt* CouplingLsFv< nDim_, SysEqn >::m_hasGapCells {}
private

Definition at line 73 of file lsfv.h.

◆ m_initialCrankAngle

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_initialCrankAngle
private

Definition at line 70 of file lsfv.h.

◆ m_lsSolverId

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_lsSolverId
private

Definition at line 67 of file lsfv.h.

◆ m_maxNoEmbeddedBodies

template<MInt nDim_, class SysEqn >
constexpr const MInt CouplingLsFv< nDim_, SysEqn >::m_maxNoEmbeddedBodies = 20
staticconstexprprivate

Definition at line 80 of file lsfv.h.

◆ m_maxVelocity

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_maxVelocity
private

Definition at line 76 of file lsfv.h.

◆ m_solverMethod

template<MInt nDim_, class SysEqn >
MString CouplingLsFv< nDim_, SysEqn >::m_solverMethod
private

Definition at line 78 of file lsfv.h.

◆ m_static_computeBodyProperties_amplitude

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_amplitude[m_maxNoEmbeddedBodies] {}
private

Definition at line 84 of file lsfv.h.

◆ m_static_computeBodyProperties_bodyToFunction

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_bodyToFunction[m_maxNoEmbeddedBodies] {}
private

Definition at line 96 of file lsfv.h.

◆ m_static_computeBodyProperties_circleStartAngle

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_circleStartAngle[m_maxNoEmbeddedBodies] {}
private

Definition at line 94 of file lsfv.h.

◆ m_static_computeBodyProperties_first

template<MInt nDim_, class SysEqn >
MBool CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_first = true
private

Definition at line 83 of file lsfv.h.

◆ m_static_computeBodyProperties_freqFactor

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_freqFactor[m_maxNoEmbeddedBodies] {}
private

Definition at line 85 of file lsfv.h.

◆ m_static_computeBodyProperties_initialBodyCenter

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_initialBodyCenter[m_maxNoEmbeddedBodies *3] {}
private

Definition at line 86 of file lsfv.h.

◆ m_static_computeBodyProperties_liftEndAngle1

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_liftEndAngle1[m_maxNoEmbeddedBodies] {}
private

Definition at line 91 of file lsfv.h.

◆ m_static_computeBodyProperties_liftEndAngle2

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_liftEndAngle2[m_maxNoEmbeddedBodies] {}
private

Definition at line 93 of file lsfv.h.

◆ m_static_computeBodyProperties_liftStartAngle1

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_liftStartAngle1[m_maxNoEmbeddedBodies] {}
private

Definition at line 90 of file lsfv.h.

◆ m_static_computeBodyProperties_liftStartAngle2

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_liftStartAngle2[m_maxNoEmbeddedBodies] {}
private

Definition at line 92 of file lsfv.h.

◆ m_static_computeBodyProperties_mu

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_mu[m_maxNoEmbeddedBodies] {}
private

Definition at line 88 of file lsfv.h.

◆ m_static_computeBodyProperties_mu2

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_mu2[m_maxNoEmbeddedBodies] {}
private

Definition at line 89 of file lsfv.h.

◆ m_static_computeBodyProperties_normal

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_normal[m_maxNoEmbeddedBodies *3] {}
private

Definition at line 95 of file lsfv.h.

◆ m_static_computeBodyProperties_omega

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_omega {}
private

Definition at line 97 of file lsfv.h.

◆ m_static_computeBodyProperties_rotAngle

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_rotAngle {}
private

Definition at line 98 of file lsfv.h.

◆ m_static_computeBodyProperties_Strouhal

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_computeBodyProperties_Strouhal {}
private

Definition at line 87 of file lsfv.h.

◆ m_static_crankAngle_first

template<MInt nDim_, class SysEqn >
MBool CouplingLsFv< nDim_, SysEqn >::m_static_crankAngle_first = true
private

Definition at line 101 of file lsfv.h.

◆ m_static_crankAngle_Strouhal

template<MInt nDim_, class SysEqn >
MFloat CouplingLsFv< nDim_, SysEqn >::m_static_crankAngle_Strouhal
private

Definition at line 102 of file lsfv.h.

◆ m_timeStepMethod

template<MInt nDim_, class SysEqn >
MInt CouplingLsFv< nDim_, SysEqn >::m_timeStepMethod
private

Definition at line 77 of file lsfv.h.

◆ nDim

template<MInt nDim_, class SysEqn >
constexpr MInt CouplingLsFv< nDim_, SysEqn >::nDim = nDim_
staticconstexpr

Definition at line 29 of file lsfv.h.


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