www.mooseframework.org
FunctorRelationshipManager.C
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 
11 #include "MooseApp.h"
12 
15 {
17  return params;
18 }
19 
21  : RelationshipManager(parameters), _functor(nullptr)
22 {
23 }
24 
26  : RelationshipManager(other), _functor(other._functor ? other._functor->clone() : nullptr)
27 {
28 }
29 
30 void
31 FunctorRelationshipManager::operator()(const MeshBase::const_element_iterator & range_begin,
32  const MeshBase::const_element_iterator & range_end,
34  map_type & coupled_elements)
35 {
36  if (!_functor)
37  mooseError("Functor was not initialized!");
38 
39  (*_functor)(range_begin, range_end, p, coupled_elements);
40 }
41 
42 void
44 {
45  if (!_functor)
46  mooseError("Functor was not initialized!");
47 
48  _functor->mesh_reinit();
49 }
50 
51 void
53 {
54  if (!_functor)
55  mooseError("Functor was not initialized!");
56 
57  _functor->dofmap_reinit();
58 }
59 
60 void
62 {
63  if (!_functor)
64  mooseError("Functor was not initialized!");
65 
66  _functor->redistribute();
67 }
68 
69 void
71 {
72  if (!_functor)
73  mooseError("Functor was not initialized!");
74 
75  _functor->delete_remote_elements();
76 }
virtual void operator()(const MeshBase::const_element_iterator &range_begin, const MeshBase::const_element_iterator &range_end, processor_id_type p, map_type &coupled_elements) override
virtual void dofmap_reinit() override
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
std::unique_ptr< GhostingFunctor > _functor
uint8_t processor_id_type
virtual void delete_remote_elements() override
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
static InputParameters validParams()
FunctorRelationshipManager(const InputParameters &parameters)
virtual void redistribute() override
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void mesh_reinit() override
static InputParameters validParams()
Intermediate base class for RelationshipManagers that are simply built using ghosting functors...