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

#include <ComputeNodalDampingThread.h>

Inheritance diagram for ComputeNodalDampingThread:
[legend]

Public Member Functions

 ComputeNodalDampingThread (FEProblemBase &feproblem)
 
 ComputeNodalDampingThread (ComputeNodalDampingThread &x, Threads::split split)
 
virtual ~ComputeNodalDampingThread ()
 
virtual void onNode (ConstNodeRange::const_iterator &node_it) override
 Called for each node. More...
 
void join (const ComputeNodalDampingThread &y)
 
Real damping ()
 
void operator() (const ConstNodeRange &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void postNode (ConstNodeRange::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 Attributes

Real _damping
 
NonlinearSystemBase_nl
 
const MooseObjectWarehouse< NodalDamper > & _nodal_dampers
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 29 of file ComputeNodalDampingThread.h.

Constructor & Destructor Documentation

ComputeNodalDampingThread::ComputeNodalDampingThread ( FEProblemBase feproblem)

Definition at line 23 of file ComputeNodalDampingThread.C.

25  _damping(1.0),
26  _nl(feproblem.getNonlinearSystemBase()),
28 {
29 }
NonlinearSystemBase & getNonlinearSystemBase()
const MooseObjectWarehouse< NodalDamper > & _nodal_dampers
const MooseObjectWarehouse< NodalDamper > & getNodalDamperWarehouse()
ComputeNodalDampingThread::ComputeNodalDampingThread ( ComputeNodalDampingThread x,
Threads::split  split 
)

Definition at line 32 of file ComputeNodalDampingThread.C.

35  _damping(1.0),
36  _nl(x._nl),
37  _nodal_dampers(x._nodal_dampers)
38 {
39 }
static PetscErrorCode Vec x
const MooseObjectWarehouse< NodalDamper > & _nodal_dampers
ComputeNodalDampingThread::~ComputeNodalDampingThread ( )
virtual

Definition at line 41 of file ComputeNodalDampingThread.C.

41 {}

Member Function Documentation

virtual void ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::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 60 of file ThreadedNodeLoop.h.

61  {
62  std::string what(e.what());
64  };
virtual void setException(const std::string &message)
Set an exception.
virtual const char * what() const
Get out the error message.
Real ComputeNodalDampingThread::damping ( )

Definition at line 68 of file ComputeNodalDampingThread.C.

Referenced by NonlinearSystemBase::computeDamping().

69 {
70  return _damping;
71 }
void ComputeNodalDampingThread::join ( const ComputeNodalDampingThread y)

Definition at line 74 of file ComputeNodalDampingThread.C.

75 {
76  if (y._damping < _damping)
77  _damping = y._damping;
78 }
virtual bool ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::const_iterator >::keepGoing ( )
inlinevirtualinherited

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Definition at line 71 of file ThreadedNodeLoop.h.

71 { return !_fe_problem.hasException(); }
virtual bool hasException()
Whether or not an exception has occurred.
void ComputeNodalDampingThread::onNode ( ConstNodeRange::const_iterator &  node_it)
overridevirtual

Called for each node.

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

Definition at line 44 of file ComputeNodalDampingThread.C.

45 {
46  const Node * node = *node_it;
48 
49  std::set<MooseVariable *> damped_vars;
50 
51  const auto & ndampers = _nl.getNodalDamperWarehouse().getActiveObjects(_tid);
52  for (const auto & damper : ndampers)
53  damped_vars.insert(damper->getVariable());
54 
56 
57  const auto & objects = _nodal_dampers.getActiveObjects(_tid);
58  for (const auto & obj : objects)
59  {
60  Real cur_damping = obj->computeDamping();
61  obj->checkMinDamping(cur_damping);
62  if (cur_damping < _damping)
63  _damping = cur_damping;
64  }
65 }
const MooseObjectWarehouse< NodalDamper > & _nodal_dampers
const MooseObjectWarehouse< NodalDamper > & getNodalDamperWarehouse()
void reinitIncrementAtNodeForDampers(THREAD_ID tid, const std::set< MooseVariable * > &damped_vars)
Compute the incremental change in variables at nodes for dampers.
virtual void reinitNode(const Node *node, THREAD_ID tid) override
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
void ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::const_iterator >::operator() ( const ConstNodeRange &  range)
inherited
virtual void ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::const_iterator >::post ( )
virtualinherited

Called after the node range loop.

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

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

Parameters
node- active node
virtual void ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::const_iterator >::pre ( )
virtualinherited

Called before the node range loop.

Reimplemented in ComputeNodalKernelJacobiansThread, and ComputeNodalKernelsThread.

Member Data Documentation

Real ComputeNodalDampingThread::_damping
protected

Definition at line 47 of file ComputeNodalDampingThread.h.

Referenced by damping(), join(), and onNode().

FEProblemBase& ThreadedNodeLoop< ConstNodeRange , ConstNodeRange::const_iterator >::_fe_problem
protectedinherited
NonlinearSystemBase& ComputeNodalDampingThread::_nl
protected

Definition at line 48 of file ComputeNodalDampingThread.h.

Referenced by onNode().

const MooseObjectWarehouse<NodalDamper>& ComputeNodalDampingThread::_nodal_dampers
protected

Definition at line 49 of file ComputeNodalDampingThread.h.

Referenced by onNode().

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

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