18 #ifndef VECTOR_SEQ_DOUBLE_HH_ 19 #define VECTOR_SEQ_DOUBLE_HH_ 45 typedef typename std::shared_ptr< std::vector<double> >
VectorSeq;
86 template <
int spacedim,
class Value>
87 std::shared_ptr<FieldElementwise<spacedim, Value> >
create_field(
unsigned int n_comp)
89 std::shared_ptr<FieldElementwise<spacedim, Value> > field_ptr(
138 data_ptr_ = std::make_shared< std::vector<double> >(local_size);
177 template <int spacedim, class Value>
178 std::shared_ptr<FieldElementwise<spacedim, Value> > create_field(unsigned int n_comp)
180 std::shared_ptr<FieldElementwise<spacedim, Value> > field_ptr(
181 new FieldElementwise<spacedim, Value>( data_ptr_, n_comp ));
Vec data_petsc_
stored vector of data in PETSC format
void copy(VectorMPI &other)
void fill(double value)
Fill all values of data vector with given value.
~VectorSeqDouble()
Destructor.
std::shared_ptr< std::vector< double > > VectorSeq
void duplicate(VectorMPI other)
Return new vector with same parallel structure.
std::vector< double > VectorData
void chkerr(unsigned int ierr)
Replacement of new/delete operator in the spirit of xmalloc.
VectorDataPtr data_ptr()
Getter for shared pointer of output data.
double & operator[](unsigned int idx)
double & operator[](unsigned int idx)
unsigned int size()
Getter for shared pointer of output data.
static constexpr bool value
VectorSeq data_ptr_
shared pointer to vector of data
Global macros to enhance readability and debugging, general constants.
VectorDataPtr data_ptr_
shared pointer to vector of data
Vec data_petsc_
stored vector of data in PETSC format
void resize(unsigned int local_size)
void resize(unsigned int size)
Create shared pointer and PETSC vector with given size.
Vec & petsc_vec()
Getter for PETSC vector of output data (e.g. can be used by scatters).
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
void swap(VectorMPI &other)
std::shared_ptr< FieldElementwise< spacedim, Value > > create_field(unsigned int n_comp)
Create and return shared pointer to FieldElementwise object.
VectorMPI(unsigned int local_size)
Create shared pointer and PETSC vector with given size. COLLECTIVE.
#define OLD_ASSERT_EQUAL(a, b)
VectorSeq get_data_ptr()
Getter for shared pointer of output data.
std::shared_ptr< VectorData > VectorDataPtr
Vec & get_data_petsc()
Getter for PETSC vector of output data (e.g. can be used by scatters).