https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
PenetrationInfo.h File Reference

Go to the source code of this file.

Classes

class  PenetrationInfo
 Data structure used to hold penetration information. More...
 

Namespaces

namespace  libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 

Functions

template<>
void dataStore (std::ostream &stream, PenetrationInfo *&pinfo, void *context)
 
template<>
void dataLoad (std::istream &stream, PenetrationInfo *&pinfo, void *context)
 

Function Documentation

◆ dataLoad()

template<>
void dataLoad ( std::istream &  stream,
PenetrationInfo *&  pinfo,
void *  context 
)

Definition at line 223 of file PenetrationInfo.C.

224{
225 if (!context)
226 mooseError("Can only load PenetrationInfo objects using a MooseMesh context!");
227
228 // First, see if this is supposed to be NULL
229 unsigned int i = 0;
230 dataLoad(stream, i, context);
231 if (i)
232 {
233 pinfo = new PenetrationInfo();
234
235 dataLoad(stream, pinfo->_elem, context);
236 dataLoad(stream, pinfo->_side_num, context);
237 // Rebuild the side element.
239 *pinfo->_elem, pinfo->_side_num, pinfo->_side_num == libMesh::invalid_uint)
240 .release();
241
242 dataLoad(stream, pinfo->_normal, context);
243 dataLoad(stream, pinfo->_distance, context);
244 dataLoad(stream, pinfo->_tangential_distance, context);
245 dataLoad(stream, pinfo->_closest_point, context);
246 dataLoad(stream, pinfo->_closest_point_ref, context);
247 dataLoad(stream, pinfo->_closest_point_on_face_ref, context);
248 dataLoad(stream, pinfo->_off_edge_nodes, context);
249 dataLoad(stream, pinfo->_side_phi, context);
250 dataLoad(stream, pinfo->_side_grad_phi, context);
251 dataLoad(stream, pinfo->_dxyzdxi, context);
252 dataLoad(stream, pinfo->_dxyzdeta, context);
253 dataLoad(stream, pinfo->_d2xyzdxideta, context);
254 dataLoad(stream, pinfo->_starting_elem, context);
255 dataLoad(stream, pinfo->_starting_side_num, context);
256 dataLoad(stream, pinfo->_starting_closest_point_ref, context);
257 dataLoad(stream, pinfo->_incremental_slip, context);
258 dataLoad(stream, pinfo->_accumulated_slip, context);
259 dataLoad(stream, pinfo->_frictional_energy, context);
260 dataLoad(stream, pinfo->_contact_force, context);
261 dataLoad(stream, pinfo->_lagrange_multiplier, context);
262 dataLoad(stream, pinfo->_lagrange_multiplier_slip, context);
263 dataLoad(stream, pinfo->_mech_status, context);
264 dataLoad(stream, pinfo->_mech_status_old, context);
265
266 // Don't need frictional_energy_old, accumulated_slip_old, contact_force_old, or
267 // locked_this_step
268 // because they are always set by the constraints at the beginning of a new time step.
269 }
270 else
271 pinfo = NULL;
272}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
void dataLoad(std::istream &stream, PenetrationInfo *&pinfo, void *context)
Data structure used to hold penetration information.
std::vector< const Node * > _off_edge_nodes
const Elem * _side
MECH_STATUS_ENUM _mech_status
std::vector< RealGradient > _d2xyzdxideta
MECH_STATUS_ENUM _mech_status_old
Point _closest_point_on_face_ref
RealVectorValue _contact_force
std::vector< RealGradient > _dxyzdeta
static std::unique_ptr< const Elem > buildSide(const Elem &elem, unsigned int side_num, bool elem_is_surface_elem)
Build the contact face for side side_num of a primary element, or copy elem directly when the element...
std::vector< RealGradient > _dxyzdxi
unsigned int _starting_side_num
std::vector< std::vector< Real > > _side_phi
const Elem * _elem
const Elem * _starting_elem
std::vector< std::vector< RealGradient > > _side_grad_phi
Point _starting_closest_point_ref
unsigned int _side_num
RealVectorValue _lagrange_multiplier_slip
RealVectorValue _normal
const unsigned int invalid_uint

Referenced by dataLoad().

◆ dataStore()

template<>
void dataStore ( std::ostream &  stream,
PenetrationInfo *&  pinfo,
void *  context 
)

Definition at line 171 of file PenetrationInfo.C.

172{
173 if (!context)
174 mooseError("Can only store PenetrationInfo objects using a MooseMesh context!");
175
176 if (pinfo)
177 {
178 // Store 1 so that we know that this pinfo really exists!
179 unsigned int i = 1;
180 dataStore(stream, i, context);
181
182 dataStore(stream, pinfo->_elem, context);
183 // Not storing the side element as we will need to recreate it on load
184 dataStore(stream, pinfo->_side_num, context);
185 dataStore(stream, pinfo->_normal, context);
186 dataStore(stream, pinfo->_distance, context);
187 dataStore(stream, pinfo->_tangential_distance, context);
188 dataStore(stream, pinfo->_closest_point, context);
189 dataStore(stream, pinfo->_closest_point_ref, context);
190 dataStore(stream, pinfo->_closest_point_on_face_ref, context);
191 dataStore(stream, pinfo->_off_edge_nodes, context);
192 dataStore(stream, pinfo->_side_phi, context);
193 dataStore(stream, pinfo->_side_grad_phi, context);
194 dataStore(stream, pinfo->_dxyzdxi, context);
195 dataStore(stream, pinfo->_dxyzdeta, context);
196 dataStore(stream, pinfo->_d2xyzdxideta, context);
197 dataStore(stream, pinfo->_starting_elem, context);
198 dataStore(stream, pinfo->_starting_side_num, context);
199 dataStore(stream, pinfo->_starting_closest_point_ref, context);
200 dataStore(stream, pinfo->_incremental_slip, context);
201 dataStore(stream, pinfo->_accumulated_slip, context);
202 dataStore(stream, pinfo->_frictional_energy, context);
203 dataStore(stream, pinfo->_contact_force, context);
204 dataStore(stream, pinfo->_lagrange_multiplier, context);
205 dataStore(stream, pinfo->_lagrange_multiplier_slip, context);
206 dataStore(stream, pinfo->_mech_status, context);
207 dataStore(stream, pinfo->_mech_status_old, context);
208
209 // Don't need frictional_energy_old, accumulated_slip_old, contact_force_old, or
210 // locked_this_step
211 // because they are always set by the constraints at the beginning of a new time step.
212 }
213 else
214 {
215 // Store 0 so that we know that this pinfo is NULL
216 unsigned int i = 0;
217 dataStore(stream, i, context);
218 }
219}
void dataStore(std::ostream &stream, PenetrationInfo *&pinfo, void *context)

Referenced by dataStore().