https://mooseframework.inl.gov
ActivateElementsUserObjectBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "ElementUserObject.h"
13 #include "NonlinearSystemBase.h"
14 #include "AuxiliarySystem.h"
15 
17 {
18 public:
20 
22 
23  const std::set<dof_id_type> & getNewlyActivatedElements() const { return _newly_activated_elem; };
24 
26  {
27  mooseAssert(!_boundary_ids.empty(), "Boundary ID is empty");
28  return _boundary_ids[0];
29  }
30 
31  virtual bool isElementActivated() = 0;
32 
33  void initialize() override{};
34  void execute() override;
35  void threadJoin(const UserObject & /*uo*/) override{};
36  void finalize() override;
37 
38 protected:
39  void setNewBoundayName();
40 
41  void updateBoundaryInfo(MooseMesh & mesh);
42 
44  MooseMesh & mesh,
45  std::unordered_map<processor_id_type, std::vector<std::pair<dof_id_type, unsigned int>>> &
46  elems_to_push);
47 
49  MooseMesh & mesh,
50  std::unordered_map<processor_id_type, std::vector<dof_id_type>> & nodes_to_push);
54  void initSolutions(ConstElemRange & elem_range, ConstBndNodeRange & bnd_node_range);
58  bool isNewlyActivated(const Node * node);
59 
60  void getNodesToRemoveFromBnd(std::set<dof_id_type> & remove_set, std::set<dof_id_type> & add_set);
61 
62  void insertNodeIdsOnSide(const Elem * ele,
63  const unsigned short int side,
64  std::set<dof_id_type> & node_ids);
65 
72 
73  std::set<dof_id_type> _newly_activated_elem;
74  std::set<dof_id_type> _newly_activated_node;
79  std::set<dof_id_type> _node_to_remove_from_bnd;
80 
84  std::unique_ptr<ConstElemRange> _activated_elem_range;
85  std::unique_ptr<ConstBndNodeRange> _activated_bnd_node_range;
86  std::unique_ptr<ConstNodeRange> _activated_node_range;
87 
93  const std::vector<BoundaryName> _expand_boundary_name;
95  std::vector<BoundaryID> _boundary_ids, _disp_boundary_ids;
96 };
std::set< dof_id_type > _node_to_remove_from_bnd
Somes nodes are to be removed from the boundary when adding/removing sides.
std::unique_ptr< ConstBndNodeRange > _activated_bnd_node_range
void getNodesToRemoveFromBnd(std::set< dof_id_type > &remove_set, std::set< dof_id_type > &add_set)
std::unique_ptr< ConstElemRange > _activated_elem_range
Ranges for use with threading.
void push_boundary_node_info(MooseMesh &mesh, std::unordered_map< processor_id_type, std::vector< dof_id_type >> &nodes_to_push)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const std::vector< BoundaryName > _expand_boundary_name
expanded boundary name
virtual bool isElementActivated()=0
void execute() override
Execute method.
uint8_t processor_id_type
std::vector< BoundaryID > _boundary_ids
expanded boundary IDs
ActivateElementsUserObjectBase(const InputParameters &parameters)
void threadJoin(const UserObject &) override
Must override.
const subdomain_id_type _active_subdomain_id
activate subdomain ID
boundary_id_type BoundaryID
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
void insertNodeIdsOnSide(const Elem *ele, const unsigned short int side, std::set< dof_id_type > &node_ids)
const std::set< dof_id_type > & getNewlyActivatedElements() const
void initialize() override
Called before execute() is ever called so that data can be cleared.
ConstElemRange * getNewlyActivatedElementRange()
Get ranges for use with threading.
std::unique_ptr< ConstNodeRange > _activated_node_range
const subdomain_id_type _inactive_subdomain_id
inactivate subdomain ID (the subdomain that you want to keep the same)
const InputParameters & parameters() const
Get the parameters of the object.
void push_boundary_side_info(MooseMesh &mesh, std::unordered_map< processor_id_type, std::vector< std::pair< dof_id_type, unsigned int >>> &elems_to_push)
void initSolutions(ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range)
Initialize solutions for the nodes.
bool isNewlyActivated(const Node *node)
Returns true if all the connected elements are in the _newly_activated_elem.
Base class for user-specific data.
Definition: UserObject.h:40