WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::temporal_solver Class Reference

Base class for all temporal solvers. More...

#include <wmtemporalsolver.h>

Inheritance diagram for wxm::temporal_solver:
WmHostAction WxStepper WxObject WmTemporalSolver_RK wxm::temporal::implicit

Detailed Description

Base class for all temporal solvers.

Classes

struct  temporal_var
 

Public Types

typedef std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
 
- Public Types inherited from WxStepper
typedef real time_t
 Time scalar data type.
 

Public Member Functions

const std::vector< wxm::dfem::variable_adjuster::variable_adjuster_t * > & getVariableAdjusters () const
 
std::vector< variables_type > & getVariables ()
 This function grabs the variables owned by this temporal solver.
 
 temporal_solver (const WmConstOpaquePtr &parent_solver)
 
void setup (const WxCryptSet &wxc) override
 Setup hostaction object using supplied cryptset.
 
bool needsDomain () const override
 Return true if this updater needs a domain to work on.
 
void start_sync (size_t i)
 Asynchronously start syncing ghost cell data on stage i.
 
void finish_sync (size_t i)
 wait for syncing on stage i to finish
 
void fill_local (size_t i, real val=0)
 fill the temporal variables associated with stage i with the given value
 
- Public Member Functions inherited from WmHostAction
 ~WmHostAction () override
 Destroy hostaction.
 
void setup (const WxCryptSet &wxc) override
 Setup hostaction object using supplied cryptset.
 
std::vector< std::string > readVarNames () const
 Get names of all read variables used.
 
std::vector< std::string > writeVarNames () const
 Get names of all write variables used.
 
unsigned numExpectedReadVars () const
 Return number of read variables expected by this hostaction, or minimum number required for hostactions allowing variable number of read vars.
 
unsigned numExpectedWriteVars () const
 Return number of write variables expected by this hostaction, or minimum number required for hostactions allowing variable number of write vars.
 
bool allowsVariableReadVars () const
 Does this hostaction allow variable number of read variables?
 
bool allowsVariableWriteVars () const
 Does this hostaction allow variable number of write variables?
 
virtual bool needsDomain () const
 Return true if this updater needs a domain to work on.
 
void setParentStepHandler (WmExecutionStep< WmHostAction > *parentStepHandler)
 Set enclosing step handler TODO: convert this to being a friend function or something.
 
unsigned numActualReadVars () const
 Get number of actual read variables used when user calls this hostaction.
 
unsigned numActualWriteVars () const
 Get number of actual write variables used when user calls this hostaction.
 
const WmDomaingetDomain () const
 Get (unstructured) domain on which host action works.
 
std::vector< std::string > getWriteVarList () const
 Returns list of write variables for this hostaction.
 
std::vector< std::string > getReadVarList () const
 Returns list of read variables for this hostaction.
 
const WmSolverBasegetParent () const
 Get parent solver object.
 
- Public Member Functions inherited from WxStepper
 WxStepper ()
 Create a new stepper.
 
virtual ~WxStepper ()
 Dtor: destroy object.
 
void setDt (time_t dt)
 Set time-step for the step method.
 
time_t getDt () const
 Get time-step for the step method.
 
void setTimeData (const WxStepper &timeData)
 Set time data for the step method.
 
void setCurrentTime (time_t tcurr)
 Set current time.
 
time_t incrementCurrentTime (time_t tadd)
 Increment current time.
 
time_t getCurrentTime () const
 Get the current time.
 
void setCurrentFrame (int frame)
 Set current frame number.
 
int incrementCurrentFrame ()
 Increment current frame number.
 
int getCurrentFrame () const
 Get the current frame number.
 
virtual WxStepperStatus step ()=0
 Advance the stepper by assigned time step.
 
virtual WxStepperStatus end ()
 Perform actions only done at simulation end.
 
- Public Member Functions inherited from WxObject
virtual ~WxObject ()
 Dtor: destroy object.
 
void setIo (WxIoBase &io)
 Set the I/O pointer for use in object.
 
void setMsg (WxMsgBase &msg)
 Set the msg pointer for use in object.
 
WxIoBasegetIo ()
 Return reference to I/O object.
 
const WxIoBasegetIo () const
 Return constant reference to I/O object.
 
WxMsgBasegetMsg ()
 Return reference to msg object.
 
const WxMsgBasegetMsg () const
 Return const reference to msg object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void init ()
 Initialize the object.
 
virtual void finishBuild ()
 Finish building the object.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual std::string name () const
 Get name of object.
 
