https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AugmentSparsityBetweenElements Class Reference

Relationship manager to add ghosting between elements. More...

#include <AugmentSparsityBetweenElements.h>

Inheritance diagram for AugmentSparsityBetweenElements:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 
typedef std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
 

Public Member Functions

 AugmentSparsityBetweenElements (const InputParameters &)
 
 AugmentSparsityBetweenElements (const AugmentSparsityBetweenElements &others)
 
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 std::unique_ptr< GhostingFunctorclone () const override
 
virtual void mesh_reinit () override
 
virtual void redistribute () override
 
std::string getInfo () const override
 
virtual bool operator>= (const RelationshipManager &rhs) const override
 
void init (MooseMesh &moose_mesh, const MeshBase &mesh, const libMesh::DofMap *dof_map=nullptr)
 
bool inited ()
 
virtual const std::vector< std::string > & forWhom () const
 
void addForWhom (const std::string &for_whom)
 
Moose::RelationshipManagerType getType () const
 
bool isType (const Moose::RelationshipManagerType &type) const
 
virtual bool operator== (const RelationshipManager &) const
 
virtual bool baseGreaterEqual (const RelationshipManager &rhs) const
 
bool attachGeometricEarly ()
 
bool useDisplacedMesh () const
 
const libMesh::DofMapdofMap ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
virtual void set_mesh (const MeshBase *mesh)
 
virtual void set_periodic_boundaries (const PeriodicBoundaries *)
 
const MeshBase * get_mesh () const
 
virtual void dofmap_reinit ()
 
virtual void delete_remote_elements ()
 

Static Public Member Functions

static InputParameters validParams ()
 
static bool isGeometric (Moose::RelationshipManagerType input_rm)
 
static bool isAlgebraic (Moose::RelationshipManagerType input_rm)
 
static bool isCoupling (Moose::RelationshipManagerType input_rm)
 
static InputParameters zeroLayerGhosting ()
 
static InputParameters oneLayerGhosting (Moose::RelationshipManagerType rm_type)
 
static std::string get_info ()
 
static void print_info (std::ostream &out_stream=libMesh::out)
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static Moose::RelationshipManagerType geo_and_alg
 
static Moose::RelationshipManagerType geo_alg_and_coupl
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

virtual void internalInitWithMesh (const MeshBase &) override
 
virtual void internalInit ()
 
void increment_constructor_count (const std::string &name) noexcept
 
void increment_destructor_count (const std::string &name) noexcept
 

Protected Attributes

const std::map< dof_id_type, std::vector< dof_id_type > > & _elem_map
 Map of element ghosting. Element IDs linked to list of element IDs that they are connected to. More...
 
bool _inited
 
MooseMesh_moose_mesh
 
const libMesh::DofMap_dof_map
 
const bool _attach_geometric_early
 
Moose::RelationshipManagerType _rm_type
 
std::vector< std::string > _for_whom
 
const bool _use_displaced_mesh
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const Parallel::Communicator & _communicator
 
const MeshBase * _mesh
 

Static Protected Attributes

static Counts _counts
 
static Threads::atomic< unsigned int_n_objects
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter
 

Detailed Description

Relationship manager to add ghosting between elements.

The list of element IDs and connected element IDs has to be constructed. This is to be used when THM components need to see each other in distributed memory parallelism

Definition at line 22 of file AugmentSparsityBetweenElements.h.

Constructor & Destructor Documentation

◆ AugmentSparsityBetweenElements() [1/2]

AugmentSparsityBetweenElements::AugmentSparsityBetweenElements ( const InputParameters params)

Definition at line 26 of file AugmentSparsityBetweenElements.C.

27  : RelationshipManager(params),
28  _elem_map(*getParam<std::map<dof_id_type, std::vector<dof_id_type>> *>("_elem_map"))
29 {
30 }
const std::map< dof_id_type, std::vector< dof_id_type > > & _elem_map
Map of element ghosting. Element IDs linked to list of element IDs that they are connected to...
const T & getParam(const std::string &name) const
RelationshipManager(const InputParameters &parameters)
uint8_t dof_id_type

◆ AugmentSparsityBetweenElements() [2/2]

AugmentSparsityBetweenElements::AugmentSparsityBetweenElements ( const AugmentSparsityBetweenElements others)

Definition at line 32 of file AugmentSparsityBetweenElements.C.

