public abstract class FemElement3d extends FemElement implements Boundable, PointAttachable, FrameAttachable
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
COPY_REFERENCES
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
FemElement3d() |
Modifier and Type | Method and Description |
---|---|
void |
addAuxiliaryMaterial(AuxiliaryMaterial mat) |
void |
addNodeForce(Vector3d f,
int i,
boolean corotated)
Deprecated.
|
void |
addNodeStiffness(int i,
int j,
boolean corotated)
Deprecated.
|
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 |
computeJacobian(Vector3d s,
Matrix3d J) |
void |
computePosition(Point3d pnt,
Vector3d coords)
Compute position within element based on natural coordinates
|
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(Matrix3d F,
SymmetricMatrix3d P)
Deprecated.
|
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) |
FrameFem3dAttachment |
createFrameAttachment(Frame frame,
RigidTransform3d TFW)
Returns a FrameAttachment that attaches a
frame to this
component. |
static IntegrationPoint3d[] |
createIntegrationPoints(FemElement3d exampleElem,
double[] cdata) |
PointAttachment |
createPointAttachment(Point pnt)
Returns a PointAttachment that attaches
pnt
to this component. |
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() |
FaceNodes3d[] |
getFaces()
Returns an array of FaceNodes3d describing a set of faces
associated with this element.
|
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() |
double[] |
getLagrangePressures()
Lagrange pressures array for use with incompressibility
|
boolean |
getMarkerCoordinates(VectorNd coords,
Point3d pnt,
boolean checkInside) |
abstract double |
getN(int i,
Vector3d coords) |
boolean |
getNaturalCoordinates(Vector3d coords,
Point3d pnt)
Calls
getNaturalCoordinates(Vector3d,Point3d,int)
with a default maximum number of interations. |
int |
getNaturalCoordinates(Vector3d coords,
Point3d pnt,
int maxIters)
Given point p, get its natural coordinates with respect to this element.
|
int |
getNaturalCoordinatesGSS(Vector3d coords,
Point3d pnt,
int maxIters)
Given point p, get its natural coordinates with respect to this element.
|
boolean |
getNaturalCoordinatesOld(Vector3d coords,
Point3d pnt,
int maxIters) |
int |
getNaturalCoordinatesStd(Vector3d coords,
Point3d pnt,
int maxIters) |
abstract double[] |
getNodalExtrapolationMatrix() |
abstract double[] |
getNodeCoords() |
void |
getNodeCoords(Vector3d coords,
int nodeIdx) |
FemNodeNeighbor[][] |
getNodeNeighbors() |
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.
|
double[] |
getRestVolumes()
Volumes array for use with incompressibility
|
StiffnessWarper3d |
getStiffnessWarper()
Retrieves the current stiffness warper.
|
double[] |
getVolumes()
Volumes array for use with incompressibility
|
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()
Queries 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) |
abstract void |
renderWidget(Renderer renderer,
double size,
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) |
void |
setStiffnessWarper(StiffnessWarper3d warper)
Explicitly sets a stiffness warper
|
FemNode3d[][] |
triangulateFace(FaceNodes3d face) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
containsNode, createRenderProps, getDensity, getDensityMode, getEffectiveMaterial, getHardReferences, getIndex, getLocalNodeIndex, getMass, getMaterial, getRestVolume, getSelection, getVolume, hasActiveNodes, hasControllableNodes, integrationPointsInterpolateToNodes, integrationPointsMapToNodes, isDuplicatable, isInverted, isMassExplicit, numberString, numNodes, prerender, propertyChanged, render, render, scaleMass, setDensity, setDensityMode, setIndex, setInverted, setMass, setMassExplicit, setMaterial, updateRestVolumeAndMass
getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
public static PropertyList myProps
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 FemNodeNeighbor[][] getNodeNeighbors()
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 insidepublic boolean isInvertedAtRest()
public int getNumEdges()
public int getNumFaces()
public FaceNodes3d[] getFaces()
public FemNode3d[][] triangulateFace(FaceNodes3d face)
public void computeCentroid(Vector3d centroid)
Boundable
computeCentroid
in interface Boundable
centroid
- returns the computed centroid value.public void computePosition(Point3d pnt, Vector3d coords)
pnt
- populated position within elementcoords
- natural coordinatespublic 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 covariancepublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface Boundable
updateBounds
in interface IsRenderable
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 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 boolean getMarkerCoordinates(VectorNd coords, Point3d pnt, boolean checkInside)
getMarkerCoordinates
in class FemElement
public abstract double[] getNodeCoords()
public void getNodeCoords(Vector3d coords, int nodeIdx)
public boolean getNaturalCoordinates(Vector3d coords, Point3d pnt)
getNaturalCoordinates(Vector3d,Point3d,int)
with a default maximum number of interations.coords
- Outputs the natural coordinates, and supplies (on input) an initial
guess as to their position.pnt
- A given point (in world coords)public int getNaturalCoordinates(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 (in world coords)maxIters
- Maximum number of Newton iterationspublic int getNaturalCoordinatesGSS(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 (in world coords)maxIters
- Maximum number of Newton iterationspublic int getNaturalCoordinatesStd(Vector3d coords, Point3d pnt, int maxIters)
public boolean getNaturalCoordinatesOld(Vector3d coords, Point3d pnt, int maxIters)
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 double[] getVolumes()
public void computePressures(double[] pressures, IncompressibleMaterial imat)
public double[] getLagrangePressures()
public double computeRestVolumes()
public double[] getRestVolumes()
@Deprecated public void addNodeStiffness(int i, int j, boolean corotated)
@Deprecated public void addNodeForce(Vector3d f, int i, boolean corotated)
public void setStiffnessWarper(StiffnessWarper3d warper)
warper
- new stiffness warper to usepublic StiffnessWarper3d getStiffnessWarper()
public boolean materialsAreInvertible()
true
if the materials associated with this
element are invertible@Deprecated public void computeWarping(Matrix3d F, SymmetricMatrix3d P)
public abstract void renderWidget(Renderer renderer, double size, RenderProps props)
public double computeDirectedRenderSize(Vector3d dir)
public void computeRenderCoordsAndGradient(Matrix3d F, float[] coords)
F
- returns the deformation gradientcoords
- returns the current coordinatespublic void addAuxiliaryMaterial(AuxiliaryMaterial mat)
public boolean removeAuxiliaryMaterial(AuxiliaryMaterial mat)
public int numAuxiliaryMaterials()
public AuxiliaryMaterial[] getAuxiliaryMaterials()
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 excludedpublic 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
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
componentspublic VectorNd computeGravityWeights()
public static FemElement3d createElement(FemNode3d[] nodes, boolean flipped)
public static FemElement3d createElement(FemNode3d[] nodes)
public PointAttachment createPointAttachment(Point pnt)
PointAttachable
pnt
to this component. It should not be assumed that pnt
is currently connected to the component hierarchy, and no attempt
should be made to connect the returned attachment to the hierarchy;
the latter, if desired, is the responsibility of the caller.
In some cases, it may not be possible to attach the point at its present location. In that case, the method will create an attachment to the nearest feasible location.
createPointAttachment
in interface PointAttachable
pnt
- point for which an attachment should be createdpnt
to this componentpublic FrameFem3dAttachment createFrameAttachment(Frame frame, RigidTransform3d TFW)
frame
to this
component. Once attached the frame will follow the body around. The
initial pose of the frame is specified by TFW
, which gives
its position and orientation in world coordinates. If TFW
is
null
, then the current pose of the frame is used. If
frame
is null
, then a virtual attachment is
created at the initial pose specified by
TFW
. frame
and TFW
cannot both be
null
.
In some cases, it may not be possible to attach the frame at the requested location. In that case, the method will relocate the frame to the nearest feasible attachment location.
createFrameAttachment
in interface FrameAttachable
frame
- frame to be attachedTFW
- transform from (initial) frame coordinates to world
coordinatesframe
to this componentpublic int numPoints()
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.