www.mooseframework.org
ElementLoopUserObject.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef ELEMENTLOOPUSEROBJECT_H
9 #define ELEMENTLOOPUSEROBJECT_H
10 
11 #include "GeneralUserObject.h"
12 #include "Coupleable.h"
13 #include "MooseVariableInterface.h"
14 #include "ScalarCoupleable.h"
15 #include "MooseVariableDependencyInterface.h"
16 #include "ZeroInterface.h"
17 #include "MooseVariable.h"
18 #include "SubProblem.h"
19 #include "NonlinearSystem.h"
20 #include "Assembly.h"
21 #include "FEProblem.h"
22 #include "MooseMesh.h"
23 
24 #include "libmesh/elem.h"
25 #include "libmesh/parallel_algebra.h"
26 
27 // Forward Declarations
29 
30 namespace libMesh
31 {
32 class Elem;
33 class QBase;
34 }
35 
36 template <>
37 InputParameters validParams<ElementLoopUserObject>();
38 
59 class ElementLoopUserObject : public GeneralUserObject,
60  public BlockRestrictable,
61  public Coupleable,
62  public MooseVariableDependencyInterface,
63  public ZeroInterface
64 {
65 public:
66  ElementLoopUserObject(const InputParameters & parameters);
67  ElementLoopUserObject(ElementLoopUserObject & x, Threads::split split);
68  virtual ~ElementLoopUserObject();
69 
70  virtual void initialize();
71  virtual void execute();
72  virtual void finalize();
73 
74  virtual void pre();
75  virtual void onElement(const Elem * elem);
76  virtual void onBoundary(const Elem * elem, unsigned int side, BoundaryID bnd_id);
77  virtual void onInternalSide(const Elem * elem, unsigned int side);
78  virtual void onInterface(const Elem * elem, unsigned int side, BoundaryID bnd_id);
79  virtual void post();
80  virtual void subdomainChanged();
81  virtual bool keepGoing() { return true; }
82 
83  virtual void meshChanged();
84 
85  void join(const ElementLoopUserObject & /*y*/);
86 
87 protected:
88  virtual void caughtMooseException(MooseException & e);
89 
90  MooseMesh & _mesh;
91 
92  const Elem * _current_elem;
93  const Real & _current_elem_volume;
94  unsigned int _current_side;
95  const Elem * _current_neighbor;
96 
97  const MooseArray<Point> & _q_point;
98  QBase *& _qrule;
99  const MooseArray<Real> & _JxW;
100  const MooseArray<Real> & _coord;
101 
105  std::set<dof_id_type> _interface_elem_ids;
106 
108  SubdomainID _subdomain;
109 
111  SubdomainID _old_subdomain;
112 
113  virtual void computeElement();
114  virtual void computeBoundary();
115  virtual void computeInternalSide();
116  virtual void computeInterface();
117 };
118 
119 #endif
const MooseArray< Real > & _JxW
A base class that loops over elements and do things.
const MooseArray< Point > & _q_point
InputParameters validParams< ElementLoopUserObject >()
SubdomainID _subdomain
The subdomain for the current element.
const MooseArray< Real > & _coord
SubdomainID _old_subdomain
The subdomain for the last element.
std::set< dof_id_type > _interface_elem_ids
List of element IDs that are on the processor boundary and need to be send to other processors...
bool _have_interface_elems
true if we have cached interface elements, false if they need to be cached. We want to (re)cache only...