WARPXM v1.10.0
Loading...
Searching...
No Matches
WmFunctionApplicator Class Reference

The WmFunctionApplicator class generates initial conditions. More...

#include <wmfunctionapplicator.h>

Inheritance diagram for WmFunctionApplicator:
WmHostAction WxStepper WxObject

Detailed Description

The WmFunctionApplicator class generates initial conditions.

The step function in this class is not thread safe within a variable on a given cluster node. If this class is called multiple times in parallel the data uploaded to the OpenCL buffers will be undefined (i.e. we don't know which WmFunctionApplicator will have applied initial conditions). In other words:

This class is not thread safe given two/more WmFunctionApplicator's acting on two/more components of the same variable.

This class is thread safe for complete variables (i.e. all components), or groups of complete variables.

Always put all initial conditions into a single instance of WmFunctionApplicator

This is not an optimized class: Only use this for initial conditions

Also note that this class requires the arrays to be in double precision

TODO: fix the type casting issue for initial conditions

Classes

class  applicator_t
 

Public Types

typedef std::vector< WmICFunction * > functions_t
 
typedef std::vector< applicator_t * > applicators_t
 
- Public Types inherited from WxStepper
typedef real time_t
 Time scalar data type.
 

Public Member Functions

 WmFunctionApplicator (const WmConstOpaquePtr &parent_solver)
 Create new WmFunctionApplicator host action.
 
 ~WmFunctionApplicator ()
 Destroy WmFunctionApplicator host action.
 
void setup (const WxCryptSet &wxc)
 Setup HostAction object using supplied cryptset.
 
virtual void typeCheck ()
 check that variable types are appropriate for this HostAction.
 
WxStepperStatus step ()
 Step the solver by assigned time step.
 
bool needsDomain () const
 Return false because icGenerator is not yet setup for structured grids.
 
- 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.
 

Additional Inherited Members

- 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 inherited from WmHostAction
bool _allReadVarsSameType
 
bool _allWriteVarsSameType
 
bool _allowsVariableReadVars
 
bool _allowsVariableWriteVars
 
bool _WriteVarConditionHasBeenSet
 
bool _ReadVarConditionHasBeenSet
 
unsigned _numExpectedReadVars
 
unsigned _numExpectedWriteVars
 

Member Typedef Documentation

◆ applicators_t

◆ functions_t

Constructor & Destructor Documentation

◆ WmFunctionApplicator()

WmFunctionApplicator::WmFunctionApplicator ( const WmConstOpaquePtr parent_solver)

Create new WmFunctionApplicator host action.

Parameters
parent_solvertype opaque wrapper to parent solver

◆ ~WmFunctionApplicator()

WmFunctionApplicator::~WmFunctionApplicator ( )

Destroy WmFunctionApplicator host action.

Member Function Documentation

◆ needsDomain()

bool WmFunctionApplicator::needsDomain ( ) const
inlinevirtual

Return false because icGenerator is not yet setup for structured grids.

Returns
false

Reimplemented from WmHostAction.

◆ setup()

void WmFunctionApplicator::setup ( const WxCryptSet wxc)
virtual

Setup HostAction object using supplied cryptset.

Parameters
wxcCryptset to use for setup

Reimplemented from WxObject.

◆ step()

WxStepperStatus WmFunctionApplicator::step ( )
virtual

Step the solver by assigned time step.

Returns
return status of step

Implements WxStepper.

◆ typeCheck()

virtual void WmFunctionApplicator::typeCheck ( )
virtual

check that variable types are appropriate for this HostAction.

Implements WmHostAction.


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