www.mooseframework.org
Public 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, NonlinearSystemBase &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 Attributes

NonlinearSystemBase_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 19 of file MaxVarNDofsPerNode.h.

Constructor & Destructor Documentation

◆ MaxVarNDofsPerNode() [1/2]

MaxVarNDofsPerNode::MaxVarNDofsPerNode ( FEProblemBase feproblem,
NonlinearSystemBase sys 
)

Definition at line 18 of file MaxVarNDofsPerNode.C.

20  _system(sys),
21  _max(0),
23 {
24 }
const DofMap & _dof_map
DOF map.
NonlinearSystemBase & _system
The nonlinear system.
virtual DofMap & dofMap()
Gets the dof map.
Definition: SystemBase.C:900
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.
static PetscErrorCode Vec x
NonlinearSystemBase & _system
The nonlinear system.
std::vector< std::string > split(const std::string &str, const std::string &delimiter)
Python like split function for strings.
Definition: MooseUtils.C:784
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 55 of file ThreadedNodeLoop.h.

56  {
57  std::string what(e.what());
59  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception.

◆ join()

void MaxVarNDofsPerNode::join ( const MaxVarNDofsPerNode y)

Definition at line 49 of file MaxVarNDofsPerNode.C.

50 {
51  _max = std::max(_max, y._max);
52 }
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 66 of file ThreadedNodeLoop.h.

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

◆ max()

dof_id_type MaxVarNDofsPerNode::max ( )
inline

Definition at line 33 of file MaxVarNDofsPerNode.h.

Referenced by NonlinearSystemBase::init().

33 { 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.
NonlinearSystemBase & _system
The nonlinear system.
virtual unsigned int nVariables() const
Get the number of variables in this system.
Definition: SystemBase.C:676
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 88 of file ThreadedNodeLoop.h.

89 {
90  try
91  {
92  ParallelUniqueId puid;
93  _tid = puid.id;
94 
95  pre();
96 
97  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
98  {
99  if (!keepGoing())
100  break;
101 
102  onNode(nd);
103 
104  postNode(nd);
105  }
106 
107  post();
108  }
109  catch (MooseException & e)
110  {
112  }
113 }
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.

Definition at line 123 of file ThreadedNodeLoop.h.

124 {
125 }

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

136 {
137 }

◆ pre()

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

Called before the node range loop.

Reimplemented in ComputeNodalKernelJacobiansThread, and ComputeNodalKernelsThread.

Definition at line 117 of file ThreadedNodeLoop.h.

118 {
119 }

Member Data Documentation

◆ _dof_indices

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

Reusable storage.

Definition at line 46 of file MaxVarNDofsPerNode.h.

Referenced by onNode().

◆ _dof_map

const DofMap& MaxVarNDofsPerNode::_dof_map
protected

DOF map.

Definition at line 43 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 40 of file MaxVarNDofsPerNode.h.

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

◆ _system

NonlinearSystemBase& MaxVarNDofsPerNode::_system
protected

The nonlinear system.

Definition at line 37 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: