https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SetupPeriodicRayBCAction.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
12#include "AddRayBCAction.h"
13#include "PeriodicRayBC.h"
14
15registerMooseAction("RayTracingApp", SetupPeriodicRayBCAction, "add_geometric_rm");
16registerMooseAction("RayTracingApp", SetupPeriodicRayBCAction, "add_periodic_bc");
17
20{
21 auto params = Action::validParams();
22 params.addClassDescription("Sets up the periodic boundaries for a PeriodicRayBC if applicable.");
23 return params;
24}
25
27 : Action(params),
28 Moose::PeriodicBCHelper(getAddRayBCAction()),
29 _is_periodic_ray_bc(PeriodicRayBC::isPeriodicRayBC(getAddRayBCAction().getObjectParams()))
30{
33}
34
35void
37{
39 return;
40
41 // Tell the mesh to hold off on deleting remote elements because we need to wait for our
42 // periodic boundaries to be added
43 if (_current_task == "add_geometric_rm")
44 _mesh->allowRemoteElementRemoval(false);
45 else if (_current_task == "add_periodic_bc")
47}
48
49void
51{
52 mooseAssert(_is_periodic_ray_bc, "Not a PeriodicRayBC");
53
54 const auto & periodic_boundaries = getPeriodicBoundaries();
55
56 // Form boundaries for hidden "boundary" param
57 std::vector<BoundaryName> boundary;
58 for (const auto & it : periodic_boundaries)
59 boundary.push_back(std::to_string(it.first));
60 params.set<std::vector<BoundaryName>>("boundary") = boundary;
61
62 // Allow BC to access the PeriodicBoundaries object
64 &periodic_boundaries;
65}
66
67const AddRayBCAction &
registerMooseAction("RayTracingApp", SetupPeriodicRayBCAction, "add_geometric_rm")
const T & getAction(const std::string &name) const
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
MooseApp & _app
std::shared_ptr< FEProblemBase > & _problem
const std::string & _current_task
Action for creating a RayBC and associating it with the necessary RayTracingStudy objects.
T & set(const std::string &name, bool quiet_mode=false)
ActionWarehouse & actionWarehouse()
const std::string & name() const
void checkPeriodicParams() const
void setupPeriodicBoundaries(FEProblemBase &problem)
const libMesh::PeriodicBoundaries & getPeriodicBoundaries() const
RayBC that enforces periodic boundaries.
static const std::string periodic_boundaries_param
Name of the parameter that stores the PeriodicBoundaries pointer.
Action that sets up the periodic boundary conditions for a PeriodicRayBC.
SetupPeriodicRayBCAction(const InputParameters &params)
static InputParameters validParams()
const AddRayBCAction & getAddRayBCAction() const
Helper for getting the AddRayBCAction that is responsible for building the RayBC this action is assoc...
const bool _is_periodic_ray_bc
Whether or not we are acting on a PeriodicRayBC.
void setupPeriodicRayBC(InputParameters &params) const
Method to be called from the AddRayBCAction that is associated with the same RayBC this Action is ass...