artisynth.core.femmodels
Class HexElement
java.lang.Object
artisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.RenderableComponentBase
artisynth.core.femmodels.FemElement
artisynth.core.femmodels.FemElement3d
artisynth.core.femmodels.HexElement
- All Implemented Interfaces:
- CopyableComponent, ModelComponent, RenderableComponent, PropertyChangeListener, ScalableUnits, java.lang.Cloneable, Boundable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
public class HexElement
- extends FemElement3d
Method Summary |
void |
addTetElement(TetElement e)
|
void |
clearTetElements()
|
static double |
computeVolume(FemNode3d n1,
FemNode3d n2,
FemNode3d n3,
FemNode3d n4,
FemNode3d n5,
FemNode3d n6,
FemNode3d n7,
FemNode3d n8)
|
boolean |
coordsAreInside(Vector3d coords)
|
HexElement |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component. |
static double[] |
createHexIntegrationCoords(double[] locs,
double[] wgts)
Computes hexahedral integration coordinates using a tensor product
of the supplied 1D quadrature rule. |
IntegrationPoint3d[] |
getDefaultIntegrationPoints()
|
void |
getdNds(Vector3d dNds,
int i,
Vector3d coords)
|
int[] |
getEdgeIndices()
|
int[] |
getFaceIndices()
|
HexElement[] |
getFaceNeighbors()
|
double[] |
getIntegrationCoords()
|
IntegrationPoint3d[] |
getIntegrationPoints()
|
double |
getN(int i,
Vector3d coords)
|
double[] |
getNodalExtrapolationMatrix()
|
double[] |
getNodeCoords()
|
int |
getParity()
|
FaceNodes3d[] |
getQuadFaces()
|
TetElement |
getTetElement(int i)
|
IntegrationPoint3d |
getWarpingPoint()
|
boolean |
hasEdge(FemNode3d n0,
FemNode3d n1)
|
boolean |
hasFace(FemNode3d n0,
FemNode3d n1,
FemNode3d n2,
FemNode3d n3)
|
boolean |
integrationPointsMapToNodes()
Returns true if there is a one-to-one mapping between integration points
and nodes. |
boolean |
isInside(Point3d pnt)
Tests whether or not a point is inside an element. |
boolean |
isInsideRobust(Point3d pnt)
|
static boolean |
mapICoordsToNodes(double[] coords)
|
static boolean |
mapIPointsToNodes(IntegrationPoint3d[] ipnts,
double[] nodalInterp,
FemNode3d[] nodes)
|
int |
numIntegrationPoints()
|
int |
numTetElements()
|
boolean |
removeTetElement(TetElement e)
|
void |
renderWidget(GLRenderer renderer,
double size,
RenderProps props)
|
void |
setFaceNeighbors(HexElement[] nbrs)
|
void |
setIntegrationPoints(IntegrationPoint3d[] ipnts,
double[] nodalExtrapMat)
|
void |
setIntegrationPoints(IntegrationPoint3d[] ipnts,
double[] nodalExtrapMat,
boolean mapToNodes)
|
int |
setNeighborParities()
Rescursively sets the partities of a nodes neighbors, starting with this
element, so as to try and obtain conforming tesselation. |
void |
setNodalExtrapolationMatrix(double[] nem)
|
static void |
setParities(java.util.List<HexElement> hexes)
|
void |
setParity(int parity)
|
TetElement[] |
tesselate(int parity)
|
Methods inherited from class artisynth.core.femmodels.FemElement3d |
addAuxiliaryMaterial, addNodeForce, addNodeForce0, addNodeForce0, addNodeStiffness, addNodeStiffness, clearState, computeCentroid, computeCovariance, computeDirectedRenderSize, computeGravityWeights, computePressures, computeRenderCoordsAndGradient, computeRestVolumes, computeVolumes, computeWarping, computeWarping, connectToHierarchy, createElement, createElement, createIntegrationPoints, disconnectFromHierarchy, getAllPropertyInfo, getAuxiliaryMaterials, getCopyReferences, getElementWidgetSize, getElementWidgetSizeMode, getFrame, getH, getIncompressConstraints, getIncompressIndex, getIntegrationData, getMarkerCoordinates, 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, isDuplicatable, isInverted, numberString, numNodes, prerender, propertyChanged, scaleMass, setDensity, setDensityMode, setIndex, setInverted, setMass, setMaterial, updateNodeMasses |
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 |
INTEGRATION_COORDS_GAUSS_8
public static final double[] INTEGRATION_COORDS_GAUSS_8
INTEGRATION_COORDS_GAUSS_27
public static final double[] INTEGRATION_COORDS_GAUSS_27
INTEGRATION_COORDS_GAUSS_64
public static final double[] INTEGRATION_COORDS_GAUSS_64
INTEGRATION_COORDS_LOBATTO_8
public static final double[] INTEGRATION_COORDS_LOBATTO_8
INTEGRATION_COORDS_LOBATTO_27
public static final double[] INTEGRATION_COORDS_LOBATTO_27
INTEGRATION_COORDS_LOBATTO_64
public static final double[] INTEGRATION_COORDS_LOBATTO_64
NODAL_EXTRAPOLATION_8
public static final double[] NODAL_EXTRAPOLATION_8
NODAL_EXTRAPOLATION_27
public static final double[] NODAL_EXTRAPOLATION_27
NODAL_EXTRAPOLATION_64
public static final double[] NODAL_EXTRAPOLATION_64
HexElement
public HexElement()
HexElement
public HexElement(FemNode3d n0,
FemNode3d n1,
FemNode3d n2,
FemNode3d n3,
FemNode3d n4,
FemNode3d n5,
FemNode3d n6,
FemNode3d n7)
- Creates a HexElement from eight nodes. The first four nodes should
describe a single face of the element, arranged counter-clockwise about
the outward-directed normal. The last four nodes should describe the
corresponding nodes on the opposite face (these will be arranged
clockwise about that face's normal).
HexElement
public HexElement(FemNode3d[] nodes)
integrationPointsMapToNodes
public boolean integrationPointsMapToNodes()
- Returns true if there is a one-to-one mapping between integration points
and nodes. If so, this means that nodal values of quantities such as
stress and volume can be adequately approximated by averaging the same
quantities from all the associated integration points.
- Overrides:
integrationPointsMapToNodes
in class FemElement
getDefaultIntegrationPoints
public IntegrationPoint3d[] getDefaultIntegrationPoints()
setIntegrationPoints
public void setIntegrationPoints(IntegrationPoint3d[] ipnts,
double[] nodalExtrapMat)
setIntegrationPoints
public void setIntegrationPoints(IntegrationPoint3d[] ipnts,
double[] nodalExtrapMat,
boolean mapToNodes)
getIntegrationPoints
public IntegrationPoint3d[] getIntegrationPoints()
- Specified by:
getIntegrationPoints
in class FemElement3d
getWarpingPoint
public IntegrationPoint3d getWarpingPoint()
- Specified by:
getWarpingPoint
in class FemElement3d
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
getNodeCoords
public double[] getNodeCoords()
- Specified by:
getNodeCoords
in class FemElement3d
setNodalExtrapolationMatrix
public void setNodalExtrapolationMatrix(double[] nem)
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
getEdgeIndices
public int[] getEdgeIndices()
- Specified by:
getEdgeIndices
in class FemElement3d
getFaceIndices
public int[] getFaceIndices()
- Specified by:
getFaceIndices
in class FemElement3d
getParity
public int getParity()
setParity
public void setParity(int parity)
setFaceNeighbors
public void setFaceNeighbors(HexElement[] nbrs)
getFaceNeighbors
public HexElement[] getFaceNeighbors()
addTetElement
public void addTetElement(TetElement e)
removeTetElement
public boolean removeTetElement(TetElement e)
clearTetElements
public void clearTetElements()
numTetElements
public int numTetElements()
getTetElement
public TetElement getTetElement(int i)
tesselate
public TetElement[] tesselate(int parity)
renderWidget
public void renderWidget(GLRenderer renderer,
double size,
RenderProps props)
- Overrides:
renderWidget
in class FemElement3d
computeVolume
public static double computeVolume(FemNode3d n1,
FemNode3d n2,
FemNode3d n3,
FemNode3d n4,
FemNode3d n5,
FemNode3d n6,
FemNode3d n7,
FemNode3d n8)
isInsideRobust
public boolean isInsideRobust(Point3d pnt)
isInside
public boolean isInside(Point3d pnt)
- Tests whether or not a point is inside an element.
Note: this routine divides the element into a
set of Tets, making the assumption that faces
are piece-wise planes. This isn't technically
correct. Do avoid potential gaps between adjacent elements,
we split the hex in all possible ways
- Overrides:
isInside
in class FemElement3d
- Parameters:
pnt
- point to check if is inside
- Returns:
- true if point is inside the element
getQuadFaces
public FaceNodes3d[] getQuadFaces()
setNeighborParities
public int setNeighborParities()
- Rescursively sets the partities of a nodes neighbors, starting with this
element, so as to try and obtain conforming tesselation. Returns the
number of elements, if any, whose parity code not be set properly.
setParities
public static void setParities(java.util.List<HexElement> hexes)
hasEdge
public boolean hasEdge(FemNode3d n0,
FemNode3d n1)
- Overrides:
hasEdge
in class FemElement3d
hasFace
public boolean hasFace(FemNode3d n0,
FemNode3d n1,
FemNode3d n2,
FemNode3d n3)
- Overrides:
hasFace
in class FemElement3d
copy
public HexElement copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
- Description copied from interface:
CopyableComponent
- Create a copy of this component. If
COPY_REFERENCES
is set in flags
, then any component referenced
by this component should itself be set to a copy. This
should be done first checking copyMap
for an
existing copy of the referenced component. If there is no existing
copy, then a copy should be created by calling copy
recursively and adding the new copy to copyMap
.
- Specified by:
copy
in interface CopyableComponent
- Overrides:
copy
in class FemElement3d
createHexIntegrationCoords
public static double[] createHexIntegrationCoords(double[] locs,
double[] wgts)
- Computes hexahedral integration coordinates using a tensor product
of the supplied 1D quadrature rule.
- Parameters:
locs
- 1D locations in [-1 1]wgts
- associated weights
- Returns:
- double array with [x1,y1,z1,w1, x2,y2,z2,w1, ...]
mapIPointsToNodes
public static boolean mapIPointsToNodes(IntegrationPoint3d[] ipnts,
double[] nodalInterp,
FemNode3d[] nodes)
mapICoordsToNodes
public static boolean mapICoordsToNodes(double[] coords)