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

 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 208 of file PenetrationInfo.C.

Referenced by dataLoad< Moose::LibtorchArtificialNeuralNet >(), ReporterState< std::vector< T > >::loadInternal(), RestartableDataReader::readHeader(), and RedistributeProperties::redistribute().

209 {
210  if (!context)
211  mooseError("Can only load PenetrationInfo objects using a MooseMesh context!");
212 
213  // First, see if this is supposed to be NULL
214  unsigned int i = 0;
215  loadHelper(stream, i, context);
216  if (i)
217  {
218  pinfo = new PenetrationInfo();
219 
220  loadHelper(stream, pinfo->_elem, context);
221  loadHelper(stream, pinfo->_side_num, context);
222  // Rebuild the side element.
223  pinfo->_side = pinfo->_elem->build_side_ptr(pinfo->_side_num, false).release();
224 
225  loadHelper(stream, pinfo->_normal, context);
226  loadHelper(stream, pinfo->_distance, context);
227  loadHelper(stream, pinfo->_tangential_distance, context);
228  loadHelper(stream, pinfo->_closest_point, context);
229  loadHelper(stream, pinfo->_closest_point_ref, context);
230  loadHelper(stream, pinfo->_closest_point_on_face_ref, context);
231  loadHelper(stream, pinfo->_off_edge_nodes, context);
232  loadHelper(stream, pinfo->_side_phi, context);
233  loadHelper(stream, pinfo->_side_grad_phi, context);
234  loadHelper(stream, pinfo->_dxyzdxi, context);
235  loadHelper(stream, pinfo->_dxyzdeta, context);
236  loadHelper(stream, pinfo->_d2xyzdxideta, context);
237  loadHelper(stream, pinfo->_starting_elem, context);
238  loadHelper(stream, pinfo->_starting_side_num, context);
239  loadHelper(stream, pinfo->_starting_closest_point_ref, context);
240  loadHelper(stream, pinfo->_incremental_slip, context);
241  loadHelper(stream, pinfo->_accumulated_slip, context);
242  loadHelper(stream, pinfo->_frictional_energy, context);
243  loadHelper(stream, pinfo->_contact_force, context);
244  loadHelper(stream, pinfo->_lagrange_multiplier, context);
245  loadHelper(stream, pinfo->_lagrange_multiplier_slip, context);
246  loadHelper(stream, pinfo->_mech_status, context);
247  loadHelper(stream, pinfo->_mech_status_old, context);
248 
249  // Don't need frictional_energy_old, accumulated_slip_old, contact_force_old, or
250  // locked_this_step
251  // because they are always set by the constraints at the beginning of a new time step.
252  }
253  else
254  pinfo = NULL;
255 }
std::vector< RealGradient > _d2xyzdxideta
RealVectorValue _normal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
Data structure used to hold penetration information.
const Elem * _starting_elem
Point _closest_point_on_face_ref
std::vector< std::vector< RealGradient > > _side_grad_phi
std::vector< std::vector< Real > > _side_phi
const Elem * _elem
unsigned int _starting_side_num
unsigned int _side_num
std::vector< RealGradient > _dxyzdxi
const Elem * _side
RealVectorValue _contact_force
MECH_STATUS_ENUM _mech_status
std::vector< const Node * > _off_edge_nodes
Point _starting_closest_point_ref
std::vector< RealGradient > _dxyzdeta
MECH_STATUS_ENUM _mech_status_old
RealVectorValue _lagrange_multiplier_slip
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataStore()

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

Definition at line 156 of file PenetrationInfo.C.

Referenced by dataStore< Moose::LibtorchArtificialNeuralNet >(), RedistributeProperties::redistribute(), ReporterState< std::vector< T > >::storeInternal(), and RestartableDataWriter::write().

157 {
158  if (!context)
159  mooseError("Can only store PenetrationInfo objects using a MooseMesh context!");
160 
161  if (pinfo)
162  {
163  // Store 1 so that we know that this pinfo really exists!
164  unsigned int i = 1;
165  storeHelper(stream, i, context);
166 
167  storeHelper(stream, pinfo->_elem, context);
168  // Not storing the side element as we will need to recreate it on load
169  storeHelper(stream, pinfo->_side_num, context);
170  storeHelper(stream, pinfo->_normal, context);
171  storeHelper(stream, pinfo->_distance, context);
172  storeHelper(stream, pinfo->_tangential_distance, context);
173  storeHelper(stream, pinfo->_closest_point, context);
174  storeHelper(stream, pinfo->_closest_point_ref, context);
175  storeHelper(stream, pinfo->_closest_point_on_face_ref, context);
176  storeHelper(stream, pinfo->_off_edge_nodes, context);
177  storeHelper(stream, pinfo->_side_phi, context);
178  storeHelper(stream, pinfo->_side_grad_phi, context);
179  storeHelper(stream, pinfo->_dxyzdxi, context);
180  storeHelper(stream, pinfo->_dxyzdeta, context);
181  storeHelper(stream, pinfo->_d2xyzdxideta, context);
182  storeHelper(stream, pinfo->_starting_elem, context);
183  storeHelper(stream, pinfo->_starting_side_num, context);
184  storeHelper(stream, pinfo->_starting_closest_point_ref, context);
185  storeHelper(stream, pinfo->_incremental_slip, context);
186  storeHelper(stream, pinfo->_accumulated_slip, context);
187  storeHelper(stream, pinfo->_frictional_energy, context);
188  storeHelper(stream, pinfo->_contact_force, context);
189  storeHelper(stream, pinfo->_lagrange_multiplier, context);
190  storeHelper(stream, pinfo->_lagrange_multiplier_slip, context);
191  storeHelper(stream, pinfo->_mech_status, context);
192  storeHelper(stream, pinfo->_mech_status_old, context);
193 
194  // Don't need frictional_energy_old, accumulated_slip_old, contact_force_old, or
195  // locked_this_step
196  // because they are always set by the constraints at the beginning of a new time step.
197  }
198  else
199  {
200  // Store 0 so that we know that this pinfo is NULL
201  unsigned int i = 0;
202  storeHelper(stream, i, context);
203  }
204 }
std::vector< RealGradient > _d2xyzdxideta
RealVectorValue _normal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const Elem * _starting_elem
Point _closest_point_on_face_ref
std::vector< std::vector< RealGradient > > _side_grad_phi
std::vector< std::vector< Real > > _side_phi
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
const Elem * _elem
unsigned int _starting_side_num
unsigned int _side_num
std::vector< RealGradient > _dxyzdxi
RealVectorValue _contact_force
MECH_STATUS_ENUM _mech_status
std::vector< const Node * > _off_edge_nodes
Point _starting_closest_point_ref
std::vector< RealGradient > _dxyzdeta
MECH_STATUS_ENUM _mech_status_old
RealVectorValue _lagrange_multiplier_slip