PlasCom2  1.0
XPACC Multi-physics simluation application
rk4advancer< DomainType > Class Template Reference

Detailed Description

template<typename DomainType>
class rk4advancer< DomainType >

Definition at line 43 of file RK4Advancer.H.

#include <RK4Advancer.H>

Public Types

enum  { ZAXPYKERNEL =0, RKSUMKERNEL, NUMTIMERS }
 
typedef simulation::advancer::base< DomainType > DomainAdvancerType
 
typedef DomainType::GridType GridType
 
typedef DomainType::StateType StateType
 
typedef DomainType::HaloType HaloType
 
typedef DomainType::OperatorType OperatorType
 
typedef DomainType::RHSType RHSType
 
- Public Types inherited from base< DomainType >
typedef DomainType::GridType GridType
 
typedef DomainType::StateType StateType
 

Public Member Functions

 rk4advancer ()
 
 rk4advancer (DomainType &inDomain)
 
 rk4advancer (fixtures::ConfigurationType &inConfig, DomainType &inDomain)
 
void SetCommunication (bool onoff)
 
void SetTimers (bool onoff)
 
virtual int Configure (fixtures::ConfigurationType &inConfig)
 
virtual int InitializeAdvance ()
 Initialize advance called every time step. More...
 
virtual void SetRHS (RHSType &inRHS)
 
void SetMessageStream (std::ostream &inStream)
 
virtual int InitializeAdvancer (DomainType &inDomain, pcpp::ParallelGlobalType &inGlobal, std::ostream &inStream)
 Initializes the advancer object. More...
 
int SetupStateMessage (StateType &inState, HaloType &inHalo)
 
int PackStateMessage (StateType &inState, HaloType &inHalo, int messageId, int threadId)
 
int UnpackStateMessage (StateType &inState, HaloType &inHalo, int messageId, int threadId)
 
int SyncStates ()
 
virtual int FinalizeAdvance ()
 Last call after 1 advance step. More...
 
virtual int GetStateUpdate (GridType &inGrid, StateType &inState, StateType &stateUpdate)
 
virtual int InterGridExchange ()
 
virtual void SetError (const std::string &errorMessage, fixtures::CommunicatorType &inComm)
 
virtual int ErrorCheck (fixtures::CommunicatorType &inComm)
 
virtual int AdvanceDomain ()
 Advances domain, grid, and state by one step. More...
 
int GetRHS (GridType &currentGrid, HaloType &gridHalo, StateType &inState, StateType &stateRHS, int myThreadId)
 
int AXPY (double a, StateType &xState, StateType &yState, StateType &outState, int localGridIndex, int myThreadId)
 
int RKSum (int localGridIndex, int myThreadId)
 
void GetTimers (double **timersPtr, const char ***namesPtr, unsigned int *numTimers)
 
void GetCounters (long long ***countersPtr)
 
void SetGlobal (pcpp::ParallelGlobalType &inGlobal)
 
void SyncIntervals ()
 
- Public Member Functions inherited from base< DomainType >
 base ()
 
 base (DomainType &inDomain)
 
virtual int InitializeAdvancer (DomainType &inDomain, std::ostream &messageStream)
 

Public Attributes

bool errCheck
 
- Public Attributes inherited from base< DomainType >
bool errCheck
 

Protected Attributes

pcpp::ParallelGlobalTypemyGlobalPtr
 
bool timersOn
 
bool communicateState
 
double advancerTimers [NUMTIMERS]
 
long long * advancerCounters [NUMTIMERS]
 
int numStateFields
 
int myErrorCode
 
std::vector< int > threadStage
 
std::vector< int > threadGrid
 
int numGrids
 
int numStages
 
double rkH
 
double * timePtr
 
double * timeStepPtr
 
std::vector< RHSType * > rhsHandlers
 
RHSTyperhsHandlerPtr
 
std::vector< std::string > advancerFields
 
std::vector< double > stageWeights
 
std::vector< double > updateWeights
 
std::vector< std::vector< StateType > > stageStates
 
std::vector< std::vector< StateType > > stageKs
 
std::vector< size_t > numPointsGrids
 
std::vector< std::vector< size_t > > gridSizes
 
std::vector< int > stateMessageIds
 
std::vector< double * > gridTimes
 
