WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::dfem::variable::UniqueDistributedVariable Class Reference

Class for Unique Distributed Variable. More...

#include <unique_distributed_variable.h>

Inheritance diagram for wxm::dfem::variable::UniqueDistributedVariable:
wxm::variable::distributed_variable_t wxm::variable::variable_t WxObject

Detailed Description

Class for Unique Distributed Variable.

Public Member Functions

 UniqueDistributedVariable (const WmConstOpaquePtr &parentPointer)
 Constructor.
 
 ~UniqueDistributedVariable () override
 Destructor.
 
void setup (const WxCryptSet &wxc) override
 Setup object using supplied crypset.
 
void fill (const std::vector< real > &values) override
 For each component, apply a fill value throughout the domain.
 
void swap (variable_t &other) override
 Swap the internal data storage of this variable with otherVar leaving the outer shell the same, given both have same size and properties.
 
bool check_compatible (const variable_t &other) const override
 Compares this variable to another supplied variable_t and report if they are swap compatible.
 
void dump (WxIoBase &io, WxIoNodeType &group_node) const override
 Dump object to file.
 
void load (WxIoBase &io, const WxIoNodeType &group_node) override
 Load object from file.
 
wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) override
 Acquire a patch array for a specified component.
 
const wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) const override
 Acquire a patch array for a specified component.
 
bool has_patch_array (const int component_index, const int patch_index) const override
 Query if the patch (or component) exist for a variable.
 
void load_subdomain_data (WxIoBase &io, int component_index, const std::string &subdomain, WxIoNodeType comp_group) override
 Loads data from file into a particular component/subdomain section.
 
- Public Member Functions inherited from wxm::variable::distributed_variable_t
virtual void setup (const WxCryptSet &wxc)
 Setup the distributed variable.
 
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.
 
virtual bool has_patch_array (const int component_index, const int patch_index) const =0
 Query if the patch (or component) exist for a variable.
 
virtual void load_subdomain_data (WxIoBase &io, int component_index, const std::string &subdomain, WxIoNodeType comp_group)=0
 Loads data from file into a particular component/subdomain section.
 
- Public Member Functions inherited from wxm::variable::variable_t
virtual ~variable_t ()
 Destroy object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void fill (const std::vector< real > &values)=0
 For each component, apply a fill value throughout the domain.
 
virtual void swap (variable_t &other)=0
 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 check_compatible (const variable_t &other) const =0
 Compares this variable to another supplied variable_t and report if they are swap compatible.
 
virtual void dump (WxIoBase &io, WxIoNodeType &group_node) const
 Dump object to file.
 
virtual void load (WxIoBase &io, const WxIoNodeType &group_node)
 Load object from file.
 
bool has_component (const std::string &component_name) const
 Check if this variable has a component matching the name supplied.
 
int num_components () const
 Returns number of components represented in the variable.
 
const std::vector< std::string > & component_names () const
 Get names of all components.
 
int component_index (const std::string &component_name) const
 Returns the component number associated with the componentName.
 
const std::string & component_name (const int component_index) const
 Returns the component name for a given index.
 
const WmSolverBaseget_parent () 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 Types

typedef std::vector< UniqueDistributedComponent * > component_arrays_t
 Component arrays associates a component index with a patch array map.
 

Protected Attributes

component_arrays_t _component_arrays
 Where the data is stored.
 
WxRange _element_range
 Range of each element.
 
- Protected Attributes inherited from wxm::variable::distributed_variable_t
std::vector< std::string > _subdomain_names
 List of subdomains on which this distributed variable exists.
 
std::vector< std::string > _virtual_subdomains
 List of subdomains on which this distributed variable exists.
 
- Protected Attributes inherited from wxm::variable::variable_t
std::vector< std::string > _component_names
 List of component names in order.
 

Additional Inherited Members

- Protected Member Functions inherited from wxm::variable::distributed_variable_t
 distributed_variable_t (const WmConstOpaquePtr &parent_solver)
 Forces the distributed variable to be a base class.
 
- Protected Member Functions inherited from wxm::variable::variable_t
 variable_t (const WmConstOpaquePtr &parent_solver)
 Constructor sets up basic variable container, but no properties or specifics.
 
- 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.
 

Member Typedef Documentation

◆ component_arrays_t

Component arrays associates a component index with a patch array map.

Constructor & Destructor Documentation

◆ UniqueDistributedVariable()

wxm::dfem::variable::UniqueDistributedVariable::UniqueDistributedVariable ( const WmConstOpaquePtr parentPointer)

Constructor.

◆ ~UniqueDistributedVariable()

wxm::dfem::variable::UniqueDistributedVariable::~UniqueDistributedVariable ( )
override

Destructor.

Member Function Documentation

◆ check_compatible()

bool wxm::dfem::variable::UniqueDistributedVariable::check_compatible ( const variable_t other) const
override

Compares this variable to another supplied variable_t and report if they are swap compatible.

Returns
Result of comparison. True for equal.

◆ dump()

void wxm::dfem::variable::UniqueDistributedVariable::dump ( WxIoBase io,
WxIoNodeType group_node 
) const
overridevirtual

Dump object to file.

This method is passed a group node to which it should write its data. Enough data should be written so that it can reconstruct itself using the load() method.

Parameters
ioI/O object to use for writing
grpNodegroup node to write to

Reimplemented from wxm::variable::variable_t.

◆ fill()

void wxm::dfem::variable::UniqueDistributedVariable::fill ( const std::vector< real > &  values)
overridevirtual

For each component, apply a fill value throughout the domain.

Parameters
fillValuesvalues for each variable component.

Implements wxm::variable::variable_t.

◆ has_patch_array()

bool wxm::dfem::variable::UniqueDistributedVariable::has_patch_array ( const int  component_index,
const int  patch_index 
) const
overridevirtual

Query if the patch (or component) exist for a variable.

Parameters
component_indexComponent of interest
patch_indexPatch of interest
Returns
True if variable exists on patch

Implements wxm::variable::distributed_variable_t.

◆ load()

void wxm::dfem::variable::UniqueDistributedVariable::load ( WxIoBase io,
const WxIoNodeType group_node 
)
overridevirtual

Load object from file.

This method is passed a group node from which its data should be read and then constructed.

Parameters
ioI/O object to use for writing
grpNodegroup node to read from

Reimplemented from wxm::variable::variable_t.

◆ load_subdomain_data()

void wxm::dfem::variable::UniqueDistributedVariable::load_subdomain_data ( WxIoBase io,
int  component_index,
const std::string &  subdomain,
WxIoNodeType  comp_group 
)
overridevirtual

Loads data from file into a particular component/subdomain section.

Implements wxm::variable::distributed_variable_t.

◆ patch_array() [1/2]

const wxm::array::patch_array_t & wxm::dfem::variable::UniqueDistributedVariable::patch_array ( const int  component_index,
const int  patch_index 
) const
overridevirtual

Acquire a patch array for a specified component.

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

Implements wxm::variable::distributed_variable_t.

◆ patch_array() [2/2]

wxm::array::patch_array_t & wxm::dfem::variable::UniqueDistributedVariable::patch_array ( const int  component_index,
const int  patch_index 
)
overridevirtual

Acquire a patch array for a specified component.

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

Implements wxm::variable::distributed_variable_t.

◆ setup()

void wxm::dfem::variable::UniqueDistributedVariable::setup ( const WxCryptSet wxc)
overridevirtual

Setup object using supplied crypset.

Parameters
wxcCryptset using which the object is set up.

Reimplemented from wxm::variable::distributed_variable_t.

◆ swap()

void wxm::dfem::variable::UniqueDistributedVariable::swap ( variable_t other)
override

Swap the internal data storage of this variable with otherVar leaving the outer shell the same, given both have same size and properties.

Parameters
otherVaris the other variable to swap with Undefined if variables are not compatible.
See also
check_compatible()

Member Data Documentation

◆ _component_arrays

component_arrays_t wxm::dfem::variable::UniqueDistributedVariable::_component_arrays
protected

Where the data is stored.

◆ _element_range

WxRange wxm::dfem::variable::UniqueDistributedVariable::_element_range
protected

Range of each element.


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