https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
21registerMooseAction("MooseApp", CouplingFunctorCheckAction, "coupling_functor_check");
22
25{
26 auto params = Action::validParams();
27 params.set<std::string>(MooseBase::name_param) = "coupling_functor_check";
28 return Action::validParams();
29}
30
35
36void
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}
registerMooseAction("MooseApp", CouplingFunctorCheckAction, "coupling_functor_check")
Base class for actions.
Definition Action.h:38
static InputParameters validParams()
Definition Action.C:26
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
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:148
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition Action.h:178
Checks whether there are any Kernels or BoundaryConditions in the warehouses and if so adds a default...
CouplingFunctorCheckAction(const InputParameters &parameters)
static InputParameters validParams()
void act() override
Method to add objects to the simulation or perform other setup tasks.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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:3204
static const std::string name_param
The name of the parameter that contains the object name.
Definition MooseBase.h:55
static InputParameters oneLayerGhosting(Moose::RelationshipManagerType rm_type)
This returns an InputParameters object containing an ElementSideNeighborLayers relationship manager w...
processor_id_type size() const
const Parallel::Communicator & _communicator
@ ST_JFNK
Jacobian-Free Newton Krylov.
Definition MooseTypes.h:899