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 : #include "CylindricalDuo.h" 11 : #include "Legendre.h" 12 : #include "Zernike.h" 13 : 14 : #include <memory> 15 : 16 0 : CylindricalDuo::CylindricalDuo(const std::string & who_is_using_me) 17 0 : : CompositeSeriesBasisInterface(who_is_using_me) 18 : { 19 0 : } 20 : 21 7 : CylindricalDuo::CylindricalDuo(const std::vector<MooseEnum> & domains, 22 : const std::vector<std::size_t> & orders, 23 : const std::vector<MooseEnum> & series_types, 24 : const std::string & who_is_using_me, 25 : MooseEnum expansion_type, 26 7 : MooseEnum generation_type) 27 7 : : CompositeSeriesBasisInterface(orders, series_types, who_is_using_me) 28 : { 29 : // Initialize the pointer to the axial series 30 7 : if (_series_types[0] == "Legendre") 31 : { 32 14 : std::vector<MooseEnum> local_domain = {domains[0]}; 33 7 : std::vector<std::size_t> local_order = {orders[0]}; 34 7 : _series.push_back( 35 7 : std::make_unique<Legendre>(local_domain, local_order, expansion_type, generation_type)); 36 7 : } 37 : else 38 0 : mooseError("CylindricalDuo: No other linear series implemented except Legendre!"); 39 : 40 : // Initialize the pointer to the disc series 41 7 : if (_series_types[1] == "Zernike") 42 : { 43 15 : std::vector<MooseEnum> local_domain = {domains[1], domains[2]}; 44 5 : std::vector<std::size_t> local_order = {orders[1]}; 45 5 : _series.push_back( 46 10 : std::make_unique<Zernike>(local_domain, local_order, expansion_type, generation_type)); 47 5 : } 48 : else 49 2 : mooseError("CylindricalDuo: No other disc series implemented except Zernike!"); 50 : 51 : /* 52 : * Set the _number_of_terms for the composite series by looping over each of the single series. 53 : * This also initializes _basis_evaluation with zero values and the appropriate length. 54 : */ 55 5 : setNumberOfTerms(); 56 17 : } 57 : 58 : void 59 0 : CylindricalDuo::setPhysicalBounds(const std::vector<Real> & bounds) 60 : { 61 : // The axial direction will have two bounds, the disc three 62 0 : if (bounds.size() != 5) 63 0 : mooseError("CylindricalDuo: Must provide 3 physical bounds: axial_min axial_max disc_center1 " 64 : "disc_center2 radius"); 65 : 66 0 : _series[0]->setPhysicalBounds({bounds[0], bounds[1]}); 67 0 : _series[1]->setPhysicalBounds({bounds[2], bounds[3], bounds[4]}); 68 0 : }