A class for combining variables. More...
#include <MultiVariable.h>

Public Member Functions | |
| virtual void | add (std::shared_ptr< Variable > newVar) |
| Add a variable to the end of the variable list. | |
| auto | begin () |
| Get the first variable in the MultiVariable. | |
| auto | begin () const |
| Get the first variable in the MultiVariable. | |
| std::string | className () const override |
| A function that returns the name of a variable. | |
| std::shared_ptr< Variable > | clone () const |
| Create a variable of the same type with a new name. | |
| virtual std::shared_ptr< Variable > | clone (const std::string &name) const override |
| Create a variable of the same type with a new name. | |
| std::shared_ptr< VectorSelector > | createVectorSelector () const override |
| Create a VectorSelector. | |
| auto | end () |
| Get end of the MultiVariable array. | |
| auto | end () const |
| Get end of the MultiVariable array. | |
| virtual uint64_t | getID () const |
| Get a unique id hash for the vector. | |
| auto & | getName () const |
| A function that returns the name of a variable. | |
| virtual const Units & | getUnits () const |
| Get the units of this variable. | |
| virtual std::shared_ptr< Variable > | getVariable (size_t which) |
| Get a particular variable from the list of variables. | |
| virtual std::shared_ptr< const Variable > | getVariable (size_t which) const |
| Get a particular variable from the list of variables. | |
| MultiVariable () | |
| MultiVariable (const MultiVariable &)=default | |
| MultiVariable (const std::string &name, std::vector< std::shared_ptr< Variable > > vars={}) | |
| Constructor. | |
| MultiVariable (int64_t, AMP::IO::RestartManager *manager) | |
| MultiVariable (MultiVariable &&)=default | |
| MultiVariable (std::shared_ptr< Variable > var) | |
| Create a multivariable from a single variable. | |
| virtual size_t | numVariables () const |
| Returns the number of variables in the list. | |
| bool | operator!= (const Variable &rhs) const |
| Inverse of ==. | |
| MultiVariable & | operator= (const MultiVariable &)=default |
| MultiVariable & | operator= (MultiVariable &&)=default |
| virtual bool | operator== (const Variable &rhs) const override |
| Compares two variables for equality. | |
| void | registerChildObjects (AMP::IO::RestartManager *manager) const override |
| Register any child objects. | |
| void | removeDuplicateVariables () |
| If there are multiple matching variables in the list, this will remove them. Note that may change the etnry order and will remove any null entries. | |
| virtual void | setUnits (const Units &units) override |
| Set the units of this variable. | |
| virtual void | setVariable (size_t i, std::shared_ptr< Variable > &var) |
| Set a particular variable in the list. | |
| std::shared_ptr< Variable > | shared_from_this () |
| std::shared_ptr< const Variable > | shared_from_this () const |
| void | writeRestart (int64_t) const override |
| Write restart data to file. | |
| virtual | ~MultiVariable ()=default |
Protected Attributes | |
| AMP::Units | d_Units |
| The units this variable is measured in. | |
| std::string | d_VariableName |
| A name given to the variable. | |
| std::vector< std::shared_ptr< Variable > > | d_vVariables |
| List of variables comprising the MultiVariable. | |
| std::weak_ptr< Variable > | weak_ptr_ |
A class for combining variables.
When physics are brought together, individual variables need to be combined to generate a composition. For instance, combining temperature and displacement into a single variable.
Definition at line 20 of file MultiVariable.h.
|
explicit |
Constructor.
Because a MultiVariable is a Variable, it must have a name. This does not change the names of the variables in the list of vectors.
| [in] | name | The name of the MultiVariable |
| [in] | vars | Optional list of variables in the MultiVariable |
|
explicit |
Create a multivariable from a single variable.
|
inline |
Definition at line 123 of file MultiVariable.h.
|
default |
|
default |
|
virtualdefault |
| AMP::LinearAlgebra::MultiVariable::MultiVariable | ( | int64_t | , |
| AMP::IO::RestartManager * | manager | ||
| ) |
|
virtual |
Add a variable to the end of the variable list.
| newVar | a shared pointer to the new variable |
This is an alias for
unless newVar is a MultiVariable. In order to keep heirarchies to a minimum, the members of newVar are added instead of newVar itself.
|
inline |
Get the first variable in the MultiVariable.
Definition at line 26 of file MultiVariable.h.
References d_vVariables.
|
inline |
Get the first variable in the MultiVariable.
Definition at line 36 of file MultiVariable.h.
References d_vVariables.
|
inlineoverridevirtual |
A function that returns the name of a variable.
This gives access to the name
Reimplemented from AMP::LinearAlgebra::Variable.
Definition at line 131 of file MultiVariable.h.
|
inherited |
Create a variable of the same type with a new name.
This function will create a "deep" copy of this variable.
|
overridevirtual |
Create a variable of the same type with a new name.
This function will create a "deep" copy of this variable.
Reimplemented from AMP::LinearAlgebra::Variable.
|
overridevirtual |
Create a VectorSelector.
This function will create a VectorSelector that is able to subset a vector for the variable. This is used by Vector::subsetVectorForVariable which then calls Vector::selectInto.
Reimplemented from AMP::LinearAlgebra::Variable.
|
inline |
Get end of the MultiVariable array.
Definition at line 31 of file MultiVariable.h.
References d_vVariables.
|
inline |
Get end of the MultiVariable array.
Definition at line 41 of file MultiVariable.h.
References d_vVariables.
|
virtualinherited |
Get a unique id hash for the vector.
Reimplemented in AMP::LinearAlgebra::CommSelfVariable, AMP::LinearAlgebra::CommVariable, AMP::LinearAlgebra::MeshVariable, and AMP::LinearAlgebra::MeshIteratorVariable.
|
inlineinherited |
A function that returns the name of a variable.
This gives access to the name
Definition at line 74 of file Variable.h.
References AMP::LinearAlgebra::Variable::d_VariableName.
|
virtualinherited |
Get the units of this variable.
|
virtual |
Get a particular variable from the list of variables.
| which | the index of the variable sought |
This is an alias for
It is bounds checked in debug builds.
|
virtual |
Get a particular variable from the list of variables.
| which | the index of the variable sought |
This is an alias for
It is bounds checked in debug builds.
|
virtual |
|
inherited |
Inverse of ==.
This function performs an equality check and negates it.
| rhs | Variable to compare |
|
default |
|
default |
|
overridevirtual |
Compares two variables for equality.
This operation compares the names.
| rhs | Variable to compare |
Reimplemented from AMP::LinearAlgebra::Variable.
|
overridevirtual |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented from AMP::LinearAlgebra::Variable.
| void AMP::LinearAlgebra::MultiVariable::removeDuplicateVariables | ( | ) |
If there are multiple matching variables in the list, this will remove them. Note that may change the etnry order and will remove any null entries.
|
overridevirtual |
Set the units of this variable.
Reimplemented from AMP::LinearAlgebra::Variable.
|
virtual |
Set a particular variable in the list.
| i | index into the list |
| var | a shared pointer to the variable to be placed in the list |
This is an alias for
This is bounds checked in debug builds
|
inlineinherited |
Definition at line 28 of file enable_shared_from_this.h.
|
inlineinherited |
Definition at line 46 of file enable_shared_from_this.h.
|
overridevirtual |
Write restart data to file.
This function will the variable to an HDF5 file
| fid | File identifier to write |
Reimplemented from AMP::LinearAlgebra::Variable.
|
protectedinherited |
The units this variable is measured in.
Definition at line 155 of file Variable.h.
|
protectedinherited |
A name given to the variable.
Variables have names for easy identification. For instance, some variables are called displacement, concentration, search direction, etc.
Definition at line 151 of file Variable.h.
Referenced by AMP::LinearAlgebra::Variable::getName().
|
protected |
List of variables comprising the MultiVariable.
Definition at line 139 of file MultiVariable.h.
|
mutableprotectedinherited |
Definition at line 69 of file enable_shared_from_this.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |