Skip to content

Commit

Permalink
code style & doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
arng40 committed Feb 5, 2025
1 parent d216553 commit 0b22bdf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
19 changes: 17 additions & 2 deletions src/coreComponents/dataRepository/ExecutableGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,35 @@ class ExecutableGroup : public dataRepository::Group
*/
TimesteppingBehavior getTimesteppingBehavior() const { return m_timesteppingBehavior; }

/**
* @brief Get the track of substeps
* @return A vector containing the track of substeps
*/
std::vector< real64 > const & getSubStepDt() const { return m_subStepDt; }

/**
* @brief Get the track of substeps
* @return A const vector containing the track of substeps
*/
std::vector< real64 > & getSubStepDt() { return m_subStepDt; }

integer const & getNumOfSubSteps() const { return m_numOfSubSteps; }

/**
* @brief Get number of time sub-steps allowed for the solver
* @return Number of time sub-steps allowed
*/
integer & getNumOfSubSteps() { return m_numOfSubSteps; }

/**
* @brief Set number of time sub-steps allowed for the solver
*/
void setNumOfSubSteps( integer nbStep ) { m_numOfSubSteps = nbStep;}

private:

/// Keep track of substeps
std::vector< real64 > m_subStepDt = {};

/// number of time sub-steps allowed for the solver
integer m_numOfSubSteps = 0;

TimesteppingBehavior m_timesteppingBehavior = TimesteppingBehavior::DoesNotDetermineTimeStepSize;
Expand Down
8 changes: 8 additions & 0 deletions src/coreComponents/events/EventBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,16 @@ class EventBase : public ExecutableGroup
*/
void getExecutionOrder( array1d< integer > & eventCounters );

/**
* @brief Get the track of substeps
* @return A vector containing the the track of substeps
*/
std::vector< real64 > const & getSubStepDt() const { return m_target->getSubStepDt(); }

/**
* @brief Get number of time sub-steps allowed for the solver
* @return Number of time sub-steps allowed
*/
integer const & getNumOfSubSteps() const { return m_target->getNumOfSubSteps(); }


Expand Down
5 changes: 2 additions & 3 deletions src/coreComponents/events/EventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ bool EventManager::run( DomainPartition & domain )

if( subEvent->getEventTarget()->getTimesteppingBehavior() == ExecutableGroup::TimesteppingBehavior::DeterminesTimeStepSize )
{

subStepDt = subEvent->getSubStepDt();
numTimeSteps = subEvent->getNumOfSubSteps();
}
Expand Down Expand Up @@ -269,7 +268,7 @@ void EventManager::outputTime( LogPart & logPart ) const
logPart.addDescription( "- Time : ", timeInfosUnfolded, timeCompletionSeconds );
logPart.addDescription( "- Delta Time : ", units::TimeFormatInfo::fromSeconds( m_dt ).toString() );
logPart.addDescription( "- Cycle : ", m_cycle, cycleLimited );
logPart.setMaxWidth(70 );
logPart.setMaxWidth( 70 );

// We are keeping the old outputs to keep compatibility with current log reading scripts.
if( m_timeOutputFormat==TimeOutputFormat::full )
Expand Down Expand Up @@ -318,7 +317,7 @@ void EventManager::logEndOfCycleInformation( LogPart & logpart,
std::cout << units::TimeFormatInfo::fromSeconds( subStepDt[0] ).toString() << std::endl;
for( integer i = 0; i < numOfSubSteps; ++i )
{
if (i > 0)
if( i > 0 )
{
logMessage << ", ";
}
Expand Down
4 changes: 3 additions & 1 deletion src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ bool PhysicsSolverBase::execute( real64 const time_n,
nextDt,
cycleNumber,
domain );
getNumOfSubSteps()++;

setNumOfSubSteps( subStep );

subStepDt[subStep] = dtAccepted;

// increment the cumulative number of nonlinear and linear iterations
Expand Down

0 comments on commit 0b22bdf

Please sign in to comment.