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

#include <ComputeNodalAuxBcsThread.h>

Inheritance diagram for ComputeNodalAuxBcsThread:
[legend]

Public Member Functions

 ComputeNodalAuxBcsThread (FEProblemBase &fe_problem, const MooseObjectWarehouse< AuxKernel > &storage)
 
 ComputeNodalAuxBcsThread (ComputeNodalAuxBcsThread &x, Threads::split split)
 
virtual void onNode (ConstBndNodeRange::const_iterator &node_it) override
 Called for each node. More...
 
void join (const ComputeNodalAuxBcsThread &)
 
void operator() (const ConstBndNodeRange &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void postNode (ConstBndNodeRange::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

AuxiliarySystem_aux_sys
 
const MooseObjectWarehouse< AuxKernel > & _storage
 Storage object containing active AuxKernel objects. More...
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 27 of file ComputeNodalAuxBcsThread.h.

Constructor & Destructor Documentation

ComputeNodalAuxBcsThread::ComputeNodalAuxBcsThread ( FEProblemBase fe_problem,
const MooseObjectWarehouse< AuxKernel > &  storage 
)

Definition at line 23 of file ComputeNodalAuxBcsThread.C.

26  _aux_sys(fe_problem.getAuxiliarySystem()),
27  _storage(storage)
28 {
29 }
AuxiliarySystem & getAuxiliarySystem()
const MooseObjectWarehouse< AuxKernel > & _storage
Storage object containing active AuxKernel objects.
ComputeNodalAuxBcsThread::ComputeNodalAuxBcsThread ( ComputeNodalAuxBcsThread x,
Threads::split  split 
)

Definition at line 32 of file ComputeNodalAuxBcsThread.C.

35  _aux_sys(x._aux_sys),
36  _storage(x._storage)
37 {
38 }
static PetscErrorCode Vec x
const MooseObjectWarehouse< AuxKernel > & _storage
Storage object containing active AuxKernel objects.

Member Function Documentation

virtual void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::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.
void ComputeNodalAuxBcsThread::join ( const ComputeNodalAuxBcsThread )

Definition at line 85 of file ComputeNodalAuxBcsThread.C.

86 {
87 }
virtual bool ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::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 ComputeNodalAuxBcsThread::onNode ( ConstBndNodeRange::const_iterator &  node_it)
overridevirtual

Called for each node.

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

Definition at line 41 of file ComputeNodalAuxBcsThread.C.

42 {
43  const BndNode * bnode = *node_it;
44 
45  BoundaryID boundary_id = bnode->_bnd_id;
46 
47  // prepare variables
48  for (const auto & it : _aux_sys._nodal_vars[_tid])
49  {
50  MooseVariable * var = it.second;
51  var->prepareAux();
52  }
53 
54  Node * node = bnode->_node;
55 
56  if (node->processor_id() == _fe_problem.processor_id())
57  {
58  // Get a map of all active block restricted AuxKernel objects
59  const auto & kernels = _storage.getActiveBoundaryObjects(_tid);
60 
61  // Operate on the node BoundaryID only
62  const auto iter = kernels.find(boundary_id);
63  if (iter != kernels.end())
64  {
65  _fe_problem.reinitNodeFace(node, boundary_id, _tid);
66 
67  for (const auto & aux : iter->second)
68  aux->compute();
69  }
70  }
71 
72  // We are done, so update the solution vector
73  {
74  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
75  // update the solution vector
76  for (const auto & it : _aux_sys._nodal_vars[_tid])
77  {
78  MooseVariable * var = it.second;
79  var->insert(_aux_sys.solution());
80  }
81  }
82 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< std::map< std::string, MooseVariable * > > _nodal_vars
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
BoundaryID _bnd_id
boundary id for the node
Definition: BndNode.h:28
Node * _node
pointer to the node
Definition: BndNode.h:26
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, THREAD_ID tid) override
virtual NumericVector< Number > & solution() override
const MooseObjectWarehouse< AuxKernel > & _storage
Storage object containing active AuxKernel objects.
void insert(NumericVector< Number > &residual)
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::operator() ( const ConstBndNodeRange range)
inherited
virtual void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::post ( )
virtualinherited

Called after the node range loop.

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

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

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

Called before the node range loop.

Reimplemented in ComputeNodalKernelBCJacobiansThread, and ComputeNodalKernelBcsThread.

Member Data Documentation

AuxiliarySystem& ComputeNodalAuxBcsThread::_aux_sys
protected

Definition at line 42 of file ComputeNodalAuxBcsThread.h.

Referenced by onNode().

FEProblemBase& ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::_fe_problem
protectedinherited
const MooseObjectWarehouse<AuxKernel>& ComputeNodalAuxBcsThread::_storage
protected

Storage object containing active AuxKernel objects.

Definition at line 45 of file ComputeNodalAuxBcsThread.h.

Referenced by onNode().

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

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