Skip to content

Commit

Permalink
Merge pull request #26331 from MengnanLi91/App_register_patch
Browse files Browse the repository at this point in the history
Explicitly register dependent applications for modules
  • Loading branch information
loganharbour authored Dec 20, 2023
2 parents 439f045 + f42c60d commit 9d715f0
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .coverage
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ require_total = 63
[richards]
require_total = 93

[scalar_transport]
require_total = 85

[solid_properties]
require_total = 83

Expand Down
29 changes: 29 additions & 0 deletions modules/combined/src/base/CombinedApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "FsiApp.h"
#include "FunctionalExpansionToolsApp.h"
#include "GeochemistryApp.h"
#include "HeatTransferApp.h"
#include "HeatConductionApp.h"
#include "LevelSetApp.h"
#include "MiscApp.h"
Expand Down Expand Up @@ -64,6 +65,34 @@ void
CombinedApp::registerApps()
{
registerApp(CombinedApp);

ChemicalReactionsApp::registerApps();
ContactApp::registerApps();
ElectromagneticsApp::registerApps();
ExternalPetscSolverApp::registerApps();
FluidPropertiesApp::registerApps();
FsiApp::registerApps();
FunctionalExpansionToolsApp::registerApps();
GeochemistryApp::registerApps();
HeatTransferApp::registerApps();
HeatConductionApp::registerApps();
LevelSetApp::registerApps();
MiscApp::registerApps();
NavierStokesApp::registerApps();
OptimizationApp::registerApps();
PeridynamicsApp::registerApps();
PhaseFieldApp::registerApps();
PorousFlowApp::registerApps();
RayTracingApp::registerApps();
RdgApp::registerApps();
ReactorApp::registerApps();
RichardsApp::registerApps();
ScalarTransportApp::registerApps();
SolidPropertiesApp::registerApps();
StochasticToolsApp::registerApps();
TensorMechanicsApp::registerApps();
ThermalHydraulicsApp::registerApps();
XFEMApp::registerApps();
}

void
Expand Down
36 changes: 28 additions & 8 deletions modules/combined/test/src/base/CombinedTestApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "ReactorTestApp.h"
#include "RichardsTestApp.h"
#include "StochasticToolsTestApp.h"
#include "ScalarTransportTestApp.h"
#include "SolidPropertiesTestApp.h"
#include "TensorMechanicsTestApp.h"
#include "ThermalHydraulicsTestApp.h"
#include "XFEMTestApp.h"
Expand Down Expand Up @@ -100,14 +102,32 @@ CombinedTestApp::registerApps()
registerApp(CombinedApp);
registerApp(CombinedTestApp);

// Terrible Hack:
// Right now we aren't automatically registering dependent apps to build. We
// need a way to do this so that Multiapp types work automatically. We have a
// few regression tests in THM that create ThermalHydraulicsApp that fail to work with the
// combined module. For now, I'm going to manually register ThermalHydraulicsApp. We'll
// need to design the API so that all registered apps and modules also get
// immediate access to the buildable apps for use in Multiapps.
registerApp(ThermalHydraulicsApp);
ChemicalReactionsTestApp::registerApps();
ContactTestApp::registerApps();
ElectromagneticsTestApp::registerApps();
ExternalPetscSolverTestApp::registerApps();
FluidPropertiesTestApp::registerApps();
FsiTestApp::registerApps();
FunctionalExpansionToolsTestApp::registerApps();
GeochemistryTestApp::registerApps();
HeatTransferTestApp::registerApps();
LevelSetTestApp::registerApps();
MiscTestApp::registerApps();
NavierStokesTestApp::registerApps();
OptimizationTestApp::registerApps();
PeridynamicsTestApp::registerApps();
PhaseFieldTestApp::registerApps();
PorousFlowTestApp::registerApps();
RayTracingTestApp::registerApps();
RdgTestApp::registerApps();
ReactorTestApp::registerApps();
RichardsTestApp::registerApps();
ScalarTransportTestApp::registerApps();
SolidPropertiesTestApp::registerApps();
StochasticToolsTestApp::registerApps();
TensorMechanicsTestApp::registerApps();
ThermalHydraulicsTestApp::registerApps();
XFEMTestApp::registerApps();
}

std::string
Expand Down
2 changes: 2 additions & 0 deletions modules/contact/src/base/ContactApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ void
ContactApp::registerApps()
{
registerApp(ContactApp);

TensorMechanicsApp::registerApps();
}

