Skip to content

Commit

Permalink
migrate BlockRestrictable to use MooseObject pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
aeslaughter committed Oct 30, 2017
1 parent a073c8f commit d86a6a1
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 35 deletions.
6 changes: 3 additions & 3 deletions framework/include/base/BlockRestrictable.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BlockRestrictable
* Populates the 'block' input parameters, see the general class documentation for details.
* @param parameters The input parameters (see the detailed help for additional information)
*/
BlockRestrictable(const InputParameters & parameters);
BlockRestrictable(const MooseObject * moose_object);

/**
* Class constructor
Expand All @@ -79,7 +79,7 @@ class BlockRestrictable
* @param parameters The input parameters (see the detailed help for additional information)
* @param boundary_ids The boundary ids that the object is restricted to
*/
BlockRestrictable(const InputParameters & parameters, const std::set<BoundaryID> & boundary_ids);
BlockRestrictable(const MooseObject * moose_object, const std::set<BoundaryID> & boundary_ids);

/**
* Destructor: does nothing but needs to be marked as virtual since
Expand Down Expand Up @@ -212,7 +212,7 @@ class BlockRestrictable
/**
* An initialization routine needed for dual constructors
*/
void initializeBlockRestrictable(const InputParameters & parameters);
void initializeBlockRestrictable(const MooseObject * moose_object);

