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 12 of file NodalArea.h.

Constructor & Destructor Documentation

NodalArea::NodalArea ( const InputParameters &  parameters)

Definition at line 27 of file NodalArea.C.

28  : SideIntegralVariableUserObject(parameters),
29  _phi(getCoupledVars().find("variable")->second[0]->phiFace()),
30  _system(_variable->sys()),
31  _aux_solution(_system.solution())
32 {
33 }
NumericVector< Number > & _aux_solution
Definition: NodalArea.h:37
SystemBase & _system
Definition: NodalArea.h:36
const VariablePhiValue & _phi
Definition: NodalArea.h:34
NodalArea::~NodalArea ( )
virtual

Definition at line 35 of file NodalArea.C.

35 {}

Member Function Documentation

Real NodalArea::computeQpIntegral ( )
protectedvirtual

Definition at line 51 of file NodalArea.C.

52 {
53  return 1;
54 }
void NodalArea::execute ( )
virtual

Definition at line 63 of file NodalArea.C.

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

Definition at line 84 of file NodalArea.C.

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

Definition at line 57 of file NodalArea.C.

58 {
59  _node_areas.clear();
60 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:29
Real NodalArea::nodalArea ( const Node *  node) const

Definition at line 106 of file NodalArea.C.

107 {
108  std::map<const Node *, Real>::const_iterator it = _node_areas.find(node);
109  Real retVal(0);
110  if (it != _node_areas.end())
111  {
112  retVal = it->second;
113  }
114  return retVal;
115 }
std::map< const Node *, Real > _node_areas
Definition: NodalArea.h:29
void NodalArea::threadJoin ( const UserObject &  uo)
virtual

Definition at line 38 of file NodalArea.C.

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

Member Data Documentation

NumericVector<Number>& NodalArea::_aux_solution
protected

Definition at line 37 of file NodalArea.h.

Referenced by finalize().

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

Definition at line 31 of file NodalArea.h.

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

Definition at line 32 of file NodalArea.h.

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

Definition at line 29 of file NodalArea.h.

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

const VariablePhiValue& NodalArea::_phi
protected

Definition at line 34 of file NodalArea.h.

Referenced by execute().

SystemBase& NodalArea::_system
protected

Definition at line 36 of file NodalArea.h.

Referenced by finalize().


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