www.mooseframework.org
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

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 113 of file PenetrationLocator.h.

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