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

#include <ComputeMarkerThread.h>

Inheritance diagram for ComputeMarkerThread:
[legend]

Public Member Functions

 ComputeMarkerThread (FEProblemBase &fe_problem)
 
 ComputeMarkerThread (ComputeMarkerThread &x, Threads::split split)
 
virtual ~ComputeMarkerThread ()
 
virtual void subdomainChanged () override
 Called every time the current subdomain changes (i.e. More...
 
virtual void onElement (const Elem *elem) override
 Assembly of the element (not including surface assembly) More...
 
virtual void onBoundary (const Elem *elem, unsigned int side, BoundaryID bnd_id) override
 Called when doing boundary assembling. More...
 
virtual void onInternalSide (const Elem *elem, unsigned int side) override
 Called when doing internal edge assembling. More...
 
virtual void postElement (const Elem *) override
 Called after the element assembly is done (including surface assembling) More...
 
virtual void post () override
 Called after the element range loop. More...
 
void join (const ComputeMarkerThread &)
 
virtual void caughtMooseException (MooseException &e) override
 Called if a MooseException is caught anywhere during the computation. More...
 
virtual bool keepGoing () override
 Whether or not the loop should continue. More...
 
virtual void preElement (const Elem *elem) override
 Called before the element assembly. More...
 
virtual void preInternalSide (const Elem *elem, unsigned int side) override
 Called before evaluations on an element internal side. More...
 
virtual void neighborSubdomainChanged () override
 Called every time the neighbor subdomain changes (i.e. More...
 
void operator() (const ConstElemRange &range, bool bypass_threading=false)
 
virtual void pre ()
 Called before the element range loop. More...
 
virtual void postInternalSide (const Elem *elem, unsigned int side)
 Called after evaluations on an element internal side. More...
 
virtual void onInterface (const Elem *elem, unsigned int side, BoundaryID bnd_id)
 Called when doing interface assembling. More...
 

Protected Attributes

FEProblemBase_fe_problem
 
AuxiliarySystem_aux_sys
 
const MooseObjectWarehouse< Marker > & _marker_whs
 Reference to the Marker warhouse in FEProblemBase. More...
 
MooseMesh_mesh
 
THREAD_ID _tid
 
SubdomainID _subdomain
 The subdomain for the current element. More...
 
SubdomainID _old_subdomain
 The subdomain for the last element. More...
 
SubdomainID _neighbor_subdomain
 The subdomain for the current neighbor. More...
 
SubdomainID _old_neighbor_subdomain
 The subdomain for the last neighbor. More...
 

Detailed Description

Definition at line 24 of file ComputeMarkerThread.h.

Constructor & Destructor Documentation

ComputeMarkerThread::ComputeMarkerThread ( FEProblemBase fe_problem)

Definition at line 26 of file ComputeMarkerThread.C.

28  _fe_problem(fe_problem),
29  _aux_sys(fe_problem.getAuxiliarySystem()),
31 {
32 }
FEProblemBase & _fe_problem
const MooseObjectWarehouse< Marker > & _marker_whs
Reference to the Marker warhouse in FEProblemBase.
AuxiliarySystem & _aux_sys
AuxiliarySystem & getAuxiliarySystem()
const MooseObjectWarehouse< Marker > & getMarkerWarehouse()
ComputeMarkerThread::ComputeMarkerThread ( ComputeMarkerThread x,
Threads::split  split 
)

Definition at line 35 of file ComputeMarkerThread.C.

38  _aux_sys(x._aux_sys),
39  _marker_whs(x._marker_whs)
40 {
41 }
FEProblemBase & _fe_problem
FEProblemBase & _fe_problem
const MooseObjectWarehouse< Marker > & _marker_whs
Reference to the Marker warhouse in FEProblemBase.
static PetscErrorCode Vec x
AuxiliarySystem & _aux_sys
ComputeMarkerThread::~ComputeMarkerThread ( )
virtual

Definition at line 43 of file ComputeMarkerThread.C.

43 {}

Member Function Documentation

virtual void ThreadedElementLoop< ConstElemRange >::caughtMooseException ( MooseException e)
overridevirtualinherited

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

void ComputeMarkerThread::join ( const ComputeMarkerThread )

Definition at line 116 of file ComputeMarkerThread.C.

117 {
118 }
virtual bool ThreadedElementLoop< ConstElemRange >::keepGoing ( )
inlineoverridevirtualinherited

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 50 of file ThreadedElementLoop.h.

50 { return !_fe_problem.hasException(); }
virtual bool hasException()
Whether or not an exception has occurred.
virtual void ThreadedElementLoop< ConstElemRange >::neighborSubdomainChanged ( )
overridevirtualinherited

Called every time the neighbor subdomain changes (i.e.

the subdomain of this neighbor is not the same as the subdomain of the last neighbor). Beware of over-using this! You might think that you can do some expensive stuff in here and get away with it... but there are applications that have TONS of subdomains....

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

void ComputeMarkerThread::onBoundary ( const Elem *  elem,
unsigned int  side,
BoundaryID  bnd_id 
)
overridevirtual

Called when doing boundary assembling.

Parameters
elem- The element we are checking is on the boundary.
side- The side of the element in question.
bnd_id- ID of the boundary we are at

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 95 of file ComputeMarkerThread.C.

96 {
97 }
void ComputeMarkerThread::onElement ( const Elem *  elem)
overridevirtual

Assembly of the element (not including surface assembly)

Parameters
elem- active element

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 65 of file ComputeMarkerThread.C.

66 {
67  _fe_problem.prepare(elem, _tid);
69 
70  // Set up Sentinel class so that, even if reinitMaterials() throws, we
71  // still remember to swap back during stack unwinding.
73 
75 
77  {
78  const std::vector<std::shared_ptr<Marker>> & markers =
80  for (const auto & marker : markers)
81  marker->computeMarker();
82  }
83 
84  {
85  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
86  for (const auto & it : _aux_sys._elem_vars[_tid])
87  {
88  MooseVariable * var = it.second;
89  var->insert(_aux_sys.solution());
90  }
91  }
92 }
virtual void prepare(const Elem *elem, THREAD_ID tid) override
FEProblemBase & _fe_problem
Class for stuff related to variables.
Definition: MooseVariable.h:43
const MooseObjectWarehouse< Marker > & _marker_whs
Reference to the Marker warhouse in FEProblemBase.
virtual void reinitElem(const Elem *elem, THREAD_ID tid) override
virtual void reinitMaterials(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
std::vector< std::map< std::string, MooseVariable * > > _elem_vars
AuxiliarySystem & _aux_sys
virtual void swapBackMaterials(THREAD_ID tid)
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual NumericVector< Number > & solution() override
bool hasActiveBlockObjects(THREAD_ID tid=0) const
SubdomainID _subdomain
The subdomain for the current element.
void insert(NumericVector< Number > &residual)
The "SwapBackSentinel" class&#39;s destructor guarantees that FEProblemBase::swapBackMaterials{Face,Neighbor}() is called even when an exception is thrown from FEProblemBase::reinitMaterials{Face,Neighbor}.
virtual void ThreadedElementLoopBase< ConstElemRange >::onInterface ( const Elem *  elem,
unsigned int  side,
BoundaryID  bnd_id 
)
virtualinherited

Called when doing interface assembling.

Parameters
elem- Element we are on
side- local side number of the element 'elem'
bnd_id- ID of the interface we are at

Reimplemented in ComputeJacobianThread, and ComputeResidualThread.

void ComputeMarkerThread::onInternalSide ( const Elem *  elem,
unsigned int  side 
)
overridevirtual

Called when doing internal edge assembling.

Parameters
elem- Element we are on
side- local side number of the element 'elem'

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 100 of file ComputeMarkerThread.C.

101 {
102 }
void ThreadedElementLoopBase< ConstElemRange >::operator() ( const ConstElemRange &  range,
bool  bypass_threading = false 
)
inherited
void ComputeMarkerThread::post ( )
overridevirtual

Called after the element range loop.

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 110 of file ComputeMarkerThread.C.

111 {
113 }
FEProblemBase & _fe_problem
virtual void clearActiveElementalMooseVariables(THREAD_ID tid) override
Clear the active elemental MooseVariable.
void ComputeMarkerThread::postElement ( const Elem *  elem)
overridevirtual

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

Parameters
elem- active element

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 105 of file ComputeMarkerThread.C.

106 {
107 }
virtual void ThreadedElementLoopBase< ConstElemRange >::postInternalSide ( const Elem *  elem,
unsigned int  side 
)
virtualinherited

Called after evaluations on an element internal side.

Parameters
elem- Element we are on
side- local side number of the element 'elem'
virtual void ThreadedElementLoopBase< ConstElemRange >::pre ( )
virtualinherited

Called before the element range loop.

virtual void ThreadedElementLoop< ConstElemRange >::preElement ( const Elem *  elem)
overridevirtualinherited

Called before the element assembly.

Parameters
elem- active element

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

virtual void ThreadedElementLoop< ConstElemRange >::preInternalSide ( const Elem *  elem,
unsigned int  side 
)
overridevirtualinherited

Called before evaluations on an element internal side.

Parameters
elem- Element we are on
side- local side number of the element 'elem'

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

void ComputeMarkerThread::subdomainChanged ( )
overridevirtual

Called every time the current subdomain changes (i.e.

the subdomain of this element is not the same as the subdomain of the last element). Beware of over-using this! You might think that you can do some expensive stuff in here and get away with it... but there are applications that have TONS of subdomains....

Reimplemented from ThreadedElementLoopBase< ConstElemRange >.

Definition at line 46 of file ComputeMarkerThread.C.

47 {
50 
51  std::set<MooseVariable *> needed_moose_vars;
52  _marker_whs.updateVariableDependency(needed_moose_vars, _tid);
53 
54  for (const auto & it : _aux_sys._elem_vars[_tid])
55  {
56  MooseVariable * var = it.second;
57  var->prepareAux();
58  }
59 
60  _fe_problem.setActiveElementalMooseVariables(needed_moose_vars, _tid);
62 }
virtual void setActiveElementalMooseVariables(const std::set< MooseVariable * > &moose_vars, THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
FEProblemBase & _fe_problem
virtual void prepareMaterials(SubdomainID blk_id, THREAD_ID tid)
Add the MooseVariables that the current materials depend on to the dependency list.
Class for stuff related to variables.
Definition: MooseVariable.h:43
const MooseObjectWarehouse< Marker > & _marker_whs
Reference to the Marker warhouse in FEProblemBase.
virtual void subdomainSetup(THREAD_ID tid=0) const
virtual void subdomainSetup(SubdomainID subdomain, THREAD_ID tid)
std::vector< std::map< std::string, MooseVariable * > > _elem_vars
void updateVariableDependency(std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
AuxiliarySystem & _aux_sys
SubdomainID _subdomain
The subdomain for the current element.

Member Data Documentation

AuxiliarySystem& ComputeMarkerThread::_aux_sys
protected

Definition at line 45 of file ComputeMarkerThread.h.

Referenced by onElement(), and subdomainChanged().

FEProblemBase& ComputeMarkerThread::_fe_problem
protected

Definition at line 44 of file ComputeMarkerThread.h.

Referenced by onElement(), post(), and subdomainChanged().

const MooseObjectWarehouse<Marker>& ComputeMarkerThread::_marker_whs
protected

Reference to the Marker warhouse in FEProblemBase.

Definition at line 48 of file ComputeMarkerThread.h.

Referenced by onElement(), and subdomainChanged().

MooseMesh& ThreadedElementLoopBase< ConstElemRange >::_mesh
protectedinherited

Definition at line 141 of file ThreadedElementLoopBase.h.

SubdomainID ThreadedElementLoopBase< ConstElemRange >::_neighbor_subdomain
protectedinherited

The subdomain for the current neighbor.

Definition at line 151 of file ThreadedElementLoopBase.h.

SubdomainID ThreadedElementLoopBase< ConstElemRange >::_old_neighbor_subdomain
protectedinherited

The subdomain for the last neighbor.

Definition at line 154 of file ThreadedElementLoopBase.h.

SubdomainID ThreadedElementLoopBase< ConstElemRange >::_old_subdomain
protectedinherited

The subdomain for the last element.

Definition at line 148 of file ThreadedElementLoopBase.h.

SubdomainID ThreadedElementLoopBase< ConstElemRange >::_subdomain
protectedinherited
THREAD_ID ThreadedElementLoopBase< ConstElemRange >::_tid
protectedinherited

Definition at line 142 of file ThreadedElementLoopBase.h.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), ComputeJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalFaceJacobian(), ComputeJacobianThread::computeInternalFaceJacobian(), ComputeFullJacobianThread::computeInternalInterFaceJacobian(), ComputeJacobianThread::computeInternalInterFaceJacobian(), ComputeFullJacobianThread::computeJacobian(), ComputeJacobianThread::computeJacobian(), ComputeResidualThread::onBoundary(), ComputeJacobianThread::onBoundary(), ComputeUserObjectsThread::onBoundary(), ComputeMaterialsObjectThread::onBoundary(), onElement(), ComputeElemDampingThread::onElement(), ComputeElemAuxVarsThread::onElement(), ComputeResidualThread::onElement(), ComputeJacobianThread::onElement(), ComputeIndicatorThread::onElement(), ComputeUserObjectsThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeResidualThread::onInterface(), ComputeJacobianThread::onInterface(), ComputeJacobianThread::onInternalSide(), ComputeResidualThread::onInternalSide(), ComputeIndicatorThread::onInternalSide(), ComputeMaterialsObjectThread::onInternalSide(), ComputeUserObjectsThread::onInternalSide(), post(), ComputeElemAuxVarsThread::post(), ComputeMaterialsObjectThread::post(), ComputeIndicatorThread::post(), ComputeResidualThread::post(), ComputeJacobianThread::post(), ComputeUserObjectsThread::post(), ComputeResidualThread::postElement(), ComputeJacobianThread::postElement(), ComputeJacobianBlocksThread::postElement(), subdomainChanged(), ComputeElemAuxVarsThread::subdomainChanged(), ComputeResidualThread::subdomainChanged(), ComputeJacobianThread::subdomainChanged(), ComputeIndicatorThread::subdomainChanged(), ComputeMaterialsObjectThread::subdomainChanged(), and ComputeUserObjectsThread::subdomainChanged().


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