Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "MyTRIMPKAInConeInfo.h" 10 : 11 : registerMooseObject("MagpieApp", MyTRIMPKAInConeInfo); 12 : 13 : InputParameters 14 16 : MyTRIMPKAInConeInfo::validParams() 15 : { 16 16 : InputParameters params = MyTRIMPKAInfo::validParams(); 17 16 : params.addClassDescription( 18 : "Aggregate a global property of the primary knock-on atom for PKAs within a cone of " 19 : "opening angle opening_angle along cone_axis"); 20 32 : params.addRequiredParam<RealVectorValue>("cone_axis", "Axis of the cone"); 21 32 : params.addRequiredParam<Real>( 22 : "opening_angle", 23 : "Opening angle of the cone = twice the angle measured from cone_axis to surface"); 24 16 : return params; 25 0 : } 26 : 27 8 : MyTRIMPKAInConeInfo::MyTRIMPKAInConeInfo(const InputParameters & params) 28 : : MyTRIMPKAInfo(params), 29 8 : _direction(getParam<RealVectorValue>("cone_axis")), 30 24 : _min_cosine(std::cos(0.5 * getParam<Real>("opening_angle"))) 31 : { 32 8 : } 33 : 34 : bool 35 150 : MyTRIMPKAInConeInfo::skipPKA(const MyTRIM_NS::IonBase & ion) const 36 : { 37 150 : Real magnitude = _direction.norm(); 38 150 : magnitude *= ion._dir.norm(); 39 : // we skip counting if the cosine is smaller than min cosine because that 40 : // translates to an angle larger than opening_angle / 2 41 150 : return _direction * ion._dir < magnitude * _min_cosine; 42 : }