www.mooseframework.org
ElementLoopUserObject.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "GeneralUserObject.h"
13 #include "Coupleable.h"
14 #include "ScalarCoupleable.h"
16 #include "MooseVariable.h"
17 #include "SubProblem.h"
18 #include "NonlinearSystem.h"
19 #include "Assembly.h"
20 #include "FEProblem.h"
21 #include "MooseMesh.h"
22 
23 #include "libmesh/elem.h"
24 #include "libmesh/parallel_algebra.h"
25 
26 // Forward Declarations
27 
28 namespace libMesh
29 {
30 class Elem;
31 class QBase;
32 }
33 
55  public BlockRestrictable,
56  public Coupleable,
58 {
59 public:
61 
64  virtual ~ElementLoopUserObject();
65 
66  virtual void initialize();
67  virtual void execute();
68  virtual void finalize();
69 
70  virtual void pre();
71  virtual void preElement(const Elem * elem);
72  virtual void onElement(const Elem * elem);
73  virtual void onBoundary(const Elem * elem, unsigned int side, BoundaryID bnd_id);
74  virtual void onInternalSide(const Elem * elem, unsigned int side);
75  virtual void onInterface(const Elem * elem, unsigned int side, BoundaryID bnd_id);
76  virtual void post();
77  virtual void subdomainChanged();
78  virtual bool keepGoing() { return true; }
79 
80  virtual void meshChanged();
81 
82  void join(const ElementLoopUserObject & /*y*/);
83 
84 protected:
85  virtual void caughtMooseException(MooseException & e);
86 
88 
89  const Elem * _current_elem;
91  unsigned int _current_side;
92  const Elem * _current_neighbor;
93 
95  const QBase * const & _qrule;
98 
102  std::set<dof_id_type> _interface_elem_ids;
103 
106 
109 
110  virtual void computeElement();
111  virtual void computeBoundary();
112  virtual void computeInternalSide();
113  virtual void computeInterface();
114 };
const MooseArray< Real > & _JxW
A base class that loops over elements and do things.
const MooseArray< Point > & _q_point
virtual void onInterface(const Elem *elem, unsigned int side, BoundaryID bnd_id)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
virtual void onInternalSide(const Elem *elem, unsigned int side)
virtual void caughtMooseException(MooseException &e)
static InputParameters validParams()
virtual void onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id)
ElementLoopUserObject(const InputParameters &parameters)
SubdomainID _subdomain
The subdomain for the current element.
virtual void computeInternalSide()
const MooseArray< Real > & _coord
virtual void preElement(const Elem *elem)
const std::vector< double > x
boundary_id_type BoundaryID
virtual void onElement(const Elem *elem)
SubdomainID _old_subdomain
The subdomain for the last element.
tbb::split split
const QBase *const & _qrule
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
const InputParameters & parameters() const
void join(const ElementLoopUserObject &)