public class FemQuery
extends java.lang.Object
Constructor and Description |
---|
FemQuery() |
Modifier and Type | Method and Description |
---|---|
static java.util.HashSet<FemNode3d> |
fillNodeRegion(java.util.Collection<FemNode3d> region,
FemNode3d node0,
FemMeshComp mcomp)
Finds all the nodes of an FEM model that are required to fill a region
about a starting node
node0 . |
static java.util.ArrayList<FemNode3d> |
fillNodeRegion(FemModel3d fem,
java.util.Collection<FemNode3d> region,
FemNode3d node0,
boolean surfaceOnly)
Finds all the nodes of an FEM model that are required to fill a region
about a starting node
node0 . |
static java.util.HashSet<FemNode3d> |
findAdjacentNodes(java.util.Collection<FemNode3d> nodes,
FemMeshComp mcomp)
Finds all the nodes of an FEM model that are adjacent to an existing node
set
nodes , where adjacency is defined in the documentation for
getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean) with forFill set to false . |
static java.util.ArrayList<FemNode3d> |
findAdjacentNodes(FemModel3d fem,
java.util.Collection<FemNode3d> nodes,
boolean surfaceOnly)
Finds all the nodes of an FEM model that are adjacent to an existing node
set
nodes , where adjacency is defined in the documentation for
getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean) with forFill set to false . |
static java.util.HashSet<FemNode3d> |
findBoundaryNodes(java.util.Collection<FemNode3d> nodes,
FemMeshComp mcomp)
Finds all the nodes of an FEM model that lie on the boundary of an
existing node set
nodes . |
static java.util.ArrayList<FemNode3d> |
findBoundaryNodes(FemModel3d fem,
java.util.Collection<FemNode3d> nodes,
boolean surfaceOnly)
Finds all the nodes of an FEM model that lie on the boundary of an
existing node set
nodes , where the boundary is defined in the
documentation for findBoundaryNodes(Collection,FemMeshComp) . |
static java.util.ArrayList<FemNode3d> |
findEdgeLineNodes(FemModel3d fem,
FemNode3d node0,
double minBendAngle,
double maxEdgeAngle,
boolean allowBranching)
Find all the surface nodes of an FEM model that lie along an edge
line, starting at
node0 . |
static java.util.HashSet<FemNode3d> |
findEnclosedNodes(java.util.Collection<FemNode3d> nodes,
FemMeshComp mcomp)
Finds all the nodes of an FEM model that lie inside the boundary of an
existing node set
nodes . |
static java.util.ArrayList<FemNode3d> |
findEnclosedNodes(FemModel3d fem,
java.util.Collection<FemNode3d> nodes,
boolean surfaceOnly)
Finds all the nodes of an FEM model that lie inside the boundary of an
existing node set
nodes , where the boundary is defined in the
documentation for findEnclosedNodes(Collection,FemMeshComp) . |
static java.util.ArrayList<FemNode3d> |
findNodePath(FemModel3d fem,
FemNode3d nodeA,
FemNode3d nodeB,
boolean surfaceOnly)
Finds a minimum distance path of nodes within an FEM model between nodes
nodeA and nodeB , as described in the documentation for
findNodePath(FemNode3d,FemNode3d,FemMeshComp) . |
static java.util.ArrayList<FemNode3d> |
findNodePath(FemNode3d nodeA,
FemNode3d nodeB,
FemMeshComp mcomp)
Finds a minimum distance path of nodes within an FEM model between nodes
nodeA and nodeB . |
static java.util.ArrayList<FemNode3d> |
findPatchBoundaryNodes(FemModel3d fem,
FemNode3d node0,
double maxBendAngle)
Find all the surface nodes of an FEM model that border a patch
containing
node0 . |
static java.util.ArrayList<FemNode3d> |
findPatchNodes(FemModel3d fem,
FemNode3d node0,
double maxBendAngle)
Find all the surface nodes of an FEM model in a patch containing
node0 . |
static java.util.ArrayList<FemNode3d> |
getAdjacentNodes(FemNode3d node,
FemMeshComp mcomp,
boolean forFill)
Returns all the nodes in an FEM model that are adjacent to a given
node.
|
public static java.util.ArrayList<FemNode3d> findEdgeLineNodes(FemModel3d fem, FemNode3d node0, double minBendAngle, double maxEdgeAngle, boolean allowBranching)
node0
. Edges along the edge line must have
a bend angle that is >= minBendAngle
, where the bend angle
is the absolute value of the angle between an edge's adjacent faces. In
addition, the edge angle between adjacent edges must be <=
maxEdgeAngle
. Branching is allowed if allowBranching
is true
; otherwise, edges are followed so as to minimize the edge angle.
The returned node list will always include node0
.
fem
- FEM model for which the query is being madenode0
- starting nodeminBendAngle
- minimum bend angle between adjacent faces (radians)maxEdgeAngle
- maximum edge angle between adjacent edges (radians)allowBranching
- if true
, allow branchingpublic static java.util.ArrayList<FemNode3d> findPatchNodes(FemModel3d fem, FemNode3d node0, double maxBendAngle)
node0
. The patch is the collection of all faces surrounding
node0
for which the bend angle between them is <=
maxBendAngle
, where the bend angle is the absolute value of the angle
between two faces about their common edge.
The returned node list will always include node0
.
fem
- FEM model for which the query is being madenode0
- starting node within the patchmaxBendAngle
- maximum bend angle between adjacent faces (radians)public static java.util.ArrayList<FemNode3d> findPatchBoundaryNodes(FemModel3d fem, FemNode3d node0, double maxBendAngle)
node0
. The patch is the collection of all faces
surrounding node0
for which the bend angle between them is
<= maxBendAngle
, where the bend angle is the absolute value of
the angle between two faces about their common edge.fem
- FEM model for which the query is being madenode0
- starting node within the patchmaxBendAngle
- maximum bend angle between adjacent faces (radians)public static java.util.ArrayList<FemNode3d> getAdjacentNodes(FemNode3d node, FemMeshComp mcomp, boolean forFill)
mcomp
is non-null
, the search
is restricted to nodes which lie on the mesh surface and are coincident
with mesh vertices.
Adjacent nodes are found by examing all the elements which contain the node and collecting the adjacent nodes in each element.
For adjacency not constrained to a mesh surface, adjacent nodes within each element are determined as follows:
node
.
node
is a
corner node, then adjacency is restricted to nodes which are immediately
adjacent along a face edge.
node
is a edge node, then
adjacency is restricted to nodes which are either immediately adjacent
or one away along a face edge.
If adjacency is constrained to a mesh surface, then adjacent nodes
within an element are chosen from those nodes which lie in element faces
that both contain node
and are also contained in the mesh
surface. For each of these eligible element faces:
node
, unless forFill
is true
,
in which case adjacency for quad faces is restricted to the two
nodes nearest to node
(this latter condition prevents
region filling on surfaces from passing through diagonal boundaries).
node
is a corner node, then
adjacency is restricted to the two immediately adjacent edge nodes.
node
is an edge node, then
adjacency is restricted to the two immediately adjacent corner nodes,
plus the two edge nodes which are adjacent to them.
node
- node for which adjacent nodes are desiredmcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesforFill
- if true
, adjacency is being requested for
region filling purposespublic static java.util.ArrayList<FemNode3d> findBoundaryNodes(FemModel3d fem, java.util.Collection<FemNode3d> nodes, boolean surfaceOnly)
nodes
, where the boundary is defined in the
documentation for findBoundaryNodes(Collection,FemMeshComp)
. If
surfaceOnly
is true
, the search is restricted to nodes
which lie on the FEM surface mesh and are coincident with mesh vertices.fem
- FEM model for which the query is being madenodes
- initial node set. The method will run faster if this is an
actual set.surfaceOnly
- if true
, restricts the search to nodes
on the FEM surfacenodes
public static java.util.HashSet<FemNode3d> findBoundaryNodes(java.util.Collection<FemNode3d> nodes, FemMeshComp mcomp)
nodes
. If the mesh component mcomp
is
non-null
, the search is restricted to nodes which lie on the mesh
surface and are coincident with mesh vertices.
A node is on the boundary if it is adjacent to at least one
other node that is not in nodes
, where adjacency is defined in
the documentation for getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set to false
.
nodes
- initial node set. The method will run faster if this is an
actual set.mcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesnodes
public static java.util.ArrayList<FemNode3d> findEnclosedNodes(FemModel3d fem, java.util.Collection<FemNode3d> nodes, boolean surfaceOnly)
nodes
, where the boundary is defined in the
documentation for findEnclosedNodes(Collection,FemMeshComp)
. If
surfaceOnly
is true
, the search is restricted to nodes
which lie on the FEM surface mesh and are coincident with mesh vertices.fem
- FEM model for which the query is being madenodes
- initial node set. The method will run faster if this is an
actual set.surfaceOnly
- if true
, restricts the search to nodes
on the FEM surfacenodes
public static java.util.HashSet<FemNode3d> findEnclosedNodes(java.util.Collection<FemNode3d> nodes, FemMeshComp mcomp)
nodes
. If the mesh component mcomp
is
non-null
, the search is restricted to nodes which lie on the mesh
surface and are coincident with mesh vertices.
A node is inside the boundary if every adjacent node is
contained in nodes
, where adjacency is defined in the
documentation for getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set to false
.
nodes
- initial node set. The method will run faster if this is an
actual set.mcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesnodes
public static java.util.ArrayList<FemNode3d> findAdjacentNodes(FemModel3d fem, java.util.Collection<FemNode3d> nodes, boolean surfaceOnly)
nodes
, where adjacency is defined in the documentation for
getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set to false
. If
surfaceOnly
is true
, the search is restricted to nodes
which lie on the FEM surface mesh and are coincident with mesh vertices.fem
- FEM model for which the query is being madenodes
- initial node set. The method will run faster if this is an
actual set.surfaceOnly
- if true
, restricts the search to nodes
on the FEM surfacenodes
public static java.util.HashSet<FemNode3d> findAdjacentNodes(java.util.Collection<FemNode3d> nodes, FemMeshComp mcomp)
nodes
, where adjacency is defined in the documentation for
getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set to false
. If
the mesh component mcomp
is non-null
, the search is
restricted to nodes which lie on the mesh surface and are coincident with
mesh vertices.nodes
- initial node set. The method will run faster if this is an
actual set.mcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesnodes
public static java.util.ArrayList<FemNode3d> fillNodeRegion(FemModel3d fem, java.util.Collection<FemNode3d> region, FemNode3d node0, boolean surfaceOnly)
node0
. The fill proceeds as described
in the documentation for fillNodeRegion(Collection,FemNode3d,FemMeshComp)
. If
surfaceOnly
is true
, the fill is restricted to nodes
which lie on the FEM surface mesh and are coincident with mesh vertices.fem
- FEM model for which the query is being maderegion
- initial node region. The method will run faster if this is
an actual set.node0
- starting node inside the regionsurfaceOnly
- if true
, restricts the search to nodes
on the FEM surfaceregion
that are needed to
perform the fillpublic static java.util.HashSet<FemNode3d> fillNodeRegion(java.util.Collection<FemNode3d> region, FemNode3d node0, FemMeshComp mcomp)
node0
. The fill proceeds by adding adjacent
nodes that are not currently contained in region
, and terminates
when at the region's boundary. If the region does not have a proper
boundary, the fill will expand to include all nodes in the FEM model. If
the mesh component mcomp
is non-null
, the search is
restricted to nodes which lie on the mesh surface and are coincident with
mesh vertices.
For fill purposes, adjacency is defined in the documentation for
getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set to true
.
region
- initial node region. The method will run faster if this is
an actual set.node0
- starting node inside the regionmcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesregion
that are needed to
perform the fillpublic static java.util.ArrayList<FemNode3d> findNodePath(FemModel3d fem, FemNode3d nodeA, FemNode3d nodeB, boolean surfaceOnly)
nodeA
and nodeB
, as described in the documentation for
findNodePath(FemNode3d,FemNode3d,FemMeshComp)
. If surfaceOnly
is true
, the search is restricted to nodes which lie
on the FEM surface mesh and are coincident with mesh vertices.fem
- FEM model for which the query is being madenodeA
- path start nodenodeB
- path end nodesurfaceOnly
- if true
, restricts the search to nodes
on the FEM surfacenode0
and node1
that comprise the
pathpublic static java.util.ArrayList<FemNode3d> findNodePath(FemNode3d nodeA, FemNode3d nodeB, FemMeshComp mcomp)
nodeA
and nodeB
. The path is computed using a graph
search based on the adjacency relationships between nodes, as defined in
the documentation for getAdjacentNodes(artisynth.core.femmodels.FemNode3d, artisynth.core.femmodels.FemMeshComp, boolean)
with forFill
set
to false
, and so may not necessarily yield a path that is
strictly minimal with respect to Euclidean distance. If the mesh
component mcomp
is non-null
, the search is restricted to
nodes which lie on the mesh surface and are coincident with mesh
vertices.nodeA
- path start nodenodeB
- path end nodemcomp
- if non-null
, restricts the search to nodes
coincident with mesh verticesnode0
and node1
that comprise the
path