Line data Source code
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 "GeneralUserObject.h" 13 : 14 : #include "libmesh/ghosting_functor.h" 15 : 16 : #include <unordered_map> 17 : 18 : class MooseMesh; 19 : class NonlinearSystemBase; 20 : 21 : /** 22 : * This object loops over all of the underlying ghosting functors added by libMesh or MOOSE through 23 : * RelationshipManagers to display the effective ghosting for a particular simulation. Normally this 24 : * information is output through several AuxVariables. 25 : */ 26 : class GhostingUserObject : public GeneralUserObject 27 : { 28 : public: 29 : static InputParameters validParams(); 30 : 31 : GhostingUserObject(const InputParameters & parameters); 32 : 33 : virtual void initialSetup() override; 34 : 35 87 : virtual void initialize() override {} 36 87 : virtual void execute() override {} 37 87 : virtual void finalize() override {} 38 : 39 : virtual void meshChanged() override; 40 : 41 : Real getElementalValue(const Elem * elem, 42 : Moose::RelationshipManagerType rm_type, 43 : processor_id_type pid) const; 44 : 45 : private: 46 : /// The PID to show the ghosting for 47 : std::vector<processor_id_type> _pids; 48 : 49 : /// Ghost Functor maps 50 : /// Dimension one: Map type (Geometric, Algebraic) 51 : /// Dimension two: Proc ID -> Map 52 : /// Dimension three: Elem Ptr -> Coupling Matrix 53 : std::vector<std::unordered_map<processor_id_type, libMesh::GhostingFunctor::map_type>> _maps; 54 : 55 : MooseMesh & _mesh; 56 : NonlinearSystemBase & _nl; 57 : };