https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MaxVarNDofsPerNode Class Reference

#include <MaxVarNDofsPerNode.h>

Inheritance diagram for MaxVarNDofsPerNode:
[legend]

Public Member Functions

 MaxVarNDofsPerNode (FEProblemBase &feproblem, SolverSystem &sys)
 
 MaxVarNDofsPerNode (MaxVarNDofsPerNode &x, Threads::split split)
 
virtual ~MaxVarNDofsPerNode ()
 
virtual void onNode (ConstNodeRange::const_iterator &node_it) override
 
void join (const MaxVarNDofsPerNode &)
 
dof_id_type max ()
 
void operator() (const ConstNodeRange &range)
 
virtual void pre ()
 Called before the node range loop.
 
virtual void post ()
 Called after the node range loop.
 
virtual void onNode (ConstNodeRange::const_iterator &node_it)
 Called for each node.
 
virtual void postNode (ConstNodeRange::const_iterator &node_it)
 Called after the node assembly is done (including surface assembling)
 
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.
 

Protected Member Functions

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

Protected Attributes

SolverSystem_system
 The nonlinear system.
 
size_t _max
 Maximum number of dofs for any one variable on any one node.
 
const DofMap & _dof_map
 DOF map.
 
std::vector< dof_id_type > _dof_indices
 Reusable storage.
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 18 of file MaxVarNDofsPerNode.h.

Constructor & Destructor Documentation

◆ MaxVarNDofsPerNode() [1/2]

MaxVarNDofsPerNode::MaxVarNDofsPerNode ( FEProblemBase feproblem,
SolverSystem sys 
)

Definition at line 18 of file MaxVarNDofsPerNode.C.

20 _system(sys),
21 _max(0),
23{
24}
SolverSystem & _system
The nonlinear system.
size_t _max
Maximum number of dofs for any one variable on any one node.
const DofMap & _dof_map
DOF map.
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.

◆ MaxVarNDofsPerNode() [2/2]

MaxVarNDofsPerNode::MaxVarNDofsPerNode ( MaxVarNDofsPerNode x,
Threads::split  split 
)

Definition at line 27 of file MaxVarNDofsPerNode.C.

◆ ~MaxVarNDofsPerNode()

MaxVarNDofsPerNode::~MaxVarNDofsPerNode ( )
virtual

Definition at line 35 of file MaxVarNDofsPerNode.C.

35{}

Member Function Documentation

◆ caughtMooseException()

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 56 of file ThreadedNodeLoop.h.

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

◆ join()

void MaxVarNDofsPerNode::join ( const MaxVarNDofsPerNode y)

Definition at line 49 of file MaxVarNDofsPerNode.C.

50{
51 _max = std::max(_max, y._max);
52}

◆ keepGoing()

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 69 of file ThreadedNodeLoop.h.

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

◆ max()

dof_id_type MaxVarNDofsPerNode::max ( )
inline

Definition at line 32 of file MaxVarNDofsPerNode.h.

32{ return _max; }

Referenced by FEProblemBase::initialSetup().

◆ onNode() [1/2]

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

Called for each node.

Definition at line 43 of file ThreadedNodeLoop.h.

137{
138}

◆ onNode() [2/2]

void MaxVarNDofsPerNode::onNode ( ConstNodeRange::const_iterator &  node_it)
overridevirtual

Definition at line 38 of file MaxVarNDofsPerNode.C.

39{
40 for (unsigned int var = 0; var < _system.nVariables(); var++)
41 {
42 _dof_map.dof_indices(*node_it, _dof_indices, var);
43
44 _max = std::max(_max, _dof_indices.size());
45 }
46}
std::vector< dof_id_type > _dof_indices
Reusable storage.
virtual unsigned int nVariables() const
Get the number of variables in this system.
Definition SystemBase.C:890

◆ operator()()

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

Definition at line 28 of file ThreadedNodeLoop.h.

95{
96 try
97 {
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}
Provides a way for users to bail out of the current solve.
virtual void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
virtual void postNode(ConstNodeRange::const_iterator &node_it)
Called after the node assembly is done (including surface assembling)
virtual void onNode(ConstNodeRange::const_iterator &node_it)
Called for each node.
virtual bool keepGoing()
Whether or not the loop should continue.
virtual void pre()
Called before the node range loop.
virtual void post()
Called after the node range loop.
virtual void caughtMooseException(MooseException &e)
Called if a MooseException is caught anywhere during the computation.

◆ post()

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

Called after the node range loop.

Reimplemented in ComputeNodalAuxVarsThread< AuxKernelType >.

Definition at line 38 of file ThreadedNodeLoop.h.

131{
132}

◆ postNode()

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

Definition at line 50 of file ThreadedNodeLoop.h.

143{
144}

◆ pre()

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

Called before the node range loop.

Reimplemented in ComputeNodalKernelJacobiansThread, and ComputeNodalKernelsThread.

Definition at line 33 of file ThreadedNodeLoop.h.

125{
126}

◆ printGeneralExecutionInformation()

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

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

Reimplemented in ComputeNodalAuxVarsThread< AuxKernelType >, ComputeNodalDampingThread, ComputeNodalKernelJacobiansThread, ComputeNodalKernelsThread, and ComputeNodalUserObjectsThread.

Definition at line 76 of file ThreadedNodeLoop.h.

76{}

Member Data Documentation

◆ _dof_indices

std::vector<dof_id_type> MaxVarNDofsPerNode::_dof_indices
protected

Reusable storage.

Definition at line 45 of file MaxVarNDofsPerNode.h.

Referenced by onNode().

◆ _dof_map

const DofMap& MaxVarNDofsPerNode::_dof_map
protected

DOF map.

Definition at line 42 of file MaxVarNDofsPerNode.h.

Referenced by onNode().

◆ _fe_problem

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

Definition at line 72 of file ThreadedNodeLoop.h.

◆ _max

size_t MaxVarNDofsPerNode::_max
protected

Maximum number of dofs for any one variable on any one node.

Definition at line 39 of file MaxVarNDofsPerNode.h.

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

◆ _system

SolverSystem& MaxVarNDofsPerNode::_system
protected

The nonlinear system.

Definition at line 36 of file MaxVarNDofsPerNode.h.

Referenced by onNode().

◆ _tid

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

Definition at line 73 of file ThreadedNodeLoop.h.


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