void
Expand Down
3 changes: 3 additions & 0 deletions modules/fsi/src/base/FsiApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void
FsiApp::registerApps()
{
registerApp(FsiApp);

NavierStokesApp::registerApps();
TensorMechanicsApp::registerApps();
}

/***************************************************************************************************
Expand Down
2 changes: 2 additions & 0 deletions modules/heat_transfer/src/base/HeatTransferApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void
HeatTransferApp::registerApps()
{
registerApp(HeatTransferApp);

RayTracingApp::registerApps();
}

static void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

class HeatConductionTestApp : public HeatTransferTestApp
{
}
};
84 changes: 84 additions & 0 deletions modules/module_loader/src/ModulesApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,90 @@ void
ModulesApp::registerApps()
{
registerApp(ModulesApp);

#ifdef CHEMICAL_REACTIONS_ENABLED
ChemicalReactionsApp::registerApps();
#endif

#ifdef CONTACT_ENABLED
ContactApp::registerApps();
#endif

#ifdef ELECTROMAGNETICS_ENABLED
ElectromagneticsApp::registerApps();
#endif

#ifdef FLUID_PROPERTIES_ENABLED
FluidPropertiesApp::registerApps();
#endif

#ifdef FUNCTIONAL_EXPANSION_TOOLS_ENABLED
FunctionalExpansionToolsApp::registerApps();
#endif

#ifdef HEAT_TRANSFER_ENABLED
HeatTransferApp::registerApps();
#endif

#ifdef LEVEL_SET_ENABLED
LevelSetApp::registerApps();
#endif

#ifdef MISC_ENABLED
MiscApp::registerApps();
#endif

#ifdef NAVIER_STOKES_ENABLED
NavierStokesApp::registerApps();
#endif

#ifdef PERIDYNAMICS_ENABLED
PeridynamicsApp::registerApps();
#endif

#ifdef PHASE_FIELD_ENABLED
PhaseFieldApp::registerApps();
#endif

#ifdef POROUS_FLOW_ENABLED
PorousFlowApp::registerApps();
#endif

#ifdef RAY_TRACING_ENABLED
RayTracingApp::registerApps();
#endif

#ifdef RDG_ENABLED
RdgApp::registerApps();
#endif

#ifdef REACTOR_ENABLED
ReactorApp::registerApps();
#endif

#ifdef RICHARDS_ENABLED
RichardsApp::registerApps();
#endif

#ifdef SOLID_PROPERTIES_ENABLED
SolidPropertiesApp::registerApps();
#endif

#ifdef STOCHASTIC_TOOLS_ENABLED
StochasticToolsApp::registerApps();
#endif

#ifdef TENSOR_MECHANICS_ENABLED
TensorMechanicsApp::registerApps();
#endif

#ifdef THERMAL_HYDRAULICS_ENABLED
ThermalHydraulicsApp::registerApps();
#endif

#ifdef XFEM_ENABLED
XFEMApp::registerApps();
#endif
}

void
Expand Down
7 changes: 5 additions & 2 deletions modules/navier_stokes/src/base/NavierStokesApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "MooseSyntax.h"

#include "FluidPropertiesApp.h"
#include "HeatConductionApp.h"
#include "HeatTransferApp.h"

InputParameters
NavierStokesApp::validParams()
Expand All @@ -40,6 +40,9 @@ void
NavierStokesApp::registerApps()
{
registerApp(NavierStokesApp);

FluidPropertiesApp::registerApps();
HeatTransferApp::registerApps();
}

static void
Expand Down Expand Up @@ -104,7 +107,7 @@ void
NavierStokesApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
FluidPropertiesApp::registerAll(f, af, s);
HeatConductionApp::registerAll(f, af, s);
HeatTransferApp::registerAll(f, af, s);
Registry::registerObjectsTo(f, {"NavierStokesApp"});
Registry::registerActionsTo(af, {"NavierStokesApp"});
associateSyntaxInner(s, af);
Expand Down
2 changes: 2 additions & 0 deletions modules/peridynamics/src/base/PeridynamicsApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ void
PeridynamicsApp::registerApps()
{
registerApp(PeridynamicsApp);

TensorMechanicsApp::registerApps();
}

void
Expand Down
4 changes: 4 additions & 0 deletions modules/porous_flow/src/base/PorousFlowApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void
PorousFlowApp::registerApps()
{
registerApp(PorousFlowApp);

TensorMechanicsApp::registerApps();
FluidPropertiesApp::registerApps();
ChemicalReactionsApp::registerApps();
}

static void
Expand Down
14 changes: 12 additions & 2 deletions modules/scalar_transport/src/base/ScalarTransportApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "NavierStokesApp.h"
#include "ThermalHydraulicsApp.h"
#include "FluidPropertiesApp.h"
#include "HeatConductionApp.h"
#include "HeatTransferApp.h"
#include "RdgApp.h"
#include "RayTracingApp.h"
#include "SolidPropertiesApp.h"
Expand Down Expand Up @@ -48,7 +48,7 @@ ScalarTransportApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
NavierStokesApp::registerAll(f, af, s);
ThermalHydraulicsApp::registerAll(f, af, s);
FluidPropertiesApp::registerAll(f, af, s);
HeatConductionApp::registerAll(f, af, s);
HeatTransferApp::registerAll(f, af, s);
RdgApp::registerAll(f, af, s);
RayTracingApp::registerAll(f, af, s);
SolidPropertiesApp::registerAll(f, af, s);
Expand All @@ -61,6 +61,16 @@ void
ScalarTransportApp::registerApps()
{
registerApp(ScalarTransportApp);

ChemicalReactionsApp::registerApps();
NavierStokesApp::registerApps();
ThermalHydraulicsApp::registerApps();
FluidPropertiesApp::registerApps();
HeatTransferApp::registerApps();
RdgApp::registerApps();
RayTracingApp::registerApps();
SolidPropertiesApp::registerApps();
MiscApp::registerApps();
}

/***************************************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ScalarTransportTestApp::registerAll(Factory & f, ActionFactory & af, Syntax & s,
void
ScalarTransportTestApp::registerApps()
{
ScalarTransportApp::registerApps();
registerApp(ScalarTransportApp);
registerApp(ScalarTransportTestApp);
}

Expand Down
6 changes: 4 additions & 2 deletions modules/solid_properties/src/base/SolidPropertiesApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "SolidPropertiesApp.h"
#include "HeatConductionApp.h"
#include "HeatTransferApp.h"
#include "Moose.h"
#include "AppFactory.h"
#include "MooseSyntax.h"
Expand All @@ -32,6 +32,8 @@ void
SolidPropertiesApp::registerApps()
{
registerApp(SolidPropertiesApp);

HeatTransferApp::registerApps();
}

static void
Expand All @@ -49,7 +51,7 @@ associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)
void
SolidPropertiesApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
HeatConductionApp::registerAll(f, af, s);
HeatTransferApp::registerAll(f, af, s);
Registry::registerObjectsTo(f, {"SolidPropertiesApp"});
Registry::registerActionsTo(af, {"SolidPropertiesApp"});
associateSyntaxInner(s, af);
Expand Down
12 changes: 10 additions & 2 deletions modules/thermal_hydraulics/src/base/ThermalHydraulicsApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ThermalHydraulicsApp.h"
#include "THMSyntax.h"
#include "HeatConductionApp.h"
#include "HeatTransferApp.h"
#include "FluidPropertiesApp.h"
#include "NavierStokesApp.h"
#include "RayTracingApp.h"
Expand Down Expand Up @@ -88,7 +88,7 @@ ThermalHydraulicsApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
Registry::registerObjectsTo(f, {"ThermalHydraulicsApp"});
Registry::registerActionsTo(af, {"ThermalHydraulicsApp"});

HeatConductionApp::registerAll(f, af, s);
HeatTransferApp::registerAll(f, af, s);
FluidPropertiesApp::registerAll(f, af, s);
NavierStokesApp::registerAll(f, af, s);
RayTracingApp::registerAll(f, af, s);
Expand Down Expand Up @@ -121,6 +121,14 @@ void
ThermalHydraulicsApp::registerApps()
{
registerApp(ThermalHydraulicsApp);

HeatTransferApp::registerApps();
FluidPropertiesApp::registerApps();
NavierStokesApp::registerApps();
RayTracingApp::registerApps();
RdgApp::registerApps();
SolidPropertiesApp::registerApps();
MiscApp::registerApps();
}

const std::string &
Expand Down
2 changes: 2 additions & 0 deletions modules/xfem/src/base/XFEMApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ void
XFEMApp::registerApps()
{
registerApp(XFEMApp);

TensorMechanicsApp::registerApps();
}

void
Expand Down

0 comments on commit 9d715f0

Please sign in to comment.