Monday, June 27, 2016

NURBS geometry interface

Then let's have a look at how to generalize the B-Spline geometry nterface to NURBS. You may probably know that NURBS is a projective B-Spline in higher dimension space. Analytically, NURRBS can be expressed by B-Splines with weights of control points. When all the weights are the same, a NURBS is degenerated into a B-Spline.

I try to make use of  property and correlate each NURBS object with a B-Spline object. Then most functions can be decomposed into three steps: first lift the NURBS to the corresponding B-Spline in the one dimension higher space, then do all computation on this B-Spline using the implemented B-Spline functions, project the B-Spline back to the NURBS, But for derivative, it's a bit tricky. I will talk it later.

So of course, a NURBS patch should also contain the weight gird corresponding to the control gird in addition to other information which a B-Spline patch requires.















Fig.2. A NURBS suface with same control points but different weights as Fig.1.

Sunday, June 19, 2016

B-Spline geometry interface

Hello all,

In the past few weeks, I have almost finished a complete B-Spline geometry interface and NURBS as well except for the inverse.

In this post, I'm going to describe the important aspects of the B-Spline geometry interface. As you can easily get all the functions required for a DUNE geometry interface, I am not going to elaborate all of them here. But I would like to specifically point out the mathematical model behind some tricky functions in case you want to review the code later. 

1, LocalCoordinate global (const GlobalCoordinate &global) const
The function defines the mapping from the parameter space to the physical space. In isogemetric analysis, each valid(not repeated knots) knot span acts as an element. From definition, we know that a pth-order B-Spline geometry is a weighted sum of all the control points, where the weights are the p-th order basis functions defined on the given knot vector. Normally, we need to build the whole basis function pyramid from the bottom to top to get the p-th order basis we need. But actually for a specific parameter, most values in the pyramid are zeros and the nonzero values will form  an inverted triangle. We also store the knot differences in another triangle as we may need them quite often both for the evaluation and other operations(e.g. derivatives of the basis functions). So together they form an (p+1) by (p+1) table. Please check "The NURBS book" for more details about this algorithm. The computation of the p+1 non-vanishing basis functions of order p are achieved via the getBasis function. Then in the global function, the control points corresponding to the non-zero basis functions will be picked and multiplied with the them.













Fig.1. A B-Spline surface

2.JacobianTransposed jacobianTransposed (const LocalCoordinate &local) const
This function requires all first partial derivative of the B-Spline geometry. And the B-Spline derivative can boil down into the derivative of the basis function. The derivative of a p-th order B-Spline function requires two neighboring (p-1)order B-Spline basis functions. Similar to the computation of the basis functions, we only compute the non-zero basis derivatives. So we can reuse the table build by the getBasis function. We need to compute the derivative vector for each parameter variable, decided by the dimensionality of the B-Spline geometry. Each time, we replace the basis function by the derivative of the basis function with respect to a certain parameter in the original B-Spline definition formula.

Some other interface functions like the inverse mapping  and the volume are very challenging in B-Spline scenarios and also not quite useful, so we decided to skip them and move forward to other more important functionalities.