CmUtils::CmConvert

cmConvert - converts files between CMISS formats

VERSION

1.01 (23 March 2001)

USAGE

The routines in this package can be called in several ways.

1/ From the shell prompt, call as cmConvert, or one of the aliases for specific conversions. Prefix options with '-'. e.g.

    cmConvert -toformat exdata -force file.ipdata   # creates file.exdata
    toIpnode file.exnode                            # creates file.ipnode
    cmConvert file.ipnode                           # creates file.exnode

2/ If data is piped in (or out) then the file formats must be explicitly specified. e.g.

    cat file.ipnode | cmConvert -fromformat ipnode -toformat exnode > file.exnode

3/ From a Perl script, or from inside CMISS, load this module (with optional flags):

    use CmUtils::CmConvert;                           # loads cmConvert()
    use CmUtils::CmConvert qw(:all);                  # loads all routines
    use CmUtils::CmConvert qw(ipExnode toIpdata);     # ipExnode() & toIpdata()

Options and filenames can then be specified in several ways.

a) as a string equivalent to a command line

    ipExnode("-force -unique file.ipnode");   # create file.exnode

b) as options and filenames

    cmConvert("-toformat","ipdata",$file);

c) as a hash array of options, followed by a list of files

    $options->{-force} = 1;
    $options->{-toformat} = "ipdata";
    cmConvert($options, @files);
    $options = {-force => 1, -unique => 1, x0 => 5.7};
    toIpdata($options, $exdatafile);
    
    %options = (-force => 1, -unique => 1, x0 => 5.7);
    toIpdata(\%options, "file.exdata");

SYNOPSIS of cmConvert

cmConvert
[-help] [-man] [-verbose] [-force] [-offset offset] [-unique [-thousand|-log]] [-x0 x0] [-y0 y0] [-z0 z0] [-sort] [-fields fieldlist] [-allfields] [-nodes nodelist] [-fromformat format] [-toformat format] [filename(s)]

OPTIONS AND ARGUMENTS

-help
-man
-verbose
-force
Force output file to be overwritten if it exists.
-offset offset
Node number offset to begin numbering from.
-unique
Causes all nodes for all files to have unique numbers.
-thousand
Starts each new numbering from next multiple of 1000.
-log
Starts each new numbering according to power of ten of previous set.
-x0 x0 -y0 y0 -z0 z0
Translation of position.
-sort
Will sort multiple files by decreasing size.
-allfields
Write all fields (usually "coordinates" and "weights") to file. Default is to only write "coordinate" field.
-fields fieldlist
Write the given field(s) only to the file. Default is to only write "coordinate" field.
-nodes nodelist

Select a subset of nodes to convert. Any nodes lying in the range given will be output if they exist. Nodelist must be defined without spaces, e.g.

  -nodes 4,7,10..14,32
-fromformat format
Input file format. If not specified, it will be determined from the input filename. Must be specified if file comes from STDIN.
-toformat format
Output file format. By default, is the corresponding alternate format (i.e. exdata from ipdata).
filename(s)
Input file(s) to convert. Also accepts piped input.

DESCRIPTION

cmConvert converts file between different CMISS formats, including ipnode, ipdata, exnode, exdata, ipfiel and ipfibr. Will also read from STDIN and write to STDOUT. If multiple files are specified and sort is set, then files will be sorted by decreasing size. If an output file already exists, it will not be written, unless the force option is used.

File input and output formats are specified using the fromformat and toformat options, or are determined from the input file(s).

If the variable offset is set, then the numbering will begin from offset, else it is the same as the input file. If multiple files are parsed, the unique option allows numbering to increment for each file in sequence so that all written nodes for all files have unique numbers. The thousand option causes this numbering to jump to the next multiple of 1000. The log option instead jumps to next appropriate power of 10.

Can also set a translation using x0, y0 and z0. Translates the nodes so this specified point is at the origin.

If symbolic links are made to this program, it can also be run as one of the following names, with appropriate input and output formats preset.

  ipExdata
  exIpdata
  ipExnode
  exIpnode
  toExdata
  toIpdata
  toExnode
  toIpnode

SUBROUTINES

cmConvert

Used as a module, the cmConvert routine is available by default, with additional routines exportable if needed, individually, or together with qualifier :all.

ipExdata

Converts from ipdata to exdata formats.

ipExnode

Converts from ipnode to exnode formats.

exIpdata

Converts from exdata to ipdata formats.

exIpnode

Converts from exnode to ipnode formats.

toExdata

Converts to exdata formats.

toIpdata

Converts to ipdata formats.

toExnode

Converts to exnode formats.

toIpnode

Converts to ipnode formats.

CHANGES

1.01 - Added options for specifying fields to use. Also verbose option.

1.0 - Release

0.7 - Added new Pod documentation system to give help in CMISS or perldl etc

0.6 - Added documentation and examples describing usage