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

#include <NodalArea.h>

Inheritance diagram for NodalArea:
[legend]

Public Member Functions

 NodalArea (const InputParameters &parameters)
 
virtual ~NodalArea ()
 
virtual void threadJoin (const UserObject &uo)
 
virtual void initialize ()
 
virtual void execute ()
 
virtual void finalize ()
 
Real nodalArea (const Node *node) const
 

Protected Member Functions

virtual Real computeQpIntegral ()
 

Protected Attributes

std::map< const Node *, Real > _node_areas
 
std::map< unsigned, unsigned > _commMap
 
std::vector< Real > _commVec
 
const VariablePhiValue & _phi
 
SystemBase & _system
 
NumericVector< Number > & _aux_solution
 

Detailed Description

Definition at line 15 of file NodalArea.h.

Constructor & Destructor Documentation

◆ NodalArea()

NodalArea::NodalArea ( const InputParameters &  parameters)

Definition at line 30 of file NodalArea.C.

31  : SideIntegralVariableUserObject(parameters),
32  _phi(_variable->phiFace()),
33  _system(_variable->sys()),
34  _aux_solution(_system.solution())
35 {
36 }
NumericVector< Number > & _aux_solution
Definition: NodalArea.h:40
SystemBase & _system
Definition: NodalArea.h:39
const VariablePhiValue & _phi
Definition: NodalArea.h:37

◆ ~NodalArea()

NodalArea::~NodalArea ( )
virtual

Definition at line 38 of file NodalArea.C.

38 {}

Member Function Documentation

◆ computeQpIntegral()

Real NodalArea::computeQpIntegral ( )
protectedvirtual

Definition at line 54 of file NodalArea.C.

55 {
56  return 1;
57 }

◆ execute()

void NodalArea::execute ( )
virtual

Definition at line 66 of file NodalArea.C.

67 {
68  std::vector<Real> nodeAreas(_phi.size());
69  for (unsigned qp(0); qp < _qrule->n_points(); ++qp)
70  {
71  for (unsigned j(0); j < _phi.size(); ++j)
72  {
73  nodeAreas[j] += (_phi[j][qp] * _JxW[qp] * _coord[qp]);
74  }
75  }
76  for (unsigned j(0); j < _phi.size(); ++j)
77  {
78  const Real area = nodeAreas[j];
79  if (area != 0)
80  {
81  _node_areas[_current_elem->get_node(j)] += area;
82  }
83  }
84 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:32
const VariablePhiValue & _phi
Definition: NodalArea.h:37

◆ finalize()

void NodalArea::finalize ( )
virtual

Definition at line 87 of file NodalArea.C.

88 {
89 
90  const std::map<const Node *, Real>::iterator it_end = _node_areas.end();
91  for (std::map<const Node *, Real>::iterator it = _node_areas.begin(); it != it_end; ++it)
92  {
93  const Node * const node = it->first;
94  dof_id_type dof = node->dof_number(_system.number(), _variable->number(), 0);
95  _aux_solution.set(dof, 0);
96  }
97  _aux_solution.close();
98 
99  for (std::map<const Node *, Real>::iterator it = _node_areas.begin(); it != it_end; ++it)
100  {
101  const Node * const node = it->first;
102  dof_id_type dof = node->dof_number(_system.number(), _variable->number(), 0);
103  _aux_solution.add(dof, it->second);
104  }
105  _aux_solution.close();
106 }
NumericVector< Number > & _aux_solution
Definition: NodalArea.h:40
SystemBase & _system
Definition: NodalArea.h:39
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:32

◆ initialize()

void NodalArea::initialize ( )
virtual

Definition at line 60 of file NodalArea.C.

61 {
62  _node_areas.clear();
63 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:32

◆ nodalArea()

Real NodalArea::nodalArea ( const Node *  node) const

Definition at line 109 of file NodalArea.C.

110 {
111  std::map<const Node *, Real>::const_iterator it = _node_areas.find(node);
112  Real retVal(0);
113  if (it != _node_areas.end())
114  {
115  retVal = it->second;
116  }
117  return retVal;
118 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:32

◆ threadJoin()

void NodalArea::threadJoin ( const UserObject &  uo)
virtual

Definition at line 41 of file NodalArea.C.

42 {
43  const NodalArea & na = dynamic_cast<const NodalArea &>(fred);
44 
45  std::map<const Node *, Real>::const_iterator it = na._node_areas.begin();
46  const std::map<const Node *, Real>::const_iterator it_end = na._node_areas.end();
47  for (; it != it_end; ++it)
48  {
49  _node_areas[it->first] += it->second;
50  }
51 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:32

Member Data Documentation

◆ _aux_solution

NumericVector<Number>& NodalArea::_aux_solution
protected

Definition at line 40 of file NodalArea.h.

Referenced by finalize().

◆ _commMap

std::map<unsigned, unsigned> NodalArea::_commMap
protected

Definition at line 34 of file NodalArea.h.

◆ _commVec

std::vector<Real> NodalArea::_commVec
protected

Definition at line 35 of file NodalArea.h.

◆ _node_areas

std::map<const Node *, Real> NodalArea::_node_areas
protected

Definition at line 32 of file NodalArea.h.

Referenced by execute(), finalize(), initialize(), nodalArea(), and threadJoin().

◆ _phi

const VariablePhiValue& NodalArea::_phi
protected

Definition at line 37 of file NodalArea.h.

Referenced by execute().

◆ _system

SystemBase& NodalArea::_system
protected

Definition at line 39 of file NodalArea.h.

Referenced by finalize().


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