void setName (const std::string &nm)
 Set object's name.
 

Protected Member Functions

void typeCheck () override
 Check that the provided variables meet the expected variable types for this hostaction.
 
- Protected Member Functions inherited from WmHostAction
 WmHostAction (const WmConstOpaquePtr &parent_solver)
 Create new hostaction.
 
const std::type_info & getVarType (const std::string &variableName) const
 Get a variable types from the parent solver.
 
const wxm::variable::variable_tgetReadVar (unsigned pos) const
 Get a reference to a read variable.
 
wxm::variable::variable_tgetWriteVar (unsigned pos) const
 Get a reference to a write variable.
 
virtual void typeCheck ()=0
 Check that the provided variables meet the expected variable types for this hostaction.
 
- Protected Member Functions inherited from WxObject
 WxObject ()
 Create object, that will be initialized subsequently.
 
 WxObject (const std::string &name)
 Create object with given name bypassing object setup phase Protected because there is no reason to have a WxObject directly, as it is meant to be a parent class.
 

Protected Attributes

std::vector< wxm::dfem::variable_adjuster::variable_adjuster_t * > adjusters_
 
std::vector< int > va_priorities
 
int min_priority
 
int max_priority
 
std::vector< wxm::dfem::solver::spatial_solver_t * > spatial_solvers_
 
std::vector< variables_typevariables_
 
std::vector< temporal_vartemporal_vars_
 
- Protected Attributes inherited from WmHostAction
bool _allReadVarsSameType
 
bool _allWriteVarsSameType
 
bool _allowsVariableReadVars
 
bool _allowsVariableWriteVars
 
bool _WriteVarConditionHasBeenSet
 
bool _ReadVarConditionHasBeenSet
 
unsigned _numExpectedReadVars
 
unsigned _numExpectedWriteVars
 

Member Typedef Documentation

◆ variables_type

Constructor & Destructor Documentation

◆ temporal_solver()

wxm::temporal_solver::temporal_solver ( const WmConstOpaquePtr parent_solver)
inline

Member Function Documentation

◆ fill_local()

void wxm::temporal_solver::fill_local ( size_t  i,
real  val = 0 
)

fill the temporal variables associated with stage i with the given value

◆ finish_sync()

void wxm::temporal_solver::finish_sync ( size_t  i)

wait for syncing on stage i to finish

◆ getVariableAdjusters()

const std::vector< wxm::dfem::variable_adjuster::variable_adjuster_t * > & wxm::temporal_solver::getVariableAdjusters ( ) const
inline

◆ getVariables()

std::vector< variables_type > & wxm::temporal_solver::getVariables ( )
inline

This function grabs the variables owned by this temporal solver.

Note
This function is only exposed for testing purposes and user should be careful if calling it otherwise. The variables can be changed outside of the temporal solver if they are extracted using this function. The way to change variables in general is through solvers (like DG) or variable adjusters.

◆ needsDomain()

bool wxm::temporal_solver::needsDomain ( ) const
inlineoverridevirtual

Return true if this updater needs a domain to work on.

Returns
true if a domain is needed, false otherwise.

Reimplemented from WmHostAction.

◆ setup()

void wxm::temporal_solver::setup ( const WxCryptSet wxc)
overridevirtual

Setup hostaction object using supplied cryptset.

Parameters
wxcCryptset to use for setting

Reimplemented from WmHostAction.

◆ start_sync()

void wxm::temporal_solver::start_sync ( size_t  i)

Asynchronously start syncing ghost cell data on stage i.

◆ typeCheck()

void wxm::temporal_solver::typeCheck ( )
overrideprotectedvirtual

Check that the provided variables meet the expected variable types for this hostaction.

This is a pure virtual function to ensure that derived sub solvers implement it.

Implements WmHostAction.

Member Data Documentation

◆ adjusters_

std::vector<wxm::dfem::variable_adjuster::variable_adjuster_t*> wxm::temporal_solver::adjusters_
protected

◆ max_priority

int wxm::temporal_solver::max_priority
protected

◆ min_priority

int wxm::temporal_solver::min_priority
protected

◆ spatial_solvers_

std::vector<wxm::dfem::solver::spatial_solver_t*> wxm::temporal_solver::spatial_solvers_
protected

◆ temporal_vars_

std::vector<temporal_var> wxm::temporal_solver::temporal_vars_
protected

◆ va_priorities

std::vector<int> wxm::temporal_solver::va_priorities
protected

◆ variables_

std::vector<variables_type> wxm::temporal_solver::variables_
protected

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