Skip to content

Commit

Permalink
Remove preset BC objects and legacy dirichlet BC param
Browse files Browse the repository at this point in the history
refs #17316
  • Loading branch information
loganharbour committed Mar 15, 2021
1 parent 0e84165 commit 34b2b05
Show file tree
Hide file tree
Showing 56 changed files with 15 additions and 515 deletions.
4 changes: 0 additions & 4 deletions examples/ex01_inputfile/src/base/ExampleApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ validParams<ExampleApp>()

params.set<bool>("automatic_automatic_scaling") = false;

// Sets DirichletBC default for preset = true
// This will be removed in the future when the global default is changed
params.set<bool>("use_legacy_dirichlet_bc") = false;

return params;
}

Expand Down
4 changes: 0 additions & 4 deletions examples/ex15_actions/src/base/ExampleApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ validParams<ExampleApp>()

params.set<bool>("automatic_automatic_scaling") = false;

// Sets DirichletBC default for preset = true
// This will be removed in the future when the global default is changed
params.set<bool>("use_legacy_dirichlet_bc") = false;

return params;
}

Expand Down
4 changes: 0 additions & 4 deletions framework/doc/content/source/bcs/ADDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ before the solve begins. With `preset = false`, the boundary condition is
only enforced as the solve progresses. In most situations, presetting the boundary
condition is better.

The default behavior of the `preset` parameter is determined by the flag
`use_legacy_dirichlet_bc` in the application. Change this flag to false to switch
your application to the preferred behavior (setting `preset = true` as the default).

## Example Input Syntax

!listing test/tests/bcs/ad_bc_preset_nodal/bc_preset_nodal.i block=BCs
Expand Down
4 changes: 0 additions & 4 deletions framework/doc/content/source/bcs/ADFunctionDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ before the solve begins. With `preset = false`, the boundary condition is
only enforced as the solve progresses. In most situations, presetting the boundary
condition is better.

The default behavior of the `preset` parameter is determined by the flag
`use_legacy_dirichlet_bc` in the application. Change this flag to false to switch
your application to the preferred behavior (setting `preset = true` as the default).

## Example Input Syntax

!listing test/tests/bcs/ad_bcs/ad_bc.i block=BCs
Expand Down
3 changes: 0 additions & 3 deletions framework/doc/content/source/bcs/ADFunctionPresetBC.md

This file was deleted.

3 changes: 0 additions & 3 deletions framework/doc/content/source/bcs/ADPresetBC.md

This file was deleted.

4 changes: 0 additions & 4 deletions framework/doc/content/source/bcs/DirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ before the solve begins. With `preset = false`, the boundary condition is
only enforced as the solve progresses. In most situations, presetting the boundary
condition is better.

The default behavior of the `preset` parameter is determined by the flag
`use_legacy_dirichlet_bc` in the application. Change this flag to false to switch
your application to the preferred behavior (setting `preset = true` as the default).

## Example Input Syntax

!listing test/tests/bcs/matched_value_bc/matched_value_bc_test.i start=[./right_v] end=[../] include-end=true
Expand Down
4 changes: 0 additions & 4 deletions framework/doc/content/source/bcs/FunctionDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ before the solve begins. With `preset = false`, the boundary condition is
only enforced as the solve progresses. In most situations, presetting the boundary
condition is better.

The default behavior of the `preset` parameter is determined by the flag
`use_legacy_dirichlet_bc` in the application. Change this flag to false to switch
your application to the preferred behavior (setting `preset = true` as the default).

## Example Input Syntax

!listing test/tests/bcs/function_dirichlet_bc/test.i block=BCs
Expand Down
3 changes: 0 additions & 3 deletions framework/doc/content/source/bcs/FunctionPresetBC.md

This file was deleted.

3 changes: 0 additions & 3 deletions framework/doc/content/source/bcs/PresetBC.md

This file was deleted.

38 changes: 0 additions & 38 deletions framework/include/bcs/ADFunctionPresetBC.h

This file was deleted.

24 changes: 0 additions & 24 deletions framework/include/bcs/ADPresetBC.h

This file was deleted.

32 changes: 0 additions & 32 deletions framework/include/bcs/FunctionPresetBC.h

This file was deleted.

34 changes: 0 additions & 34 deletions framework/include/bcs/PresetBC.h

This file was deleted.

31 changes: 0 additions & 31 deletions framework/include/bcs/PresetNodalBC.h

This file was deleted.

14 changes: 7 additions & 7 deletions framework/src/base/MooseApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,6 @@ MooseApp::validParams()
params.addPrivateParam<const MooseMesh *>("_master_mesh");
params.addPrivateParam<const MooseMesh *>("_master_displaced_mesh");

params.addParam<bool>(
"use_legacy_dirichlet_bc",
true,
"Set false to have MOOSE utilize the new and preferred method of setting preset = true as "
"default for all DirichletBC and derived objects, which is ideal for the majority of solves "
"utilizing this boundary condition type.\nThe old behavior (which is utilized if this is set "
"to true) is to set preset = false as the default for DirichletBC and derived objects.");
params.addParam<bool>(
"use_legacy_material_output",
true,
Expand Down Expand Up @@ -538,6 +531,13 @@ MooseApp::MooseApp(InputParameters parameters)
// that need them during the setup process. Most of the restartable data isn't made available
// until all objects have been created and all Actions have been executed (i.e. initialSetup).
registerRestartableDataMapName(MooseApp::MESH_META_DATA, "mesh");

if (parameters.have_parameter<bool>("use_legacy_dirichlet_bc"))
mooseDeprecated("The parameter 'use_legacy_dirichlet_bc' is no longer valid.\n\n",
"All Dirichlet boundary conditions are preset by default.\n\n",
"Remove said parameter in ",
name(),
" to remove this deprecation warning.");
}

void
Expand Down
15 changes: 3 additions & 12 deletions framework/src/bcs/ADDirichletBCBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,13 @@ InputParameters
ADDirichletBCBase::validParams()
{
InputParameters params = ADNodalBC::validParams();
params.addParam<bool>("preset",
true,
"Whether or not to preset the BC (apply the value before the solve "
"begins). Note that the default value of this parameter is handled by the "
"use_legacy_dirichlet_bc parameter on the MooseApp.");
params.addParam<bool>(
"preset", true, "Whether or not to preset the BC (apply the value before the solve begins).");
return params;
}

ADDirichletBCBase::ADDirichletBCBase(const InputParameters & parameters)
: ADNodalBC(parameters),
// If the user sets preset, abide by it. Otherwise, pick the default depending on the
// application's preference to using the legacy dirichlet BC (legacy: preset = false,
// non-legacy: preset = true)
_preset(parameters.isParamSetByUser("preset")
? getParam<bool>("preset")
: !this->_app.parameters().template get<bool>("use_legacy_dirichlet_bc"))
: ADNodalBC(parameters), _preset(getParam<bool>("preset"))
{
}

Expand Down
41 changes: 0 additions & 41 deletions framework/src/bcs/ADFunctionPresetBC.C

This file was deleted.

32 changes: 0 additions & 32 deletions framework/src/bcs/ADPresetBC.C

This file was deleted.

Loading

0 comments on commit 34b2b05

Please sign in to comment.