23 "Lua wrapper function for getting the data from a quadrature.");
37 auto& quad = Chi::GetStackItem<chi_math::Quadrature>(
44 for (
const auto& qpointXYZ : quad.qpoints_)
48 std::vector<double>{qpointXYZ.x, qpointXYZ.y, qpointXYZ.z});
51 for (
const double w : quad.weights_)
63 return output_as_table;
71 "\\ingroup LuaQuadrature\n"
72 "Base class for 1D quadratures");
79 AllowableRangeLowHighLimit::New(0, 43));
86 order_(static_cast<
QuadratureOrder>(params.GetParamValue<int>(
"order"))),
87 verbose_(params.GetParamValue<bool>(
"verbose"))
93 const auto& old_range =
range_;
94 const auto& new_range = in_range;
96 const double h_new = new_range.second - new_range.first;
97 const double h_old = old_range.second - old_range.first;
100 "Called with negative or zero ranges.");
103 "Called with no abscissae initialized.");
105 const double scale_factor = h_new / h_old;
107 for (
unsigned int i = 0; i <
qpoints_.size(); ++i)
110 new_range.first + (
qpoints_[i][0] - old_range.first) * scale_factor;
#define ChiInvalidArgumentIf(condition, message)
static std::vector< ChiObjectPtr > object_stack
static chi::InputParameters GetInputParameters()
void AddParameter(ParameterBlock block)
T GetParamValue(const std::string ¶m_name) const
static chi::InputParameters GetInputParameters()
void SetRange(const std::pair< double, double > &in_range)
std::vector< chi_math::QuadraturePointXYZ > qpoints_
std::pair< double, double > range_
Quadrature(const chi::InputParameters ¶ms)
std::vector< double > weights_
chi::ParameterBlock Get1DQuadratureData(const chi::InputParameters ¶ms)
chi::InputParameters GetSyntax_Get1DQuadratureData()
RegisterWrapperFunction(chi_math, Get1DQuadratureData, GetSyntax_Get1DQuadratureData, Get1DQuadratureData)