|
| Variables () |
| Default construct an empty Variables class, Charm++ needs this.
|
|
| Variables (size_t number_of_grid_points) |
|
| Variables (size_t number_of_grid_points, value_type value) |
|
| Variables (pointer start, size_t size) |
| Construct a non-owning Variables that points to start . size is the size of the allocation, which must be number_of_grid_points * Variables::number_of_independent_components
|
|
| Variables (Variables &&rhs) |
|
Variables & | operator= (Variables &&rhs) |
|
| Variables (const Variables &rhs) |
|
Variables & | operator= (const Variables &rhs) |
|
constexpr size_t | number_of_grid_points () const |
|
constexpr size_type | size () const |
| Number of grid points * number of independent components.
|
|
bool | is_owning () const |
| Returns true if the class owns the data.
|
|
void | pup (PUP::er &p) |
| Serialization for Charm++.
|
|
template<typename SubsetOfTags > |
Variables< SubsetOfTags > | extract_subset () const |
| Create a Variables from a subset of the Tensor s in this Variables.
|
|
template<typename SubsetOfTags > |
Variables< SubsetOfTags > | reference_subset () const |
| Create a non-owning Variables referencing a subset of the Tensor s in this Variables. The referenced tensors must be consecutive in this Variables's tags list. More...
|
|
template<typename WrappedVariables > |
WrappedVariables | reference_with_different_prefixes () const |
| Create a non-owning version of this Variables with different prefixes on the tensors. Both sets of prefixes must have the same tensor types. More...
|
|
template<typename VT , bool VF> |
| Variables (const blaze::DenseVector< VT, VF > &expression) |
| Converting constructor for an expression to a Variables class.
|
|
template<typename VT , bool VF> |
Variables & | operator= (const blaze::DenseVector< VT, VF > &expression) |
|
template<typename T , typename VectorType , size_t StaticSize> |
| Variables (const VectorImpl< T, VectorType, StaticSize > &)=delete |
|
template<typename T , typename VectorType , size_t StaticSize> |
Variables & | operator= (const VectorImpl< T, VectorType, StaticSize > &)=delete |
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same_v< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >... >::value > = nullptr> |
Variables & | operator+= (const Variables< tmpl::list< WrappedTags... > > &rhs) |
|
template<typename VT , bool VF> |
Variables & | operator+= (const blaze::Vector< VT, VF > &rhs) |
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same_v< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >... >::value > = nullptr> |
Variables & | operator-= (const Variables< tmpl::list< WrappedTags... > > &rhs) |
|
template<typename VT , bool VF> |
Variables & | operator-= (const blaze::Vector< VT, VF > &rhs) |
|
Variables & | operator*= (const value_type &rhs) |
|
Variables & | operator/= (const value_type &rhs) |
|
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >::value... >::value > = nullptr> |
| Variables (Variables< tmpl::list< WrappedTags... > > &&rhs) |
| Copy and move semantics for wrapped variables.
|
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >::value... >::value > = nullptr> |
Variables & | operator= (Variables< tmpl::list< WrappedTags... > > &&rhs) |
| Copy and move semantics for wrapped variables.
|
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >::value... >::value > = nullptr> |
| Variables (const Variables< tmpl::list< WrappedTags... > > &rhs) |
| Copy and move semantics for wrapped variables.
|
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >::value... >::value > = nullptr> |
Variables & | operator= (const Variables< tmpl::list< WrappedTags... > > &rhs) |
| Copy and move semantics for wrapped variables.
|
|
|
void | initialize (size_t number_of_grid_points) |
| Initialize a Variables to the state it would have after calling the constructor with the same arguments.
|
|
void | initialize (size_t number_of_grid_points, value_type value) |
| Initialize a Variables to the state it would have after calling the constructor with the same arguments.
|
|
|
void | set_data_ref (const gsl::not_null< Variables * > rhs) |
| Set the VectorImpl to be a reference to another VectorImpl object.
|
|
void | set_data_ref (pointer const start, const size_t size) |
| Set the VectorImpl to be a reference to another VectorImpl object.
|
|
|
pointer | data () |
| Access pointer to underlying data.
|
|
const_pointer | data () const |
| Access pointer to underlying data.
|
|
|
template<typename... SubsetOfTags> |
void | assign_subset (const Variables< tmpl::list< SubsetOfTags... > > &vars) |
| Assign a subset of the Tensor s from another Variables or a tuples::TaggedTuple. Any tags that aren't in both containers are ignored. More...
|
|
template<typename... SubsetOfTags> |
void | assign_subset (const tuples::TaggedTuple< SubsetOfTags... > &vars) |
| Assign a subset of the Tensor s from another Variables or a tuples::TaggedTuple. Any tags that aren't in both containers are ignored. More...
|
|
|
template<typename Tag , typename TagList > |
constexpr Tag::type & | get (Variables< TagList > &v) |
| Return Tag::type pointing into the contiguous array. More...
|
|
template<typename Tag , typename TagList > |
constexpr const Tag::type & | get (const Variables< TagList > &v) |
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same_v< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >... >::value > = nullptr> |
decltype(auto) | operator+ (const Variables< tmpl::list< WrappedTags... > > &lhs, const Variables &rhs) |
|
template<typename VT , bool VF> |
decltype(auto) | operator+ (const blaze::DenseVector< VT, VF > &lhs, const Variables &rhs) |
|
template<typename VT , bool VF> |
decltype(auto) | operator+ (const Variables &lhs, const blaze::DenseVector< VT, VF > &rhs) |
|
template<typename... WrappedTags, Requires< tmpl2::flat_all< std::is_same_v< db::remove_all_prefixes< WrappedTags >, db::remove_all_prefixes< Tags > >... >::value > = nullptr> |
decltype(auto) | operator- (const Variables< tmpl::list< WrappedTags... > > &lhs, const Variables &rhs) |
|
template<typename VT , bool VF> |
decltype(auto) | operator- (const blaze::DenseVector< VT, VF > &lhs, const Variables &rhs) |
|
template<typename VT , bool VF> |
decltype(auto) | operator- (const Variables &lhs, const blaze::DenseVector< VT, VF > &rhs) |
|
decltype(auto) | operator* (const Variables &lhs, const value_type &rhs) |
|
decltype(auto) | operator* (const value_type &lhs, const Variables &rhs) |
|
decltype(auto) | operator/ (const Variables &lhs, const value_type &rhs) |
|
decltype(auto) | operator- (const Variables &lhs) |
|
decltype(auto) | operator+ (const Variables &lhs) |
|
bool | operator== (const Variables &lhs, const Variables &rhs) |
|
template<typename VT , bool TF> |
bool | operator== (const Variables &lhs, const blaze::DenseVector< VT, TF > &rhs) |
|
template<typename VT , bool TF> |
bool | operator== (const blaze::DenseVector< VT, TF > &lhs, const Variables &rhs) |
|
template<typename... Tags>
class Variables< tmpl::list< Tags... > >
A Variables holds a contiguous memory block with Tensors pointing into it.
The Tags
are struct
s that must have a public type alias type
whose value must be a Tensor<DataVector, ...>
, a ‘static’ method name()
that returns a std::string
of the tag name, and must derive off of db::SimpleTag
. In general, they should be DataBoxTags that are not compute items. For example,
template <typename VectorType = DataVector>
};
Definition: ContractFirstNIndices.hpp:16
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
Prefix tags can also be stored and their format is:
template <class Tag>
using type = typename Tag::type;
using tag = Tag;
};
Mark a struct as a prefix tag by inheriting from this.
Definition: Tag.hpp:103
Design Decisions
The Variables
class is designed to hold several different Tensor
s performing one memory allocation for all the Tensor
s. The advantage is that memory allocations are quite expensive, especially in a parallel environment.
In Debug mode, or if the macro SPECTRE_NAN_INIT
is defined, the contents are initialized with NaN
s.
Variables
stores the data it owns in a std::unique_ptr<double[]>
instead of a std::vector
because std::vector
value-initializes its contents, which is very slow.