SpECTRE  v2024.02.05
DataVector Class Reference

Stores a collection of function values. More...

#include <DataVector.hpp>

Public Types

using BaseType = VectorImpl< double, DataVector >
 
- Public Types inherited from VectorImpl< double, DataVector >
using value_type = double
 
using size_type = size_t
 
using difference_type = std::ptrdiff_t
 
using BaseType = blaze::CustomVector< double, blaze::AlignmentFlag::unaligned, blaze::PaddingFlag::unpadded, blaze::defaultTransposeFlag, blaze::GroupTag< 0 >, DataVector >
 
using ElementType = double
 
using TransposeType = VectorImpl< double, DataVector, default_vector_impl_static_size >
 
using CompositeType = const VectorImpl< double, DataVector, default_vector_impl_static_size > &
 
using iterator = typename BaseType::Iterator
 
using const_iterator = typename BaseType::ConstIterator
 

Public Member Functions

 DataVector (const DataVector &)=default
 
 DataVector (DataVector &&)=default
 
DataVectoroperator= (const DataVector &)=default
 
DataVectoroperator= (DataVector &&)=default
 
- Public Member Functions inherited from VectorImpl< double, DataVector >
 VectorImpl (size_t set_size)
 Create with the given size. In debug mode, the vector is initialized to 'NaN' by default. If not initialized to 'NaN', the memory is allocated but not initialized. More...
 
 VectorImpl (size_t set_size, double value)
 Create with the given size and value. More...
 
 VectorImpl (double *start, size_t set_size)
 Create a non-owning VectorImpl that points to start
 
 VectorImpl (std::initializer_list< U > list)
 Create from an initializer list of T.
 
 VectorImpl ()=default
 Empty VectorImpl.
 
VectorImploperator= (const double &rhs)
 
decltype(auto) operator[] (const size_t index)
 
decltype(auto) operator[] (const size_t index) const
 
void destructive_resize (const size_t new_size)
 A common operation for checking the size and resizing a memory buffer if needed to ensure that it has the desired size. This operation is not permitted on a non-owning vector. More...
 
bool is_owning () const
 Returns true if the class owns the data.
 
void clear ()
 Put the class in the default-constructed state.
 
void pup (PUP::er &p)
 Serialization for Charm++.
 
const BaseType & operator* () const
 Upcast to BaseType More...
 
BaseType & operator* ()
 Upcast to BaseType More...
 
void set_data_ref (gsl::not_null< DataVector * > rhs)
 Set the VectorImpl to be a reference to another VectorImpl object.
 
void set_data_ref (double *const start, const size_t set_size)
 Set the VectorImpl to be a reference to another VectorImpl object.
 

Additional Inherited Members

- Static Public Attributes inherited from VectorImpl< double, DataVector >
static constexpr bool transpose_flag
 
static constexpr size_t static_size
 
- Protected Member Functions inherited from VectorImpl< double, DataVector >
void reset_pointer_vector (const size_t set_size)
 
std::unique_ptr< value_type[]> heap_alloc_if_necessary (const size_t set_size)
 
- Protected Attributes inherited from VectorImpl< double, DataVector >
std::unique_ptr< value_type[]> owned_data_
 
std::array< double, default_vector_impl_static_sizestatic_owned_data_
 
bool owning_
 

Detailed Description

Stores a collection of function values.

Details

Use DataVector to represent function values on the computational domain. Note that interpreting the data also requires knowledge of the points that these function values correspond to.

A DataVector holds an array of contiguous data. The DataVector can be owning, meaning the array is deleted when the DataVector goes out of scope, or non-owning, meaning it just has a pointer to an array.

Refer to the Data Structures documentation for a list of other available types. In particular, to represent a generic vector that supports common vector and matrix operations and whose meaning may not be of function values at points, use any of the Blaze vector types instead.

DataVectors support a variety of mathematical operations that are applicable to nodal coefficients. In addition to common arithmetic operations such as elementwise addition, subtraction, multiplication and division, the elementwise operations on blaze vectors of doubles are supported. See [blaze-wiki/Vector_Operations] (https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20Operations).

In addition, the Heaviside step function step_function is supported for DataVectors.


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