Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #pragma once 20 : 21 : #include "PlaneSpatialBinUserObject.h" 22 : 23 : /** 24 : * Class that bins spatial coordinates into planes oriented in a particular direction. 25 : */ 26 : class LayeredGapBin : public PlaneSpatialBinUserObject 27 : { 28 : public: 29 : static InputParameters validParams(); 30 : 31 : LayeredGapBin(const InputParameters & parameters); 32 : 33 : virtual unsigned int bin(const Point & p) const override; 34 : 35 : virtual unsigned int num_bins() const override; 36 : 37 : virtual Real distanceFromGap(const Point & point, const unsigned int & gap_index) const override; 38 : 39 : virtual unsigned int gapIndex(const Point & point) const override; 40 : 41 : virtual void 42 : gapIndexAndDistance(const Point & point, unsigned int & index, Real & distance) const override; 43 : 44 4 : virtual const std::vector<Point> & gapUnitNormals() const override { return _unit_normals; } 45 : 46 : virtual Real adjustBinValue(const unsigned int & i) const override; 47 : 48 : protected: 49 : /// Direction of the bins (x, y, or z) 50 : const unsigned int _direction; 51 : 52 : /// Number of equal-size layers 53 : const unsigned int & _num_layers; 54 : 55 : /// Underlying problem 56 : const SubProblem * _layered_subproblem; 57 : 58 : /// Number of bins 59 : const unsigned int _num_faces; 60 : 61 : /// Minimum coordinate in the direction 62 : Real _direction_min; 63 : 64 : /// Maxium coordinate in the direction 65 : Real _direction_max; 66 : 67 : /// Bounds of the 1-D layering 68 : std::vector<Real> _layer_pts; 69 : 70 : /// Bounds of the volume bins that achieve the same pairing of points to bins 71 : std::vector<Real> _effective_layer_pts; 72 : 73 : /// Unit normal vectors of the gaps 74 : std::vector<Point> _unit_normals; 75 : };