WARPXM v1.10.0
|
#include <variable.h>
Public Member Functions | |
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 WmSolverBase & | get_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. | |
WxIoBase & | getIo () |
Return reference to I/O object. | |
const WxIoBase & | getIo () const |
Return constant reference to I/O object. | |
WxMsgBase & | getMsg () |
Return reference to msg object. | |
const WxMsgBase & | getMsg () 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 | |
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. | |
Protected Attributes | |
std::vector< std::string > | _component_names |
List of component names in order. | |
|
virtual |
Destroy object.
|
protected |
Constructor sets up basic variable container, but no properties or specifics.
Instead, must use setup(wxc) method. Protected because direct variable_t is not intended to be a complete type.
parent_solver | type opaque wrapper to parent solver |
|
pure virtual |
Compares this variable to another supplied variable_t and report if they are swap compatible.
Implemented in wxm::dfem::variable::distributed_variable_t.
int wxm::variable::variable_t::component_index | ( | const std::string & | component_name | ) | const |
Returns the component number associated with the componentName.
component_name | component name to be checked |
const std::string & wxm::variable::variable_t::component_name | ( | const int | component_index | ) | const |
Returns the component name for a given index.
Throws exception if component not found
componentName | component name to be checked |
|
inline |
Get names of all components.
Names | of all components |
|
virtual |
Dump object to file.
This methods is passed a group node to which is should write its data to. Enough data should be written so that it can reconstruct itself using the load() method.
io | I/O object to use for writing |
grpNode | group node to write to |
Reimplemented from WxObject.
Reimplemented in wxm::dfem::variable::distributed_variable_t, and wxm::dfem::variable::UniqueDistributedVariable.
|
pure virtual |
For each component, apply a fill value throughout the domain.
fillValues | values for each variable component. |
Implemented in wxm::dfem::variable::distributed_variable_t, and wxm::dfem::variable::UniqueDistributedVariable.
const WmSolverBase & wxm::variable::variable_t::get_parent | ( | ) | const |
Get the parent solver.
Throws WxExcept if parent solver not set.
|
inline |
Check if this variable has a component matching the name supplied.
componentName | component name to be checked |
|
virtual |
Load object from file.
This method is passed a group node from which its data should be read and then constructed.
io | I/O object to use for writing |
grpNode | group node to read from |
Reimplemented from WxObject.
Reimplemented in wxm::dfem::variable::distributed_variable_t, and wxm::dfem::variable::UniqueDistributedVariable.
|
inline |
Returns number of components represented in the variable.
|
virtual |
Setup object using supplied crypset.
This method reads in parameters needed to initialize the object. This establishes variable name and component names. The cryptset should have variables
NumComponents = int # number of components per value associated with this variable; if specified, components are named c0,c1,etc. ComponentNames = [ string, ... ] # names assigned to each component of the variable
Either ComponentNames or NumComponents can be specified, not both. If neither is specified, 1 component named to match the variable name is assumed. Subsequent calls to this function have no affect.
Component names shoud be a vector of names for each sub component like "x", "y", "z" or "E","B","J" The compents can be hierarchically named using dot '.' tokens such as "E.x", "E.y", "J.normal".
wxc | Cryptset using which the object is set up. |
Reimplemented from WxObject.
Reimplemented in wxm::variable::distributed_variable_t, wxm::dfem::variable::distributed_variable_t, and wxm::dfem::variable::UniqueDistributedVariable.
|
pure virtual |
Swap the internal data storage of this variable with otherVar leaving the outer shell the same, given both have same size and properties.
otherVar | is the other variable to swap with Undefined if variables are not compatible. |
Implemented in wxm::dfem::variable::distributed_variable_t.
|
protected |
List of component names in order.