www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ResetDisplacedMeshThread Class Reference

#include <ResetDisplacedMeshThread.h>

Inheritance diagram for ResetDisplacedMeshThread:
[legend]

Public Member Functions

 ResetDisplacedMeshThread (FEProblemBase &fe_problem, DisplacedProblem &displaced_problem)
 
 ResetDisplacedMeshThread (ResetDisplacedMeshThread &x, Threads::split split)
 
void onNode (NodeRange::const_iterator &nd)
 Called for each node. More...
 
void join (const ResetDisplacedMeshThread &)
 
void operator() (const NodeRange &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void postNode (NodeRange::const_iterator &node_it)
 Called after the node assembly is done (including surface assembling) More...
 
virtual void caughtMooseException (MooseException &e)
 Called if a MooseException is caught anywhere during the computation. More...
 
virtual bool keepGoing ()
 Whether or not the loop should continue. More...
 

Protected Member Functions

virtual void printGeneralExecutionInformation () const
 Print information about the loop, mostly order of execution of objects. More...
 

Protected Attributes

DisplacedProblem_displaced_problem
 
MooseMesh_ref_mesh
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 23 of file ResetDisplacedMeshThread.h.

Constructor & Destructor Documentation

◆ ResetDisplacedMeshThread() [1/2]

ResetDisplacedMeshThread::ResetDisplacedMeshThread ( FEProblemBase fe_problem,
DisplacedProblem displaced_problem 
)

◆ ResetDisplacedMeshThread() [2/2]

ResetDisplacedMeshThread::ResetDisplacedMeshThread ( ResetDisplacedMeshThread x,
Threads::split  split 
)

Member Function Documentation

◆ caughtMooseException()

virtual void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::caughtMooseException ( MooseException e)
inlinevirtualinherited

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Definition at line 56 of file ThreadedNodeLoop.h.

57  {
58  Threads::spin_mutex::scoped_lock lock(threaded_node_mutex);
59 
60  std::string what(e.what());
62  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
static Threads::spin_mutex threaded_node_mutex

◆ join()

void ResetDisplacedMeshThread::join ( const ResetDisplacedMeshThread )

Definition at line 46 of file ResetDisplacedMeshThread.C.

47 {
48 }

◆ keepGoing()

virtual bool ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::keepGoing ( )
inlinevirtualinherited

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Definition at line 69 of file ThreadedNodeLoop.h.

69 { return !_fe_problem.hasException(); }
virtual bool hasException()
Whether or not an exception has occurred.

◆ onNode()

void ResetDisplacedMeshThread::onNode ( NodeRange::const_iterator &  node_it)
virtual

Called for each node.

Reimplemented from ThreadedNodeLoop< NodeRange, NodeRange::const_iterator >.

Definition at line 33 of file ResetDisplacedMeshThread.C.

34 {
35  Node & displaced_node = **nd;
36 
37  // Get the same node from the reference mesh.
38  Node & reference_node = _ref_mesh.nodeRef(displaced_node.id());
39 
40  // Undisplace the node
41  for (const auto i : make_range(Moose::dim))
42  displaced_node(i) = reference_node(i);
43 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:637
IntRange< T > make_range(T beg, T end)

◆ operator()()

void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::operator() ( const NodeRange range)
inherited

Definition at line 94 of file ThreadedNodeLoop.h.

95 {
96  try
97  {
98  ParallelUniqueId puid;
99  _tid = puid.id;
100 
101  pre();
103 
104  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
105  {
106  if (!keepGoing())
107  break;
108 
109  onNode(nd);
110 
111  postNode(nd);
112  }
113 
114  post();
115  }
116  catch (MooseException & e)
117  {
119  }
120 }
virtual void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
virtual void caughtMooseException(MooseException &e)
Called if a MooseException is caught anywhere during the computation.
virtual bool keepGoing()
Whether or not the loop should continue.
Provides a way for users to bail out of the current solve.
virtual void pre()
Called before the node range loop.
virtual void post()
Called after the node range loop.
virtual void postNode(NodeRange::const_iterator &node_it)
Called after the node assembly is done (including surface assembling)
virtual void onNode(NodeRange::const_iterator &node_it)
Called for each node.

◆ post()

void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::post ( )
virtualinherited

Called after the node range loop.

Definition at line 130 of file ThreadedNodeLoop.h.

131 {
132 }

◆ postNode()

void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::postNode ( NodeRange::const_iterator &  node_it)
virtualinherited

Called after the node assembly is done (including surface assembling)

Parameters
node- active node

Definition at line 142 of file ThreadedNodeLoop.h.

143 {
144 }

◆ pre()

void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::pre ( )
virtualinherited

Called before the node range loop.

Definition at line 124 of file ThreadedNodeLoop.h.

125 {
126 }

◆ printGeneralExecutionInformation()

virtual void ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::printGeneralExecutionInformation ( ) const
inlineprotectedvirtualinherited

Print information about the loop, mostly order of execution of objects.

Definition at line 76 of file ThreadedNodeLoop.h.

76 {}

Member Data Documentation

◆ _displaced_problem

DisplacedProblem& ResetDisplacedMeshThread::_displaced_problem
protected

Definition at line 35 of file ResetDisplacedMeshThread.h.

◆ _fe_problem

FEProblemBase& ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::_fe_problem
protectedinherited

Definition at line 72 of file ThreadedNodeLoop.h.

Referenced by UpdateDisplacedMeshThread::init().

◆ _ref_mesh

MooseMesh& ResetDisplacedMeshThread::_ref_mesh
protected

Definition at line 36 of file ResetDisplacedMeshThread.h.

Referenced by onNode().

◆ _tid

THREAD_ID ThreadedNodeLoop< NodeRange , NodeRange::const_iterator >::_tid
protectedinherited

Definition at line 73 of file ThreadedNodeLoop.h.


The documentation for this class was generated from the following files: