artisynth.core.femmodels
Class TetElement

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.femmodels.FemElement
              extended by artisynth.core.femmodels.FemElement3d
                  extended by artisynth.core.femmodels.TetElement
All Implemented Interfaces:
CopyableComponent, ModelComponent, RenderableComponent, PropertyChangeListener, ScalableUnits, java.lang.Cloneable, Boundable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable

public class TetElement
extends FemElement3d

Nodes are arranged clockwise WRT p0


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
 
Fields inherited from class artisynth.core.femmodels.FemElement3d
myProps
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
TetElement()
           
TetElement(FemNode3d[] nodes)
          Creates a new TetraHedral element from four nodes.
TetElement(FemNode3d p0, FemNode3d p1, FemNode3d p2, FemNode3d p3)
          Creates a new TetraHedral element from four nodes.
 
Method Summary
 double computeRestVolumes()
          Default method to compute the element rest volume and partial volumes.
static double computeVolume(FemNode3d n0, FemNode3d n1, FemNode3d n2, FemNode3d n3)
          Computes the volume of the tetrahedron formed by four FemNodes, where the first three nodes are arranged clockwise about a single face, and clockwise is with respect to the face's outward normal.
static double computeVolume(Point3d p0, Point3d p1, Point3d p2, Point3d p3)
           
 double computeVolumes()
          Default method to compute an element's volume and partial volumes.
 boolean coordsAreInside(Vector3d coords)
           
static TetElement[] createCubeTesselation(FemNode3d p0, FemNode3d p1, FemNode3d p2, FemNode3d p3, FemNode3d p4, FemNode3d p5, FemNode3d p6, FemNode3d p7, boolean even)
          Create a tesselation for a cubic configuration of nodes, using a Freudenthal cut.
static TetElement[] createWedgeTesselation(FemNode3d p0, FemNode3d p1, FemNode3d p2, FemNode3d p3, FemNode3d p4, FemNode3d p5, int type)
          Create a tesselation for a wedge configuration of nodes.
 void getAreaWeightedNormals(Vector3d[] anormals)
          Compute the area-weighted normals for this tetrahedron.
 double getConditionNum()
           
 void getdNds(Vector3d dNds, int i, Vector3d coords)
           
 int[] getEdgeIndices()
           
 int[] getFaceIndices()
           
 double getIncompDerivative(Vector3d tmp1, Vector3d tmp2)
           
 double[] getIntegrationCoords()
           
 IntegrationPoint3d[] getIntegrationPoints()
           
 void getMarkerCoordinates(VectorNd coords, Point3d pos)
           
 double getN(int i, Vector3d coords)
           
 double[] getNodalExtrapolationMatrix()
           
 double[] getNodeCoords()
           
 IntegrationPoint3d getWarpingPoint()
           
 boolean hasEdge(FemNode3d n0, FemNode3d n1)
           
 boolean hasFace(FemNode3d n0, FemNode3d n1, FemNode3d n2)
           
 boolean isInside(Point3d pnt)
          Tests whether or not a point is inside an element.
static boolean isInside(Point3d pnt, Point3d p0, Point3d p1, Point3d p2, Point3d p3)
           
 boolean isInverted()
          Returns true if this element has been marked as inverted by the FEM code.
 int numIntegrationPoints()
           
 void renderWidget(GLRenderer renderer, double size, RenderProps props)
           
 void setNodes(FemNode3d p0, FemNode3d p1, FemNode3d p2, FemNode3d p3)
          Sets the nodes of a TetraHedral element.
 
