public abstract class FemElement extends RenderableComponentBase implements Boundable, ScalableUnits, CopyableComponent, PropertyChangeListener, HasNumericState
| Modifier and Type | Class and Description |
|---|---|
static class |
FemElement.ElementClass
Describes the different element types.
|
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
static boolean |
setScannedNodesInPostscan |
static boolean |
writeNodeRefsByNumber |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesCOPY_REFERENCES, REST_POSITIONTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
FemElement() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAugmentingMaterial(FemMaterial mat) |
void |
addAuxiliaryMaterial(AuxiliaryMaterial mat) |
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.
|
abstract double |
computeRestVolumes()
Computes the rest volume associated with this element and stores the
result in the
myRestVolume field. |
abstract double |
computeVolumes()
Computes the volume associated with this element and stores the result in
the
myVolume field. |
boolean |
containsNode(FemNode p) |
FemElement |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
boolean |
defaultRenderPropsAreNull() |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
java.util.ArrayList<FemMaterial> |
getAugmentingMaterials() |
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.
|
double |
getDensity() |
PropertyMode |
getDensityMode() |
FemMaterial |
getEffectiveMaterial() |
abstract FemElement.ElementClass |
getElementClass() |
FemModel3d |
getFemModel() |
void |
getHardReferences(java.util.List<ModelComponent> refs)
Appends all hard references for this component to a list.
|
int |
getIndex() |
int |
getLocalNodeIndex(FemNode p) |
boolean |
getMarkerCoordinates(VectorNd coords,
Vector3d ncoords,
Point3d pnt,
boolean checkInside) |
double |
getMass() |
FemMaterial |
getMaterial() |
abstract FemNode[] |
getNodes() |
Matrix3d |
getPlasticDeformation() |
Point3d |
getPoint(int idx)
Returns the
idx-th point associated with this element. |
double |
getRestVolume() |
void |
getSelection(java.util.LinkedList<java.lang.Object> list,
int qid)
Append to
list the component (or components) associated with
the qid-th selection query issued by this component's render
method. |
int |
getStateVersion()
Returns a version number for this component's state.
|
double |
getStrainEnergy()
Returns the most recently computed strain energy for this element.
|
double |
getVolume()
Returns the most recently computed volume for this element, as determined
by computeVolume().
|
boolean |
hasActiveNodes()
Returns true if at least one node in this element is active
|
boolean |
hasControllableNodes()
Returns true if at least one node in this element is controllable
|
boolean |
hasState()
Queries if this component has state.
|
boolean |
integrationPointsInterpolateToNodes()
Queries whether there is an interpolation mapping between integration points
and nodes.
|
boolean |
integrationPointsMapToNodes()
Queries whether there is a one-to-one mapping between integration points
and nodes.
|
void |
invalidateMassIfNecessary() |
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 |
isDuplicatable()
Returns true if this component can be duplicated.
|
boolean |
isInverted()
Returns true if this element has been marked as inverted by the FEM code.
|
boolean |
isLinear()
Returns true if the shape functions for this element are linear or
multilinear.
|
boolean |
isMassExplicit()
Queries whether the mass for this element has been explicitly set.
|
boolean |
materialsAreInvertible()
Queries if the effective material for this element, and all auxiliary
materials, are defined for non-positive deformation gradients.
|
abstract void |
notifyStateVersionChanged() |
int |
numAugmentingMaterials() |
int |
numAuxiliaryMaterials() |
java.lang.String |
numberString()
Returns a string giving the node numbers associated with this element.
|
int |
numNodes() |
int |
numPoints()
Returns the number of points associated with this element, if any, or
zero otherwise.
|
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
propertyChanged(PropertyChangeEvent e) |
boolean |
removeAugmentingMaterial(FemMaterial mat) |
boolean |
removeAuxiliaryMaterial(AuxiliaryMaterial mat) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer. |
abstract void |
render(Renderer renderer,
RenderProps rprops,
int flags) |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
setDensity(double p) |
void |
setDensityMode(PropertyMode mode) |
void |
setExplicitMass(double mass)
Sets the mass for this element to an explicit value.
|
void |
setIndex(int idx) |
void |
setInverted(boolean inverted)
Used by the internal FEM code to mark whether or not this element is
inverted.
|
void |
setMass(double m) |
<T extends FemMaterial> |
setMaterial(T mat) |
void |
setPlasticDeformation(Matrix3d F0) |
void |
unsetExplicitMass()
Unsets an explicit mass for this element.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
void |
updateRestVolumeAndMass() |
getRenderHints, getRenderProps, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectToHierarchy, disconnectFromHierarchy, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writeadvanceState, getAuxVarDerivative, getAuxVarState, getState, numAuxVars, requiresAdvance, setAuxVarState, setStatepublic static boolean writeNodeRefsByNumber
public static boolean setScannedNodesInPostscan
public static PropertyList myProps
public abstract FemElement.ElementClass getElementClass()
public boolean isLinear()
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class RenderableComponentBasepublic FemMaterial getMaterial()
public <T extends FemMaterial> void setMaterial(T mat)
public FemMaterial getEffectiveMaterial()
public FemModel3d getFemModel()
public void addAugmentingMaterial(FemMaterial mat)
public boolean removeAugmentingMaterial(FemMaterial mat)
public int numAugmentingMaterials()
public java.util.ArrayList<FemMaterial> getAugmentingMaterials()
public boolean materialsAreInvertible()
true if the materials associated with this
element are invertiblepublic void setPlasticDeformation(Matrix3d F0)
public Matrix3d getPlasticDeformation()
public double getMass()
public void setMass(double m)
public boolean isMassExplicit()
public void setExplicitMass(double mass)
mass - explicit mass valuepublic void unsetExplicitMass()
public void invalidateMassIfNecessary()
public void setDensity(double p)
public double getDensity()
public void setDensityMode(PropertyMode mode)
public PropertyMode getDensityMode()
public int numNodes()
public boolean integrationPointsMapToNodes()
true if there is a one-to-one mapping between
integration points and nodespublic boolean integrationPointsInterpolateToNodes()
true if there is an interpolation mapping between
integration points and nodespublic abstract FemNode[] getNodes()
public int getLocalNodeIndex(FemNode p)
public boolean containsNode(FemNode p)
public double getVolume()
public double getStrainEnergy()
computeStrainEnergy, which can be set using
FemModel.setComputeStrainEnergy(boolean).public abstract double computeVolumes()
myVolume field.
The method should return the minimum Jacobian determinant ratio (det(J)/det(J0)) over all integration points. A negative value indicates that the element is "inverted" at one or more integration points.
public void invalidateRestData()
public double getRestVolume()
public void updateRestVolumeAndMass()
public abstract double computeRestVolumes()
myRestVolume field.
The method should return the minimum Jacobian determinant (det(J0)) over all integration points. A negative value indicates that the element is "inverted" in its rest position at one or more integration points.
public boolean defaultRenderPropsAreNull()
defaultRenderPropsAreNull in class RenderableComponentBasepublic RenderProps createRenderProps()
HasRenderPropscreateRenderProps in interface HasRenderPropscreateRenderProps in class RenderableComponentBasepublic void prerender(RenderList list)
IsRenderablelist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class RenderableComponentBaselist - list of objects to be renderedpublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface BoundableupdateBounds in interface IsRenderableupdateBounds in class RenderableComponentBasepmin - minimum pointpmax - maximum pointpublic abstract void render(Renderer renderer, RenderProps rprops, int flags)
public void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class RenderableComponentBaserenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT and
Renderer.SORT_FACES.public void getSelection(java.util.LinkedList<java.lang.Object> list,
int qid)
IsSelectablelist the component (or components) associated with
the qid-th selection query issued by this component's render
method. This will only be called if this component manages its own
selection (i.e., the number nums returned by IsSelectable.numSelectionQueriesNeeded() is positive), and qid will in
turn be a number between 0 and nums-1.getSelection in interface IsSelectablegetSelection in class RenderableComponentBaselist - selected objects are appended to the end of this listqid - index of the selection querypublic void scaleDistance(double s)
ScalableUnitsscaleDistance in interface ScalableUnitss - scaling factorpublic void scaleMass(double s)
ScalableUnitsscaleMass in interface ScalableUnitss - scaling factorpublic java.lang.String numberString()
public void setInverted(boolean inverted)
inverted - if true, marks this element as inverted.public boolean isInverted()
public boolean getMarkerCoordinates(VectorNd coords, Vector3d ncoords, Point3d pnt, boolean checkInside)
public boolean hasActiveNodes()
public boolean hasControllableNodes()
public boolean isDuplicatable()
true if and only if CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent) returns true.
This method is not currently used. It is intended to provide a faster
way of determining if a component can be duplicated, without having to
use CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent) to build the list of copy references.
isDuplicatable in interface CopyableComponenttrue if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true if and only if CopyableComponent.isDuplicatable() returns
true.getCopyReferences in interface CopyableComponentrefs - list to which references are appendedancestor - root node of the hierarchy from which references are to be excludedpublic int getIndex()
public void setIndex(int idx)
public void getHardReferences(java.util.List<ModelComponent> refs)
getHardReferences in interface ModelComponentgetHardReferences in class ModelComponentBaserefs - list to which hard references are appendedpublic FemElement copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponentCOPY_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 CopyableComponentcopy in class RenderableComponentBaseflags - flags to control the copyingcopyMap - map to possible existing instances of referenced
componentspublic void propertyChanged(PropertyChangeEvent e)
propertyChanged in interface PropertyChangeListenerpublic void computeCentroid(Vector3d centroid)
BoundablecomputeCentroid in interface Boundablecentroid - returns the computed centroid value.public double computeCovariance(Matrix3d C)
Boundableint_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 BoundableC - returns the covariancepublic int numPoints()
Boundablepublic Point3d getPoint(int idx)
Boundableidx-th point associated with this element.getPoint in interface Boundableidx - index of the point (must be on the range 0 to
Boundable.numPoints()).idx-th point associated with this element.
Must not be modified.public void addAuxiliaryMaterial(AuxiliaryMaterial mat)
public boolean removeAuxiliaryMaterial(AuxiliaryMaterial mat)
public int numAuxiliaryMaterials()
public AuxiliaryMaterial[] getAuxiliaryMaterials()
public boolean hasState()
ModelComponenthasState in interface HasNumericStatehasState in interface ModelComponenthasState in class ModelComponentBasetrue if this component has statepublic abstract void notifyStateVersionChanged()
public int getStateVersion()
HasNumericStategetStateVersion in interface HasNumericState