www.mooseframework.org
Functions
MaterialPropertyStorage.C File Reference

Go to the source code of this file.

Functions

void shallowCopyData (const std::vector< unsigned int > &stateful_prop_ids, MaterialProperties &data, MaterialProperties &data_from)
 Shallow copy the material properties. More...
 
void shallowCopyDataBack (const std::vector< unsigned int > &stateful_prop_ids, MaterialProperties &data, MaterialProperties &data_from)
 

Function Documentation

void shallowCopyData ( const std::vector< unsigned int > &  stateful_prop_ids,
MaterialProperties data,
MaterialProperties data_from 
)

Shallow copy the material properties.

Parameters
stateful_prop_idsList of IDs with properties to shallow copy
dataDestination data
data_fromSource data

Definition at line 32 of file MaterialPropertyStorage.C.

Referenced by MaterialPropertyStorage::swap().

35 {
36  for (unsigned int i = 0; i < stateful_prop_ids.size(); ++i)
37  {
38  if (i >= data_from.size() || stateful_prop_ids[i] >= data.size())
39  continue;
40  PropertyValue * prop = data[stateful_prop_ids[i]]; // do the look-up just once (OPT)
41  PropertyValue * prop_from = data_from[i]; // do the look-up just once (OPT)
42  if (prop != nullptr && prop_from != nullptr)
43  prop->swap(prop_from);
44  }
45 }
virtual void swap(PropertyValue *rhs)=0
Abstract definition of a property value.
void shallowCopyDataBack ( const std::vector< unsigned int > &  stateful_prop_ids,
MaterialProperties data,
MaterialProperties data_from 
)

Definition at line 48 of file MaterialPropertyStorage.C.

Referenced by MaterialPropertyStorage::swapBack().

51 {
52  for (unsigned int i = 0; i < stateful_prop_ids.size(); ++i)
53  {
54  if (i >= data.size() || stateful_prop_ids[i] >= data_from.size())
55  continue;
56  PropertyValue * prop = data[i]; // do the look-up just once (OPT)
57  PropertyValue * prop_from = data_from[stateful_prop_ids[i]]; // do the look-up just once (OPT)
58  if (prop != nullptr && prop_from != nullptr)
59  prop->swap(prop_from);
60  }
61 }
virtual void swap(PropertyValue *rhs)=0
Abstract definition of a property value.