Methods inherited from class artisynth.core.femmodels.FemElement3d
addAuxiliaryMaterial, addNodeForce, addNodeForce0, addNodeForce0, addNodeStiffness, addNodeStiffness, clearState, computeCentroid, computeCovariance, computeDirectedRenderSize, computeGravityWeights, computePressures, computeRenderCoordsAndGradient, computeWarping, computeWarping, connectToHierarchy, copy, createElement, createElement, createIntegrationPoints, disconnectFromHierarchy, getAllPropertyInfo, getAuxiliaryMaterials, getCopyReferences, getElementWidgetSize, getElementWidgetSizeMode, getFrame, getH, getIncompressConstraints, getIncompressIndex, getIntegrationData, getNaturalCoordinates, getNaturalCoordinatesRobust, getNodeCoords, getNodes, getNumEdges, getNumFaces, getPoint, getPressureWeightMatrix, getTriFaces, getWarpingData, hasFace, invalidateRestData, isInvertedAtRest, materialsAreInvertible, numAuxiliaryMaterials, numPoints, numPressureVals, removeAuxiliaryMaterial, render, render, renderEdges, renderWidget, renderWidget, renderWidgetEdges, renderWidgetEdges, scaleDistance, setElementWidgetSize, setElementWidgetSizeMode, setFrame, setIncompressIndex, triangulateFace, updateBounds, updateWarpingStiffness
 
Methods inherited from class artisynth.core.femmodels.FemElement
containsNode, createRenderProps, getDensity, getDensityMode, getEffectiveMaterial, getHardReferences, getIndex, getLocalNodeIndex, getMass, getMaterial, getRestVolume, getSelection, getVolume, hasActiveNodes, hasControllableNodes, integrationPointsMapToNodes, isDuplicatable, numberString, numNodes, prerender, propertyChanged, scaleMass, setDensity, setDensityMode, setIndex, setInverted, setMass, setMaterial, updateNodeMasses
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Constructor Detail

TetElement

public TetElement()

TetElement

public TetElement(FemNode3d p0,
                  FemNode3d p1,
                  FemNode3d p2,
                  FemNode3d p3)
Creates a new TetraHedral element from four nodes. The first three nodes should define a clockwise arrangement about a particular face.


TetElement

public TetElement(FemNode3d[] nodes)
Creates a new TetraHedral element from four nodes. The first three nodes should define a clockwise arrangement about a particular face.

Method Detail

getIntegrationPoints

public IntegrationPoint3d[] getIntegrationPoints()
Specified by:
getIntegrationPoints in class FemElement3d

getWarpingPoint

public IntegrationPoint3d getWarpingPoint()
Specified by:
getWarpingPoint in class FemElement3d

getConditionNum

public double getConditionNum()

isInverted

public boolean isInverted()
Description copied from class: FemElement
Returns true if this element has been marked as inverted by the FEM code.

Overrides:
isInverted in class FemElement
Returns:
true if this element has been marked as inverted.

setNodes

public void setNodes(FemNode3d p0,
                     FemNode3d p1,
                     FemNode3d p2,
                     FemNode3d p3)
Sets the nodes of a TetraHedral element. The first three nodes should define a clockwise arrangement about a particular face.


createCubeTesselation

public static TetElement[] createCubeTesselation(FemNode3d p0,
                                                 FemNode3d p1,
                                                 FemNode3d p2,
                                                 FemNode3d p3,
                                                 FemNode3d p4,
                                                 FemNode3d p5,
                                                 FemNode3d p6,
                                                 FemNode3d p7,
                                                 boolean even)
Create a tesselation for a cubic configuration of nodes, using a Freudenthal cut. The first four particles should define a single counter-clockwise face, while the last four should give the corresponding (clockwise) nodes for the opposite face. If the tesselation is even, it means that vertices p1, p3, p4, and p6 form the internal tetrahedron of the Freudenthal cut. Otherwise, this tetrahedron is formed from vertices p0, p2, p5, and p7.


createWedgeTesselation

public static TetElement[] createWedgeTesselation(FemNode3d p0,
                                                  FemNode3d p1,
                                                  FemNode3d p2,
                                                  FemNode3d p3,
                                                  FemNode3d p4,
                                                  FemNode3d p5,
                                                  int type)
Create a tesselation for a wedge configuration of nodes. The first three particles should define a single counter-clockwise face, while the last three should give the corresponding (clockwise) nodes for the opposite face. The tesselation type is controlled by a code type, which is an integer in which bits 0, 1, and 2 describe whether the side edge of the tetrahedron directly beneath edges p0-p1, p1-p2, and p2-p0 is rising or falling as the edge is traversed in a counter-clockwise fashion. Not all edges can be rising or falling, and so bit patterns 0x0 and 0x7 are illegal.


coordsAreInside

public boolean coordsAreInside(Vector3d coords)
Specified by:
coordsAreInside in class FemElement3d

