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

#include <ComputeBoundaryInitialConditionThread.h>

Inheritance diagram for ComputeBoundaryInitialConditionThread:
[legend]

Public Member Functions

 ComputeBoundaryInitialConditionThread (FEProblemBase &fe_problem)
 
 ComputeBoundaryInitialConditionThread (ComputeBoundaryInitialConditionThread &x, Threads::split split)
 
void onNode (ConstBndNodeRange::const_iterator &nd)
 Called for each node. More...
 
void join (const ComputeBoundaryInitialConditionThread &)
 
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

FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 26 of file ComputeBoundaryInitialConditionThread.h.

Constructor & Destructor Documentation

ComputeBoundaryInitialConditionThread::ComputeBoundaryInitialConditionThread ( FEProblemBase fe_problem)
ComputeBoundaryInitialConditionThread::ComputeBoundaryInitialConditionThread ( ComputeBoundaryInitialConditionThread x,
Threads::split  split 
)

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 ComputeBoundaryInitialConditionThread::join ( const ComputeBoundaryInitialConditionThread )

Definition at line 74 of file ComputeBoundaryInitialConditionThread.C.

75 {
76 }
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 ComputeBoundaryInitialConditionThread::onNode ( ConstBndNodeRange::const_iterator &  node_it)
virtual

Called for each node.

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

Definition at line 36 of file ComputeBoundaryInitialConditionThread.C.

37 {
38  const BndNode * bnode = *nd;
39 
40  Node * node = bnode->_node;
41  BoundaryID boundary_id = bnode->_bnd_id;
42 
44 
46 
47  if (warehouse.hasActiveBoundaryObjects(boundary_id, _tid))
48  {
49  const std::vector<std::shared_ptr<InitialCondition>> & ics =
50  warehouse.getActiveBoundaryObjects(boundary_id, _tid);
51  for (const auto & ic : ics)
52  {
53  if (node->processor_id() == _fe_problem.processor_id())
54  {
55  MooseVariable & var = ic->variable();
56  var.reinitNode();
57  var.computeNodalValues(); // has to call this to resize the internal array
58  Real value = ic->value(*node);
59 
60  var.setNodalValue(value); // update variable data, which is referenced by others, so the
61  // value is up-to-date
62 
63  // We are done, so update the solution vector
64  {
65  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
66  var.insert(var.sys().solution());
67  }
68  }
69  }
70  }
71 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
Warehouse for storing initial conditions.
virtual Assembly & assembly(THREAD_ID tid) override
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
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition: Assembly.C:650
void computeNodalValues()
Compute nodal values of this variable.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
void setNodalValue(Number value, unsigned int idx=0)
Set the nodal value for this variable to keep everything up to date.
virtual NumericVector< Number > & solution()=0
SystemBase & sys()
Get the system this variable is part of.
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

FEProblemBase& ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::_fe_problem
protectedinherited
THREAD_ID ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::_tid
protectedinherited

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