A variable used to create a SubsetVector. More...
#include <SubsetVariable.h>

Public Member Functions | |
| 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 |
| Create a variable of the same type with a new name. | |
| std::shared_ptr< VectorSelector > | createVectorSelector () const override |
| Create a VectorSelector. | |
| virtual AMP::AMP_MPI | getComm (const AMP::AMP_MPI &comm) const =0 |
| Return the comm for the subset. | |
| 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 std::shared_ptr< AMP::Discretization::DOFManager > | getSubsetDOF (std::shared_ptr< AMP::Discretization::DOFManager > manager) const =0 |
| Return a DOFManager that describes the subset. | |
| virtual const Units & | getUnits () const |
| Get the units of this variable. | |
| bool | operator!= (const Variable &rhs) const |
| Inverse of ==. | |
| virtual bool | operator== (const Variable &rhs) const |
| Compares two variables for equality. | |
| virtual void | registerChildObjects (AMP::IO::RestartManager *manager) const |
| Register any child objects. | |
| virtual void | setUnits (const Units &u) |
| Set the units of this variable. | |
| std::shared_ptr< Variable > | shared_from_this () |
| std::shared_ptr< const Variable > | shared_from_this () const |
| SubsetVariable (const std::string &name) | |
| Constructor. | |
| SubsetVariable (int64_t) | |
| virtual Vector::const_shared_ptr | view (Vector::const_shared_ptr) const |
| This vector is a subset of an AMP Vector. | |
| virtual Vector::shared_ptr | view (Vector::shared_ptr) const |
| This vector is a subset of an AMP Vector. | |
| void | writeRestart (int64_t) const override |
| Write restart data to file. | |
Protected Attributes | |
| AMP::Units | d_Units |
| The units this variable is measured in. | |
| std::string | d_VariableName |
| A name given to the variable. | |
| std::weak_ptr< Variable > | weak_ptr_ |
A variable used to create a SubsetVector.
Definition at line 16 of file SubsetVariable.h.
|
inlineexplicit |
Constructor.
| [in] | name | The name of the variable |
Definition at line 22 of file SubsetVariable.h.
| AMP::LinearAlgebra::SubsetVariable::SubsetVariable | ( | int64_t | ) |
|
inlineoverridevirtual |
A function that returns the name of a variable.
This gives access to the name
Reimplemented from AMP::LinearAlgebra::Variable.
Definition at line 96 of file SubsetVariable.h.
|
inherited |
Create a variable of the same type with a new name.
This function will create a "deep" copy of this variable.
|
virtualinherited |
Create a variable of the same type with a new name.
This function will create a "deep" copy of this variable.
Reimplemented in AMP::LinearAlgebra::MultiVariable.
|
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.
|
pure virtual |
Return the comm for the subset.
| [in] | comm | The comm of the original vector / DOFManager |
Implemented in AMP::LinearAlgebra::CommSelfVariable, AMP::LinearAlgebra::CommVariable, AMP::LinearAlgebra::MeshVariable, AMP::LinearAlgebra::MeshIteratorVariable, and AMP::LinearAlgebra::StridedVariable.
|
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.
|
pure virtual |
Return a DOFManager that describes the subset.
| [in] | manager | The DOF manager we want to subset |
Implemented in AMP::LinearAlgebra::CommSelfVariable, AMP::LinearAlgebra::CommVariable, AMP::LinearAlgebra::MeshVariable, AMP::LinearAlgebra::MeshIteratorVariable, and AMP::LinearAlgebra::StridedVariable.
|
virtualinherited |
Get the units of this variable.
|
inherited |
Inverse of ==.
This function performs an equality check and negates it.
| rhs | Variable to compare |
|
virtualinherited |
Compares two variables for equality.
This operation compares the names.
| rhs | Variable to compare |
Reimplemented in AMP::LinearAlgebra::MultiVariable.
|
virtualinherited |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented in AMP::LinearAlgebra::MultiVariable.
|
virtualinherited |
Set the units of this variable.
Reimplemented in AMP::LinearAlgebra::MultiVariable.
|
inlineinherited |
Definition at line 28 of file enable_shared_from_this.h.
|
inlineinherited |
Definition at line 46 of file enable_shared_from_this.h.
|
virtual |
This vector is a subset of an AMP Vector.
Given an AMP Vector, this will create a view of a subset of the vector. For instance, if \(\mathbf{a} = \{ a_0 a_1 a_2 \ldots a_n\}\), and \(S\) is a set of non-negative integers \(( s_0 s_1 \ldots s_m )\) such that \(0 \le s_i \le n\), then the SubsetVector will be the vector \(\mathbf{a}_S = \{ a_{s_0} a_{s_1} a_{s_2} \ldots a_{s_m}\} \).
Since this is a view, any change to vec2 will be reflected on vec1 and vice versa. vec2 is a sparse vector, with a mapping of new index to old. vec3, on the other hand, is a dense vector without an index. If a lot of computation is necessary on the sparse vector, the data can be copied in and out:
Reimplemented in AMP::LinearAlgebra::CommSelfVariable.
|
virtual |
This vector is a subset of an AMP Vector.
Given an AMP Vector, this will create a view of a subset of the vector. For instance, if \(\mathbf{a} = \{ a_0 a_1 a_2 \ldots a_n\}\), and \(S\) is a set of non-negative integers \(( s_0 s_1 \ldots s_m )\) such that \(0 \le s_i \le n\), then the SubsetVector will be the vector \(\mathbf{a}_S = \{ a_{s_0} a_{s_1} a_{s_2} \ldots a_{s_m}\} \).
Since this is a view, any change to vec2 will be reflected on vec1 and vice versa. vec2 is a sparse vector, with a mapping of new index to old. vec3, on the other hand, is a dense vector without an index. If a lot of computation is necessary on the sparse vector, the data can be copied in and out:
Reimplemented in AMP::LinearAlgebra::CommSelfVariable, and AMP::LinearAlgebra::CommSelfVariable.
|
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().
|
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:43. Comments on this page |