Skip to content

Postprocessing context

Knut Morten Okstad edited this page Jun 8, 2019 · 4 revisions

The <postprocessing> context is for everything related to postprocessing and data output. It can have the following sub-contexts:

<vtfformat>

Set the format of the VTF output.

Attributes:

  • nviz - The number of visualization points over each knot-span (uniformly distributed) in the output. Applies to all parameter directions. The default is 2 (only the end points).
  • nu, nv, nw - The number of visualization points in the given parameter direction.
  • file - The file to write. If not specified, it will equal the input file name with extension .vtf

Value: The type of VTF file to output to (binary or ascii).

Example:

<vtfformat nviz="5">ascii</vtfformat>
<vtfformat nu="3" nv="5" file="foo.vtf">binary</vtfformat>

<stride>

The stride of the data output.

Attributes:

  • dt - Use this to dump at a given time interval, rather than every n step.

Value: The number of time steps n between data output. Ignored if dt is specified.

Example:

<stride dt="0.05"/>
<stride>10</stride>

<restartstride>

The stride of the data serialization for restart.

Attributes: None

Value: The number of time steps n between each serialization.

Example:

<restartstride>10</stride>

<hdf5>

Use this to output to a HDF5 file.

Attributes: None

Value: The name of the HDF5 file. If blank, the default HDF5 name is given (input file name with .xinp replaced by .hdf5)

Example:

<hdf5/>
<hdf5>foo.hdf5</hdf5>

<primarySolOnly>

Use this to specify output of only primary solution variables to HDF5.

Attributes: None

Value: None

<saveNorms>

Use this to specify output of element norms to HDF5, for applications performing norm integration.

Attributes: None

Value: None

<resultpoints>

Use this to output values at specified points of interest to console.

Attributes: None

Value: One or more <point> tags. A <point> tag has the following available attributes (and no value):

  • patch - 1-based index of the patch the point belongs to
  • u, v, w - The parameter values for the point

Example:

<resultpoints>
  <point patch="1" u="0" v="0.1" w="0.3"/>
  <point patch="2" u="0" v="0.1"/>
</resultpoints>

control points.

<dump_lhs_matrix>

Use this to save the left hand side matrix to file for inspection.

Attributes:

  • step - Dump at the given step
  • format - The format of the dump file (m = Matlab)

Value: Name of the file to dump to

Example:

<dump_lhs_matrix step="1" format="m">mydump.m</dump_lhs_matrix>

<dump_rhs_vector>

Use this to save the right hand side vector to file for inspection.

Attributes:

  • step - Dump at the given step
  • format - The format of the dump file (m = Matlab)

Value: Name of the file to dump to

Example:

<dump_rhs_vector step="1" format="m">mydump.m</dump_rhs_vector>

<projection>

Use this to set the projection schemes to use for field recovery and adaptive simulations.

Attributes: None

Value: One or more of the following tags:

  • <global> - global Greville point projection
  • <DGL2> - discrete global L2-projection
  • <CGL2> - continuous global L2-projection
  • <scr> - superconvergent recovery projection
  • <vdsa> - variational diminishing spline approximation projection
  • <quasi> - quasi-interpolation projection
  • <lsq> - Least squares projection

Example:

<projection>
  <vdsa/>
  <Global/>
</projection>

Background

We may classify the projection techniques into local and global approximation methods [1]:

Global methods, like

  • <global> - global Greville point projection, and
  • <lsq> - least squares projection

are methods where we have to solve a system of linear equations to compute the B-spline coefficients for given data. For these methods the B-spline coefficients depend on all initial data points.

Local methods, like

  • <vdsa> - variational diminishing spline approximation projection, and
  • <quasi> - quasi-interpolation projection

where the value of the coefficients is directly given in terms of given values of the function which has to be interpolated. Here, the B-spline coefficients depend only on neighboring points of the support of the corresponding B-spline.

Comparison between these four projection methods: TODO: the formatting of the below needs to be fixed!

[](/File:ComparisonProjectionMethods.png "wikilink") **Global interpolation method using Greville points ()**
  • General: We seek a spline function (f) that matches given data values (y_j) at given points (x_j), such that
\(f(x_j) = y_j,\)

for j = 1,....m. This problem expressed in terms of (m) basis functions of degree (p) and control points (c) leads to

\(f(x_j) = \sum\limits^m_{i=1}N_{i,p}(x_j) c_i = y_j.\)

We reformulate this equation as a system of linear equations

\(f(x) = A c = y.\) - *Projection:* Given is the derivative \(f'(\xi)\) of a spline function \(f(\xi)\) (example: strain and stresses - "derivatives of the displacement field" ) with respect to given control weights \(c\) and knot vector \(\Xi\). The spline function \(f\) itself belongs to the spline space \(\mathbb{S}_{p,\Xi}\), while the derivative \(f'\) of one degree lower belongs to the spline space \(\mathbb{S}_{p-1,\Xi}\). In order to project the derivative \(f'\) into the same spline space as the spline function \(f\), we evaluate the derivative at the Greville points

(\xi^\ast_i = \frac{1}{p} \sum\limits^{i +p}_{k=i+1}\xi_k,)

where (i = 1,2,...,n) and obtain (f'(\xi^\ast)). We denote (y^\ast:=f'(\xi^\ast)) and solve a system of linear equations

(A c^\ast = \left( \begin{array}{ccc} N_{1,p}(\xi^\ast_1) &\cdots & N_{m,p}(\xi^\ast_1) \ \vdots & \ddots & \vdots \ N_{1,p}(\xi^\ast_m) & \cdots & N_{m,p}(\xi^\ast_m) \end{array} \right) \left( \begin{array}{c} c^\ast_1\ \vdots\c^\ast_m \end{array} \right) = \left( \begin{array}{c} f'_1(\xi^\ast)\ \vdots\f'_m(\xi^\ast) \end{array} \right) = f'(\xi^\ast).)

To ensure an existing and unique solution the Schoenberg-Whitney Theorem must be satisfied. We obtain as solution a new set of control points (c^\ast) with respect to the Greville points. The resulting control points (c^\ast) are used to produce a derivative (\hat{f}'(\xi)) which belong to the same spline space (\mathbb{S}_{p,\Xi}) as the spline function (f)

(\hat{f}'(\xi) = \sum\limits^n_{i=1}N_{i,p}(\xi) c_i^\ast.)

Global Approximation Method: Least-Squares (<lsq>)

  • General: With (m \ge n), (A \in {R}^{m,n}) and (b \in {R}^m), the linear least-square problem

(\min\limits_{c\in{R}^n} | A c - b|^2_{L^2})

has a solution (c) by solving (A^\top A c = A^\top b,)

where (A) and (b) have components

(a_{i,j} = \sqrt{w_i} N_j(\xi_i) \quad \mbox{and} \quad b_i = \sqrt{w_i}y_i.)

The expression that is minimized is a sum of the squares of the errors at each data point, weighted by the numbers (w_i) which are called weights.

  • Projection: The least-square procedure defines (u) by minimizing the (L_2)-norm (\min_{\tilde{u} \in S}|u(x) - u^h(x)|_{L_2})

this results in the minimization of the following integral

(\min \frac{1}{2}\int\limits_{\Omega} (u(x) - u^h(x))^2 dx.)

By using the usual test function approximation

(\hat{u} = N \tilde{u})

we can substitute and derivate

(\frac{1}{2}\int\limits_{\Omega} (u - N \tilde{u})^2 dx = \int\limits_{\Omega} N^\top (u - N \tilde{u}) dx = 0)

(\int\limits_{\Omega} N^\top N \tilde{u} dx = \int\limits_{\Omega} N^\top u dx)

By using the Gauss quadrature rule to approximate the integral this leads to the solution of a linear system

(N^\top N \tilde{u} = N^\top u)

in unknowns (\tilde{u}) where the function (u) and the basis functions

((N^\top N ){i,j} = \int\limits{\Omega} \varphi_{i}(x) \varphi_{j}(x) dx)

are evaluated at the respective Gauss points. In stead of using the Greville points as in global Greville projection, here we evaluate (y:=f') at Gauss points.

Local quasi-interpolation ()

  • General: Let the spline space (\mathbb{S}{p,\Xi}) of dimension (n) and the real function (f) defined on the interval ([\xi{p+1} , \xi_{n+1} ]) be given, and suppose that (\Xi) is a (p+1)-regular knot vector. To approximate (f) from the space (\mathbb{S}{p,\Xi}), choose a sub-interval (I= [\xi\mu , \xi_\nu ]) of ([\xi_{p+1} , \xi_{n+1} ]) with the property that (I \in (\xi_{j} , \xi_{j+p+1})) is not empty, and let (f^I) denote the restriction of (f) to this interval. Choose a local approximation method (P^I) and determine an approximation (g^I) to (f^{I})

(g^{I} =P^I f^{I} = \sum\limits_{i} b_i N_{i,p})

on the interval (I). Set (j) of the global solution and (c_j = b_j). Iterate until

(P f = \sum\limits^n_{j=1} c_j N_{j,p}.)

  • Projection: We choose as a local approximation method a (p+1)-point (p)-quasi-interpolant. Our starting point is a spline space of degree (p) based on a (p+1)-regular knot vector with distinct interior knots. The support of the B-spline (N_j) is ([ \xi_j, \xi_{j+(p+1)}]), and we choose our local interval as (I = [ \xi_{j+1}, \xi_{j+p} ]). For the projection we evaluate again at the respective Greville points in each interval and solve a system of linear equations as in the global case, but here is this system solved only over a sub-interval of the entire approximation area.

Local Variation Diminishing Spline Approximation

  • *General:*Let (f) be a given continuous function on the interval ([a,b]), let (p) be the degree of the spline basis functions, and let (\Xi = (\xi_i)^{n+p+1}{i=1}) be a (p+1)-regular knot vector with boundary knots (\xi{p+1}=a) and (\xi_{n+1}=b). The spline is then given by the Variation Diminishing Spline Approximation

((Vf)(x) = \sum\limits^n_{j=1} f(\xi_j^\ast) N_{j,p}(x).)

of degree (p) of (f) on the knot vector (\Xi), where (\xi_j^\ast), (j=1,...,n) the Greville abscissa.

This approximation method has a shape-preserving property.

  • Projection: In order to obtain a local spline approximation to the derivative (f') of the spline function (f) that is living in the same spline space as the spline function (f), we evaluate the derivative at the Greville points (\xi^\ast) and obtain (f'(\xi^\ast)). To obtain the variation diminishing approximation (Vb(\xi)) to the derivative, we simply use the function values (f'(\xi^\ast)) as B-spline coefficients (b^\ast_j = f'_j(\xi^\ast)) directly

((Vb)(\xi) = \sum\limits^n_{j=1} N_{j,p}(x) b^\ast_j.)

the approximation (Vb(\xi)) belongs then to the spline space (\mathbb{S}_{p,\Xi}). By using this method no system of equations has to be solved, like in all the other projection methods. Evaluated function values are directly used as control points.

[1] LycheMoerkenSplineMetoder2011