NodeIP
NodeIP is a double-indexed, dynamic storage container which stores only non-zero values of the local interface properties. It is used as a storage unit in Storage3D container.
The storage unit inside of the NodeIP container is the InterfacePropertiesEntry which contains five members: indexA and indexB which designate a pair of phase field indices for which the interface properties are stored, and energy, stiffness and mobility values. All these parameters are always stored together in one structure.
The data inside of the NodeIP container is manipulated using a number of dedicated methods:
Arithmetic operations
cppNodeIP operator+(const NodeIP& 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 sign of the values is unchanged. The content of both operands is not changed.
cppNodeIP operator-(const NodeIP& 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 sign of the values is unchanged. The content of both operands is not changed.
cppNodeIP 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.
cppNodeIP& operator=(const NodeIP& 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.
cppNodeIP& operator+=(const NodeIP& n); NodeIP& operator-=(const NodeIP& n); NodeIP& 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_energy(const size_t n, const size_t m, const double energy_value);The method, which sets the interface
energyvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse(m,n)index order already exists in the container, itsenergyvalue is overwritten, otherwise a new entry is created with the specified indices and the givenenergyvalue and zero other values.
cppvoid set_stiffness(const size_t n, const size_t m, const double stiffness_value);The method, which sets the interface
stiffnessvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsstiffnessvalue is overwritten, otherwise a new entry is created with the specified indices and the givenstiffnessvalue and zero other values.
cppvoid set_mobility(const size_t n, const size_t m, const double mobility_value);The method, which sets the interface
mobilityvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsmobilityvalue is overwritten, otherwise a new entry is created with the specified indices and the givenmobilityvalue and zero other values.
cppdouble get_energy(const size_t n, const size_t m) const;The method, which returns the interface
energyvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsenergyvalue is returned, otherwise zero value is returned. The content of the container is not changed.
cppdouble get_stiffness(const size_t n, const size_t m) const;The method, which returns the interface
stiffnessvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsstiffnessvalue is returned, otherwise zero value is returned. The content of the container is not changed.
cppdouble get_mobility(const size_t n, const size_t m) const;The method, which returns the interface
mobilityvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsmobilityvalue is returned, otherwise zero value is returned. The content of the container is not changed.
cppvoid add_energy(const size_t n, const size_t m, const double energy_value);The method, which increments the interface
energyvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsenergyvalue is incremented byenergy_value, otherwise a new entry is created with the specified indices and the givenenergyvalue and zero other values.
cppvoid add_stiffness(const size_t n, const size_t m, const double stiffness_value);The method, which increments the interface
stiffnessvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsstiffnessvalue is incremented bystiffness_value, otherwise a new entry is created with the specified indices and the givenstiffnessvalue and zero other values.
cppvoid add_mobility(const size_t n, const size_t m, const double mobility_value);The method, which increments the interface
mobilityvalue for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order exists in the container, itsmobilityvalue is incremented bymobility_value, otherwise a new entry is created with the specified indices and the givenmobilityvalue and zero other values.
cppvoid set_energy_and_mobility(const size_t n, const size_t m, const double energy_value, const double mobility_value);The method, which sets the interface
energyandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandmobilityvalues are overwritten, otherwise a new entry is created with the specified indices and the givenenergyandmobilityvalues and zerostiffnessvalue.
cppvoid set_stiffness_and_mobility(const size_t n, const size_t m, const double stiffness_value, const double mobility_value);The method, which sets the interface
stiffnessandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsstiffnessandmobilityvalues are overwritten, otherwise a new entry is created with the specified indices and the givenstiffnessandmobilityvalues and zeroenergyvalue.
cppvoid set_energy_and_stiffness(const size_t n, const size_t m, const double energy_value, const double stiffness_value);The method, which sets the interface
energyandstiffnessvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandstiffnessvalues are overwritten, otherwise a new entry is created with the specified indices and the givenenergyandstiffnessvalues and zeromobilityvalue.
cppvoid set_energy_stiffness_and_mobility(const size_t n, const size_t m, const double energy_value, const double stiffness_value, const double mobility_value);The method, which sets the interface
energy,stiffnessandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergy,stiffnessandmobilityvalues are overwritten, otherwise a new entry is created with the specified indices and the givenenergy,stiffnessandmobilityvalues.
cppvoid add_energy_and_mobility(const size_t n, const size_t m, const double energy_value, const double mobility_value);The method, which increments the interface
energyandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandmobilityvalues are incremented with the specifiedenergy_valueandmobility_valuevalues, correspondingly, otherwise a new entry is created with the specified indices and the givenenergyandmobilityvalues and zerostiffnessvalue.
cppvoid add_stiffness_and_mobility(const size_t n, const size_t m, const double stiffness_value, const double mobility_value);The method, which increments the interface
stiffnessandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsstiffnessandmobilityvalues are incremented with the specifiedstiffness_valueandmobility_valuevalues, correspondingly, otherwise a new entry is created with the specified indices and the givenstiffnessandmobilityvalues and zeroenergyvalue.
cppvoid add_energy_and_stiffness(const size_t n, const size_t m, const double energy_value, const double stiffness_value);The method, which increments the interface
energyandstiffnessvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandstiffnessvalues are incremented with the specifiedenergy_valueandstiffness_valuevalues, correspondingly, otherwise a new entry is created with the specified indices and the givenenergyandstiffnessvalues and zeromobilityvalue.
cppvoid add_energy_stiffness_and_mobility(const size_t n, const size_t m, const double energy_value, const double stiffness_value, const double mobility_value);The method, which increments the interface
energy,stiffnessandmobilityvalues for a pair of phase fields. If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, itsenergy,stiffnessandmobilityvalues are incremented with the specifiedenergy_value,stiffness_valueandmobility_valuevalues, correspondingly, otherwise a new entry is created with the specified indices and the givenenergy,stiffnessandmobilityvalues.
cppstd::pair<double,double> get_energy_and_mobility(const size_t n, const size_t m) const;The method, which returns std::pair<energy_value, mobility_value> for a pair of phase fields. If the entry with direct,
(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandmobilityvalues are returned, otherwise zeroenergyandmobilityvalues are returned. The content of the container is not changed.
cppstd::pair<double,double> get_stiffness_and_mobility(const size_t n, const size_t m) const;The method, which returns std::pair<stiffness_value, mobility_value> for a pair of phase fields. If the entry with direct,
(n,m), or reverse,(m,n), index order already exists in the container, itsstiffnessandmobilityvalues are returned, otherwise zerostiffnessandmobilityvalues are returned. The content of the container is not changed.
cppstd::pair<double,double> get_energy_and_stiffness(const size_t n, const size_t m) const;The method, which returns std::pair<energy_value,stiffness_value> for a pair of phase fields. If the entry with direct,
(n,m), or reverse,(m,n), index order already exists in the container, itsenergyandstiffnessvalues are returned, otherwise zeroenergyandstiffnessvalues are returned. The content of the container is not changed.
cppInterfacePropertiesEntry get_entry(const size_t n, const size_t m) const;The method, which returns InterfacePropertiesEntry for a pair of phase fields
(n,m). If the entry with direct,(n,m), or reverse,(m,n), index order already exists in the container, its content is returned, otherwise an entry with the specified indices and zeroenergy,stiffnessandmobilityvalues is returned. The content of the container is not changed.
cppvoid add_energies(const NodeIP& energy_value);The method, which adds
energyvalues of all entries in theenergy_valuecontainer to the current container. Theenergyvalues of the entries with similar index pairs are added to the corresponding entries in the current container, theenergyvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_stiffnesses(const NodeIP& stiffness_values);The method, which adds
stiffnessvalues of all entries in thestiffness_valuescontainer to the current container. Thestiffnessvalues of the entries with similar index pairs are added to the corresponding entries in the current container, thestiffnessvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_mobilities(const NodeIP& mobility_values);The method, which adds
mobilityvalues of all entries in themobility_valuescontainer to the current container. Themobilityvalues of the entries with similar index pairs are added to the corresponding entries in the current container, themobilityvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_energies_and_mobilities(const NodeIP& values);The method, which adds
energyandmobilityvalues of all entries in thevaluescontainer to the current container. Theenergyandmobilityvalues of the entries with similar index pairs are added to the corresponding entries in the current container, theenergyandmobilityvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_energies_and_stiffnesses(const NodeIP& values);The method, which adds
energyandstiffnessvalues of all entries in thevaluescontainer to the current container. Theenergyandstiffnessvalues of the entries with similar index pairs are added to the corresponding entries in the current container, theenergyandstiffnessvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_energies_stiffnesses_and_mobilities(const NodeIP& values);The method, which adds
energy,stiffnessandmobilityvalues of all entries in thevaluescontainer to the current container. Theenergy,stiffnessandmobilityvalues of the entries with similar index pairs are added to the corresponding entries in the current container, theenergy,stiffnessandmobilityvalues of the entries with indices not existing in the current container are copied into the newly created entries in the current container.
cppvoid add_energies_exist(const NodeIP& energy_values);The method, which adds
energyvalues of entries in theenergy_valuecontainer to the current container if the entries with the same index pairs exist in the current container. Theenergyvalues of other entries are ignored.
cppvoid add_stiffnesses_exist(const NodeIP& stiffness_values);The method, which adds
stiffnessvalues of entries in thestiffness_valuescontainer to the current container if the entries with the same index pairs exist in the current container. Thestiffnessvalues of other entries are ignored.
cppvoid add_mobilities_exist(const NodeIP& mobility_values);The method, which adds
mobilityvalues of entries in themobility_valuescontainer to the current container if the entries with the same index pairs exist in the current container. Themobilityvalues of other entries are ignored.
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 storesInterfacePropertiesEntryentries.
cppiterator end();Iterator to the end of the underlying
std::vector<>container which storesInterfacePropertiesEntryentries.
cppconst_iterator cbegin();Constant iterator to the begin of the underlying
std::vector<>container which storesInterfacePropertiesEntryentries.
cppconst_iterator cend();Constant iterator to the end of the underlying
std::vector<>container which storesInterfacePropertiesEntryentries.
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
NodeIPobject into the MPI communication buffer.
cppvoid unpack(std::vector<double>& buffer, size_t& it);The method, which unpacks (reads) the content of the current
NodeIPobject 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
NodeIPobject from the input stream.
cppvoid write(std::ostream& outp) const;The method, which writes the content of the current
NodeIPobject into the output stream.