/**
* Check if the blocks this object operates on all have the same coordinate system,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ template <typename T>
LineMaterialSamplerBase<T>::LineMaterialSamplerBase(const InputParameters & parameters)
: GeneralVectorPostprocessor(parameters),
SamplerBase(parameters, this, _communicator),
BlockRestrictable(parameters),
BlockRestrictable(this),
_start(getParam<Point>("start")),
_end(getParam<Point>("end")),
_mesh(_subproblem.mesh()),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/auxkernels/AuxKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ validParams<AuxKernel>()

AuxKernel::AuxKernel(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
BoundaryRestrictable(parameters,
parameters.get<AuxiliarySystem *>("_aux_sys")
->getVariable(parameters.get<THREAD_ID>("_tid"),
Expand Down
40 changes: 21 additions & 19 deletions framework/src/base/BlockRestrictable.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,38 @@ validParams<BlockRestrictable>()
}

// Standard constructor
BlockRestrictable::BlockRestrictable(const InputParameters & parameters)
: _blk_dual_restrictable(parameters.get<bool>("_dual_restrictable")),
_blk_feproblem(parameters.isParamValid("_fe_problem_base")
? parameters.get<FEProblemBase *>("_fe_problem_base")
BlockRestrictable::BlockRestrictable(const MooseObject * moose_object)
: _blk_dual_restrictable(moose_object->getParam<bool>("_dual_restrictable")),
_blk_feproblem(moose_object->isParamValid("_fe_problem_base")
? moose_object->getParam<FEProblemBase *>("_fe_problem_base")
: NULL),
_blk_mesh(parameters.isParamValid("_mesh") ? parameters.get<MooseMesh *>("_mesh") : NULL),
_blk_mesh(moose_object->isParamValid("_mesh") ? moose_object->getParam<MooseMesh *>("_mesh")
: NULL),
_boundary_ids(_empty_boundary_ids),
_blk_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0),
_blk_name(parameters.get<std::string>("_object_name"))
_blk_tid(moose_object->isParamValid("_tid") ? moose_object->getParam<THREAD_ID>("_tid") : 0),
_blk_name(moose_object->getParam<std::string>("_object_name"))
{
initializeBlockRestrictable(parameters);
initializeBlockRestrictable(moose_object);
}

// Dual restricted constructor
BlockRestrictable::BlockRestrictable(const InputParameters & parameters,
BlockRestrictable::BlockRestrictable(const MooseObject * moose_object,
const std::set<BoundaryID> & boundary_ids)
: _blk_dual_restrictable(parameters.get<bool>("_dual_restrictable")),
_blk_feproblem(parameters.isParamValid("_fe_problem_base")
? parameters.get<FEProblemBase *>("_fe_problem_base")
: _blk_dual_restrictable(moose_object->getParam<bool>("_dual_restrictable")),
_blk_feproblem(moose_object->isParamValid("_fe_problem_base")
? moose_object->getParam<FEProblemBase *>("_fe_problem_base")
: NULL),
_blk_mesh(parameters.isParamValid("_mesh") ? parameters.get<MooseMesh *>("_mesh") : NULL),
_blk_mesh(moose_object->isParamValid("_mesh") ? moose_object->getParam<MooseMesh *>("_mesh")
: NULL),
_boundary_ids(boundary_ids),
_blk_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0),
_blk_name(parameters.get<std::string>("_object_name"))
_blk_tid(moose_object->isParamValid("_tid") ? moose_object->getParam<THREAD_ID>("_tid") : 0),
_blk_name(moose_object->getParam<std::string>("_object_name"))
{
initializeBlockRestrictable(parameters);
initializeBlockRestrictable(moose_object);
}

void
BlockRestrictable::initializeBlockRestrictable(const InputParameters & parameters)
BlockRestrictable::initializeBlockRestrictable(const MooseObject * moose_object)
{
// If the mesh pointer is not defined, but FEProblemBase is, get it from there
if (_blk_feproblem != NULL && _blk_mesh == NULL)
Expand All @@ -89,10 +91,10 @@ BlockRestrictable::initializeBlockRestrictable(const InputParameters & parameter


// The 'block' input is defined
if (parameters.isParamValid("block"))
if (moose_object->isParamValid("block"))
{
// Extract the blocks from the input
_blocks = parameters.get<std::vector<SubdomainName>>("block");
_blocks = moose_object->getParam<std::vector<SubdomainName>>("block");

// Get the IDs from the supplied names
std::vector<SubdomainID> vec_ids = _blk_mesh->getSubdomainIDs(_blocks);
Expand Down
2 changes: 1 addition & 1 deletion framework/src/dgkernels/DGKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ validParams<DGKernel>()

DGKernel::DGKernel(const InputParameters & parameters)
: DGKernelBase(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
TwoMaterialPropertyInterface(this, blockIDs(), boundaryIDs())
{
}
2 changes: 1 addition & 1 deletion framework/src/ics/InitialCondition.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ validParams<InitialCondition>()

InitialCondition::InitialCondition(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
Coupleable(this,
getParam<SystemBase *>("_sys")
->getVariable(parameters.get<THREAD_ID>("_tid"),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/indicators/Indicator.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ validParams<Indicator>()

Indicator::Indicator(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
SetupInterface(this),
FunctionInterface(this),
UserObjectInterface(this),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/kernels/KernelBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ validParams<KernelBase>()

KernelBase::KernelBase(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
SetupInterface(this),
CoupleableMooseVariableDependencyIntermediateInterface(this, false),
FunctionInterface(this),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/markers/Marker.C
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ validParams<Marker>()

Marker::Marker(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
SetupInterface(this),
DependencyResolverInterface(),
UserObjectInterface(this),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/materials/Material.C
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ validParams<Material>()

Material::Material(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
BoundaryRestrictable(parameters, blockIDs(), false), // false for being _not_ nodal
SetupInterface(this),
Coupleable(this, false),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/nodalkernels/NodalKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ validParams<NodalKernel>()

NodalKernel::NodalKernel(const InputParameters & parameters)
: MooseObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
BoundaryRestrictable(parameters, true), // true for applying to nodesets
SetupInterface(this),
FunctionInterface(this),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/userobject/ElementUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ validParams<ElementUserObject>()

ElementUserObject::ElementUserObject(const InputParameters & parameters)
: UserObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
MaterialPropertyInterface(this, blockIDs()),
UserObjectInterface(this),
Coupleable(this, false),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/userobject/InternalSideUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ validParams<InternalSideUserObject>()

InternalSideUserObject::InternalSideUserObject(const InputParameters & parameters)
: UserObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
TwoMaterialPropertyInterface(this, blockIDs()),
NeighborCoupleable(this, false, false),
MooseVariableDependencyInterface(),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/userobject/NodalUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ validParams<NodalUserObject>()

NodalUserObject::NodalUserObject(const InputParameters & parameters)
: UserObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
BoundaryRestrictable(parameters, blockIDs(), true), // true for applying to nodesets
UserObjectInterface(this),
Coupleable(this, true),
Expand Down
2 changes: 1 addition & 1 deletion modules/rdg/src/userobjects/ElementLoopUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ validParams<ElementLoopUserObject>()

ElementLoopUserObject::ElementLoopUserObject(const InputParameters & parameters)
: GeneralUserObject(parameters),
BlockRestrictable(parameters),
BlockRestrictable(this),
Coupleable(this, false),
MooseVariableDependencyInterface(),
ZeroInterface(parameters),
Expand Down

0 comments on commit d86a6a1

Please sign in to comment.