Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Functions
PenetrationLocator.h File Reference

Go to the source code of this file.

Classes

class  PenetrationLocator
 

Functions

template<>
void dataLoad (std::istream &stream, std::map< dof_id_type, PenetrationInfo *> &m, void *context)
 We have to have a specialization for this map because the PenetrationInfo objects MUST get deleted before the ones are loaded from a file or it's a memory leak. More...
 

Function Documentation

◆ dataLoad()

template<>
void dataLoad ( std::istream &  stream,
std::map< dof_id_type, PenetrationInfo *> &  m,
void context 
)
inline

We have to have a specialization for this map because the PenetrationInfo objects MUST get deleted before the ones are loaded from a file or it's a memory leak.

Definition at line 111 of file PenetrationLocator.h.

112 {
113  std::map<dof_id_type, PenetrationInfo *>::iterator it = m.begin();
114  std::map<dof_id_type, PenetrationInfo *>::iterator end = m.end();
115 
116  for (; it != end; ++it)
117  delete it->second;
118 
119  m.clear();
120 
121  // First read the size of the map
122  unsigned int size = 0;
123  stream.read((char *)&size, sizeof(size));
124 
125  for (unsigned int i = 0; i < size; i++)
126  {
127  dof_id_type key;
128  loadHelper(stream, key, context);
129  loadHelper(stream, m[key], context);
130  }
131 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:985
uint8_t dof_id_type