Algorithmresearch
Isogeometric collocation
Also called IGA collocation.
Auricchio and coauthors' method that enforces the strong form of the equations at Greville or other points instead of integrating, cheap because it needs no quadrature.
- Solves
- Poisson equation
- Time
- O(n p^2) worst
- Space
- O(n p) extra
- Where
- n = number of spline basis functions; p = spline degree
- Model
- Real RAM
- Properties
- deterministicnot exactiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Ferdinando Auricchio, Lourenço Beirão da Veiga, Thomas J. R. Hughes, Alessandro Reali, Giancarlo Sangalli, 2010
Isogeometric collocation solves a differential equation in the spline space of isogeometric analysis by asking the equation, in its strong form, to hold at one point per unknown. The points are usually the Greville abscissae of the B-spline basis. Auricchio, Beirão da Veiga, Hughes, Reali and Sangalli proposed it in 2010 as a cheaper partner of the Galerkin method: there is no integral, so there is no quadrature, and each row of the matrix costs one evaluation of the non-zero basis functions and their derivatives. The price is accuracy: with Greville points the error in decreases like for even degree and like for odd , against for Galerkin. The basis on this page is the B-spline basis, and the discretization is collocation, in 1D.
In plain words
A spline is a smooth curve built from a row of overlapping bumps, each bump scaled by a number. To solve an equation with a spline, you must choose these numbers. The Galerkin way asks the equation to hold "on average" against every bump, and these averages are integrals that cost many function evaluations.
Collocation asks less. It picks one point for each unknown number, plugs the spline into the equation at that point, and asks the two sides to agree there. Each point gives one linear equation, so the unknowns follow from one linear system. A good choice of points is the "average position" of each bump, which comes from the knots alone. If the true answer is itself one of the splines, collocation finds it exactly.
The problem
The model problem is the 1D Poisson equation with Dirichlet boundary conditions:
The discrete space is , the B-splines of degree on an open knot vector , with , , and interior knots of multiplicity at most . So each function of is and has a second derivative on each knot span. The Greville abscissae are the knot averages
They satisfy , and . They are also the abscissae of the control points of the identity: . The method looks for with
That is linear equations in unknowns. Where falls on a knot at which jumps, the value is the limit from the right.
The algorithm
IGA-COLLOCATION(ξ, p, f, g_a, g_b)- 1
n ← |ξ| − p − 1 ▷ number of basis functions - 2
τ_i ← (ξ_{i+1} + ⋯ + ξ_{i+p}) / p for i = 1..n ▷ Greville abscissae - 3
row 1: A[1, j] ← N_j(a); b_1 ← g_a - 4
for i = 2 to n − 1 do - 5
A[i, j] ← −N_j''(τ_i) for the p + 1 values of j with N_j(τ_i) ≠ 0 or N_j''(τ_i) ≠ 0 - 6
b_i ← f(τ_i) - 7
row n: A[n, j] ← N_j(b); b_n ← g_b - 8
solve the banded system A c = b and return c
Lines L3 and L7 are trivial for an open knot vector: , , and all other basis functions vanish at the ends, so and . Line L5 evaluates the second derivatives of the non-zero B-splines at one point with the derivative form of the Cox-de Boor recursion, which gives all of them in operations. Row has its non-zeros in the columns of the B-splines whose support holds , so the matrix is a banded matrix of half bandwidth at most . The matrix is not symmetric, unlike the Galerkin matrix.
For a problem in 2D or 3D on a NURBS map of the parameter square or cube, the points are the tensor products of the 1D Greville abscissae, the rows are the strong form pulled back by (which needs the first and second derivatives of ), and the boundary rows hold the boundary conditions at the Greville points of the boundary. The 1D case shows all the steps.
Example
A quadratic case by hand. Take , two elements on , , so and . On the span the second derivatives of are , and on those of are . For and the system is
With the middle rows read and , so . The spline is , the exact solution, for example . This is no accident: the exact solution is a quadratic, so it is in , and the theorem below says that collocation then returns it.
A cubic case. With and four elements, . On a uniform mesh and away from the ends, the Greville points of odd degree lie on the knots, and those of even degree lie at the element midpoints. For the coefficients are , again the exact solution.
Convergence for a smooth solution. For , , uniform meshes of elements, the largest error over 801 equally spaced points is:
| degree | observed order | ||||
|---|---|---|---|---|---|
| 2.0 | |||||
| 2.0 | |||||
| 3.95 | |||||
| 4.0 |
The order is for even and for odd , and the cubic is no better than the quadratic on the same mesh. The largest error of on the same runs decreases with order for each degree from 2 to 5. These are measurements on one smooth problem. They agree with the orders that the papers report, given under Complexity.
Correctness
The method is a collocation method in a spline space, and two things need proof: the system has exactly one solution, and the method is exact when the solution lies in the space.
Theorem. Let , let be open with interior knots of multiplicity at most , and let be the Greville abscissae. Then the matrix of lines L3 to L7 is non-singular. So if the exact solution is in , the method returns .
The idea of the proof: if solves the problem with zero data, then is a spline of degree that vanishes at the interior Greville points. The space of such second derivatives has dimension , and the Greville point lies strictly inside the support of the -th of its B-splines. The Schoenberg-Whitney theorem then forces , so is linear, and the boundary rows make it zero. Exactness follows: itself satisfies all equations, and the solution is unique. The full proof is below.
The theorem says nothing about the error when . That error is the subject of the convergence results below, which are not proved on this page.
Proof: Collocation at the Greville abscissae has a unique solution and is exact on the spline spacefull
We use the notation of the page. The degree is . The knot vector is open on , so and , and each interior knot value has multiplicity at most . is the B-spline of degree with the knots , taken right-continuous, with the value at taken as the limit from the left. A spline value at a knot where it jumps is the limit from the right, as in line L5.
Fact 1 (knot runs). (a) For , the knots are not all equal. (b) For , the knots are not all equal.
Proof. The value occurs exactly at , the value exactly at , and an interior value at most times. (a) A run that starts at with holds at most the copies of . A run that ends at with ends at or earlier, so it holds at most the copies of . An interior value gives at most equal knots. So no of these knots are equal. (b) A run that starts at or later holds at most copies of , one that ends at or earlier holds at most copies of , and an interior value gives at most . So no of these knots are equal.
Lemma 1 (the Greville points). , , , and for the point lies strictly between and .
Proof. is the mean of , which all equal , and is the mean of , which all equal . Next, , and it is zero only if the knots are equal, which Fact 1(b) excludes for . For the last claim, is the mean of the knots , and with Fact 1(a) says they are not all equal. A mean of numbers that are not all equal lies strictly between their least and their largest value, here and .
Lemma 2 (the space of second derivatives). For each , the second derivative (right limits at the knots) lies in with . The functions are linearly independent on .
Proof. The derivative formula for B-splines (de Boor, Chapter X) gives
on each knot span, with a term dropped when its denominator is zero. Applied twice, it writes for as a combination of for . The function has the knots . For these knots all equal , and for they all equal , so these four functions are zero. That leaves . For these the knots of are not all equal by Fact 1(a), so is a non-zero B-spline. The knot sequence of the has no value of multiplicity more than , so by the Curry-Schoenberg theorem the are a basis of the splines of degree on it, and in particular they are linearly independent.
Theorem. Under the precondition above, the matrix of lines L3 to L7 is non-singular. If the exact solution of , , lies in , then IGA-COLLOCATION returns its coefficients.
Proof. A square matrix is non-singular if its kernel is zero. So let satisfy the homogeneous system, and let . Then (line L3), (line L7), and for (line L5).
By Lemma 2, for some numbers . Re-index the interior rows by : row asks the element of to vanish at , for . By Lemma 1 these points are strictly increasing, and lies strictly between and , the first and the last knot of . A B-spline is positive on the open interval between its first and its last knot, so for each . This is the condition of the Schoenberg-Whitney theorem (de Boor, Chapter XIII): interpolation in at the points has a unique solution. The zero spline interpolates zero data, so , that is, all .
So on each knot span, and is constant on each span. The interior knots have multiplicity at most , so is on and is continuous. A continuous function that is constant on each span of a partition is constant. So is a polynomial of degree at most 1, and gives . The B-splines are linearly independent, so . The kernel is zero, and the matrix is non-singular.
For the second claim, let be the exact solution. Then and , and for every interior , so the vector solves the system of lines L3 to L7. By the first part this system has exactly one solution, and line L8 returns it. So the method returns .
The precondition is needed. Let and , with the interior knot of multiplicity . Then , , and holds , which is at . It has on both spans and . So is in the kernel, and the matrix is singular. In the proof, the step from to " is linear" fails because jumps.
What is not proved here. The theorem gives existence, uniqueness and exactness on . It gives no error bound for a solution outside . The orders (even ) and (odd ) in and , and in , are cited from Auricchio and coauthors (2010) and Montardini, Sangalli and Tamellini (2017), and the table on the page measures them on one problem.
Complexity
In the real RAM model with unknowns and degree :
- Forming the system. Each of the rows needs the span of one point, found by binary search in , and the second derivatives of B-splines in . So the matrix costs , and with the spans known in order, . Galerkin needs about quadrature points per element and products at each, so in 1D. In dimensions a collocation row has entries, while Galerkin needs quadrature points per element, each adding to products. Schillinger and coauthors (2013) count these operations in detail and find that the gap grows with and .
- Solving. The matrix has half bandwidth . Gaussian elimination with partial pivoting on a band of this width takes time and space. The implementation below uses a dense solver, , which is enough for the tests.
Accuracy. For a smooth solution, uniform meshes of size and the smoothest splines (), collocation at the Greville abscissae has these orders:
- In and in : for even and for odd . The best approximation in is in and in , so the method loses one order in for even and two for odd , and is optimal in only for even .
- In : for every , the best possible order in this norm.
Auricchio and coauthors (2010) report these orders from numerical tests, and Montardini, Sangalli and Tamellini (2017) restate them in this form. The table of the Example measures the same orders in the maximum norm. Galerkin with the same space gives in . So for equal accuracy collocation needs a finer mesh or a higher degree, and the cost comparison above has to be made at equal error, as Schillinger and coauthors do.
Properties
- No quadrature. Each row needs one evaluation of the basis and its derivatives, at one point.
- One point per unknown. The matrix is square, banded and not symmetric. Its condition number grows like , as for the second derivative of any discretization.
- Exact on the space. A solution in is reproduced exactly, in particular every polynomial of degree at most .
- Strong form. The method needs the second derivative of at the points, so the space must be at least ; the basis of standard finite elements does not work.
- Same geometry as IGA. The geometry stays exact under the refinements of k-refinement, as in Galerkin IGA.
Variants and improvements
- Other points. Demko abscissae, and points related to Galerkin superconvergence: Montardini, Sangalli and Tamellini (2017) choose a subset of the superconvergent points, more than one per element and fewer than two, solved in a least-squares or a clustered way, and reach the optimal order in for odd .
- NURBS and multi-patch geometry. The rows hold the pulled-back operator. At patch interfaces the strong form is replaced by a condition on the fluxes.
- Hierarchical and local refinement. Schillinger and coauthors (2013) use collocation on hierarchical NURBS, see hierarchical B-splines.
- Explicit dynamics. With a lumped mass, collocation gives a time step with one evaluation per node, which is the main use of the method in practice.
- Systems. Elasticity, beams and plates use the same idea with one row per component and point.
When to use it
Use collocation when the cost of forming the system dominates: high degree, 3D, explicit dynamics or nonlinear problems that need many re-assemblies. Use Galerkin when the error per unknown matters most, when the equation has a weak form that the strong form cannot match (rough coefficients, point loads, interfaces), or when symmetry of the matrix is needed. For integral equations on the boundary, collocation is also the common choice, see the isogeometric boundary element method.
Pitfalls
- An interior knot of multiplicity . Then holds a function with a kink and on both sides, such as for with a double knot at , and the matrix of lines L3 to L7 is singular. Keep the interior multiplicity at most , as the precondition says, or add a row for the jump of .
- Expecting Galerkin accuracy. Doubling the degree from 2 to 3 does not help here: the table shows the cubic worse than the quadratic on the same mesh. Use even degrees, or other points, when the error matters.
- The value at a knot. For the second derivative jumps at each knot. Line L5 must use one fixed side, as the code does with the right limit, or the rows depend on rounding of .
- Neumann conditions. A flux condition at an end is a row with , and it must replace one interior row, not be added to the system, or the matrix is no longer square.
- Geometry derivatives. In 2D and 3D the rows need second derivatives of the NURBS map. A geometry map with a weak or a zero Jacobian makes these rows large or undefined, see volumetric spline parameterization.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Shared helper of the ig2 cad pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Small numerical helpers: B-spline basis with derivatives, Greville points,
Gauss-Legendre points and a dense linear solver.
Every function works with float, and the spline and solver functions also work
with fractions.Fraction, so that a test can check an exact identity.
"""
from __future__ import annotations
import math
from typing import List, Sequence, Tuple
def open_uniform_knots(p: int, ne: int, a=0, b=1) -> List:
"""Open knot vector of degree p with ne equal elements on [a, b].
The ends have multiplicity p + 1 and the interior knots are simple.
With Fraction inputs the knots are Fractions.
"""
inner = [a + (b - a) * k / ne for k in range(1, ne)]
return [a] * (p + 1) + inner + [b] * (p + 1)
def find_span(knots: Sequence, p: int, x) -> int:
"""Index s with knots[s] <= x < knots[s + 1], and the last non-empty span for x = knots[-1]."""
n = len(knots) - p - 1 # number of basis functions
if x >= knots[n]:
s = n - 1
while knots[s] == knots[s + 1]:
s -= 1
return s
lo, hi = p, n
while hi - lo > 1:
mid = (lo + hi) // 2
if x < knots[mid]:
hi = mid
else:
lo = mid
return lo
def basis_ders(knots: Sequence, p: int, s: int, x, nd: int) -> List[List]:
"""Values and derivatives of the p + 1 B-splines that are non-zero on span s.
Returns d with d[k][j] = the k-th derivative of N_{s - p + j} at x, for
k = 0..nd. This is algorithm A2.3 of Piegl and Tiller.
"""
one = x - x + 1
zero = x - x
ndu = [[zero] * (p + 1) for _ in range(p + 1)]
ndu[0][0] = one
left = [zero] * (p + 1)
right = [zero] * (p + 1)
for j in range(1, p + 1):
left[j] = x - knots[s + 1 - j]
right[j] = knots[s + j] - x
saved = zero
for r in range(j):
ndu[j][r] = right[r + 1] + left[j - r]
temp = ndu[r][j - 1] / ndu[j][r]
ndu[r][j] = saved + right[r + 1] * temp
saved = left[j - r] * temp
ndu[j][j] = saved
ders = [[zero] * (p + 1) for _ in range(nd + 1)]
for j in range(p + 1):
ders[0][j] = ndu[j][p]
for r in range(p + 1):
s1, s2 = 0, 1
a = [[zero] * (p + 1) for _ in range(2)]
a[0][0] = one
for k in range(1, nd + 1):
dval = zero
rk, pk = r - k, p - k
if r >= k:
a[s2][0] = a[s1][0] / ndu[pk + 1][rk]
dval = a[s2][0] * ndu[rk][pk]
j1 = 1 if rk >= -1 else -rk
j2 = k - 1 if r - 1 <= pk else p - r
for j in range(j1, j2 + 1):
a[s2][j] = (a[s1][j] - a[s1][j - 1]) / ndu[pk + 1][rk + j]
dval += a[s2][j] * ndu[rk + j][pk]
if r <= pk:
a[s2][k] = -a[s1][k - 1] / ndu[pk + 1][r]
dval += a[s2][k] * ndu[r][pk]
ders[k][r] = dval
s1, s2 = s2, s1
fac = p
for k in range(1, nd + 1):
for j in range(p + 1):
ders[k][j] = ders[k][j] * fac
fac *= p - k
return ders
def all_basis(knots: Sequence, p: int, x, nd: int = 0) -> List[List]:
"""Full rows: out[k][i] = k-th derivative of N_i at x, for all n basis functions."""
n = len(knots) - p - 1
s = find_span(knots, p, x)
d = basis_ders(knots, p, s, x, nd)
zero = x - x
out = [[zero] * n for _ in range(nd + 1)]
for k in range(nd + 1):
for j in range(p + 1):
out[k][s - p + j] = d[k][j]
return out
def greville(knots: Sequence, p: int) -> List:
"""Greville abscissae tau_i = (knots[i+1] + ... + knots[i+p]) / p."""
n = len(knots) - p - 1
return [sum(knots[i + 1 : i + p + 1]) / p for i in range(n)]
def solve_dense(a: List[List], b: List) -> List:
"""Solve a x = b by Gaussian elimination with partial pivoting.
Works with float and with Fraction (then the result is exact).
Raises ValueError if the matrix is singular (an exact zero pivot).
Cost O(n^3) operations.
"""
n = len(a)
m = [list(row) + [bi] for row, bi in zip(a, b)]
for c in range(n):
piv = max(range(c, n), key=lambda r: abs(m[r][c]))
if m[piv][c] == 0:
raise ValueError("singular matrix")
m[c], m[piv] = m[piv], m[c]
for r in range(c + 1, n):
f = m[r][c] / m[c][c]
if f != 0:
row_r, row_c = m[r], m[c]
for k in range(c, n + 1):
row_r[k] -= f * row_c[k]
x = [0] * n
for r in range(n - 1, -1, -1):
acc = m[r][n]
for k in range(r + 1, n):
acc -= m[r][k] * x[k]
x[r] = acc / m[r][r]
return x
def gauss_legendre(n: int) -> Tuple[List[float], List[float]]:
"""Nodes and weights of the n-point Gauss-Legendre rule on [-1, 1]."""
xs, ws = [], []
for i in range(1, n + 1):
x = math.cos(math.pi * (i - 0.25) / (n + 0.5))
for _ in range(100):
p0, p1 = 1.0, x
for k in range(2, n + 1):
p0, p1 = p1, ((2 * k - 1) * x * p1 - (k - 1) * p0) / k
dp = n * (x * p1 - p0) / (x * x - 1)
dx = p1 / dp
x -= dx
if abs(dx) < 1e-16:
break
p0, p1 = 1.0, x
for k in range(2, n + 1):
p0, p1 = p1, ((2 * k - 1) * x * p1 - (k - 1) * p0) / k
dp = n * (x * p1 - p0) / (x * x - 1)
xs.append(x)
ws.append(2.0 / ((1 - x * x) * dp * dp))
return xs, ws
isogeometric_collocation.py 65 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/isogeometric-collocation/. The authors are listed in prov/AE2H60.jsonl.
"""Isogeometric collocation for the 1D Poisson problem.
Solve -u'' = f on (a, b) with u(a) = ga and u(b) = gb in the B-spline space of
degree p on an open knot vector, by asking the strong form to hold at the
interior Greville abscissae.
"""
from __future__ import annotations
from typing import Callable, List, Sequence, Tuple
from ig2kit import all_basis, greville, open_uniform_knots, solve_dense
def collocate_poisson(
knots: Sequence, p: int, f: Callable, ga, gb
) -> Tuple[List, List]:
"""Return (coefficients, collocation points) of the collocation solution.
Precondition: p >= 2, an open knot vector (end multiplicity p + 1) and
interior knots of multiplicity at most p - 1. Then the system is
non-singular (Schoenberg-Whitney, see the proof on the page).
Cost: O(n p) to build the banded rows and O(n^3) for the dense solve,
with n = len(knots) - p - 1 unknowns.
Works with float or with Fraction knots and data (then it is exact).
"""
n = len(knots) - p - 1 # @line L1
tau = greville(knots, p) # @line L2
a_, b_ = knots[0], knots[-1]
rows, rhs = [], []
rows.append(all_basis(knots, p, a_, 0)[0]) # @line L3
rhs.append(ga)
for i in range(1, n - 1): # @line L4
d2 = all_basis(knots, p, tau[i], 2)[2]
rows.append([-v for v in d2]) # @line L5
rhs.append(f(tau[i])) # @line L6
rows.append(all_basis(knots, p, b_, 0)[0]) # @line L7
rhs.append(gb)
c = solve_dense(rows, rhs) # @line L8
return c, tau
def evaluate(knots: Sequence, p: int, c: Sequence, x, nd: int = 0):
"""Value (nd = 0) or nd-th derivative of the spline with coefficients c at x."""
row = all_basis(knots, p, x, nd)[nd]
return sum(ci * ri for ci, ri in zip(c, row))
def max_error(knots: Sequence, p: int, c: Sequence, exact: Callable, samples: int = 400) -> float:
"""Largest |u_h - u| over equally spaced samples (a measure, not a proof)."""
a_, b_ = float(knots[0]), float(knots[-1])
worst = 0.0
for k in range(samples + 1):
x = a_ + (b_ - a_) * k / samples
worst = max(worst, abs(float(evaluate(knots, p, c, x)) - exact(x)))
return worst
def uniform_solve(p: int, ne: int, f: Callable, ga=0.0, gb=0.0) -> Tuple[List, List]:
"""Collocation on (0, 1) with ne equal elements; returns (knots, coefficients)."""
knots = open_uniform_knots(p, ne)
c, _ = collocate_poisson(knots, p, f, ga, gb)
return knots, c
test_isogeometric_collocation.py 100 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/isogeometric-collocation/. The authors are listed in prov/AE2H60.jsonl.
import math
import random
from fractions import Fraction as F
import pytest
from ig2kit import all_basis, greville, open_uniform_knots
from isogeometric_collocation import collocate_poisson, evaluate, max_error, uniform_solve
def random_knots(rng: random.Random, p: int, max_mult: int) -> list:
"""Open knot vector on [0, 1] with random rational interior knots of multiplicity <= max_mult."""
m = rng.randint(1, 4)
inner = sorted({F(rng.randint(1, 15), 16) for _ in range(m)})
knots = [F(0)] * (p + 1)
for t in inner:
knots += [t] * rng.randint(1, max_mult)
return knots + [F(1)] * (p + 1)
def test_worked_example() -> None:
knots = open_uniform_knots(2, 2, F(0), F(1))
assert greville(knots, 2) == [0, F(1, 4), F(3, 4), 1]
assert all_basis(knots, 2, F(1, 4), 2)[2] == [8, -12, 4, 0]
c, _ = collocate_poisson(knots, 2, lambda x: F(1), F(0), F(0))
assert c == [0, F(1, 8), F(1, 8), 0]
for k in range(9):
x = F(k, 8)
assert evaluate(knots, 2, c, x) == x * (1 - x) / 2
def test_cubic_example() -> None:
knots = open_uniform_knots(3, 4, F(0), F(1))
c, tau = collocate_poisson(knots, 3, lambda x: F(1), F(0), F(0))
assert tau == [0, F(1, 12), F(1, 4), F(1, 2), F(3, 4), F(11, 12), 1]
assert c == [0, F(1, 24), F(5, 48), F(13, 96), F(5, 48), F(1, 24), 0]
def test_exact_on_random_splines() -> None:
"""If the solution is in the spline space, collocation returns it exactly."""
rng = random.Random(4211)
for _ in range(150):
p = rng.randint(2, 5)
knots = random_knots(rng, p, p - 1)
n = len(knots) - p - 1
u = [F(0)] + [F(rng.randint(-20, 20), rng.randint(1, 9)) for _ in range(n - 2)] + [F(0)]
u[-1] = F(rng.randint(-5, 5))
f = lambda x, u=u, knots=knots, p=p: -evaluate(knots, p, u, x, 2)
c, _ = collocate_poisson(knots, p, f, u[0], u[-1])
assert c == u
def test_exact_on_polynomials() -> None:
"""u = sum a_k x^k of degree <= p: the method reproduces it exactly."""
rng = random.Random(77)
for _ in range(100):
p = rng.randint(2, 5)
knots = random_knots(rng, p, p - 1)
a = [F(rng.randint(-9, 9), rng.randint(1, 5)) for _ in range(p + 1)]
u = lambda x: sum(ak * x**k for k, ak in enumerate(a))
f = lambda x: -sum(k * (k - 1) * ak * x ** (k - 2) for k, ak in enumerate(a) if k >= 2)
c, _ = collocate_poisson(knots, p, f, u(F(0)), u(F(1)))
for j in range(11):
x = F(j, 10)
assert evaluate(knots, p, c, x) == u(x)
def test_singular_with_multiplicity_p() -> None:
"""Pitfall: an interior knot of multiplicity p allows a kink with u'' = 0."""
knots = [F(0)] * 3 + [F(1, 2)] * 2 + [F(1)] * 3
with pytest.raises(ValueError):
collocate_poisson(knots, 2, lambda x: F(1), F(0), F(0))
def test_error_and_rates_against_exact() -> None:
f = lambda x: math.pi**2 * math.sin(math.pi * x)
exact = lambda x: math.sin(math.pi * x)
for p in (2, 3, 4, 5):
errs = []
for ne in (8, 16, 32):
knots, c = uniform_solve(p, ne, f)
errs.append(max_error(knots, p, c, exact, 400))
rates = [math.log2(errs[i] / errs[i + 1]) for i in range(2)]
expected = p if p % 2 == 0 else p - 1
assert abs(rates[-1] - expected) < 0.2, (p, rates)
knots, c = uniform_solve(4, 16, f)
assert max_error(knots, 4, c, exact, 400) < 1e-5
def test_second_derivative_rate() -> None:
f = lambda x: math.pi**2 * math.sin(math.pi * x)
for p in (2, 3, 4):
errs = []
for ne in (16, 32):
knots, c = uniform_solve(p, ne, f)
errs.append(max(abs(float(evaluate(knots, p, c, k / 200, 2)) + f(k / 200)) for k in range(201)))
assert abs(math.log2(errs[0] / errs[1]) - (p - 1)) < 0.2
History
Collocation with piecewise polynomials for ordinary boundary value problems is old. De Boor and Swartz (1973) proved the convergence orders of collocation at Gauss points with splines for equations of order . Isogeometric analysis came in 2005, with Galerkin as its standard discretization. Auricchio, Beirão da Veiga, Hughes, Reali and Sangalli (2010) proposed to collocate at the Greville abscissae of the smooth spline basis, with an analysis of the 1D case and numerical tests of the orders. Schillinger, Evans, Reali, Scott and Hughes (2013) counted the operations against Galerkin and extended the method to hierarchical NURBS. Later work looked for points with better orders, such as the superconvergent points of Montardini, Sangalli and Tamellini (2017).
References
- F. Auricchio, L. Beirão da Veiga, T. J. R. Hughes, A. Reali and G. Sangalli, Isogeometric collocation methods, Mathematical Models and Methods in Applied Sciences 20(11), 2010, 2075 to 2107, the whole paper (collocation at the Greville abscissae, the 1D analysis, and the numerical convergence orders p for even and p - 1 for odd degree)
- D. Schillinger, J. A. Evans, A. Reali, M. A. Scott and T. J. R. Hughes, Isogeometric collocation, cost comparison with Galerkin methods and extension to adaptive hierarchical NURBS discretizations, Computer Methods in Applied Mechanics and Engineering 267, 2013, 170 to 232, the operation counts of the formation and the solution of collocation and Galerkin systems
- M. Montardini, G. Sangalli and L. Tamellini, Optimal-order isogeometric collocation at Galerkin superconvergent points, Computer Methods in Applied Mechanics and Engineering 316, 2017, 741 to 757, the introduction (the orders of Greville collocation in the L2, H1 and H2 norms) and the clustered superconvergent points
- Carl de Boor, A Practical Guide to Splines, revised edition, Springer, 2001, Chapter X (derivatives of B-splines) and Chapter XIII (the Schoenberg-Whitney theorem on spline interpolation)
- Carl de Boor and Blair Swartz, Collocation at Gaussian points, SIAM Journal on Numerical Analysis 10(4), 1973, 582 to 606, the whole paper, spline collocation for ordinary boundary value problems, the older form of the idea
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag AE2H60 Edit this page History Report an error Markdown