|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.RenderableComponentBase
artisynth.core.femmodels.FemElement
artisynth.core.femmodels.FemElement3d
public abstract class FemElement3d
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent |
---|
ModelComponent.NavpanelVisibility |
Field Summary | |
---|---|
static PropertyList |
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 | |
---|---|
FemElement3d()
|
Method Summary | |
---|---|
void |
addAuxiliaryMaterial(AuxiliaryMaterial mat)
|
void |
addNodeForce(Vector3d f,
int i,
boolean corotated)
|
void |
addNodeForce0(Vector3d f,
int i,
boolean corotated)
|
void |
addNodeForce0(VectorNd f,
int offset,
int i,
boolean corotated)
|
void |
addNodeStiffness(int i,
int j,
boolean corotated)
|
void |
addNodeStiffness(Matrix3d Kij,
int i,
int j,
boolean corotated)
|
void |
clearState()
|
void |
computeCentroid(Vector3d centroid)
Computed the centroid of this element. |
double |
computeCovariance(Matrix3d C)
Computes the covariance of the element, assuming a uniform density of one. |
double |
computeDirectedRenderSize(Vector3d dir)
|
VectorNd |
computeGravityWeights()
|
void |
computePressures(double[] pressures,
IncompressibleMaterial imat)
|
void |
computeRenderCoordsAndGradient(Matrix3d F,
float[] coords)
Computes the current coordinates and deformation gradient at the warping point, using render coordinates. |
double |
computeRestVolumes()
Default method to compute the element rest volume and partial volumes. |
double |
computeVolumes()
Default method to compute an element's volume and partial volumes. |
void |
computeWarping()
|
void |
computeWarping(Matrix3d F,
SymmetricMatrix3d P)
|
void |
connectToHierarchy()
Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent). |
abstract boolean |
coordsAreInside(Vector3d coords)
|
FemElement3d |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component. |
static FemElement3d |
createElement(FemNode3d[] nodes)
|
static FemElement3d |
createElement(FemNode3d[] nodes,
boolean flipped)
|
static IntegrationPoint3d[] |
createIntegrationPoints(FemElement3d exampleElem,
double[] cdata)
|
void |
disconnectFromHierarchy()
Called by the system after this component is removed from the component hierarchy (i.e., when it is removed as a child of its parent). |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by this object. |
AuxiliaryMaterial[] |
getAuxiliaryMaterials()
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to duplicate this component. |
abstract void |
getdNds(Vector3d dNds,
int i,
Vector3d coords)
|
abstract int[] |
getEdgeIndices()
|
double |
getElementWidgetSize()
|
PropertyMode |
getElementWidgetSizeMode()
|
abstract int[] |
getFaceIndices()
|
Matrix3d |
getFrame()
|
double |
getH(int i,
Vector3d coords)
Returns the value of the pressure shape function. |
MatrixBlock[] |
getIncompressConstraints()
Returns an array of MatrixBlocks to be used as constraints to make the element incompressible. |
int |
getIncompressIndex()
|
abstract double[] |
getIntegrationCoords()
|
IntegrationData3d[] |
getIntegrationData()
|
abstract IntegrationPoint3d[] |
getIntegrationPoints()
|
void |
getMarkerCoordinates(VectorNd coords,
Point3d pnt)
|
abstract double |
getN(int i,
Vector3d coords)
|
boolean |
getNaturalCoordinates(Vector3d coords,
Point3d pnt)
Given point p, get its natural coordinates with respect to this element. |
boolean |
getNaturalCoordinatesRobust(Vector3d coords,
Point3d pnt,
int maxIters)
Given point p, get its natural coordinates with respect to this element. |
abstract double[] |
getNodalExtrapolationMatrix()
|
abstract double[] |
getNodeCoords()
|
void |
getNodeCoords(Vector3d coords,
int nodeIdx)
|
FemNode3d[] |
getNodes()
|
int |
getNumEdges()
|
int |
getNumFaces()
|
Point3d |
getPoint(int idx)
Returns the idx -th point associated with this element. |
Matrix |
getPressureWeightMatrix()
Returns the pressure weight matrix for this element. |
FaceNodes3d[] |
getTriFaces()
Returns an array of FaceNodes3d describing a set of triangular faces associated with this element. |
IntegrationData3d |
getWarpingData()
|
abstract IntegrationPoint3d |
getWarpingPoint()
|
boolean |
hasEdge(FemNode3d n0,
FemNode3d n1)
|
boolean |
hasFace(FemNode3d n0,
FemNode3d n1,
FemNode3d n2)
|
boolean |
hasFace(FemNode3d n0,
FemNode3d n1,
FemNode3d n2,
FemNode3d n3)
|
void |
invalidateRestData()
Invalidate data that relies on the element's rest position, such as rest Jacobians and the base stiffness for co-rotated stiffness. |
boolean |
isInside(Point3d pnt)
Tests whether or not a point is inside an element. |
boolean |
isInvertedAtRest()
Returns true if the rest position for this element results in a negative Jacobian determinant for at least one integration point. |
boolean |
materialsAreInvertible()
Return true if the effective material for this element, and all auxiliary materials, are defined for non-positive deformation gradients. |
int |
numAuxiliaryMaterials()
|
abstract int |
numIntegrationPoints()
|
int |
numPoints()
Returns the number of points associated with this element, if any, or zero otherwise. |
int |
numPressureVals()
Returns the number of pressure variables associated with this element. |
boolean |
removeAuxiliaryMaterial(AuxiliaryMaterial mat)
|
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL. |
void |
render(GLRenderer renderer,
RenderProps rprops,
int flags)
|
void |
renderEdges(GLRenderer renderer,
RenderProps props)
|
void |
renderWidget(GLRenderer renderer,
double scale,
int[] trifaces,
RenderProps props)
Helper method to render an element widget by drawing a set of triangular faces formed from the element nodes. |
void |
renderWidget(GLRenderer renderer,
double size,
RenderProps props)
|
void |
renderWidget(GLRenderer renderer,
RenderProps props)
|
void |
renderWidgetEdges(GLRenderer renderer,
double size,
RenderProps props)
|
void |
renderWidgetEdges(GLRenderer renderer,
RenderProps props)
|
void |
scaleDistance(double s)
Scales all distance coordinates. |
void |
setElementWidgetSize(double size)
|
void |
setElementWidgetSizeMode(PropertyMode mode)
|
void |
setFrame(Matrix3dBase M)
Set reference frame information for this element. |
void |
setIncompressIndex(int idx)
|
FemNode3d[][] |
triangulateFace(FaceNodes3d face)
|
void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object. |
void |
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, isInverted, 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 |
Field Detail |
---|
public static PropertyList myProps
Constructor Detail |
---|
public FemElement3d()
Method Detail |
---|
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class FemElement
public void setElementWidgetSize(double size)
public double getElementWidgetSize()
public void setElementWidgetSizeMode(PropertyMode mode)
public PropertyMode getElementWidgetSizeMode()
public FemNode3d[] getNodes()
getNodes
in class FemElement
public int getIncompressIndex()
public void setIncompressIndex(int idx)
public int numPressureVals()
public double getH(int i, Vector3d coords)
i
- index of the pressure variable; should be less
than the value returned by numPressureVals()
coords
- coordinates at which the shape function should
be evaluated.public Matrix getPressureWeightMatrix()
By default, this method returns a pressure weight matrix for the case where there is only one pressure value. Such matrices always have a single value of 1. Elements with a larger number of pressure values should override this method to return a pressure weight matrix appropriate for that element.
public MatrixBlock[] getIncompressConstraints()
There is one block for each node, with each of size 3 x m, where m is
the number of pressure degrees-of-freedom (returned by
numPressureVals()
.
public boolean isInside(Point3d pnt)
pnt
- point to check if is inside
public boolean isInvertedAtRest()
public int getNumEdges()
public int getNumFaces()
public FaceNodes3d[] getTriFaces()
public FemNode3d[][] triangulateFace(FaceNodes3d face)
public void computeCentroid(Vector3d centroid)
Boundable
computeCentroid
in interface Boundable
centroid
- returns the computed centroid value.public double computeCovariance(Matrix3d C)
Boundable
int_V \rho x x^T dV,where
\rho
is the density, x
is any
spatial point within the element, and the integral is evaluated
over the element's spatial extent. The method returns the element's
spatial size, which for elements of dimension 3, 2, 1, or 0 will
be a volume, area, length, or discrete value.
Implementation of this method is optional, with non-implementation indicated by having the method return -1. Non-implementation may prevent the element from being enclosed within certain types of oriented bounding box (OBB) constructions.
computeCovariance
in interface Boundable
C
- returns the covariance
public void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface Boundable
updateBounds
in interface GLRenderable
updateBounds
in class FemElement
pmin
- minimum pointpmax
- maximum pointpublic abstract int numIntegrationPoints()
public abstract double[] getIntegrationCoords()
public abstract double[] getNodalExtrapolationMatrix()
public abstract double getN(int i, Vector3d coords)
public abstract void getdNds(Vector3d dNds, int i, Vector3d coords)
public abstract IntegrationPoint3d[] getIntegrationPoints()
public abstract IntegrationPoint3d getWarpingPoint()
public abstract int[] getEdgeIndices()
public abstract int[] getFaceIndices()
public IntegrationData3d[] getIntegrationData()
public void clearState()
public IntegrationData3d getWarpingData()
public static IntegrationPoint3d[] createIntegrationPoints(FemElement3d exampleElem, double[] cdata)
public void connectToHierarchy()
ModelComponentBase
When this method is called, ModelComponent.getParent()
will return
the new parent component; the system will have set this beforehand.
connectToHierarchy
in interface ModelComponent
connectToHierarchy
in class ModelComponentBase
public void invalidateRestData()
FemElement
invalidateRestData
in class FemElement
public void disconnectFromHierarchy()
ModelComponentBase
When this
method is called, ModelComponent.getParent()
will still return this original
parent component; the system will set this to null
after.
disconnectFromHierarchy
in interface ModelComponent
disconnectFromHierarchy
in class ModelComponentBase
public abstract boolean coordsAreInside(Vector3d coords)
public void getMarkerCoordinates(VectorNd coords, Point3d pnt)
getMarkerCoordinates
in class FemElement
public abstract double[] getNodeCoords()
public void getNodeCoords(Vector3d coords, int nodeIdx)
public boolean getNaturalCoordinates(Vector3d coords, Point3d pnt)
coords
argument that returned the coordinates is
used, on input, to supply an initial guess of the coordinates.
Zero is generally a safe guess.
coords
- Outputs the natural coordinates, and supplies (on input) an initial
guess as to their position.pnt
- A given point.
public boolean getNaturalCoordinatesRobust(Vector3d coords, Point3d pnt, int maxIters)
coords
argument that returned the coordinates is
used, on input, to supply an initial guess of the coordinates.
Zero is generally a safe guess.
coords
- Outputs the natural coordinates, and supplies (on input) an initial
guess as to their position.pnt
- A given point.maxIters
- Maximum number of Newton iterations
public double computeVolumes()
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.
computeVolumes
in class FemElement
public void computePressures(double[] pressures, IncompressibleMaterial imat)
public double computeRestVolumes()
public void addNodeStiffness(Matrix3d Kij, int i, int j, boolean corotated)
public void addNodeStiffness(int i, int j, boolean corotated)
public void addNodeForce(Vector3d f, int i, boolean corotated)
public void addNodeForce0(Vector3d f, int i, boolean corotated)
public void addNodeForce0(VectorNd f, int offset, int i, boolean corotated)
public void updateWarpingStiffness()
public boolean materialsAreInvertible()
public void computeWarping()
computeWarping
in class FemElement
public void computeWarping(Matrix3d F, SymmetricMatrix3d P)
public void renderWidget(GLRenderer renderer, double scale, int[] trifaces, RenderProps props)
public void renderWidget(GLRenderer renderer, RenderProps props)
public void renderWidget(GLRenderer renderer, double size, RenderProps props)
public double computeDirectedRenderSize(Vector3d dir)
public void computeRenderCoordsAndGradient(Matrix3d F, float[] coords)
public void render(GLRenderer renderer, RenderProps rprops, int flags)
render
in class FemElement
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
render
in class FemElement
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public boolean hasEdge(FemNode3d n0, FemNode3d n1)
public boolean hasFace(FemNode3d n0, FemNode3d n1, FemNode3d n2)
public boolean hasFace(FemNode3d n0, FemNode3d n1, FemNode3d n2, FemNode3d n3)
public void addAuxiliaryMaterial(AuxiliaryMaterial mat)
public boolean removeAuxiliaryMaterial(AuxiliaryMaterial mat)
public int numAuxiliaryMaterials()
public AuxiliaryMaterial[] getAuxiliaryMaterials()
public void renderEdges(GLRenderer renderer, RenderProps props)
public void renderWidgetEdges(GLRenderer renderer, RenderProps props)
public void renderWidgetEdges(GLRenderer renderer, double size, RenderProps props)
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class FemElement
s
- scaling factorpublic boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true
if and only if CopyableComponent.isDuplicatable()
returns
true.
getCopyReferences
in interface CopyableComponent
getCopyReferences
in class FemElement
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excluded
public void setFrame(Matrix3dBase M)
M
to null
removes the frame information.
M
- frame information (is copied by the method)public Matrix3d getFrame()
public FemElement3d copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponent
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
.
copy
in interface CopyableComponent
copy
in class FemElement
public VectorNd computeGravityWeights()
public static FemElement3d createElement(FemNode3d[] nodes, boolean flipped)
public static FemElement3d createElement(FemNode3d[] nodes)
public int numPoints()
Boundable
numPoints
in interface Boundable
public Point3d getPoint(int idx)
Boundable
idx
-th point associated with this element.
getPoint
in interface Boundable
idx
- index of the point (must be on the range 0 to
Boundable.numPoints()
).
idx
-th point associated with this element.
Must not be modified.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |