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

#include <distributed_variable.h>

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

Public Member Functions

 distributed_variable_t (const WmConstOpaquePtr &parentPointer)
 Constructor.
 
 ~distributed_variable_t () override
 Destructor.
 
void setup (const WxCryptSet &wxc) override
 Setup an array from input file block.
 
void swap (wxm::variable::variable_t &otherVar) 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 wxm::variable::variable_t &var) const override
 Compares this variable to another supplied WmVariable and report if they are swap compatible.
 
wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) override
 Aquire a patch array for a specified component.
 
const wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) const override
 Aquire a patch array for a specified component.
 
bool has_patch_array (const int component_index, const int patch_index) const override
 Check if variable exists on patch.
 
void fill (const std::vector< real > &values) override
 Fill the distributed variable with a value for each component.
 
void dump (WxIoBase &io, WxIoNodeType &group_node) const override
 Write out the array to file.
 
void load (WxIoBase &io, const WxIoNodeType &group_node) override
 Load object from file.
 
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< distributed_component_t * > 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.
 
wxm::basis::basis_t_basis
 Basis associated with array.
 
- 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

◆ distributed_variable_t()

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

Constructor.

◆ ~distributed_variable_t()

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

Destructor.

Member Function Documentation

◆ check_compatible()

bool wxm::dfem::variable::distributed_variable_t::check_compatible ( const wxm::variable::variable_t var) const
overridevirtual

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

Returns
Result of comparison. True for equal.

Implements wxm::variable::variable_t.

◆ dump()

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

Write out the array to file.

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

Reimplemented from wxm::variable::variable_t.

◆ fill()

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

Fill the distributed variable with a value for each component.

Parameters
valuesList of values to fill variable with - must have same number of entries as there are components

Implements wxm::variable::variable_t.

◆ has_patch_array()

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

Check if variable exists on patch.

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

Implements wxm::variable::distributed_variable_t.

◆ load()

void wxm::dfem::variable::distributed_variable_t::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::distributed_variable_t::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::distributed_variable_t::patch_array ( const int  component_index,
const int  patch_index 
) const
overridevirtual

Aquire 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::distributed_variable_t::patch_array ( const int  component_index,
const int  patch_index 
)
overridevirtual

Aquire 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::distributed_variable_t::setup ( const WxCryptSet wxc)
overridevirtual

Setup an array from input file block.

This leads to establishing associated domain, array dimensions, and memory allocation.

This is a collective call. All processes that own parts of this array must make this call.

Parameters
wxcCryptset to setup variable

Reimplemented from wxm::variable::distributed_variable_t.

◆ swap()

void wxm::dfem::variable::distributed_variable_t::swap ( wxm::variable::variable_t otherVar)
overridevirtual

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
checkCompatible()

Implements wxm::variable::variable_t.

Member Data Documentation

◆ _basis

wxm::basis::basis_t* wxm::dfem::variable::distributed_variable_t::_basis
protected

Basis associated with array.

◆ _component_arrays

component_arrays_t wxm::dfem::variable::distributed_variable_t::_component_arrays
protected

Where the data is stored.

◆ _element_range

WxRange wxm::dfem::variable::distributed_variable_t::_element_range
protected

Range of each element.


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