public class FemModel3d extends FemModel implements TransformableGeometry, ScalableUnits, MechSystemModel, Collidable, CopyableComponent, HasAuxState, HasSurfaceMesh, PointAttachable, ConnectableBody
FemModel.ElementFilter, FemModel.IncompMethod, FemModel.Ranging, FemModel.SurfaceRender
MechSystem.ConstraintInfo, MechSystem.FrictionInfo
Collidable.Collidability, Collidable.Group
HasAuxState.StateContext
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static boolean |
abortOnInvertedElems |
static boolean |
checkTangentStability |
static FemModel.IncompMethod |
DEFAULT_HARD_INCOMP |
static FemModel.IncompMethod |
DEFAULT_SOFT_INCOMP |
static java.lang.String |
DEFAULT_SURFACEMESH_NAME |
static boolean |
defaultAutoGenerateSurface |
static double |
detJStepReductionLimit |
static double |
frameMassFraction |
static PropertyList |
myProps |
static boolean |
noIncompressStiffnessDamping |
static boolean |
useFrameRelativeCouplingMasses |
myParametricsInSystemMatrix
DEFAULT_NAVPANEL_DISPLAY
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
COMPUTE_CONTACTS, UPDATE_CONTACTS
All, AllBodies, Deformable, Rigid, Self
COPY_REFERENCES
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
FemModel3d() |
FemModel3d(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb) |
void |
addConnector(BodyConnector c) |
void |
addElement(FemElement3d e) |
void |
addElements(java.util.Collection<? extends FemElement3d> elems) |
void |
addGeneralMassBlocks(SparseBlockMatrix M) |
void |
addMarker(FemMarker mkr)
Adds a marker to this FemModel.
|
FemMarker |
addMarker(Point3d pos)
Creates and adds a marker to this FemModel.
|
FemMarker |
addMarker(Point3d pos,
boolean project)
Creates and adds a marker to this FemModel.
|
void |
addMaterialBundle(AuxMaterialBundle bundle) |
FemMeshComp |
addMesh(MeshBase mesh) |
FemMeshComp |
addMesh(java.lang.String name,
MeshBase mesh) |
void |
addMeshComp(FemMeshComp surf) |
void |
addNode(FemNode3d p) |
void |
addNodes(java.util.Collection<? extends FemNode3d> nodes) |
void |
addNumberedElement(FemElement3d e,
int elemId) |
FemMarker |
addNumberedMarker(Point3d pos,
boolean project,
int markerId) |
FemMarker |
addNumberedMarker(Point3d pos,
int markerId) |
void |
addNumberedNode(FemNode3d p,
int number) |
void |
addPosJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the position Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
addSolveBlocks(SparseNumberedBlockMatrix S)
Adds any needed blocks to a solve matrix in order to accomodate the
Jacobian terms associated with this force effector.
|
void |
addTransformableDependencies(TransformGeometryContext context,
int flags)
Adds to
context any transformable components which should be
transformed as the same time as this component. |
void |
addVelJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the velocity Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
advanceAuxState(double t0,
double t1)
Called at the very beginning of the time step (in the system's
preadvance() method) to perform any required updating of the component's
state before the application in input probes or controllers.
|
void |
attachFrame(RigidTransform3d TRW) |
void |
clearElements() |
void |
clearMaterialBundles() |
void |
clearMeshComps() |
void |
componentChanged(ComponentChangeEvent e)
Notifies this composite component that a change has occured within one or
more of its descendants.
|
FemModel3d |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
static ColorMapBase |
createDefaultColorMap() |
FrameFem3dAttachment |
createFrameAttachment(Frame frame,
RigidTransform3d TFW)
Returns a FrameAttachment that attaches a
frame to this
component. |
FrameFem3dAttachment |
createFrameAttachment(Frame frame,
RigidTransform3d TFW,
boolean project)
Returns a FrameAttachment that attaches a
frame to this
component. |
PointAttachment |
createPointAttachment(Point pnt)
Returns a PointAttachment that attaches
pnt
to this component. |
PointAttachment |
createPointAttachment(Point pnt,
double reduceTol) |
SparseBlockMatrix |
createStiffnessMatrix() |
FemMeshComp |
createSurfaceMesh(FemModel.ElementFilter efilter) |
void |
dispose()
Called when the model is discarded.
|
FemElement3d |
findContainingElement(Point3d pnt)
Returns the element within an FEM that contains a specified
point, or
null if there is no such element. |
FemElement3d |
findNearestElement(Point3d loc,
Point3d pnt)
Returns the element within an FEM that contains a specified point, or if
there is no such element, finds the closest surface element.
|
FemNode3d |
findNearestNode(Point3d pnt,
double maxDist)
Finds the nearest node to a specified point that is within
a specified maximum distance.
|
FemElement3d |
findNearestSurfaceElement(Point3d loc,
Point3d pnt)
Returns the nearest surface element to a specified point,
which is found by projecting the point onto the FEM surface.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getAuxState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
void |
getAuxStateComponents(java.util.List<HasAuxState> comps,
int level) |
double |
getAxisLength() |
int |
getBilateralImpulses(VectorNd lam,
int idx) |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx) |
void |
getBilateralSizes(VectorNi sizes) |
FemNode3d |
getByNumber(int num)
Get the component with the specified number, or null if there is no such
component.
|
Collidable.Collidability |
getCollidable()
Returns the
Collidable.Collidability of this Collidable. |
Collidable |
getCollidableAncestor()
Returns the most immediate Collidable ancestor of this Collidable,
if any.
|
void |
getCollidables(java.util.List<Collidable> list,
int level) |
ColorMapBase |
getColorMap() |
PropertyMode |
getColorMapMode() |
java.util.List<BodyConnector> |
getConnectors() |
void |
getConstrainedComponents(java.util.List<DynamicComponent> list) |
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
void |
getDynamicComponents(java.util.List<DynamicComponent> active,
java.util.List<DynamicComponent> attached,
java.util.List<DynamicComponent> parametric) |
FemElement3d |
getElement(int idx) |
FemElement3d |
getElementByNumber(int num) |
java.util.LinkedList<FemElement3d> |
getElementNeighbors(FemNode3d node) |
RenderableComponentList<FemElement3d> |
getElements() |
double |
getElementWidgetSize() |
PropertyMode |
getElementWidgetSizeMode() |
FemModelFrame |
getFrame() |
FrameFem3dConstraint |
getFrameConstraint() |
FemModel.IncompMethod |
getHardIncompMethod() |
double |
getIncompCompliance() |
FemModel.IncompMethod |
getIncompressible() |
Range |
getIncompressibleRange() |
void |
getInitialAuxState(DataBuffer newData,
DataBuffer oldData)
Saves initial state information data for this component by adding data
to the supplied data buffer.
|
int |
getJacobianType()
Returns a code indicating the matrix type that results when the Jacobian
terms of this force effector are added to the solve matrix.
|
void |
getMassMatrixValues(SparseBlockMatrix M,
VectorNd f,
double t) |
RenderableComponentList<AuxMaterialBundle> |
getMaterialBundles() |
FemMeshComp |
getMeshComp(int idx) |
FemMeshComp |
getMeshComp(java.lang.String name) |
MeshComponentList<FemMeshComp> |
getMeshComps() |
void |
getNodalDeformationGradients(Matrix3d[] Fnodal) |
DoubleInterval |
getNodalPlotRange(FemModel.SurfaceRender rendering) |
FemNode3d |
getNode(int idx) |
java.util.LinkedList<FemNodeNeighbor> |
getNodeNeighbors(FemNode3d node) |
PointList<FemNode3d> |
getNodes() |
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. |
FemModel.IncompMethod |
getSoftIncompMethod() |
Range |
getSoftIncompMethodRange() |
FemElement3d |
getSurfaceElement(Face face) |
PolygonalMesh |
getSurfaceMesh()
Returns the surface mesh associated with this component, or
null if no mesh exists. |
FemMeshComp |
getSurfaceMeshComp() |
PolygonalMesh[] |
getSurfaceMeshes()
Returns an array listing all the (non-null) surface meshes associated
with this component, or a zero-length array if there are none.
|
FemNode3d |
getSurfaceNode(Vertex3d vtx)
Returns the FEM node (if any) associated with a specified
surface mesh vertex.
|
Vertex3d |
getSurfaceVertex(FemNode3d node)
Returns the surface mesh vertex (if any) associated with a specified
node.
|
void |
invalidateRestData() |
void |
invalidateStressAndStiffness() |
void |
invalidateSurfaceMesh() |
boolean |
isAbortOnInvertedElements() |
boolean |
isAutoGeneratingSurface() |
boolean |
isCompound()
Queries whether or not this collidable has sub-collidables.
|
boolean |
isDeformable()
Returns
true if this collidable is deformable. |
boolean |
isDuplicatable()
Returns true if this component can be duplicated.
|
boolean |
isFrameRelative() |
boolean |
isFreeBody() |
boolean |
isSurfaceMeshValid() |
boolean |
isSurfaceNode(FemNode3d node)
Returns true if a specified node lies on the surface mesh returned by
getSurfaceMesh() . |
boolean |
isVolumeValid() |
boolean |
isWarnOnInvertedElements() |
int |
markInvertedRestElements() |
void |
mulInverseMass(SparseBlockMatrix M,
VectorNd a,
VectorNd f) |
int |
numMeshComps() |
int |
numQuadraticElements() |
int |
numSurfaceMeshes()
Returns the number of surfaces meshes associated with this
component, or 0 if no meshes exist.
|
int |
numTetElements() |
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
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 |
printANSYSElements(java.io.PrintWriter pw)
Prints the elements of this FEM in a format which is compatible with
ANSYS.
|
void |
printANSYSNodes(java.io.PrintWriter pw)
Prints the nodes of this FEM in a format which is compatible with ANSYS.
|
void |
recursivelyFinalizeAdvance(StepAdjustment stepAdjust,
double t0,
double t1,
int flags,
int level) |
void |
recursivelyInitialize(double t,
int level) |
void |
removeConnector(BodyConnector c) |
boolean |
removeElement(FemElement3d e) |
boolean |
removeMaterialBundle(AuxMaterialBundle bundle) |
boolean |
removeMeshComp(FemMeshComp surf) |
boolean |
removeNode(FemNode3d p) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
resetRestPosition() |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
FemMeshComp |
scanMesh(ReaderTokenizer rtok) |
FemMeshComp |
scanMesh(java.lang.String fileName) |
FemMeshComp |
scanSurfaceMesh(ReaderTokenizer rtok) |
FemMeshComp |
scanSurfaceMesh(java.lang.String fileName) |
void |
setAbortOnInvertedElements(boolean set) |
void |
setAutoGenerateSurface(boolean val) |
void |
setAuxState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
void |
setAxisLength(double len) |
int |
setBilateralImpulses(VectorNd lam,
double h,
int idx) |
void |
setCollidable(Collidable.Collidability c) |
void |
setColorMap(ColorMapBase colorMap) |
void |
setColorMapMode(PropertyMode mode) |
void |
setComputeNodalStrain(boolean enable) |
void |
setComputeNodalStress(boolean enable) |
void |
setElementWidgetSize(double size) |
void |
setElementWidgetSizeMode(PropertyMode mode) |
void |
setFrameRelative(boolean enable) |
void |
setIncompCompliance(double c) |
void |
setIncompressible(FemModel.IncompMethod method) |
void |
setMaterial(FemMaterial mat) |
void |
setSoftIncompMethod(FemModel.IncompMethod method) |
FemMeshComp |
setSurfaceMesh(PolygonalMesh mesh) |
void |
setSurfaceMeshComp(FemMeshComp mesh) |
void |
setSurfaceRendering(FemModel.SurfaceRender mode) |
void |
setWarnOnInvertedElements(boolean set) |
void |
skipAuxState(DataBuffer data)
Skips over the state information for this component contained
in the supplied data buffer, starting at the current buffer offsets.
|
void |
subdivideHex(HexElement hex) |
void |
subdivideHexs(java.util.List<HexElement> hexs) |
void |
transformGeometry(AffineTransform3dBase X)
Applies an affine transformation to the geometry of this component.
|
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
void |
transformPose(RigidTransform3d T) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
double |
updateConstraints(double t,
int flags) |
void |
updateSlavePos()
Called when the system's dynamic position state changes, to update the
position state of the slave objects.
|
void |
updateStress() |
void |
updateStressAndStiffness() |
void |
useAnsysNumbering() |
boolean |
usingAttachedRelativeFrame() |
boolean |
writeSurfaceMesh(java.io.PrintWriter pw) |
void |
writeSurfaceMesh(java.lang.String fileName) |
void |
zeroImpulses() |
addFrictionConstraints, addMarker, addMarker, addMarker, addMarker, addMarker, addMarker, addUnilateralConstraints, applyForces, attachments, attachPoint, checkVelocityStability, clear, createDefaultMaterial, detachAllNodes, detachPoint, forcesNeedUpdating, getAttachments, getCharacteristicSize, getCollidables, getConstrainers, getDensity, getDensityMode, getEnergy, getForceEffectors, getGravity, getGravityMode, getImplicitIterations, getImplicitPrecision, getIntegrator, getMass, getMassDamping, getMaterial, getMatrixSolver, getNodeMass, getNumInverted, getParticleDamping, getRestVolume, getSlaveObjectComponents, getStiffnessDamping, getStressPlotRange, getStressPlotRangeMode, getStressPlotRanging, getStressPlotRangingMode, getSurfaceRendering, getSurfaceRenderingMode, getToleranceType, getUnilateralImpulses, getUnilateralInfo, getUnilateralSizes, getVolume, hasState, markers, maxFrictionConstraintSets, numElements, numNodes, printNodeMasses, propertyChanged, removeMarker, resetStressPlotRange, setBounds, setDensity, setDensityMode, setGravity, setGravity, setGravityMode, setImplicitIterations, setImplicitPrecision, setIntegrator, setLinearMaterial, setMassDamping, setMatrixSolver, setMaxStepSize, setParticleDamping, setStiffnessDamping, setStressPlotRange, setStressPlotRangeMode, setStressPlotRanging, setStressPlotRangingMode, setSurfaceRenderingMode, setToleranceType, setUnilateralImpulses, updateRestVolume, updateSlaveVel, updateVolume, validateMatrixSolver, zeroExternalForces
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, advance, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, closePrintStateFile, collectInitialForces, createState, createVelocityJacobian, getActiveForces, getActiveMass, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveStiffness, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getBilateralConstraints, getBilateralConstraintSizes, getBilateralForces, getBilateralImpulses, getBilateralInfo, getDefaultStabilization, getDynamicDOFs, getDynamicsEnabled, getForces, getFrictionConstraints, getInitialState, getInverseMassMatrix, getMassMatrix, getNumBilateralImpulses, getNumUnilateralImpulses, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getPrintState, getProfiling, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralForces, getUnilateralImpulses, getUnilateralInfo, getUpdateForcesAtStepEnd, getUpdateForcesAtStepEndMode, hasParameterizedType, initialize, numActiveComponents, numAttachedComponents, numParametricComponents, openPrintStateFile, preadvance, printActiveStiffness, reduceVelocityJacobian, reopenPrintStateFile, setActiveForces, setActivePosState, setActiveVelState, setBilateralImpulses, setDefaultStabilization, setDynamicsEnabled, setForces, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setPrintState, setPrintState, setProfiling, setStabilization, setState, setUnilateralImpulses, setUpdateForcesAtStepEnd, setUpdateForcesAtStepEndMode, topMechSystem, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeBilateralConstraintMatrix, writeMassMatrix, writeMassMatrix, writeStiffnessMatrix, writeStiffnessMatrix
createRenderProps, getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps
actionPerformed, copy, getInitialState, getMaxStepSize, getMenuItems, hierarchyContainsReferences, setInitialState
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, indexOf, invalidateNumbers, isEmpty, iterator, nextComponentNumber, numComponents, remove, remove, removeAll, removeAll, removeComponents, retainAll, set, setNavpanelDisplay, setNumbered, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkVelocityStability, getAttachments, getConstrainers, getForceEffectors, getSlaveObjectComponents
advance, getMaxStepSize, initialize, preadvance
createState, getInitialState, getState, setState
addActivePosImpulse, addPosJacobian, addVelJacobian, buildMassMatrix, buildSolveMatrix, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveVelState, getActiveVelStateSize, getBilateralConstraints, getBilateralImpulses, getBilateralInfo, getFrictionConstraints, getInverseMassMatrix, getMassMatrix, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getSolveMatrixType, getStructureVersion, getUnilateralConstraints, getUnilateralImpulses, getUnilateralInfo, maxFrictionConstraintSets, numActiveComponents, numParametricComponents, setActiveForces, setActivePosState, setActiveVelState, setBilateralImpulses, setParametricForces, setParametricPosState, setParametricVelState, setUnilateralImpulses, updateConstraints, updateForces
getName
public static boolean useFrameRelativeCouplingMasses
public static boolean abortOnInvertedElems
public static boolean checkTangentStability
public static boolean noIncompressStiffnessDamping
public static double detJStepReductionLimit
public static double frameMassFraction
public static FemModel.IncompMethod DEFAULT_HARD_INCOMP
public static FemModel.IncompMethod DEFAULT_SOFT_INCOMP
public static PropertyList myProps
public static boolean defaultAutoGenerateSurface
public static java.lang.String DEFAULT_SURFACEMESH_NAME
public FemModel3d()
public FemModel3d(java.lang.String name)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class FemModel
public void setElementWidgetSize(double size)
public double getElementWidgetSize()
public void setElementWidgetSizeMode(PropertyMode mode)
public PropertyMode getElementWidgetSizeMode()
public void getCollidables(java.util.List<Collidable> list, int level)
getCollidables
in interface MechSystemModel
public void setComputeNodalStress(boolean enable)
public void setComputeNodalStrain(boolean enable)
public static ColorMapBase createDefaultColorMap()
public void addMaterialBundle(AuxMaterialBundle bundle)
public boolean removeMaterialBundle(AuxMaterialBundle bundle)
public void clearMaterialBundles()
public RenderableComponentList<AuxMaterialBundle> getMaterialBundles()
public FemNode3d getByNumber(int num)
ComponentList
getByNumber
in interface ComponentListView<ModelComponent>
getByNumber
in interface CompositeComponent
getByNumber
in class ComponentList<ModelComponent>
num
- number of the componentpublic FemElement3d getElementByNumber(int num)
public RenderableComponentList<FemElement3d> getElements()
getElements
in class FemModel
public void addNodes(java.util.Collection<? extends FemNode3d> nodes)
public void addNode(FemNode3d p)
public void addNumberedNode(FemNode3d p, int number)
public boolean removeNode(FemNode3d p)
public FemElement3d getElement(int idx)
getElement
in class FemModel
public java.util.LinkedList<FemNodeNeighbor> getNodeNeighbors(FemNode3d node)
public java.util.LinkedList<FemElement3d> getElementNeighbors(FemNode3d node)
public void addElements(java.util.Collection<? extends FemElement3d> elems)
public void addElement(FemElement3d e)
public void addNumberedElement(FemElement3d e, int elemId)
public boolean removeElement(FemElement3d e)
public void clearElements()
public void addMarker(FemMarker mkr)
public FemMarker addMarker(Point3d pos)
pos
- position to place a marker in the modelpublic FemMarker addMarker(Point3d pos, boolean project)
project == true
, it will be
projected onto the model's surface.pos
- position to place a marker in the modelproject
- if true and pnt is outside the model, projects to the nearest point
on the surface. Otherwise, uses the original position.public void updateStressAndStiffness()
public void updateStress()
public int getJacobianType()
ForceEffector
Matrix.SYMMETRIC
or Matrix.POSITIVE_DEFINITE
. The former should be set if adding the Jacobian
terms preserves symmetry, and the latter should be set if positive
definiteness if preserved. Both should be set if there is no Jacobian for
this effector (i.e., the Jacobian methods are not implemented). Matrix
types from all the force effectors are logically and-ed together to
determine the type for the entire solve matrix.getJacobianType
in interface ForceEffector
getJacobianType
in class FemModel
public void addVelJacobian(SparseNumberedBlockMatrix M, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addVelJacobian
in interface ForceEffector
M
- solve matrix to which scaled velocity Jacobian is to be addeds
- scaling factor for velocity Jacobianpublic void addPosJacobian(SparseNumberedBlockMatrix M, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addPosJacobian
in interface ForceEffector
M
- solve matrix to which scaled position Jacobian is to be addeds
- scaling factor for position Jacobianpublic SparseBlockMatrix createStiffnessMatrix()
public void addSolveBlocks(SparseNumberedBlockMatrix S)
ForceEffector
getSolveIndex
) for all dynamic or attached components affected by this
force effector.addSolveBlocks
in interface ForceEffector
addSolveBlocks
in class FemModel
S
- solve matrix to which blocks should be addedpublic void recursivelyInitialize(double t, int level)
recursivelyInitialize
in interface MechSystemModel
recursivelyInitialize
in class FemModel
public void setSurfaceRendering(FemModel.SurfaceRender mode)
setSurfaceRendering
in class FemModel
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class FemModel
renderer
- 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 DoubleInterval getNodalPlotRange(FemModel.SurfaceRender rendering)
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class RenderableModelBase
list
- list of objects to be renderedpublic void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
IsSelectable
list
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 IsSelectable
getSelection
in class RenderableModelBase
list
- selected objects are appended to the end of this listqid
- index of the selection querypublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBase
write
.scan
in interface ModelComponent
scan
in interface Scannable
scan
in class ComponentList<ModelComponent>
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objectsjava.io.IOException
- if an I/O or formatting error occuredpublic void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
ModelComponent
scan()
method and stored in the token queue.
The most common use of this method is to resolve the paths
of component references, which may not have been created
at the time of the initial scan()
call.postscan
in interface ModelComponent
postscan
in class ComponentList<ModelComponent>
tokens
- token information that was stored during
scan()
.ancestor
- ancestor component with respect to which
reference component paths are defined.java.io.IOException
- if an error is encountered (such as a reference to a
non-existent component)public boolean writeSurfaceMesh(java.io.PrintWriter pw)
public void writeSurfaceMesh(java.lang.String fileName)
public FemMeshComp scanSurfaceMesh(ReaderTokenizer rtok) throws java.io.IOException
java.io.IOException
public FemMeshComp scanSurfaceMesh(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public FemMeshComp scanMesh(ReaderTokenizer rtok) throws java.io.IOException
java.io.IOException
public FemMeshComp scanMesh(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void addConnector(BodyConnector c)
addConnector
in interface ConnectableBody
public void removeConnector(BodyConnector c)
removeConnector
in interface ConnectableBody
public java.util.List<BodyConnector> getConnectors()
getConnectors
in interface ConnectableBody
public boolean isFreeBody()
isFreeBody
in interface ConnectableBody
public void transformPose(RigidTransform3d T)
transformPose
in interface ConnectableBody
public void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
TransformGeometryContext.transform (this, X, 0);
transformGeometry
in interface TransformableGeometry
X
- affine transformation to apply to the componentpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometry
gtr
to transform its individual attributes. The
context
argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags
provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING
and
TransformableGeometry.TG_ARTICULATED
.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase)
for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryAction
s. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
.
TransformGeometryContext
provides a number of
static convenience transform
methods
which take care of building the context and calling
apply()
for a specified set of components.
This method should not
generally call transformGeometry()
for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
.
transformGeometry
in interface TransformableGeometry
gtr
- transformer implementing the transformcontext
- context information, including what other components
are being transformedflags
- specifies conditions associated with the transformationpublic void addTransformableDependencies(TransformGeometryContext context, int flags)
TransformableGeometry
context
any transformable components which should be
transformed as the same time as this component. This will generally
include descendant components, and may also include other components to
which this component is connected in some way.
This method is generally called from with the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of a
TransformGeometryContext
.
addTransformableDependencies
in interface TransformableGeometry
context
- context information, to which the dependent components
are added.flags
- specifies conditions associated with the transformationpublic FemModel.IncompMethod getIncompressible()
public void setMaterial(FemMaterial mat)
setMaterial
in class FemModel
public FemModel.IncompMethod getHardIncompMethod()
public void setIncompressible(FemModel.IncompMethod method)
public Range getIncompressibleRange()
public void setSoftIncompMethod(FemModel.IncompMethod method)
public FemModel.IncompMethod getSoftIncompMethod()
public Range getSoftIncompMethodRange()
public double getIncompCompliance()
public void setIncompCompliance(double c)
public int numTetElements()
public int numQuadraticElements()
public void printANSYSNodes(java.io.PrintWriter pw)
pw
- PrintWriter to which nodes are writtenpublic void printANSYSElements(java.io.PrintWriter pw)
pw
- PrintWriter to which elements are writtenpublic Vertex3d getSurfaceVertex(FemNode3d node)
getSurfaceMesh()
.node
- node to checknode
, or
null
if no such vertex existspublic FemNode3d getSurfaceNode(Vertex3d vtx)
getSurfaceMesh()
.vtx
- vertex to checkvtx
, or
null
if no such node existspublic boolean isSurfaceNode(FemNode3d node)
getSurfaceMesh()
.node
- node to checktrue
if node
lies on the surface meshpublic FemMeshComp createSurfaceMesh(FemModel.ElementFilter efilter)
public FemMeshComp getSurfaceMeshComp()
public PolygonalMesh getSurfaceMesh()
HasSurfaceMesh
null
if no mesh exists. If multiple surface
meshes exist, this should be first one in the array returned
by HasSurfaceMesh.getSurfaceMeshes()
.getSurfaceMesh
in interface HasSurfaceMesh
public int numSurfaceMeshes()
HasSurfaceMesh
HasSurfaceMesh.getSurfaceMesh()
returns null
, then this method should return 0.numSurfaceMeshes
in interface HasSurfaceMesh
public PolygonalMesh[] getSurfaceMeshes()
HasSurfaceMesh
HasSurfaceMesh.getSurfaceMesh()
returns null
, then a
zero-length array should be returned.getSurfaceMeshes
in interface HasSurfaceMesh
public Collidable.Collidability getCollidable()
Collidable
Collidable.Collidability
of this Collidable. This provides
control over whether external and/or internal collisions are enabled for
this Collidable. This setting takes precedence over default and
explicitly requested collision behaviors.
Note that for collisions to actually occur, they still need to be enabled through either a default or explicit collision behavior in the MechModel.
getCollidable
in interface Collidable
public void setCollidable(Collidable.Collidability c)
public Collidable getCollidableAncestor()
Collidable
null
.getCollidableAncestor
in interface Collidable
null
.public boolean isCompound()
Collidable
isCompound
in interface Collidable
true
if this collidable has sub-collidablespublic boolean isDeformable()
Collidable
true
if this collidable is deformable. Whether or
not a collidable is deformable determines how it responds to default
collision behaviors involving deformable and rigid collidables. Also,
self-collisions among sub-collidables of a collidable A are permitted
only if A is deformable.isDeformable
in interface Collidable
isDeformable
in interface ConnectableBody
true
if this collidable is deformablepublic FemMeshComp addMesh(MeshBase mesh)
public FemMeshComp addMesh(java.lang.String name, MeshBase mesh)
public FemMeshComp getMeshComp(java.lang.String name)
public FemMeshComp getMeshComp(int idx)
public MeshComponentList<FemMeshComp> getMeshComps()
public int numMeshComps()
public void addMeshComp(FemMeshComp surf)
public boolean removeMeshComp(FemMeshComp surf)
public void clearMeshComps()
public void setAutoGenerateSurface(boolean val)
public boolean isAutoGeneratingSurface()
public boolean isSurfaceMeshValid()
public FemMeshComp setSurfaceMesh(PolygonalMesh mesh)
public void setSurfaceMeshComp(FemMeshComp mesh)
public void invalidateSurfaceMesh()
public void componentChanged(ComponentChangeEvent e)
ComponentList
This method should propagate the notification up the component hierarchy
by calling notifyParentOfChange
.
componentChanged
in interface ComponentChangeListener
componentChanged
in interface CompositeComponent
componentChanged
in class ComponentList<ModelComponent>
e
- optional argument giving specific information about the changepublic FemElement3d getSurfaceElement(Face face)
public FemElement3d findContainingElement(Point3d pnt)
null
if there is no such element.pnt
- Point for which containing element is desired.public FemElement3d findNearestSurfaceElement(Point3d loc, Point3d pnt)
loc
.loc
- Projected location of the point onto the surface.pnt
- Point for which nearest surface element is desired.public FemElement3d findNearestElement(Point3d loc, Point3d pnt)
loc
- Location of the point, within the FEM or projected onto the
surface.pnt
- Point for which the nearest element is desired.public FemNode3d findNearestNode(Point3d pnt, double maxDist)
null
is returned.pnt
- Point for which the nearest node should be locatedmaxDist
- Maximum distance that the node must be from the
point. If maxDist
< 0, then null
will be returned.null
if there is no such pointpublic void updateSlavePos()
HasSlaveObjects
updateSlavePos
in interface HasSlaveObjects
updateSlavePos
in class FemModel
public boolean isVolumeValid()
public int markInvertedRestElements()
public void recursivelyFinalizeAdvance(StepAdjustment stepAdjust, double t0, double t1, int flags, int level)
recursivelyFinalizeAdvance
in interface MechSystemModel
recursivelyFinalizeAdvance
in class MechSystemBase
public void invalidateStressAndStiffness()
invalidateStressAndStiffness
in class FemModel
public void invalidateRestData()
invalidateRestData
in class FemModel
public void resetRestPosition()
public double updateConstraints(double t, int flags)
updateConstraints
in interface Constrainer
updateConstraints
in class FemModel
public void getConstrainedComponents(java.util.List<DynamicComponent> list)
getConstrainedComponents
in interface Constrainer
getConstrainedComponents
in class FemModel
public int setBilateralImpulses(VectorNd lam, double h, int idx)
setBilateralImpulses
in interface Constrainer
setBilateralImpulses
in class FemModel
public void zeroImpulses()
zeroImpulses
in interface Constrainer
zeroImpulses
in class FemModel
public int getBilateralImpulses(VectorNd lam, int idx)
getBilateralImpulses
in interface Constrainer
getBilateralImpulses
in class FemModel
public void getBilateralSizes(VectorNi sizes)
getBilateralSizes
in interface Constrainer
getBilateralSizes
in class FemModel
public int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
addBilateralConstraints
in interface Constrainer
addBilateralConstraints
in class FemModel
public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
getBilateralInfo
in interface Constrainer
getBilateralInfo
in class FemModel
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 PointAttachment createPointAttachment(Point pnt, double reduceTol)
public 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 FrameFem3dAttachment createFrameAttachment(Frame frame, RigidTransform3d TFW, boolean project)
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
.frame
- frame to be attachedTFW
- transform from (initial) frame coordinates to world
coordinatesproject
- if true and if the frame is outside the FEM, then
the frame gets projected to the nearest point on the FEMframe
to this componentpublic void subdivideHexs(java.util.List<HexElement> hexs)
public void subdivideHex(HexElement hex)
public void dispose()
ModelBase
public void useAnsysNumbering()
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class FemModel
s
- scaling factorpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
scaleMass
in class FemModel
s
- scaling factorpublic 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 CopyableComponent
true
if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
CopyableComponent
true
if and only if CopyableComponent.isDuplicatable()
returns
true.getCopyReferences
in interface CopyableComponent
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excludedpublic void getAuxStateComponents(java.util.List<HasAuxState> comps, int level)
getAuxStateComponents
in interface MechSystemModel
public void advanceAuxState(double t0, double t1)
HasAuxState
advanceAuxState
in interface HasAuxState
t0
- beginning time associated with the time step advancet1
- end time associated with the time step advancepublic void skipAuxState(DataBuffer data)
skipAuxState
in interface HasAuxState
data
- buffer containing the state informationpublic void getAuxState(DataBuffer data)
HasAuxState
getAuxState
in interface HasAuxState
getAuxState
in class MechSystemBase
data
- buffer for storing the state values.public void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
HasAuxState
If oldData
is non-null, then this contains
previously stored initial state information (starting at its current
buffer offsets), which should be stored into
newData
in place of the current component state data.
This may only be partially possible if the component's state structure
has changed since oldData
was written.
getInitialAuxState
in interface HasAuxState
newData
- buffer for storing the state values.oldData
- if non-null, contains old state information that should be
written into newData
in place of the current state
information.public void setAuxState(DataBuffer data)
HasAuxState
setAuxState
in interface HasAuxState
setAuxState
in class MechSystemBase
data
- buffer containing the state informationpublic FemModel3d 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 FemModel
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
componentspublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class FemModel
pmin
- minimum pointpmax
- maximum pointpublic ColorMapBase getColorMap()
public void setColorMap(ColorMapBase colorMap)
public PropertyMode getColorMapMode()
public void setColorMapMode(PropertyMode mode)
public boolean isAbortOnInvertedElements()
public void setAbortOnInvertedElements(boolean set)
public void setWarnOnInvertedElements(boolean set)
public boolean isWarnOnInvertedElements()
public void getNodalDeformationGradients(Matrix3d[] Fnodal)
public FemModelFrame getFrame()
public boolean isFrameRelative()
public void setFrameRelative(boolean enable)
public boolean usingAttachedRelativeFrame()
public FrameFem3dConstraint getFrameConstraint()
public void attachFrame(RigidTransform3d TRW)
public double getAxisLength()
public void setAxisLength(double len)
public void getDynamicComponents(java.util.List<DynamicComponent> active, java.util.List<DynamicComponent> attached, java.util.List<DynamicComponent> parametric)
getDynamicComponents
in interface MechSystemModel
getDynamicComponents
in class FemModel
public void addGeneralMassBlocks(SparseBlockMatrix M)
addGeneralMassBlocks
in interface MechSystemModel
addGeneralMassBlocks
in class MechSystemBase
public void getMassMatrixValues(SparseBlockMatrix M, VectorNd f, double t)
getMassMatrixValues
in interface MechSystemModel
public void mulInverseMass(SparseBlockMatrix M, VectorNd a, VectorNd f)
mulInverseMass
in interface MechSystem
mulInverseMass
in interface MechSystemModel