Line data Source code
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 : 10 : #pragma once 11 : 12 : #include "GeneralRayBC.h" 13 : 14 : /** 15 : * RayBC that enforces periodic boundaries. 16 : */ 17 : class PeriodicRayBC : public GeneralRayBC 18 : { 19 : public: 20 : PeriodicRayBC(const InputParameters & params); 21 : 22 : static InputParameters validParams(); 23 : 24 : virtual void onBoundary(const unsigned int num_applying) override final; 25 : 26 : /// Whether or not the RayBC params belong to a PeriodicRayBC 27 : static bool isPeriodicRayBC(const InputParameters & params); 28 : 29 : /// Name of the parameter that stores the PeriodicBoundaries pointer 30 : static const std::string periodic_boundaries_param; 31 : 32 : /// Get the PeriodicBoundaries object this BC acts on 33 27 : const libMesh::PeriodicBoundaries & getPeriodicBoundaries() const { return _periodic_boundaries; } 34 : 35 : private: 36 : /// The PeriodicBoundaries object 37 : const libMesh::PeriodicBoundaries & _periodic_boundaries; 38 : /// Point locator used for searching periodic boundary points 39 : const std::unique_ptr<libMesh::PointLocatorBase> _point_locator; 40 : 41 : /** 42 : * State variables for applying periodic boundary conditions. 43 : * 44 : * Required in order to enable the application of multiple 45 : * periodic boundary conditions (via multiple calls to onBoundary()) 46 : * for a single Ray at the same point. 47 : */ 48 : ///@{ 49 : unsigned int _periodic_applied; 50 : Point _periodic_point; 51 : const Elem * _periodic_neighbor; 52 : ///@} 53 : };