From eb70253bf9a06bd5bbd67431eb8d938ac66adfc9 Mon Sep 17 00:00:00 2001 From: brandall25 Date: Tue, 6 Jun 2023 20:34:48 -0400 Subject: [PATCH 1/2] Remove MooseGhostPointNeighbors src and header closes #24573 --- .../MooseGhostPointNeighbors.h | 43 ----------- .../MooseGhostPointNeighbors.C | 74 ------------------- 2 files changed, 117 deletions(-) delete mode 100644 framework/include/relationshipmanagers/MooseGhostPointNeighbors.h delete mode 100644 framework/src/relationshipmanagers/MooseGhostPointNeighbors.C diff --git a/framework/include/relationshipmanagers/MooseGhostPointNeighbors.h b/framework/include/relationshipmanagers/MooseGhostPointNeighbors.h deleted file mode 100644 index fcd5e0f517d5..000000000000 --- a/framework/include/relationshipmanagers/MooseGhostPointNeighbors.h +++ /dev/null @@ -1,43 +0,0 @@ -//* This file is part of the MOOSE framework -//* https://www.mooseframework.org -//* -//* All rights reserved, see COPYRIGHT for full restrictions -//* https://github.com/idaholab/moose/blob/master/COPYRIGHT -//* -//* Licensed under LGPL 2.1, please see LICENSE for details -//* https://www.gnu.org/licenses/lgpl-2.1.html - -#pragma once - -#include "FunctorRelationshipManager.h" - -/** - * MooseGhostPointNeighbors is used to increase the halo or stencil depth of each processor's - * partition. It is useful when non-local element resources are needed when using DistributedMesh. - * This ghosts more elements than ElementSideNeighborLayers with a layer level of 1 because it - * includes not just side neighbors but point neighbors as well. This should only be used as - * geometric ghosting functor because it uses a nullptr coupling matrix, e.g. if used as as a - * ghosting functor on the dof_map it would ghost all dofs between local and ghosted elements - */ -class MooseGhostPointNeighbors : public FunctorRelationshipManager -{ -public: - static InputParameters validParams(); - - MooseGhostPointNeighbors(const InputParameters & parameters); - - MooseGhostPointNeighbors(const MooseGhostPointNeighbors & other); - - /** - * According to the base class docs, "We call mesh_reinit() whenever - * the relevant Mesh has changed, but before remote elements on a - * distributed mesh are deleted." - */ - virtual std::unique_ptr clone() const override; - - virtual std::string getInfo() const override; - virtual bool operator>=(const RelationshipManager & rhs) const override; - -protected: - virtual void internalInitWithMesh(const MeshBase & mesh) override; -}; diff --git a/framework/src/relationshipmanagers/MooseGhostPointNeighbors.C b/framework/src/relationshipmanagers/MooseGhostPointNeighbors.C deleted file mode 100644 index 272fc98cd806..000000000000 --- a/framework/src/relationshipmanagers/MooseGhostPointNeighbors.C +++ /dev/null @@ -1,74 +0,0 @@ -//* This file is part of the MOOSE framework -//* https://www.mooseframework.org -//* -//* All rights reserved, see COPYRIGHT for full restrictions -//* https://github.com/idaholab/moose/blob/master/COPYRIGHT -//* -//* Licensed under LGPL 2.1, please see LICENSE for details -//* https://www.gnu.org/licenses/lgpl-2.1.html - -#include "MooseGhostPointNeighbors.h" -#include "MooseMesh.h" -#include "Conversion.h" -#include "MooseApp.h" - -#include "libmesh/ghost_point_neighbors.h" - -registerMooseObject("MooseApp", MooseGhostPointNeighbors); - -InputParameters -MooseGhostPointNeighbors::validParams() -{ - InputParameters params = FunctorRelationshipManager::validParams(); - return params; -} - -MooseGhostPointNeighbors::MooseGhostPointNeighbors(const InputParameters & parameters) - : FunctorRelationshipManager(parameters) -{ - if (_rm_type != Moose::RelationshipManagerType::GEOMETRIC) - mooseError("The MooseGhostPointNeighbors relationship manager should only be used for " - "geometric ghosting"); -} - -MooseGhostPointNeighbors::MooseGhostPointNeighbors(const MooseGhostPointNeighbors & others) - : FunctorRelationshipManager(others) -{ - if (_rm_type != Moose::RelationshipManagerType::GEOMETRIC) - mooseError("The MooseGhostPointNeighbors relationship manager should only be used for " - "geometric ghosting"); -} - -std::unique_ptr -MooseGhostPointNeighbors::clone() const -{ - return std::make_unique(*this); -} - -std::string -MooseGhostPointNeighbors::getInfo() const -{ - std::ostringstream oss; - - oss << "GhostPointNeighbors"; - - return oss.str(); -} - -bool -MooseGhostPointNeighbors::operator>=(const RelationshipManager & rhs) const -{ - const auto * rm = dynamic_cast(&rhs); - if (!rm) - return false; - else - return baseGreaterEqual(*rm); -} - -void -MooseGhostPointNeighbors::internalInitWithMesh(const MeshBase & mesh) -{ - auto functor = std::make_unique(mesh); - - _functor = std::move(functor); -} From c5e35deb10b316a7596244e81d3f8ae12873f90a Mon Sep 17 00:00:00 2001 From: brandall25 Date: Wed, 7 Jun 2023 12:21:29 -0400 Subject: [PATCH 2/2] Replaced MooseNeighborPointLayers with ElementPointNeighborLayers wherever possible closes #24573 --- framework/src/actions/AdaptivityAction.C | 6 +++--- framework/src/actions/SetAdaptivityOptionsAction.C | 6 +++--- framework/src/outputs/Exodus.C | 2 +- framework/src/outputs/GMVOutput.C | 2 +- framework/src/outputs/Tecplot.C | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/src/actions/AdaptivityAction.C b/framework/src/actions/AdaptivityAction.C index 5cb1c2dfae65..7ea0c82123ff 100644 --- a/framework/src/actions/AdaptivityAction.C +++ b/framework/src/actions/AdaptivityAction.C @@ -123,7 +123,7 @@ AdaptivityAction::act() else if (_current_task == "add_geometric_rm") { - auto rm_params = _factory.getValidParams("MooseGhostPointNeighbors"); + auto rm_params = _factory.getValidParams("ElementPointNeighborLayers"); rm_params.set("for_whom") = "Adaptivity"; rm_params.set("mesh") = _mesh.get(); @@ -133,7 +133,7 @@ AdaptivityAction::act() if (rm_params.areAllRequiredParamsValid()) { auto rm_obj = _factory.create( - "MooseGhostPointNeighbors", "adaptivity_geometric_ghosting", rm_params); + "ElementPointNeighborLayers", "adaptivity_geometric_ghosting", rm_params); // Delete the resources created on behalf of the RM if it ends up not being added to the // App. @@ -141,7 +141,7 @@ AdaptivityAction::act() _factory.releaseSharedObjects(*rm_obj); } else - mooseError("Invalid initialization of MooseGhostPointNeighbors"); + mooseError("Invalid initialization of ElementPointNeighborLayers"); } else if (_current_task == "setup_adaptivity") diff --git a/framework/src/actions/SetAdaptivityOptionsAction.C b/framework/src/actions/SetAdaptivityOptionsAction.C index 8bb4a840d70f..e4c66994e414 100644 --- a/framework/src/actions/SetAdaptivityOptionsAction.C +++ b/framework/src/actions/SetAdaptivityOptionsAction.C @@ -96,7 +96,7 @@ SetAdaptivityOptionsAction::act() else if (_current_task == "add_geometric_rm") { - auto rm_params = _factory.getValidParams("MooseGhostPointNeighbors"); + auto rm_params = _factory.getValidParams("ElementPointNeighborLayers"); rm_params.set("for_whom") = "Adaptivity"; rm_params.set("mesh") = _mesh.get(); @@ -106,7 +106,7 @@ SetAdaptivityOptionsAction::act() if (rm_params.areAllRequiredParamsValid()) { auto rm_obj = _factory.create( - "MooseGhostPointNeighbors", "adaptivity_geometric_ghosting", rm_params); + "ElementPointNeighborLayers", "adaptivity_geometric_ghosting", rm_params); // Delete the resources created on behalf of the RM if it ends up not being added to the // App. @@ -114,7 +114,7 @@ SetAdaptivityOptionsAction::act() _factory.releaseSharedObjects(*rm_obj); } else - mooseError("Invalid initialization of MooseGhostPointNeighbors"); + mooseError("Invalid initialization of ElementPointNeighborLayers"); } else if (_current_task == "set_adaptivity_options") diff --git a/framework/src/outputs/Exodus.C b/framework/src/outputs/Exodus.C index f8a9acd12a70..667a90da2ae8 100644 --- a/framework/src/outputs/Exodus.C +++ b/framework/src/outputs/Exodus.C @@ -83,7 +83,7 @@ Exodus::validParams() params.addParam("write_hdf5", false, "Enables HDF5 output format for Exodus files."); // Need a layer of geometric ghosting for mesh serialization - params.addRelationshipManager("MooseGhostPointNeighbors", + params.addRelationshipManager("ElementPointNeighborLayers", Moose::RelationshipManagerType::GEOMETRIC); // Return the InputParameters diff --git a/framework/src/outputs/GMVOutput.C b/framework/src/outputs/GMVOutput.C index dd9ab2245b32..8d120bafc788 100644 --- a/framework/src/outputs/GMVOutput.C +++ b/framework/src/outputs/GMVOutput.C @@ -29,7 +29,7 @@ GMVOutput::validParams() params.addClassDescription("Object for outputting data in the GMV format"); // Need a layer of geometric ghosting for mesh serialization - params.addRelationshipManager("MooseGhostPointNeighbors", + params.addRelationshipManager("ElementPointNeighborLayers", Moose::RelationshipManagerType::GEOMETRIC); // Return the InputParameters diff --git a/framework/src/outputs/Tecplot.C b/framework/src/outputs/Tecplot.C index 8ee4e9c38100..c5ff06a63a51 100644 --- a/framework/src/outputs/Tecplot.C +++ b/framework/src/outputs/Tecplot.C @@ -34,7 +34,7 @@ Tecplot::validParams() "If true, append to an existing ASCII file rather than creating a new file each time"); // Need a layer of geometric ghosting for mesh serialization - params.addRelationshipManager("MooseGhostPointNeighbors", + params.addRelationshipManager("ElementPointNeighborLayers", Moose::RelationshipManagerType::GEOMETRIC); // Add description for the Tecplot class