https://mooseframework.inl.gov
CouplingFunctorCheckAction.C
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 
11 #include "MooseApp.h"
12 #include "FEProblemBase.h"
13 #include "DisplacedProblem.h"
14 #include "NonlinearSystemBase.h"
15 #include "InputParameters.h"
16 #include "RelationshipManager.h"
17 
18 #include "libmesh/system.h"
19 #include "libmesh/communicator.h"
20 
21 registerMooseAction("MooseApp", CouplingFunctorCheckAction, "coupling_functor_check");
22 
25 {
26  auto params = Action::validParams();
27  params.set<std::string>("_action_name") = "coupling_functor_check";
28  return Action::validParams();
29 }
30 
32  : Action(parameters)
33 {
34 }
35 
36 void
38 {
39  for (const auto i : make_range(_problem->numNonlinearSystems()))
40  {
41  if (_problem->solverParams(i)._type == Moose::ST_JFNK)
42  continue;
43 
44  auto & nl = _problem->getNonlinearSystemBase(i);
45  auto & dgs = nl.getDGKernelWarehouse();
46  auto & iks = nl.getInterfaceKernelWarehouse();
47 
48  // to reduce typing
51 
52  // If we have any DGKernels or InterfaceKernels we need one layer of sparsity
53  if (dgs.size() || iks.size())
54  {
55  // We are going to add the algebraic ghosting and coupling functors one at a time because then
56  // we can keep track of whether we need to redistribute the dofs or not
57 
58  // Add the algebraic ghosting functors if we are running in parallel
59  if (_communicator.size() > 1 &&
62 
63  // Add the coupling functor. This plays a role regardless of whether we are running serially
64  // or in parallel
67 
68  // If any nonlinear system added ghosting, then in our current MOOSE ghosting strategy we
69  // added it for all systems so we can safely exit this loop
70  break;
71  }
72  }
73 }
CouplingFunctorCheckAction(const InputParameters &parameters)
registerMooseAction("MooseApp", CouplingFunctorCheckAction, "coupling_functor_check")
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const Parallel::Communicator & _communicator
Base class for actions.
Definition: Action.h:33
processor_id_type size() const
void attachRelationshipManagers(Moose::RelationshipManagerType rm_type, bool attach_geometric_rm_final=false)
Attach the relationship managers of the given type Note: Geometric relationship managers that are sup...
Definition: MooseApp.C:3173
static InputParameters validParams()
Definition: Action.C:24
static InputParameters oneLayerGhosting(Moose::RelationshipManagerType rm_type)
This returns an InputParameters object containing an ElementSideNeighborLayers relationship manager w...
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:845
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
static InputParameters validParams()
Checks whether there are any Kernels or BoundaryConditions in the warehouses and if so adds a default...
IntRange< T > make_range(T beg, T end)
bool addRelationshipManagers(Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
Method to add a relationship manager for the objects being added to the system.
Definition: Action.C:136
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:168
void act() override
Method to add objects to the simulation or perform other setup tasks.