std::vector< std::vector< std::vector< size_t > > > gridFortranIntervals
 
std::vector< std::vector< int > > gridNeighbors
 
double myTime
 
double myTimeStep
 
- Protected Attributes inherited from base< DomainType >
fixtures::ConfigurationType advancerConfig
 
DomainType * domainPtr
 
std::ostream * messageStreamPtr
 
Inheritance diagram for rk4advancer< DomainType >:
Collaboration diagram for rk4advancer< DomainType >:

Member Typedef Documentation

◆ DomainAdvancerType

Definition at line 50 of file RK4Advancer.H.

◆ GridType

typedef DomainType::GridType GridType

Definition at line 58 of file RK4Advancer.H.

◆ HaloType

typedef DomainType::HaloType HaloType

Definition at line 60 of file RK4Advancer.H.

◆ OperatorType

typedef DomainType::OperatorType OperatorType

Definition at line 61 of file RK4Advancer.H.

◆ RHSType

typedef DomainType::RHSType RHSType

Definition at line 62 of file RK4Advancer.H.

◆ StateType

typedef DomainType::StateType StateType

Definition at line 59 of file RK4Advancer.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ZAXPYKERNEL 
RKSUMKERNEL 
NUMTIMERS 

Definition at line 47 of file RK4Advancer.H.

Constructor & Destructor Documentation

◆ rk4advancer() [1/3]

rk4advancer ( )
inline

Definition at line 66 of file RK4Advancer.H.

◆ rk4advancer() [2/3]

rk4advancer ( DomainType &  inDomain)
inline

Definition at line 79 of file RK4Advancer.H.

◆ rk4advancer() [3/3]

rk4advancer ( fixtures::ConfigurationType inConfig,
DomainType &  inDomain 
)
inline

Definition at line 93 of file RK4Advancer.H.

Member Function Documentation

◆ AdvanceDomain()

virtual int AdvanceDomain ( )
inlinevirtual

Advances domain, grid, and state by one step.

Performs advance the domain's state(s) $\Psi_{n} \rightarrow \Psi_{n+1}$. The domain $\Psi_n$ is replaced by $\Psi_{n+1}$ on success, and the old $\Psi_n$ is stored internally if needed.

Returns
0 on success, non-zero otherwise

Done by caller?

Todo:
Add API for caller-level FinalizeAdvance

Reimplemented from base< DomainType >.

Definition at line 455 of file RK4Advancer.H.

