NodeDF
NodeDF is a double-indexed, dynamic storage container which stores only non-zero values of the local driving forces. It is used as a storage unit in Storage3D container.
The storage unit inside of the NodeDF container is the DrivingForceEntry which contains six members: indexA and indexB which designate a pair of phase field indices for which the driving force is stored, raw, tmp and average values of the driving force and local weight used for the driving force. All these parameters are always stored together in one structure.
The data inside of the NodeDF container is manipulated using a number of dedicated methods:
Arithmetic operations
cppNodeDF operator+(const NodeDF& n);Plus operator, which adds values with identical indices from two contains. The entries with indices existing only in one of the containers are simply copied into the resulting output container. For the summation of the entries existing in both containers but with reverse index order the
raw,tmpandaveragevalues are added up considering antisimmetric rule, e.g., f(m,n) = -f(n,m), while the sign of theweightsis unchanged. The content of both operands is not changed.
cppNodeDF operator-(const NodeDF& n);Minus operator, which subtracts the values with identical indices from two containers. The entries with indices existing only in the leftmost container are simply copied into the resulting output container. The entries with indices existing only in the rightmost container are copied into the resulting container with their signs inverted. For the subtraction of the entries existing in both containers but with reverse index order the
raw,tmpandaveragevalues are subtracted considering antisimmetric rule, e.g., f(m,n) = -f(n,m), while the sign of theweightsis unchanged. The content of both operands is not changed.
cppNodeDF operator*(const double n);Multiplication operator, which multiplies all values stored in the container by a specified number
nand copies the result into the output container. The content of the input container is not changed.
cppNodeDF& operator=(const NodeDF& n);Assignment operator, which copies the content of container
ninto the receiving container. The initial content of the receiving container is erased and all the entries stored in the right-hand-side containernare copied into it. The content of the containernis unchanged.
cppNodeDF& operator+=(const NodeDF& n); NodeDF& operator-=(const NodeDF& n); NodeDF& operator*=(const double n);Arithmetic operators similar to the ordinary operators above except they modify the left-hand-side container and return a reference to it instead of returning a new container.
Data access and manipulation
cppvoid set_raw(const size_t n, const size_t m, const double value);The method, which sets the
rawdriving force value for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, itsrawvalue is overwritten. If the entry with the reverse index order(m,n)already exists in the container therawvalue is assigned to it with the opposite sign, e.g., f(m,n) = -f(n,m), otherwise a new entry is created with the corresponding indices and the givenrawvalue and zero other values.
cppvoid set_tmp(const size_t n, const size_t m, const double value);The method, which sets the
tmpdriving force value (used in the averaging procedure) for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, itstmpvalue is overwritten. If the entry with the reverse index order(m,n)already exists in the container thetmpvalue is assigned to it with the opposite sign, e.g., f(m,n) = -f(n,m), otherwise a new entry is created with the corresponding indices and the giventmpvalue and zero other values.
cppvoid set_average(const size_t n, const size_t m, const double value);The method, which sets the
averagedriving force value (used in the averaging procedure) for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, itsaveragevalue is overwritten. If the entry with the reverse index order(m,n)already exists in the container theaveragevalue is assigned to it with the opposite sign, e.g., f(m,n) = -f(n,m), otherwise a new entry is created with the corresponding indices and the givenaveragevalue and zero other values.
cppvoid set_weight(const size_t n, const size_t m, const double value);The method, which sets the
weightdriving force value (used in the averaging procedure) for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, itsweightvalue is overwritten. If the entry with the reverse index order(m,n)already exists in the container theweightvalue is assigned to it without changing the sign, e.g., f(m,n) = f(n,m), otherwise a new entry is created with the specified indices and the givenaveragevalue and zero other values.
cppvoid set_all(const size_t n, const size_t m, const double raw_value, const double tmp_value, const double avg_value, const double wgt_value);The method, which sets all driving force values,
raw,tmpandaverage, for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, its values are overwritten. If the entry with the reverse index order(m,n)already exists in the container the values are assigned to it with the opposite sign, e.g., f(m,n) = -f(n,m), and theweightis assigned without changing the sign, e.g., f(m,n) = f(n,m). Otherwise a new entry is created with the specified index order and the givenraw,tmpandaveragevalues andweight.
cppdouble get_raw(const size_t n, const size_t m) const;The method, which returns existing
rawvalue in antisymmetric case (changes sign when index order changes): f(m,n) = -f(n,m). Returns zero otherwise.
cppdouble get_tmp(const size_t n, const size_t m) const;The method, which returns existing
tmpvalue in antisymmetric case (changes sign when index order changes): f(m,n) = -f(n,m). Returns zero otherwise.
cppdouble get_average(const size_t n, const size_t m) const;The method, which returns existing
averagevalue in antisymmetric case (changes sign when index order changes): f(m,n) = -f(n,m). Returns zero otherwise.
cppdouble get_weight(const size_t n, const size_t m) const;The method, which returns existing
weightvalue in a symmetric case (keeps sign when index order changes): f(m,n) = f(n,m). Returns zero otherwise.
cppvoid add_raw(const size_t n, const size_t m, const double value);The method, which increments the existing
rawvalue in antisymmetric case (changes sign when index order changes): f(m,n) = -f(n,m). If the entry does not exists in the container a new entry is created with the specified index order and the givenrawvalue and zero other values.
cppvoid add_tmp(const size_t n, const size_t m, const double value);The method, which increments the existing
tmpvalue in antisymmetric case (changes sign when index order changes): f(n,m) = -f(m,n). If the entry does not exists in the container a new entry is created with the specified index order and the giventmpvalue and zero other values.
cppvoid add_average(const size_t n, const size_t m, const double value);The method, which increments the existing
averagevalue in antisymmetric case (changes sign when index order changes): f(n,m) = -f(m,n). If the entry does not exists in the container a new entry is created with the specified index order and the givenaveragevalue and zero other values.
cppvoid add_weight(const size_t n, const size_t m, const double value);The method, which increments the existing
weightin symmetric case (keeps the sign when index order changes): f(m,n) = f(n,m). If the entry does not exists in the container a new entry is created with the specified index order and the givenweightvalue and zero other values.
cppvoid add_all(const size_t n, const size_t m, const double raw_value, const double tmp_value, const double avg_value, const double wgt_value);The method, which increments all driving force values,
raw,tmpandaverage, for a pair of phase fields. If the entry with direct index order(n,m)already exists in the container, the corresponding values are added to it. If the entry with the reverse index order(m,n)already exists in the container the values are added with the opposite signs, e.g., f(m,n) = -f(n,m), and theweightis added without changing the sign, e.g., f(m,n) = f(n,m). Otherwise a new entry is created with the specified index order and the givenraw,tmpandaveragevalues andweight.
cppvoid clear()The method, which clears the container erasing all entries.
Iterators
cppiterator begin();Iterator to the begin of the underlying
std::vector<>container which storesDrivingForceEntryentries.
cppiterator end();Iterator to the end of the underlying
std::vector<>container which storesDrivingForceEntryentries.
cppconst_iterator cbegin();Constant iterator to the begin of the underlying
std::vector<>container which storesDrivingForceEntryentries.
cppconst_iterator cend();Constant iterator to the end of the underlying
std::vector<>container which storesDrivingForceEntryentries.
cppiterator erase(iterator it);The method which erases the entry pointed to by the iterator it. It returns the next iterator following the erazed one. The storage is modified and its size is reduced.
Container properties
cppsize_t size();The method which returns the size of the underlying
std::vector<>container. It is equivalent to the number of stored entries.
cppsize_t capacity();The method which returns the capacity of the underlying
std::vector<>container. It is equivalent to the number of stored entries.
MPI communication methods
cppvoid pack(std::vector<double>& buffer);The method, which packs the content of the current
NodeDFobject into the MPI communication buffer.
cppvoid unpack(std::vector<double>& buffer, size_t& it);The method, which unpacks (reads) the content of the current
NodeDFobject from the MPI communication buffer. The existing data in the container is overwritten.
Read/write methods
cppvoid read(std::istream& inp);The method, which reads the content of the current
NodeDFobject from the input stream.
cppvoid write(std::ostream& outp) const;The method, which writes the content of the current
NodeDFobject into the output stream.