Skip to content
Permalink
Browse files

Merge pull request #13145 from lindsayad/revive_remove_default_ghosti…

…ng_12354

Revive remove default ghosting
  • Loading branch information...
permcody committed Apr 9, 2019
2 parents 6b48511 + 72907b0 commit 5037db65b057f33c417f27d9a3cbbe76742976ed
Showing with 2,028 additions and 722 deletions.
  1. BIN framework/doc/content/media/aux_kernels/ghost_aux_algebraic.png
  2. BIN framework/doc/content/media/aux_kernels/ghost_aux_geometric.png
  3. +36 −0 framework/doc/content/source/auxkernels/GhostingAux.md
  4. +12 −0 framework/include/actions/CreateDisplacedProblemAction.h
  5. +6 −0 framework/include/auxkernels/AuxKernel.h
  6. +6 −0 framework/include/auxkernels/AuxScalarKernel.h
  7. +46 −0 framework/include/auxkernels/GhostingAux.h
  8. +10 −0 framework/include/base/MooseApp.h
  9. +9 −1 framework/include/problems/SubProblem.h
  10. +0 −43 framework/include/relationshipmanagers/AlgebraicRelationshipManager.h
  11. +47 −0 framework/include/relationshipmanagers/ElementPointNeighborLayers.h
  12. +0 −55 framework/include/relationshipmanagers/ElementPointNeighbors.h
  13. +7 −13 framework/include/relationshipmanagers/ElementSideNeighborLayers.h
  14. +51 −0 framework/include/relationshipmanagers/FunctorRelationshipManager.h
  15. +0 −40 framework/include/relationshipmanagers/GeometricRelationshipManager.h
  16. +40 −0 framework/include/relationshipmanagers/MooseGhostPointNeighbors.h
  17. +55 −0 framework/include/relationshipmanagers/ProxyRelationshipManager.h
  18. +51 −24 framework/include/relationshipmanagers/RelationshipManager.h
  19. +29 −11 framework/include/utils/InputParameters.h
  20. +8 −0 framework/include/utils/MooseTypes.h
  21. +102 −39 framework/src/actions/AdaptivityAction.C
  22. +14 −6 framework/src/actions/AddDGKernelAction.C
  23. +7 −1 framework/src/actions/AddInterfaceKernelAction.C
  24. +84 −52 framework/src/actions/AddPeriodicBCAction.C
  25. +15 −5 framework/src/actions/AddRelationshipManager.C
  26. +111 −16 framework/src/actions/CreateDisplacedProblemAction.C
  27. +64 −12 framework/src/actions/MooseObjectAction.C
  28. +74 −11 framework/src/actions/SetAdaptivityOptionsAction.C
  29. +2 −0 framework/src/actions/SetupMeshAction.C
  30. +83 −0 framework/src/auxkernels/GhostingAux.C
  31. +0 −1 framework/src/base/Adaptivity.C
  32. +8 −2 framework/src/base/Moose.C
  33. +85 −1 framework/src/base/MooseApp.C
  34. +5 −0 framework/src/dgkernels/DGKernelBase.C
  35. +5 −0 framework/src/interfacekernels/InterfaceKernel.C
  36. +4 −0 framework/src/outputs/Exodus.C
  37. +4 −0 framework/src/outputs/GMVOutput.C
  38. +4 −0 framework/src/outputs/Tecplot.C
  39. +4 −0 framework/src/problems/DisplacedProblem.C
  40. +2 −0 framework/src/problems/FEProblemBase.C
  41. +9 −0 framework/src/problems/SubProblem.C
  42. +0 −53 framework/src/relationshipmanagers/AlgebraicRelationshipManager.C
  43. +68 −0 framework/src/relationshipmanagers/ElementPointNeighborLayers.C
  44. +0 −85 framework/src/relationshipmanagers/ElementPointNeighbors.C
  45. +42 −34 framework/src/relationshipmanagers/ElementSideNeighborLayers.C
  46. +72 −0 framework/src/relationshipmanagers/FunctorRelationshipManager.C
  47. +0 −32 framework/src/relationshipmanagers/GeometricRelationshipManager.C
  48. +61 −0 framework/src/relationshipmanagers/MooseGhostPointNeighbors.C
  49. +107 −0 framework/src/relationshipmanagers/ProxyRelationshipManager.C
  50. +17 −59 framework/src/relationshipmanagers/RelationshipManager.C
  51. +31 −1 framework/src/systems/AuxiliarySystem.C
  52. +5 −0 framework/src/systems/NonlinearSystem.C
  53. +11 −0 framework/src/transfers/MultiAppProjectionTransfer.C
  54. +5 −0 framework/src/userobject/InterfaceUserObject.C
  55. +6 −0 framework/src/userobject/InternalSideUserObject.C
  56. +20 −13 framework/src/utils/Conversion.C
  57. +8 −19 framework/src/utils/InputParameters.C
  58. +0 −33 modules/phase_field/include/relationshipmanagers/GrainTrackerHaloRM.h
  59. +5 −0 modules/phase_field/src/postprocessors/FeatureFloodCount.C
  60. +12 −3 modules/phase_field/src/postprocessors/GrainTracker.C
  61. +0 −49 modules/phase_field/src/relationshipmanagers/GrainTrackerHaloRM.C
  62. +12 −3 modules/phase_field/src/userobjects/PolycrystalUserObjectBase.C
  63. +8 −3 modules/porous_flow/src/userobjects/AdvectiveFluxCalculatorBase.C
  64. +30 −0 test/include/userobjects/TwoRMTester.h
  65. +14 −1 test/src/userobjects/ElemSideNeighborLayersGeomTester.C
  66. +11 −1 test/src/userobjects/ElemSideNeighborLayersTester.C
  67. +56 −0 test/src/userobjects/TwoRMTester.C
  68. +87 −0 test/tests/auxkernels/ghosting_aux/ghosting_aux.i
  69. BIN test/tests/auxkernels/ghosting_aux/gold/ghosting_aux_out.e
  70. BIN test/tests/auxkernels/ghosting_aux/gold/no_ghosting_out.e
  71. +87 −0 test/tests/auxkernels/ghosting_aux/no_ghosting.i
  72. +27 −0 test/tests/auxkernels/ghosting_aux/tests
  73. BIN test/tests/relationship_managers/evaluable/gold/evaluable_neighbors_dist_out.e
  74. BIN test/tests/relationship_managers/evaluable/gold/evaluable_out.e
  75. BIN test/tests/relationship_managers/two_rm/gold/.DS_Store
  76. BIN test/tests/relationship_managers/two_rm/gold/two_rm_out.e
  77. +17 −0 test/tests/relationship_managers/two_rm/tests
  78. +110 −0 test/tests/relationship_managers/two_rm/two_rm.i
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,36 @@
# GhostingAux