References operators::AXPY(), error::FINAL, ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionEntry(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionExit(), error::IGX, error::INIT, and error::RHS.

Referenced by application::RunMaxwellSolver(), application::RunPlasCom2(), TestMaxwellRHSTimeIntegrate(), TestRK4Advancer(), and TestRK4Advancer2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AXPY()

int AXPY ( double  a,
StateType xState,
StateType yState,
StateType outState,
int  localGridIndex,
int  myThreadId 
)
inline
Todo:
This should be an interior-only update (currently AXPY the whole state!)
Todo:
Need interval-based AXPY

Definition at line 707 of file RK4Advancer.H.

References a, databuffer::Data(), FC_MODULE(), numComponents, numPoints, ix::profiler::Time(), and zaxpy().

Here is the call graph for this function:

◆ Configure()

virtual int Configure ( fixtures::ConfigurationType inConfig)
inlinevirtual

Reimplemented from base< DomainType >.

Definition at line 114 of file RK4Advancer.H.

References Parameters::GetValueVector().

Here is the call graph for this function:

◆ ErrorCheck()

virtual int ErrorCheck ( fixtures::CommunicatorType inComm)
inlinevirtual

Reimplemented from base< DomainType >.

Definition at line 443 of file RK4Advancer.H.

◆ FinalizeAdvance()

virtual int FinalizeAdvance ( )
inlinevirtual

Last call after 1 advance step.

This function just copies out the final state to the domain's storage for it's state data

Reimplemented from base< DomainType >.

Definition at line 405 of file RK4Advancer.H.

◆ GetCounters()

void GetCounters ( long long ***  countersPtr)
inline

Definition at line 886 of file RK4Advancer.H.

◆ GetRHS()

int GetRHS ( GridType currentGrid,
HaloType gridHalo,
StateType inState,
StateType stateRHS,
int  myThreadId 
)
inline

Definition at line 666 of file RK4Advancer.H.

◆ GetStateUpdate()

virtual int GetStateUpdate ( GridType inGrid,
StateType inState,
StateType stateUpdate 
)
inlinevirtual

Definition at line 421 of file RK4Advancer.H.

◆ GetTimers()

void GetTimers ( double **  timersPtr,
const char ***  namesPtr,
unsigned int *  numTimers 
)
inline

Definition at line 879 of file RK4Advancer.H.

References timerNames.

Referenced by application::RunMaxwellSolver(), and application::RunPlasCom2().

Here is the caller graph for this function:

◆ InitializeAdvance()

virtual int InitializeAdvance ( )
inlinevirtual

Initialize advance called every time step.

This function prepares any data structures for taking a time step. It resets the rkStage to 0, Zero's out any temporary structures, and does the appropriate assignments to the intermediate states. After this call, the substates for any previous step are no longer available.

Reimplemented from base< DomainType >.

Definition at line 133 of file RK4Advancer.H.

◆ InitializeAdvancer()

virtual int InitializeAdvancer ( DomainType &  inDomain,
pcpp::ParallelGlobalType inGlobal,
std::ostream &  inStream 
)
inlinevirtual

Initializes the advancer object.

This function initializes the advancer to use the given domain, it's grids, and states. The required halo for the method is created for each grid and used to populate any halo buffers with the required state information to perform the first step. This particular one is specific to 1d scalar advection and populates the relevant parameters, Tau, boundary data, CFL, time, and the state field U.

Parameters
inDomainref to the DomainType object which itself contains everything about the domain to operate on
messageStreamref to std::ostream object for any status messages, used for lifetime of advancer
Returns
0 on success, 1 on unsuccess

Definition at line 168 of file RK4Advancer.H.

References bufferSizes, databuffer::Data(), gridSizes, and numPoints.

Referenced by application::RunMaxwellSolver(), application::RunPlasCom2(), TestMaxwellRHSTimeIntegrate(), TestRK4Advancer(), and TestRK4Advancer2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterGridExchange()

virtual int InterGridExchange ( )
inlinevirtual

Reimplemented from base< DomainType >.

Definition at line 425 of file RK4Advancer.H.

◆ PackStateMessage()

int PackStateMessage ( StateType inState,
HaloType inHalo,
int  messageId,
int  threadId 
)
inline
Todo:
switch to threaded message pack

Definition at line 321 of file RK4Advancer.H.

References numComponents.

◆ RKSum()

int RKSum ( int  localGridIndex,
int  myThreadId 
)
inline

Definition at line 795 of file RK4Advancer.H.

References FC_MODULE(), numComponents, numPoints, rungekutta::rk4sum(), and ix::profiler::Time().

Here is the call graph for this function:

◆ SetCommunication()

void SetCommunication ( bool  onoff)
inline

Definition at line 109 of file RK4Advancer.H.

Referenced by application::RunPlasCom2(), and TestMaxwellRHSTimeIntegrate().

Here is the caller graph for this function:

◆ SetError()

virtual void SetError ( const std::string &  errorMessage,
fixtures::CommunicatorType inComm 
)
inlinevirtual

Reimplemented from base< DomainType >.

Definition at line 427 of file RK4Advancer.H.

◆ SetGlobal()

void SetGlobal ( pcpp::ParallelGlobalType inGlobal)
inline

Definition at line 891 of file RK4Advancer.H.

◆ SetMessageStream()

void SetMessageStream ( std::ostream &  inStream)
inlinevirtual

Reimplemented from base< DomainType >.

Definition at line 148 of file RK4Advancer.H.

◆ SetRHS()

virtual void SetRHS ( RHSType inRHS)
inlinevirtual

Definition at line 138 of file RK4Advancer.H.

◆ SetTimers()

void SetTimers ( bool  onoff)
inline

Definition at line 111 of file RK4Advancer.H.

Referenced by application::RunMaxwellSolver(), application::RunPlasCom2(), and TestMaxwellRHSTimeIntegrate().

Here is the caller graph for this function:

◆ SetupStateMessage()

int SetupStateMessage ( StateType inState,
HaloType inHalo 
)
inline

Definition at line 315 of file RK4Advancer.H.

◆ SyncIntervals()

void SyncIntervals ( )
inline

Definition at line 896 of file RK4Advancer.H.

References sizeextent::Flatten().

Referenced by application::RunMaxwellSolver(), application::RunPlasCom2(), TestMaxwellRHSTimeIntegrate(), and TestRK4Advancer2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SyncStates()

int SyncStates ( )
inline

Definition at line 354 of file RK4Advancer.H.

Referenced by application::RunMaxwellSolver(), and application::RunPlasCom2().

Here is the caller graph for this function:

◆ UnpackStateMessage()

int UnpackStateMessage ( StateType inState,
HaloType inHalo,
int  messageId,
int  threadId 
)
inline
Todo:
switch to threaded message pack

Definition at line 337 of file RK4Advancer.H.

References numComponents.

Member Data Documentation

◆ advancerCounters

long long* advancerCounters[NUMTIMERS]
protected

Definition at line 938 of file RK4Advancer.H.

◆ advancerFields

std::vector<std::string> advancerFields
protected

Definition at line 961 of file RK4Advancer.H.

◆ advancerTimers

double advancerTimers[NUMTIMERS]
protected

Definition at line 937 of file RK4Advancer.H.

◆ communicateState

bool communicateState
protected

Definition at line 935 of file RK4Advancer.H.

◆ errCheck

bool errCheck

Definition at line 64 of file RK4Advancer.H.

◆ gridFortranIntervals

std::vector< std::vector< std::vector<size_t> > > gridFortranIntervals
protected

Definition at line 976 of file RK4Advancer.H.

◆ gridNeighbors

std::vector<std::vector<int> > gridNeighbors
protected

Definition at line 984 of file RK4Advancer.H.

◆ gridSizes

std::vector<std::vector<size_t> > gridSizes
protected

Definition at line 972 of file RK4Advancer.H.

◆ gridTimes

std::vector<double *> gridTimes
protected

Definition at line 974 of file RK4Advancer.H.

◆ myErrorCode

int myErrorCode
protected

Definition at line 944 of file RK4Advancer.H.

◆ myGlobalPtr

pcpp::ParallelGlobalType* myGlobalPtr
protected

Definition at line 929 of file RK4Advancer.H.

◆ myTime

double myTime
protected

Definition at line 987 of file RK4Advancer.H.

◆ myTimeStep

double myTimeStep
protected

Definition at line 988 of file RK4Advancer.H.

◆ numGrids

int numGrids
protected

Definition at line 948 of file RK4Advancer.H.

◆ numPointsGrids

std::vector<size_t> numPointsGrids
protected

Definition at line 971 of file RK4Advancer.H.

◆ numStages

int numStages
protected

Definition at line 950 of file RK4Advancer.H.

◆ numStateFields

int numStateFields
protected

Definition at line 943 of file RK4Advancer.H.

◆ rhsHandlerPtr

RHSType* rhsHandlerPtr
protected

Definition at line 958 of file RK4Advancer.H.

◆ rhsHandlers

std::vector<RHSType *> rhsHandlers
protected

Definition at line 957 of file RK4Advancer.H.

◆ rkH

double rkH
protected

Definition at line 952 of file RK4Advancer.H.

◆ stageKs

std::vector<std::vector<StateType> > stageKs
protected

Definition at line 968 of file RK4Advancer.H.

◆ stageStates

std::vector<std::vector<StateType> > stageStates
protected

Definition at line 967 of file RK4Advancer.H.

◆ stageWeights

std::vector<double> stageWeights
protected

Definition at line 964 of file RK4Advancer.H.

◆ stateMessageIds

std::vector<int> stateMessageIds
protected

Definition at line 973 of file RK4Advancer.H.

◆ threadGrid

std::vector<int> threadGrid
protected

Definition at line 946 of file RK4Advancer.H.

◆ threadStage

std::vector<int> threadStage
protected

Definition at line 945 of file RK4Advancer.H.

◆ timePtr

double* timePtr
protected

Definition at line 954 of file RK4Advancer.H.

◆ timersOn

bool timersOn
protected

Definition at line 934 of file RK4Advancer.H.

◆ timeStepPtr

double* timeStepPtr
protected

Definition at line 955 of file RK4Advancer.H.

◆ updateWeights

std::vector<double> updateWeights
protected

Definition at line 965 of file RK4Advancer.H.


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