www.mooseframework.org
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
 Called for each node. More...
 
void join (const MaxVarNDofsPerNode &)
 
dof_id_type max ()
 
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 Member Functions

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

Protected Attributes

SolverSystem_system
 The nonlinear system. More...
 
size_t _max
 Maximum number of dofs for any one variable on any one node. More...
 
const DofMap & _dof_map
 DOF map. More...
 
std::vector< dof_id_type_dof_indices
 Reusable storage. More...
 
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 }
const DofMap & _dof_map
DOF map.
SolverSystem & _system
The nonlinear system.
virtual DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1138
size_t _max
Maximum number of dofs for any one variable on any one node.

◆ MaxVarNDofsPerNode() [2/2]

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

Definition at line 27 of file MaxVarNDofsPerNode.C.

29  _system(x._system),
30  _max(0),
31  _dof_map(x._dof_map)
32 {
33 }
const DofMap & _dof_map
DOF map.
SolverSystem & _system
The nonlinear system.
tbb::split split
size_t _max
Maximum number of dofs for any one variable on any one node.

◆ ~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  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
static Threads::spin_mutex threaded_node_mutex

◆ join()

void MaxVarNDofsPerNode::join ( const MaxVarNDofsPerNode y)

Definition at line 49 of file MaxVarNDofsPerNode.C.

50 {
51  _max = std::max(_max, y._max);
52 }
auto max(const L &left, const R &right)
size_t _max
Maximum number of dofs for any one variable on any one node.

◆ 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.

Referenced by FEProblemBase::initialSetup().

32 { return _max; }
size_t _max
Maximum number of dofs for any one variable on any one node.

◆ onNode()

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

Called for each node.

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

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 }
const DofMap & _dof_map
DOF map.
SolverSystem & _system
The nonlinear system.
auto max(const L &left, const R &right)
virtual unsigned int nVariables() const
Get the number of variables in this system.
Definition: SystemBase.C:847
std::vector< dof_id_type > _dof_indices
Reusable storage.
size_t _max
Maximum number of dofs for any one variable on any one node.

◆ operator()()

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

Definition at line 94 of file ThreadedNodeLoop.h.

95 {
96  try
97  {
98  ParallelUniqueId puid;
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 }
virtual void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
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.
Provides a way for users to bail out of the current solve.
virtual void pre()
Called before the node range loop.
virtual void post()
Called after the node range loop.
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.

◆ post()

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

Called after the node range loop.

Reimplemented in ComputeNodalAuxVarsThread< AuxKernelType >.

Definition at line 130 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 142 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 124 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 ComputeNodalKernelJacobiansThread, ComputeNodalAuxVarsThread< AuxKernelType >, ComputeNodalDampingThread, 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

◆ _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

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