|
Doxygen
1.15.0
|
The tasgrid executable is a command line interface to the Tasmanian Sparse Grid module. It provides the ability to create and manipulate sparse grids, save and load them into files and optionally interface with another program via text files. For the most part, tasgrid reads a grid from a file, calls one or more of the functions described in the previous section and then saves the resulting grid.
The commands for tasgrid correspond to calls to the C++ API, where scalar inputs are given as command line arguments and vector/array parameters are given as matrix files, see the end of this section for the matrix file format.
The first input to the executable is the command that specifies the action that needs to be taken. The command is followed by options and values.
Every command is associated with a set of options, extra options are ignored. See the help subsection on how to find the right options for each command.
Make quadrature rule in 4 dimensions that can integrate exactly all quadratic polynomials, print the result to the screen. Note that the first column is the weight.
The first command creates a global grid with 3 dimensions and clenshaw-curtis points that interpolate exactly all polynomials of order 4. The grid is stored in example_grid_file. In the second command, model values are read from the file_with_values and loaded into the grid. In the final command, the interpolant is evaluated at the points specified in file_with_points and the result is stored in the last file.
Prints information about the usage of tasgrid. In addition, writing help after any command will print information specific to that command; effectively, help is a universal option.
Additional notes:
List the available one dimensional quadrature and interpolation rules as well as the different types of grids, refinement and conformal mapping types. Use this command to see the correct spelling of all string options.
Prints the version of the library, the available acceleration options, and (if CUDA is enabled) the visible CUDA devices.
Since Tasmanian 6.0 the sparse grids testing is moved to a different executable, i.e., gridtest. The test method of tasgrid is still included but it covers only a sub-set of the tests. Also, the tests take longer, especially when CUDA is enables, since large reference solutions have to be computed on the slower CPU. The gridtest executable takes the random and verbose switches, but does not need the -test command.
The tests rely on random number generation to estimate the accuracy of computed interpolants. If the test fails, this may be indication of a problem with the hard-coded random seed. Using the random option will reset the seed on every run and will provide more statistically significant results.
The verbose will print more detailed output. This affects only the successful tests, failed tests always print verbose information.
The matrix files have two formats, binary and ASCII. The simple text file describes a two dimensional array of real (double-precision) numbers. The file contains two integers on the first line indicating the number of rows and columns. Those are followed by the actual entries of the matrix one row at a time.
The file containing
represents the matrix 
A matrix file may contain only one row or column, e.g.,
In binary format, the file starts with three characters TSG indicating that this is a binary Tasmanian file. The characters are followed by two integers and the double-precision numbers that correspond to the matrix being read left-to-right top-to-bottom.
All files used by tasgrid have the above format with three exceptions. The -gridfile option contains saved sparse grids and it is not intended for editing outside of the tasgrid calls (it is OK to modify using other Tasmanian API calls, e.g., C++ or Python). The -anisotropyfile option requires a matrix with one column and it should contain double-precision numbers that have integer values. The -customrulefile has special format is described the Custom Rule File Format section.
The default mode is to use binary files for all calls to tasgrid, but ASCII files are easier to debug and potentially easier to import to external codes. This tasgrid has an option -ascii that can be added to any command and will force the resulting output to be written in ASCII format.