artisynth.core.femmodels
Class AnsysReader

java.lang.Object
  extended by artisynth.core.femmodels.AnsysReader

public class AnsysReader
extends java.lang.Object

A class to read an FEM described in the ANSYS file format.


Field Summary
static int ONE_BASED_NUMBERING
          Tells the reader to number the nodes and elements starting from one.
static int TETRAHEDRALIZE_HEXES
          Tells the reader to subdivide each hexahedral element into five tetrahedra.
 
Constructor Summary
AnsysReader()
           
 
Method Summary
static void read(FemModel3d model, java.io.Reader nodeReader, java.io.Reader elemReader, double density, Vector3d scale, int options)
          Creates an FemModel with uniform density based on ANSYS data contained in a specified file.
static void read(FemModel3d model, java.lang.String nodeFileName, java.lang.String elemFileName, double density, Vector3d scale, int options)
          Creates an FemModel with uniform density based on ANSYS data contained in a specified file.
static java.util.LinkedHashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>> readElemFile(java.io.Reader elemReader, boolean useAnsysNum)
           
static java.util.LinkedHashMap<java.lang.Integer,Point3d> readNodeFile(java.io.Reader nodeReader, boolean useAnsysNum)
           
static java.lang.Integer[] readNodeIdxs(java.io.Reader nodeReader)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TETRAHEDRALIZE_HEXES

public static int TETRAHEDRALIZE_HEXES
Tells the reader to subdivide each hexahedral element into five tetrahedra.


ONE_BASED_NUMBERING

public static int ONE_BASED_NUMBERING
Tells the reader to number the nodes and elements starting from one. This is the same convention as used by ANSYS.

Constructor Detail

AnsysReader

public AnsysReader()
Method Detail

read

public static void read(FemModel3d model,
                        java.lang.String nodeFileName,
                        java.lang.String elemFileName,
                        double density,
                        Vector3d scale,
                        int options)
                 throws java.io.IOException
Creates an FemModel with uniform density based on ANSYS data contained in a specified file. The node coordinate data can be scaled non-uniformly using an optional parameter giving scale values about the x, y, and z axes.

Parameters:
model - FEM model to be populated by ANSYS data
nodeFileName - path name of the ANSYS node file
elemFileName - path name of the ANSYS element file
density - density of the model
scale - if non-null, gives scaling about the x, y, and z axes
options - option flags. Should be an or-ed combination of TETRAHEDRALIZE_HEXES and ONE_BASED_NUMBERING.
Throws:
java.io.IOException - if this is a problem reading the file

read

public static void read(FemModel3d model,
                        java.io.Reader nodeReader,
                        java.io.Reader elemReader,
                        double density,
                        Vector3d scale,
                        int options)
                 throws java.io.IOException
Creates an FemModel with uniform density based on ANSYS data contained in a specified file. The node coordinate data can be scaled non-uniformly using an optional parameter giving scale values about the x, y, and z axes.

Parameters:
model - FEM model to be populated by ANSYS data
nodeReader - reader supplying node data in the ANSYS format
elemReader - reader supplying element data in the ANSYS format
density - density of the model
scale - if non-null, gives scaling about the x, y, and z axes
options - option flags. Should be an or-ed combination of TETRAHEDRALIZE_HEXES and ONE_BASED_NUMBERING.
Throws:
java.io.IOException - if this is a problem reading the file

readElemFile

public static java.util.LinkedHashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>> readElemFile(java.io.Reader elemReader,
                                                                                                             boolean useAnsysNum)
                                                                                                      throws java.io.IOException
Throws:
java.io.IOException

readNodeFile

public static java.util.LinkedHashMap<java.lang.Integer,Point3d> readNodeFile(java.io.Reader nodeReader,
                                                                              boolean useAnsysNum)
                                                                       throws java.io.IOException
Throws:
java.io.IOException

readNodeIdxs

public static java.lang.Integer[] readNodeIdxs(java.io.Reader nodeReader)
                                        throws java.io.IOException
Throws:
java.io.IOException