WARPXM v1.10.0
Loading...
Searching...
No Matches
WmDistributedVariable Class Referenceabstract

Defines an interface for variables that exits over distributed memory. More...

#include <wmvariable.h>

Inheritance diagram for WmDistributedVariable:
WmVariable WxObject WmUnstructuredArray

Detailed Description

Defines an interface for variables that exits over distributed memory.

Public Member Functions

virtual void setup (const WxCryptSet &wxc)
 Setup the distributed variable.
 
virtual void updateGhosts ()
 Update values in the extended regions from neighbor processes.
 
virtual void updateGhosts_register (const int key)
 This is a registered sync call register.
 
virtual void updateGhosts_nb (const int key)
 This is a registered sync call - non blocking.
 
virtual void updateGhosts_wait (const int key)
 This is a registered sync wait call.
 
const std::vector< std::string > & subdomain_names () const
 Get a list of subdomains on which this distributed variable exists.
 
bool on_subdomain (const std::string &subdomain_name) const
 Check if this distributed variable exists on a given subdomain.
 
virtual wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index)=0
 Aquire a patch array for a specified component.
 
virtual const wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) const =0
 Aquire a patch array for a specified component.
 
- Public Member Functions inherited from WmVariable
virtual ~WmVariable ()
 Destroy object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void copy (const WmVariable &var)
 Set the variable from supplied one.
 
virtual void fill (const std::vector< WxAny > &fillValues)
 For each component, apply a fill value throughout the domain.
 
virtual void swap (WmVariable &otherVar)
 Swap the internal data storage of this variable with otherVar leaving the outer shell the same, given both have same size and properties.
 
virtual bool checkCompatible (const WmVariable &var) const
 Compares this variable to another supplied WmVariable and report if they are swap compatible.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
bool hasComponent (const std::string &componentName) const
 Check if this variable has a component matching the name supplied.
 
virtual const std::type_info & getElementTypeForComponent (unsigned int index) const
 Returns a type_info reference for the most primative element type stored by the variable.
 
virtual const std::type_info & getElementType () const
 Returns a type_info reference for the most primative element type stored by the variable.
 
unsigned int getNumComponents () const
 Returns number of components represented in the variable.
 
std::vector< std::string > getComponentNames () const
 Get names of all components (alphabetical order)
 
variableComponent_t getIndexForComponent (const std::string &componentName) const
 Returns the component number associated with the componentName.
 
const std::string & getComponentName (const variableComponent_t index) const
 Returns the component name for a given index.
 
virtual const WxAny min (const int componentIndex) const
 Returns the minimum value for the component identified.
 
virtual const WxAny absoluteMin (const int componentIndex) const
 Returns the absolute minimum value for the component identified Absolute min is the closest value to zero Value will be negative if any negative values were found.
 
const WmSolverBasegetParent () const
 Get the parent solver.
 
- 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

 WmDistributedVariable (const WmConstOpaquePtr &parent_solver)
 Forces the distributed variable to be a base class.
 
- Protected Member Functions inherited from WmVariable
 WmVariable (const WmConstOpaquePtr &parent_solver)
 Constructor sets up basic variable container, but no properties or specifics.
 
 WmVariable (const std::string &name, const std::vector< std::string > &orderedComponentNames)
 Constructor sets up basic variable container, and all properties otherwise set through setup() method in the no-argument form.
 
const std::type_info & getRealTypeID () const
 Get the type that real type aliases.
 
std::string getRealTypeStr () const
 Get the name for the type that real type aliases.
 
- 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< std::string > _subdomain_names
 List of subdomains on which this distributed variable exists.
 
std::vector< std::string > _virtual_names
 List of subdomains on which this distributed variable virtually exists.
 
- Protected Attributes inherited from WmVariable
WmNameTree< variableComponent_t_componentTree
 
unsigned _numComponents
 
std::vector< std::string > _orderedComponentNames
 
SwapImplp_impl
 

Additional Inherited Members

- Public Types inherited from WmVariable
typedef unsigned variableComponent_t
 variableComponent serves as a sort of pointer to individual components of the variable and is the value payload for nodes in the WmNameTree.
 
- Protected Types inherited from WmVariable
typedef WmNameTree< variableComponent_t >::const_iterator component_const_iterator_t
 

Constructor & Destructor Documentation

◆ WmDistributedVariable()

WmDistributedVariable::WmDistributedVariable ( const WmConstOpaquePtr parent_solver)
protected

Forces the distributed variable to be a base class.

Member Function Documentation

◆ on_subdomain()

bool WmDistributedVariable::on_subdomain ( const std::string &  subdomain_name) const

Check if this distributed variable exists on a given subdomain.

Parameters
subdomain_nameSubdomain in question
Returns
True if distributed variable exists on subdomain

◆ patch_array() [1/2]

virtual const wxm::array::patch_array_t & WmDistributedVariable::patch_array ( const int  component_index,
const int  patch_index 
) const
pure virtual

Aquire a patch array for a specified component.

Parameters
component_indexComponent of interest
patch_indexPatch of interest
Returns
Array containing patch data

◆ patch_array() [2/2]

virtual wxm::array::patch_array_t & WmDistributedVariable::patch_array ( const int  component_index,
const int  patch_index 
)
pure virtual

Aquire a patch array for a specified component.

Parameters
component_indexComponent of interest
patch_indexPatch of interest
Returns
Array containing patch data

◆ setup()

virtual void WmDistributedVariable::setup ( const WxCryptSet wxc)
virtual

Setup the distributed variable.

This call will also setup the underlying WmVariable class

Parameters
wxcCryptset

Reimplemented from WmVariable.

Reimplemented in WmUnstructuredArray.

◆ subdomain_names()

const std::vector< std::string > & WmDistributedVariable::subdomain_names ( ) const
inline

Get a list of subdomains on which this distributed variable exists.

Returns

◆ updateGhosts()

virtual void WmDistributedVariable::updateGhosts ( )
inlinevirtual

Update values in the extended regions from neighbor processes.

This involves communication of data across process boundaries. Performed for all components

NOTE: don't use this unless you have to, it can lead to race conditions for asynchronous calls

Reimplemented in WmUnstructuredArray.

◆ updateGhosts_nb()

virtual void WmDistributedVariable::updateGhosts_nb ( const int  key)
inlinevirtual

This is a registered sync call - non blocking.

Must call 'sync_wait' to wait for sync to finish

Parameters
keyKey of registered sync

Reimplemented in WmUnstructuredArray.

◆ updateGhosts_register()

virtual void WmDistributedVariable::updateGhosts_register ( const int  key)
inlinevirtual

This is a registered sync call register.

This function will register a sync operator to a particular key

Parameters
keyKey to register sync to

Reimplemented in WmUnstructuredArray.

◆ updateGhosts_wait()

virtual void WmDistributedVariable::updateGhosts_wait ( const int  key)
inlinevirtual

This is a registered sync wait call.

Function will return when sync for 'key' is complete

This is where the actually update happens

Parameters
keyKey of registered sync

Reimplemented in WmUnstructuredArray.

Member Data Documentation

◆ _subdomain_names

std::vector<std::string> WmDistributedVariable::_subdomain_names
protected

List of subdomains on which this distributed variable exists.

◆ _virtual_names

std::vector<std::string> WmDistributedVariable::_virtual_names
protected

List of subdomains on which this distributed variable virtually exists.


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