www.mooseframework.org
CacheChangedListsThread.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
15 
16 #include "libmesh/elem.h"
17 
19  : ThreadedElementLoopBase<ConstElemRange>(mesh)
20 {
21 }
22 
23 // Splitting Constructor
25  : ThreadedElementLoopBase<ConstElemRange>(x, split)
26 {
27 }
28 
30 
31 void
33 {
34  if (elem->refinement_flag() == Elem::INACTIVE && elem->has_children() &&
35  elem->child(0)->refinement_flag() == Elem::JUST_REFINED)
36  _refined_elements.push_back(elem);
37 
38  if (elem->refinement_flag() == Elem::JUST_COARSENED)
39  {
40  if (elem->has_children())
41  {
42  _coarsened_elements.push_back(elem);
43 
44  std::vector<const Elem *> & children = _coarsened_element_children[elem];
45 
46  for (unsigned int child = 0; child < elem->n_children(); child++)
47  children.push_back(elem->child(child));
48  }
49  }
50 }
51 
52 void
54 {
55  _refined_elements.insert(
56  _refined_elements.end(), y._refined_elements.begin(), y._refined_elements.end());
57  _coarsened_elements.insert(
61 }
CacheChangedListsThread(MooseMesh &mesh)
void join(const CacheChangedListsThread &y)
static PetscErrorCode Vec x
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
Map of Parent elements to children elements for elements that were just coarsened.
std::vector< const Elem * > _refined_elements
The elements that were just refined.
Base class for assembly-like calculations.
std::vector< const Elem * > _coarsened_elements
The elements that were just coarsened.