34  : RelationshipManager(other), _elem_map(other._elem_map)
35 {
36 }
const std::map< dof_id_type, std::vector< dof_id_type > > & _elem_map
Map of element ghosting. Element IDs linked to list of element IDs that they are connected to...
RelationshipManager(const InputParameters &parameters)

Member Function Documentation

◆ clone()

std::unique_ptr< GhostingFunctor > AugmentSparsityBetweenElements::clone ( ) const
overridevirtual

Reimplemented from libMesh::GhostingFunctor.

Definition at line 39 of file AugmentSparsityBetweenElements.C.

40 {
41  return _app.getFactory().clone(*this);
42 }
Factory & getFactory()

◆ getInfo()

std::string AugmentSparsityBetweenElements::getInfo ( ) const
overridevirtual

Implements RelationshipManager.

Definition at line 61 of file AugmentSparsityBetweenElements.C.

62 {
63  std::ostringstream oss;
64  oss << "AugmentSparsityBetweenElements";
65  return oss.str();
66 }

◆ internalInitWithMesh()

void AugmentSparsityBetweenElements::internalInitWithMesh ( const MeshBase )
overrideprotectedvirtual

Reimplemented from RelationshipManager.

Definition at line 56 of file AugmentSparsityBetweenElements.C.

57 {
58 }

◆ mesh_reinit()

void AugmentSparsityBetweenElements::mesh_reinit ( )
overridevirtual

Reimplemented from libMesh::GhostingFunctor.

Definition at line 45 of file AugmentSparsityBetweenElements.C.

46 {
48 }
virtual void mesh_reinit()

◆ operator()()

void AugmentSparsityBetweenElements::operator() ( const MeshBase::const_element_iterator &  range_begin,
const MeshBase::const_element_iterator &  range_end,
processor_id_type  p,
map_type coupled_elements 
)
overridevirtual

Implements libMesh::GhostingFunctor.

Definition at line 69 of file AugmentSparsityBetweenElements.C.

73 {
74  const CouplingMatrix * const null_mat = libmesh_nullptr;
75  for (const auto & elem : as_range(range_begin, range_end))
76  {
77  auto it = _elem_map.find(elem->id());
78  if (it != _elem_map.end())
79  {
80  for (auto & coupled_elem_id : it->second)
81  {
82  auto coupled_elem = _moose_mesh->elemPtr(coupled_elem_id);
83  if (coupled_elem->processor_id() != p)
84  coupled_elements.insert(std::make_pair(coupled_elem, null_mat));
85  }
86  }
87  }
88 }
virtual Elem * elemPtr(const dof_id_type i)
MooseMesh * _moose_mesh
const std::map< dof_id_type, std::vector< dof_id_type > > & _elem_map
Map of element ghosting. Element IDs linked to list of element IDs that they are connected to...
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)

◆ operator>=()

bool AugmentSparsityBetweenElements::operator>= ( const RelationshipManager rhs) const
overridevirtual

Reimplemented from RelationshipManager.

Definition at line 91 of file AugmentSparsityBetweenElements.C.

92 {
93  const auto * const rm = dynamic_cast<const AugmentSparsityBetweenElements *>(&rhs);
94  if (!rm)
95  return false;
96 
97  return (_elem_map == rm->_elem_map) && baseGreaterEqual(rhs);
98 }
const std::map< dof_id_type, std::vector< dof_id_type > > & _elem_map
Map of element ghosting. Element IDs linked to list of element IDs that they are connected to...
virtual bool baseGreaterEqual(const RelationshipManager &rhs) const
Relationship manager to add ghosting between elements.

◆ redistribute()

void AugmentSparsityBetweenElements::redistribute ( )
overridevirtual

Reimplemented from libMesh::GhostingFunctor.

Definition at line 51 of file AugmentSparsityBetweenElements.C.

52 {
53 }

◆ validParams()

InputParameters AugmentSparsityBetweenElements::validParams ( )
static

Definition at line 18 of file AugmentSparsityBetweenElements.C.

19 {
21  params.addRequiredParam<std::map<dof_id_type, std::vector<dof_id_type>> *>(
22  "_elem_map", "Element to element augmentation map");
23  return params;
24 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _elem_map

const std::map<dof_id_type, std::vector<dof_id_type> >& AugmentSparsityBetweenElements::_elem_map
protected

Map of element ghosting. Element IDs linked to list of element IDs that they are connected to.

Definition at line 42 of file AugmentSparsityBetweenElements.h.

Referenced by operator()(), and operator>=().


The documentation for this class was generated from the following files: