https://mooseframework.inl.gov
GhostEverything.C
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 // App includes
11 #include "GhostEverything.h"
12 #include "Executioner.h"
13 #include "FEProblemBase.h"
14 #include "MooseApp.h"
15 
16 // libMesh includes
17 #include "libmesh/elem.h"
18 #include "libmesh/mesh_base.h"
19 #include "libmesh/boundary_info.h"
20 
22 
23 using namespace libMesh;
24 
27 {
29  params.set<bool>("attach_geometric_early") = false;
30  return params;
31 }
32 
34 
36 
37 std::string
39 {
40  return "GhostEverything";
41 }
42 
43 void
44 GhostEverything::operator()(const MeshBase::const_element_iterator & range_begin,
45  const MeshBase::const_element_iterator & range_end,
46  const processor_id_type p,
47  map_type & coupled_elements)
48 {
49  if (std::distance(range_begin, range_end) == 0)
50  return;
51 
52  static const CouplingMatrix * const null_mat = nullptr;
53 
54  for (const Elem * const elem : _mesh->active_element_ptr_range())
55  if (elem->processor_id() != p)
56  coupled_elements.emplace(elem, null_mat);
57 }
58 
59 bool
61 {
62  return baseGreaterEqual(other);
63 }
64 
65 std::unique_ptr<GhostingFunctor>
67 {
68  return _app.getFactory().copyConstruct(*this);
69 }
virtual bool operator>=(const RelationshipManager &other) const override
Whether this relationship manager provides more or the same amount and type of ghosting as the rhs...
GhostEverything(const InputParameters &)
registerMooseObject("MooseApp", GhostEverything)
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
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition: MooseApp.h:434
uint8_t processor_id_type
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
virtual bool baseGreaterEqual(const RelationshipManager &rhs) const
Whether the base class provides more or the same amount and type of ghosting as the rhs...
const MeshBase * _mesh
std::unique_ptr< GhostingFunctor > clone() const override
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
static InputParameters validParams()
std::string getInfo() const override
Method for returning relationship manager information (suitable for console output).