!syntax description /AuxKernels/GhostingAux

# Description

`GhostingAux` allows you to visualize what the current algebraic and geomtric ghosting functors (and RelationshipManagers) are going to do. This is useful in tracking down both under and over-ghosting.

At any one time it will only show you the ghosted elements for one processor ID.

!row!
!col! class=s12 m6 l6

!media media/aux_kernels/ghost_aux_geometric.png
id=geometric
caption=The default geometric ghosting for PID 1

!col-end!

!col! class=s12 m6 l6

!media media/aux_kernels/ghost_aux_algebraic.png
id=algebraic
caption=The default algebraic ghosting for PID 1

!col-end!

!row-end!

!syntax parameters /AuxKernels/GhostingAux

!syntax inputs /AuxKernels/GhostingAux

!syntax children /AuxKernels/GhostingAux

!bibtex bibliography
@@ -13,6 +13,7 @@
#include "Action.h"

class CreateDisplacedProblemAction;
class SystemBase;

template <>
InputParameters validParams<CreateDisplacedProblemAction>();
@@ -26,6 +27,17 @@ class CreateDisplacedProblemAction : public Action
CreateDisplacedProblemAction(InputParameters parameters);

virtual void act() override;

protected:
/**
* Sets up a ProxyRelationshipManager that copies algebraic ghosting from->to
*/
void addProxyAlgebraicRelationshipManagers(SystemBase & to, SystemBase & from);

/**
* Sets up a ProxyRelationshipManager that copies geometric ghosting from->to
*/
void addProxyGeometricRelationshipManagers(SystemBase & to, SystemBase & from);
};

#endif /* CREATEDISPLACEDPROBLEMACTION_H */
@@ -66,6 +66,12 @@ class AuxKernel : public MooseObject,

virtual ~AuxKernel();

/**
* Called just before the compute loop starts so an AuxKernel can initialize
* any internal datastructures
*/
virtual void initialize() {}

/**
* Computes the value and stores it in the solution vector
*/
@@ -48,6 +48,12 @@ class AuxScalarKernel : public MooseObject,

virtual ~AuxScalarKernel();

/**
* Called just before the compute loop starts so an AuxKernel can initialize
* any internal datastructures
*/
virtual void initialize() {}

/**
* Evaluate the kernel
*/
@@ -0,0 +1,46 @@
//* 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

#ifndef GHOSTINGAUX_H
#define GHOSTINGAUX_H

#include "AuxKernel.h"

#include "libmesh/ghosting_functor.h"

// Forward Declarations
class GhostingAux;

