https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 

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

128{
129 std::map<dof_id_type, PenetrationInfo *>::iterator it = m.begin();
130 std::map<dof_id_type, PenetrationInfo *>::iterator end = m.end();
131
132 for (; it != end; ++it)
133 delete it->second;
134
135 m.clear();
136
137 // First read the size of the map
138 unsigned int size = 0;
139 stream.read((char *)&size, sizeof(size));
140
141 for (unsigned int i = 0; i < size; i++)
142 {
143 dof_id_type key;
144 dataLoad(stream, key, context);
145 dataLoad(stream, m[key], context);
146 }
147}
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 be...
uint8_t dof_id_type

Referenced by dataLoad(), and PenetrationLocator::restore().