www.mooseframework.org
FunctorRelationshipManager.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 "RelationshipManager.h"
13 
14 #include "libmesh/ghosting_functor.h"
15 
16 class MooseMesh;
17 
24 {
25 public:
27 
29 
31 
32  virtual void operator()(const MeshBase::const_element_iterator & range_begin,
33  const MeshBase::const_element_iterator & range_end,
35  map_type & coupled_elements) override;
36 
37  virtual void mesh_reinit() override;
38 
39  virtual void dofmap_reinit() override;
40 
41  virtual void redistribute() override;
42 
43  virtual void delete_remote_elements() override;
44 
49  virtual void set_mesh(const MeshBase * mesh) override
50  {
51  if (_functor)
52  {
53  _functor->set_mesh(mesh);
54  _mesh = mesh;
55  }
56  else
57  mooseError("functor does not exist");
58  }
59 
60 protected:
61  std::unique_ptr<GhostingFunctor> _functor;
62 };
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
virtual void set_mesh(const MeshBase *mesh) override
It is often called after cloning a ghosting functor/RM.
MeshBase & mesh
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
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
const MeshBase * _mesh
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
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
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Intermediate base class for RelationshipManagers that are simply built using ghosting functors...