artisynth.core.materials
Class MaterialBase

java.lang.Object
  extended by artisynth.core.materials.MaterialBase
All Implemented Interfaces:
ScalableUnits, java.lang.Cloneable, CompositeProperty, HasProperties, Clonable, Scannable
Direct Known Subclasses:
AxialMaterial, FemMaterial, FrameMaterial, MuscleMaterial, ViscoelasticBehavior

public abstract class MaterialBase
extends java.lang.Object
implements CompositeProperty, Scannable, ScalableUnits, Clonable


Field Summary
static PropertyList myProps
           
 
Constructor Summary
MaterialBase()
           
 
Method Summary
 MaterialBase clone()
          Returns a clone of this composite property.
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 Property getProperty(java.lang.String name)
          Returns a property associated with a specified path name.
 HasProperties getPropertyHost()
          Should be either HierarchyNode or HasProperties
 PropertyInfo getPropertyInfo()
          If this object is a property, returns the corresponding information
 boolean hasProperty(java.lang.String name)
           
 boolean hasSymmetricTangent()
          Returns true if the tangent matrix for this material is symmetric.
 boolean isWritable()
          Returns true if this component should in fact be written to secondary storage.
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double s)
          Scales all mass units.
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setPropertyHost(HasProperties newParent)
          Sets the host for this property.
 void setPropertyInfo(PropertyInfo info)
          Sets the property information for this property.
static boolean tangentSymmetryChanged(MaterialBase mat1, MaterialBase mat2)
           
static MaterialBase updateMaterial(HasProperties comp, java.lang.String matName, MaterialBase oldMat, MaterialBase newMat)
           
 void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref)
          Writes a text description of this element to a PrintWriter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

MaterialBase

public MaterialBase()
Method Detail

getPropertyInfo

public PropertyInfo getPropertyInfo()
Description copied from interface: CompositeProperty
If this object is a property, returns the corresponding information

Specified by:
getPropertyInfo in interface CompositeProperty

setPropertyInfo

public void setPropertyInfo(PropertyInfo info)
Description copied from interface: CompositeProperty
Sets the property information for this property.

Specified by:
setPropertyInfo in interface CompositeProperty
Parameters:
info - property information

getPropertyHost

public HasProperties getPropertyHost()
Description copied from interface: CompositeProperty
Should be either HierarchyNode or HasProperties

Specified by:
getPropertyHost in interface CompositeProperty

setPropertyHost

public void setPropertyHost(HasProperties newParent)
Description copied from interface: CompositeProperty
Sets the host for this property.

Specified by:
setPropertyHost in interface CompositeProperty
Parameters:
newParent - host for this property

getProperty

public Property getProperty(java.lang.String name)
Description copied from interface: HasProperties
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Parameters:
name - name of the desired property or sub-property
Returns:
handle to the property

hasProperty

public boolean hasProperty(java.lang.String name)

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Returns:
static information for all exported properties

clone

public MaterialBase clone()
Description copied from interface: CompositeProperty
Returns a clone of this composite property.

Specified by:
clone in interface CompositeProperty
Specified by:
clone in interface Clonable
Overrides:
clone in class java.lang.Object
Returns:
clone of this property

isWritable

public boolean isWritable()
Description copied from interface: Scannable
Returns true if this component should in fact be written to secondary storage. This gives subclasses control over whether or not they are actually written out.

Specified by:
isWritable in interface Scannable
Returns:
true if this component should be written to secondary storage.

write

public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
Description copied from interface: Scannable
Writes a text description of this element to a PrintWriter. The text description should be compatable with scan and complete enough to allow full reconstruction of the element.

Specified by:
write in interface Scannable
Parameters:
pw - stream for writing the element
fmt - numeric formating information
ref - optional reference object which can be used for producing references to other objects
Throws:
java.io.IOException - if an I/O error occured

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Description copied from interface: Scannable
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface Scannable
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

updateMaterial

public static MaterialBase updateMaterial(HasProperties comp,
                                          java.lang.String matName,
                                          MaterialBase oldMat,
                                          MaterialBase newMat)

hasSymmetricTangent

public boolean hasSymmetricTangent()
Returns true if the tangent matrix for this material is symmetric. While this is normally true, some special materials (such as those whose stress is not derived from a conservative energy funtion) may have a non-symmetric tangent, in which case this function should be overridden to return false.

Returns:
true if the tangent matrix for this material is symmetric.

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

tangentSymmetryChanged

public static boolean tangentSymmetryChanged(MaterialBase mat1,
                                             MaterialBase mat2)