numIntegrationPoints

public int numIntegrationPoints()
Specified by:
numIntegrationPoints in class FemElement3d

getIntegrationCoords

public double[] getIntegrationCoords()
Specified by:
getIntegrationCoords in class FemElement3d

getNodalExtrapolationMatrix

public double[] getNodalExtrapolationMatrix()
Specified by:
getNodalExtrapolationMatrix in class FemElement3d

getN

public double getN(int i,
                   Vector3d coords)
Specified by:
getN in class FemElement3d

getdNds

public void getdNds(Vector3d dNds,
                    int i,
                    Vector3d coords)
Specified by:
getdNds in class FemElement3d

getNodeCoords

public double[] getNodeCoords()
Specified by:
getNodeCoords in class FemElement3d

getEdgeIndices

public int[] getEdgeIndices()
Specified by:
getEdgeIndices in class FemElement3d

getFaceIndices

public int[] getFaceIndices()
Specified by:
getFaceIndices in class FemElement3d

renderWidget

public void renderWidget(GLRenderer renderer,
                         double size,
                         RenderProps props)
Overrides:
renderWidget in class FemElement3d

computeRestVolumes

public double computeRestVolumes()
Default method to compute the element rest volume and partial volumes. Uses quadrature. If the number of pressure values is 1, then there is only one partial rest volume which is equal to the overall rest volume. Individual elements can override this with a more efficient method if needed.

Overrides:
computeRestVolumes in class FemElement3d
Returns:
element rest volume

computeVolume

public static double computeVolume(FemNode3d n0,
                                   FemNode3d n1,
                                   FemNode3d n2,
                                   FemNode3d n3)
Computes the volume of the tetrahedron formed by four FemNodes, where the first three nodes are arranged clockwise about a single face, and clockwise is with respect to the face's outward normal. This method can be used when creating TetElements to make sure that the defining nodes are specified in the proper order. If they are not specified in the correct order the volume will be negative.

Parameters:
n0 - 1st FEM node
n1 - 2nd FEM node
n2 - 3rd FEM node
n3 - 4th FEM node
Returns:
volume of the tetrahedron.

computeVolume

public static double computeVolume(Point3d p0,
                                   Point3d p1,
                                   Point3d p2,
                                   Point3d p3)

computeVolumes

public double computeVolumes()
Default method to compute an element's volume and partial volumes. Uses quadrature. If the number of pressure values is 1, then there is only one partial rest volume which is equal to the overall rest volume. The volume at each quadrature point is also stored in the dv field of the elements integration data, for possible future use.

The method should return the minimum Jacobian value found when computing the volume for this element. A negative value indicates element inversion.

Individual elements can override this with a more efficient method if needed.

Overrides:
computeVolumes in class FemElement3d
Returns:
minimum Jacobian value resulting from volume computation

getAreaWeightedNormals

public void getAreaWeightedNormals(Vector3d[] anormals)
Compute the area-weighted normals for this tetrahedron. An area-weighted normal is an outward-facing normal for a face, scaled by the area of that face. The normals are returned in an array of four Vector3d objects, with the i-th normal corresponding to the face opposite the i-th vertex.

Parameters:
anormals - returns the area-weight normals

getIncompDerivative

public double getIncompDerivative(Vector3d tmp1,
                                  Vector3d tmp2)

getMarkerCoordinates

public void getMarkerCoordinates(VectorNd coords,
                                 Point3d pos)
Overrides:
getMarkerCoordinates in class FemElement3d

isInside

public boolean isInside(Point3d pnt)
Description copied from class: FemElement3d
Tests whether or not a point is inside an element.

Overrides:
isInside in class FemElement3d
Parameters:
pnt - point to check if is inside
Returns:
true if point is inside the element

isInside

public static boolean isInside(Point3d pnt,
                               Point3d p0,
                               Point3d p1,
                               Point3d p2,
                               Point3d p3)

hasEdge

public boolean hasEdge(FemNode3d n0,
                       FemNode3d n1)
Overrides:
hasEdge in class FemElement3d

hasFace

public boolean hasFace(FemNode3d n0,
                       FemNode3d n1,
                       FemNode3d n2)
Overrides:
hasFace in class FemElement3d