template <>
InputParameters validParams<GhostingAux>();

/**
*
*/
class GhostingAux : public AuxKernel
{
public:
GhostingAux(const InputParameters & parameters);

virtual void initialize() override;

protected:
virtual Real computeValue() override;

/// The PID to show the ghosting for
processor_id_type _pid;

/// The type of ghosting functor to get
int _functor_type;

/// Ghosted elems
libMesh::GhostingFunctor::map_type _ghosted_elems;
};

#endif // GHOSTINGAUX_H
@@ -638,8 +638,18 @@ class MooseApp : public ConsoleStreamInterface, public libMesh::ParallelObject
*/
bool addRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);

/**
* Attach the relationship managers of the given type
* Note: Geometric relationship managers that are supposed to be attached late
* will be attached when Algebraic are attached.
*/
void attachRelationshipManagers(Moose::RelationshipManagerType rm_type);

/**
* Retrieve the relationship managers
*/
const std::vector<std::shared_ptr<RelationshipManager>> & getReleationshipManagers();

/**
* Returns the Relationship managers info suitable for printing.
*/
@@ -48,7 +48,7 @@ class SparseMatrix;
template <typename T>
class NumericVector;
class System;
}
} // namespace libMesh

template <>
InputParameters validParams<SubProblem>();
@@ -76,6 +76,11 @@ class SubProblem : public Problem

virtual bool isTransient() const = 0;

/**
* Whether or not the user has requested default ghosting ot be on.
*/
bool defaultGhosting() { return _default_ghosting; }

/**
* Create a Tag. Tags can be associated with Vectors and Matrices and allow objects
* (such as Kernels) to arbitrarily contribute values to any set of vectors/matrics
@@ -632,6 +637,9 @@ class SubProblem : public Problem
/// nonlocal coupling requirement flag
bool _requires_nonlocal_coupling;

/// Whether or not to use default libMesh coupling
bool _default_ghosting;

/// Elements that should have Dofs ghosted to the local processor
std::set<dof_id_type> _ghosted_elems;

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,47 @@
//* 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

#ifndef ELEMENTPOINTNEIGHBORLAYERS_H
#define ELEMENTPOINTNEIGHBORLAYERS_H

#include "FunctorRelationshipManager.h"

#include "libmesh/default_coupling.h"

// Forward declarations
class ElementPointNeighborLayers;
namespace libMesh
{
class GhostingFunctor;
}

template <>
InputParameters validParams<ElementPointNeighborLayers>();

/**
* ElementPointNeighborLayers 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.
*/
class ElementPointNeighborLayers : public FunctorRelationshipManager
{
public:
ElementPointNeighborLayers(const InputParameters & parameters);

virtual std::string getInfo() const override;
virtual bool operator==(const RelationshipManager & rhs) const override;

protected:
virtual void internalInit() override;

/// Size of the halo or stencil of elements available in each local processors partition. Only
/// applicable and necessary when using DistributedMesh.
unsigned short _layers;
};

#endif /* ELEMENTPOINTNEIGHBORLAYERS_H */

This file was deleted.

Oops, something went wrong.
@@ -10,9 +10,7 @@
#ifndef ELEMENTSIDENEIGHBORLAYERS_H
#define ELEMENTSIDENEIGHBORLAYERS_H

#include "AlgebraicRelationshipManager.h"

#include "libmesh/default_coupling.h"
#include "FunctorRelationshipManager.h"

// Forward declarations
class ElementSideNeighborLayers;
@@ -28,27 +26,23 @@ InputParameters validParams<ElementSideNeighborLayers>();
* ElementSideNeighborLayers 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.
*/
class ElementSideNeighborLayers : public AlgebraicRelationshipManager
class ElementSideNeighborLayers : public FunctorRelationshipManager
{
public:
ElementSideNeighborLayers(const InputParameters & parameters);

virtual void attachRelationshipManagersInternal(Moose::RelationshipManagerType rm_type) override;
virtual std::string getInfo() const override;
virtual bool operator==(const RelationshipManager & rhs) const override;

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;

protected:
virtual void internalInit() override;

/// Size of the halo or stencil of elements available in each local processors partition. Only
/// applicable and necessary when using DistributedMesh.
unsigned short _element_side_neighbor_layers;
unsigned short _layers;

/// The libMesh coupling object that provides this RM's functionality.
std::unique_ptr<DefaultCoupling> _default_coupling;
/// Whether or not this RM is keeping track of periodic boundaries
bool _has_periodic_boundaries = false;
};

#endif /* ELEMENTSIDENEIGHBORLAYERS_H */
Oops, something went wrong.

0 comments on commit 5037db6

Please sign in to comment.
You can’t perform that action at this time.