#include <MaterialProperty.h>
|
| using | values_type = typename std::vector< std::unique_ptr< PropertyValue > > |
| |
| using | iterator = DereferenceIterator< typename values_type::iterator > |
| |
| using | const_iterator = DereferenceIterator< typename values_type::const_iterator > |
| |
|
| const std::unique_ptr< PropertyValue > & | pointerValue (const std::size_t i) const |
| | Returns a read-only reference to the underlying unique pointer at index i.
|
| |
| std::unique_ptr< PropertyValue > & | pointerValue (const std::size_t i) |
| | Returns a reference to the underlying unique pointer at index i.
|
| |
Definition at line 390 of file MaterialProperty.h.
◆ const_iterator
◆ iterator
◆ values_type
◆ addPointer()
Adds the given object in ptr to the storage.
Definition at line 153 of file UniqueStorage.h.
154 {
155 mooseAssert(ptr, "Null object");
156 return *
_values.emplace_back(std::move(ptr));
157 }
values_type _values
The underlying data.
◆ begin() [1/2]
Begin and end iterators to the underlying data.
Note that dereferencing these iterators may lead to an assertion or the dereference of a nullptr whether or not the underlying data is initialized.
Definition at line 82 of file UniqueStorage.h.
DereferenceIterator< typename values_type::iterator > iterator
◆ begin() [2/2]
Definition at line 84 of file UniqueStorage.h.
DereferenceIterator< typename values_type::const_iterator > const_iterator
◆ clear()
◆ empty()
- Returns
- Whether or not the underlying storage is empty.
Definition at line 116 of file UniqueStorage.h.
◆ end() [1/2]
◆ end() [2/2]
◆ hasValue()
- Returns
- whether or not the underlying object at index
is initialized
Definition at line 121 of file UniqueStorage.h.
const std::unique_ptr< PropertyValue > & pointerValue(const std::size_t i) const
Returns a read-only reference to the underlying unique pointer at index i.
◆ operator[]() [1/2]
Definition at line 103 of file UniqueStorage.h.
103{ return const_cast<T &>(std::as_const(*this)[i]); }
◆ operator[]() [2/2]
- Returns
- A reference to the underlying data at index
i.
Note that the underlying data may not necessarily be initialized, in which case this will throw an assertion or dereference a nullptr.
You can check whether or not the underlying data is initialized with hasValue(i).
Definition at line 98 of file UniqueStorage.h.
99 {
100 mooseAssert(
hasValue(i),
"Null object");
102 }
bool hasValue(const std::size_t i) const
◆ pointerValue() [1/2]
Returns a reference to the underlying unique pointer at index i.
Definition at line 183 of file UniqueStorage.h.
184 {
185 return const_cast<std::unique_ptr<T> &>(std::as_const(*this).pointerValue(i));
186 }
◆ pointerValue() [2/2]
Returns a read-only reference to the underlying unique pointer at index i.
Definition at line 174 of file UniqueStorage.h.
175 {
176 mooseAssert(
size() > i,
"Invalid size");
178 }
◆ queryValue() [1/2]
Definition at line 131 of file UniqueStorage.h.
132 {
133 return const_cast<T *>(std::as_const(*this).queryValue(i));
134 }
◆ queryValue() [2/2]
- Returns
- A pointer to the underlying data at index
i
The pointer will be nullptr if !hasValue(i), that is, if the unique_ptr at index i is not initialized
Definition at line 130 of file UniqueStorage.h.
◆ resize() [1/2]
◆ resize() [2/2]
| void MaterialProperties::resize |
( |
const std::size_t |
size, |
|
|
const WriteKey |
|
|
) |
| |
|
inline |
◆ resizeItems()
| void MaterialProperties::resizeItems |
( |
const std::size_t |
n_qpoints, |
|
|
const WriteKey |
|
|
) |
| |
|
inline |
Resize items in this array, i.e.
the number of values needed in PropertyValue array
- Parameters
-
| n_qpoints | The number of values needed to store (equals the the number of quadrature points per mesh element) |
Definition at line 408 of file MaterialProperty.h.
409 {
413 }
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
void resize(const std::size_t size, const WriteKey)
const PropertyValue * queryValue(const std::size_t i) const
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
auto index_range(const T &sizable)
Referenced by MaterialData::resize().
◆ setPointer() [1/2]
Sets the underlying unique_ptr at index i to ptr.
This can be used to construct objects in the storage, i.e., setPointer(0, std::make_unique<T>(...));
Definition at line 144 of file UniqueStorage.h.
145 {
146 mooseAssert(
size() > i,
"Invalid size");
148 }
◆ setPointer() [2/2]
| void MaterialProperties::setPointer |
( |
const std::size_t |
i, |
|
|
std::unique_ptr< PropertyValue > && |
ptr, |
|
|
const WriteKey |
|
|
) |
| |
|
inline |
Definition at line 420 of file MaterialProperty.h.
421 {
423 }
void setPointer(const std::size_t i, std::unique_ptr< T > &&ptr)
Sets the underlying unique_ptr at index i to ptr.
◆ size()
- Returns
- The size of the underlying storage.
Note that this is not necessarily the size of constructed objects, as underlying objects could be uninitialized
Definition at line 112 of file UniqueStorage.h.
◆ _values
The documentation for this class was generated from the following file: