ConvergenceFactor

Category

Transformation

Function

Calculates the convergence order for numerical data.

Syntax

Value_of_n = ConvergenceFactor(function_1, function_2, function_3, delta_1, delta_2, delta_3);

Inputs
Name Type Default Description Required
function_1 field (none) the first dataset yes
function_2 field (none) the second dataset yes
function_3 field (none) the third dataset yes
delta_1 scalar (none) resolution for the first dataset yes
delta_2 scalar (none) resolution for the second dataset yes
delta_3 scalar (none) resolution for the third dataset yes

Outputs
Name Type Description
Value_of_n field the value of the convergence factor

Functional Details

The ConvergenceFactor module takes three different datasets as inputs - they are fields read as single precision floating-point numbers; and three different resolutions - declared as scalars - at which the simulations were performed. In order to have the same grid structure we downsample the data, so that we have exactly the same number of points on all the grids. For example for three data sets with 21, 31 and 41 points on the grid, respectively, we would downsample the first one by a factor of 2, the second one by 3 and the third one by 4.

This modules solves the following equation for n:

where is the numerical solution at a certain resolution, is the exact solution to the wave equation, c is a constant independent of the resolution at a given point, is the resolution, and n is the convergence order.

For the above formula we use the three values of resolution and the three functions (fields) to form a system of three equations with three unknowns. In order to obtain the values of n we have to find the roots of this equation. First we bracket the root, and then apply the bisection method (a method that never fails).

ConvergenceFactor returns in the output field the values of n computed for each patch in the input fields.

The convergence factor cannot be calculated for the following cases:

-- if , -200 is assigned to n.

-- if , -100 is assigned to n.

-- if the bracket method fails -300 is assigned to n .

Example Visual Programs

ConvergenceFactor.net

The example program and the module are contained in the Visualization/OpenDX subdirectory of the NumRel CVS. Look for them in the folders for Modules and Networks .

Here are the instructions to check them out:

cvs -d :pserver:<username>@cvs.cct.lsu.edu:/numrel login

cvs -d :pserver:<username>@cvs.cct.lsu.edu:/numrel co Visualization/OpenDX

Compiling the module

In order to compile the module the user needs the following files that have been checked out from cvs: ConvergenceFactor.mdf and Makefile . The ConvergenceFactor.mdf must contain information of all the others mdf files of the other modules. In order to compile the mdf file, the ConvergenceFactor.mdf should not include any information about the other modules ( here is an example).

After the compilation with make ConvergenceFactor the initial mdf file should be copied back.

See also

ConvergenceFactorDouble

Further Documentation

More information about OpenDX can be found here.