# Reference for Dunavant Quadrature Implementations

I am using Dunavant quadrature in my software, specifically this file by John Burkardt. Recently, I wanted to convert the code into a constexpr code in C++. But doing so requires me understanding what the code does. I have read the code and the paper and I am confused about the suborders. I have specifically three questions:

1. What are the suborders, how are they related to the list of points and weights?

2. Why are the suborders apprarently calculated in three dimensions and then only two of them are used?

3. Why does the author use a mod function to calculate some suborders like in this code?

for (k = 0; k < 3; k++) {
xy[0 + o * 2] = suborder_xyz[i4_wrap(k, 0, 2) + s * 3];
xy[1 + o * 2] = suborder_xyz[i4_wrap(k + 1, 0, 2) + s * 3];
w[o] = suborder_w[s];
o = o + 1;
}

• This is a question about a specific software package. You will be better off asking the author(s) themselves since only they can help you with your questions. – Wolfgang Bangerth Nov 5 '17 at 18:24
• I have actually mailed the author and have got a response from them. I am wondering now if I should delete the question or post an answer to my own question. – user1800 Nov 5 '17 at 19:41
• @JayeshBadwaik If you can focus the answer (and the question by editing it) on the mathematical/algorithmical aspects rather than on this specific implementation (which you can of course still refer to, but then just for the sake of illustration), it would be on-topic in my opinion. (Self-answering is explicitly encouraged on the Stack Exchange network; the next person struggling with this issue will appreciate it.) – Christian Clason Nov 5 '17 at 20:49