https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RelationshipManager.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 "MooseObject.h"
13#include "InputParameters.h"
14#include "MooseMesh.h"
15
16#include "libmesh/ghosting_functor.h"
17
18class MooseMesh;
19
27{
28public:
30
32
34
38 void
39 init(MooseMesh & moose_mesh, const MeshBase & mesh, const libMesh::DofMap * dof_map = nullptr);
40
48 bool inited() { return _inited; }
49
53 virtual const std::vector<std::string> & forWhom() const { return _for_whom; }
54
58 void addForWhom(const std::string & for_whom) { _for_whom.push_back(for_whom); }
59
63 virtual std::string getInfo() const = 0;
64
69
76 {
77 return (_rm_type & type) == type;
78 }
79
80 virtual bool operator==(const RelationshipManager & /*rhs*/) const
81 {
82 mooseError("RelationshipManager::operator>= must be overridden");
83 }
84
89 virtual bool operator>=(const RelationshipManager & rhs) const
90 {
92 "Are you overriding RelationshipManager::operator==? We are transitioning to make "
93 "operator>= "
94 "the required override. If you are not overriding operator>= or operator==, you are about "
95 "to get an error message saying that operator>= must be overridden.");
96
97 return *this == rhs;
98 }
99
104 virtual bool baseGreaterEqual(const RelationshipManager & rhs) const;
105
112
119 bool useDisplacedMesh() const { return _use_displaced_mesh; }
120
121 const libMesh::DofMap * dofMap() { return _dof_map; }
122
123protected:
127 virtual void internalInitWithMesh(const MeshBase &) { internalInit(); }
128 virtual void internalInit() {}
129
131 bool _inited = false;
132
136
139 const libMesh::DofMap * _dof_map = nullptr;
140
145
149
151 std::vector<std::string> _for_whom;
152
155
156public:
160 static bool isGeometric(Moose::RelationshipManagerType input_rm);
161
165 static bool isAlgebraic(Moose::RelationshipManagerType input_rm);
166
170 static bool isCoupling(Moose::RelationshipManagerType input_rm);
171
176
181
190
198};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
bool _inited
Whether or not this has been initialized.
virtual bool operator==(const RelationshipManager &) const
bool isType(const Moose::RelationshipManagerType &type) const
Check to see if an RM is of a given type.
const bool _use_displaced_mesh
Which system this should go to (undisplaced or displaced)
virtual bool baseGreaterEqual(const RelationshipManager &rhs) const
Whether the base class provides more or the same amount and type of ghosting as the rhs.
virtual const std::vector< std::string > & forWhom() const
The object (or Action) this RelationshipManager was built for.
static bool isCoupling(Moose::RelationshipManagerType input_rm)
Whether input_rm is coupling.
void addForWhom(const std::string &for_whom)
Add another name to for_whom.
std::vector< std::string > _for_whom
The name of the object that requires this RelationshipManager.
const libMesh::DofMap * _dof_map
Pointer to DofMap (may be null if this is geometric only).
Moose::RelationshipManagerType _rm_type
The type of RM this object is.
static bool isGeometric(Moose::RelationshipManagerType input_rm)
Whether input_rm is geometric.
bool inited()
Whether or not this RM has been init-ed.
static InputParameters validParams()
bool useDisplacedMesh() const
Whether this should be placed on the undisplaced or displaced systems.
void init(MooseMesh &moose_mesh, const MeshBase &mesh, const libMesh::DofMap *dof_map=nullptr)
Called before this RM is attached.
Moose::RelationshipManagerType getType() const
Getter for returning the enum type for this RM.
static Moose::RelationshipManagerType geo_alg_and_coupl
A relationship manager type that is geometric, algebraic, and coupling.
virtual void internalInitWithMesh(const MeshBase &)
Called before this RM is attached.
const bool _attach_geometric_early
Boolean indicating whether this RM can be attached early (e.g.
const libMesh::DofMap * dofMap()
MooseMesh * _moose_mesh
Pointer to the MooseMesh object.
bool attachGeometricEarly()
Whether or not this RM can be attached to the Mesh early if it's geometric.
virtual std::string getInfo() const =0
Method for returning relationship manager information (suitable for console output).
static InputParameters zeroLayerGhosting()
This returns an InputParameters object containing an ElementSideNeighborLayers relationship manager w...
virtual bool operator>=(const RelationshipManager &rhs) const
Whether this relationship manager provides more or the same amount and type of ghosting as the rhs.
static bool isAlgebraic(Moose::RelationshipManagerType input_rm)
Whether input_rm is algebraic.
static Moose::RelationshipManagerType geo_and_alg
A relationship manager type that is geometric and algebraic.
static InputParameters oneLayerGhosting(Moose::RelationshipManagerType rm_type)
This returns an InputParameters object containing an ElementSideNeighborLayers relationship manager w...
void mooseDeprecated(Args &&... args) const
MeshBase & mesh
RelationshipManagerType
Main types of Relationship Managers.