public class FemFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FemFactory.FemElementType |
static class |
FemFactory.FemElemType |
static class |
FemFactory.FemShapingType |
Constructor and Description |
---|
FemFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
addFem(FemModel3d fem0,
FemModel3d fem1)
Adds a copy of the nodes, elements, markers and attachments from
fem1 to fem0 . |
static void |
addFem(FemModel3d fem0,
FemModel3d fem1,
double nodeMergeDist)
Adds a copy of the nodes, elements, markers and attachments from
fem1 to fem0 . |
static FemModel3d |
createCylinder(FemModel3d mod,
double l,
double r,
int nt,
int nl,
int nr)
Creates a cylinder made of mostly hex elements, with wedges in the centre
column
|
static FemModel3d |
createEllipsoid(FemModel3d mod,
double rl,
double rs1,
double rs2,
int nt,
int nl,
int ns)
Creates an ellipsoidal model using a combination of hex, wedge, and tet
elements.
|
static FemModel3d |
createExtrusion(FemModel3d model,
FemFactory.FemElementType type,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createExtrusion(FemModel3d model,
FemFactory.FemElemType type,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Extrudes each face along the normal direction to create a shell.
|
static void |
createFromElementList(FemModel3d out,
java.util.Collection<FemElement3d> elemList)
Creates a new model by duplicating nodes and elements
|
static FemModel3d |
createFromMesh(FemModel3d model,
PolygonalMesh surface,
double quality)
Creates a tetrahedral FEM model from a triangular surface mesh.
|
static FemModel3d |
createFromMeshAndPoints(FemModel3d model,
PolygonalMesh surface,
double quality,
Point3d[] pnts)
Constrained Delaunay, including the supplied list of points if they fall
inside the surface
|
static FemModel3d |
createGrid(FemModel3d model,
FemFactory.FemElementType type,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createGrid(FemModel3d model,
FemFactory.FemElemType type,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createHexExtrusion(FemModel3d model,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createHexGrid(FemModel3d mod,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createHexTorus(FemModel3d mod,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createHexTube(FemModel3d mod,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createHexWedgeCylinder(FemModel3d mod,
double l,
double r,
int nt,
int nl,
int nr) |
static FemModel3d |
createHexWedgeExtrusion(FemModel3d model,
int n,
double d,
PolygonalMesh surface,
FemModel3d surfaceFem)
Creates a combined hex/wedge fem model by extruding triangles into wedges
and quads into hexes.
|
static FemModel3d |
createIcosahedralSphere(FemModel3d mod,
double r,
int ndivisions,
double quality)
Creates a tet-based spherical model based on a icosahedron.
|
static FemModel3d |
createPartialCylinder(FemModel3d mod,
double l,
double r,
double theta,
int nl,
int nr,
int ntheta)
Creates a partial cylinder made of mostly hex elements, with wedges in the centre
column
|
static FemModel3d |
createPartialHexTube(FemModel3d mod,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta) |
static FemModel3d |
createPartialHexWedgeCylinder(FemModel3d mod,
double l,
double r,
double theta,
int nl,
int nr,
int ntheta) |
static FemModel3d |
createPartialTetTube(FemModel3d mod,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta) |
static FemModel3d |
createPartialTube(FemModel3d model,
FemFactory.FemElementType type,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta) |
static FemModel3d |
createPyramidGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Create a regular pyramidal grid centered on the origin, with specified
widths and grid resolutions along each axis.
|
static FemModel3d |
createQuadhexExtrusion(FemModel3d model,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createQuadhexGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createQuadhexTorus(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createQuadhexTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createQuadpyramidGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createQuadraticModel(FemModel3d quadMod,
FemModel3d linMod)
Takes a FemModel3d containing linear elements, and creates a quadratic
model whose elements are the corresponding quadratic elements, with new
nodes inserted along the edges as required.
|
static FemModel3d |
createQuadraticTorus(FemModel3d mod,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createQuadraticTube(FemModel3d mod,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createQuadtetExtrusion(FemModel3d model,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createQuadtetGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createQuadtetTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createQuadtetTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createQuadwedgeGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
createSphere(FemModel3d mod,
double r,
int nt,
int nl,
int ns)
Convenience method to create a symmetric hex/wedge dominant sphere
using
createEllipsoid(artisynth.core.femmodels.FemModel3d, double, double, double, int, int, int) . |
static FemModel3d |
createTetExtrusion(FemModel3d model,
int n,
double d,
PolygonalMesh surface) |
static FemModel3d |
createTetGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Create a regular tetrahedral grid centered on the origin, with specified
widths and grid resolutions along each axis.
|
static FemModel3d |
createTetTorus(FemModel3d mod,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createTetTube(FemModel3d mod,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createTorus(FemModel3d model,
FemFactory.FemElementType type,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createTorus(FemModel3d model,
FemFactory.FemElemType type,
double R,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createTube(FemModel3d model,
FemFactory.FemElementType type,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createTube(FemModel3d model,
FemFactory.FemElemType type,
double l,
double rin,
double rout,
int nt,
int nl,
int nr) |
static FemModel3d |
createWedgeGrid(FemModel3d mod,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ) |
static FemModel3d |
mergeCollapsedNodes(FemModel3d mod,
FemModel3d orig,
double epsilon) |
static FemModel3d |
refineFem(FemModel3d out,
FemModel3d in,
double quality) |
static FemModel3d |
refineFem(FemModel3d out,
FemModel3d in,
double quality,
Point3d[] pnts) |
static void |
setPlanarNodesFixed(FemModel fem,
Point3d center,
Vector3d normal,
boolean fixed) |
static FemModel3d |
subdivideFem(FemModel3d femr,
FemModel3d fem0)
Creates a subdvided FEM model by subdividing all the elements of an
existing model into eight sub-elements, adding additional nodes as
required.
|
static FemModel3d |
subdivideFem(FemModel3d femr,
FemModel3d fem0,
boolean addMarkers) |
public static FemModel3d createTetGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createPyramidGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createHexGrid(FemModel3d mod, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createWedgeGrid(FemModel3d mod, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d mergeCollapsedNodes(FemModel3d mod, FemModel3d orig, double epsilon)
public static FemModel3d createIcosahedralSphere(FemModel3d mod, double r, int ndivisions, double quality)
mod
- empty FEM model to which elements are added; if
null
then a new model is allocatedr
- radiusndivisions
- number of divisions used in creating the surface mesh.
Typical values are 1 or 2.quality
- quality parameter passed to tetgen. See
createFromMesh(artisynth.core.femmodels.FemModel3d, maspack.geometry.PolygonalMesh, double)
for a full description.mod
if
mod
is not null
).public static FemModel3d createSphere(FemModel3d mod, double r, int nt, int nl, int ns)
createEllipsoid(artisynth.core.femmodels.FemModel3d, double, double, double, int, int, int)
.mod
- empty FEM model to which elements are added; if
null
then a new model is allocatedr
- radiusnt
- number of nodes in each ring parallel to the equatornl
- number of nodes in each quarter ring perpendicular to the
equator (including end nodes)ns
- number of nodes in each radial line extending out from
the polar axis (including end nodes)mod
if
mod
is not null
).public static FemModel3d createEllipsoid(FemModel3d mod, double rl, double rs1, double rs2, int nt, int nl, int ns)
rl
should be the longest
radius, and corresponds to the polar axis.mod
- empty FEM model to which elements are added; if
null
then a new model is allocatedrl
- longest radius (also the polar radius)rs1
- first radius perpendicular to the polar axisrs2
- second radius perpendicular to the polar axisnt
- number of nodes in each ring parallel to the equatornl
- number of nodes in each quarter ring perpendicular to the
equator (including end nodes)ns
- number of nodes in each radial line extending out from
the polar axis (including end nodes)mod
if
mod
is not null
).public static FemModel3d createCylinder(FemModel3d mod, double l, double r, int nt, int nl, int nr)
public static FemModel3d createHexWedgeCylinder(FemModel3d mod, double l, double r, int nt, int nl, int nr)
public static FemModel3d createPartialCylinder(FemModel3d mod, double l, double r, double theta, int nl, int nr, int ntheta)
public static FemModel3d createPartialHexWedgeCylinder(FemModel3d mod, double l, double r, double theta, int nl, int nr, int ntheta)
public static FemModel3d createHexTube(FemModel3d mod, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createTetTube(FemModel3d mod, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createPartialHexTube(FemModel3d mod, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
public static FemModel3d createPartialTetTube(FemModel3d mod, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
public static FemModel3d createHexTorus(FemModel3d mod, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createTetTorus(FemModel3d mod, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadraticTube(FemModel3d mod, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadraticTorus(FemModel3d mod, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadraticModel(FemModel3d quadMod, FemModel3d linMod)
linMod
- A FemModel3d previously inialized with only linear elements.public static FemModel3d createQuadtetGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createQuadtetTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadtetTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadtetExtrusion(FemModel3d model, int n, double d, PolygonalMesh surface)
public static FemModel3d createQuadhexGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createQuadwedgeGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createQuadpyramidGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createQuadhexTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createQuadhexTorus(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createQuadhexExtrusion(FemModel3d model, int n, double d, PolygonalMesh surface)
public static FemModel3d createHexExtrusion(FemModel3d model, int n, double d, PolygonalMesh surface)
public static FemModel3d createHexWedgeExtrusion(FemModel3d model, int n, double d, PolygonalMesh surface, FemModel3d surfaceFem)
model
- Empty FEM model to which elements are added. If null
,
then a new FEM model will be created and returned. Note that
model
must be different from surfaceFem
n
- number of layersd
- layer thicknesssurface
- surface mesh to extrudesurfaceFem
- FEM associated with the surface mesh, or
null
if there is associated FEM.model
if
that argument is not null
.public static FemModel3d createExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
model
- (if null, a new model will be created)n
- n-1 is the number of layersd
- thickness of each layerzOffset
- offset along normal to beginsurface
- PolygonalMesh surface to extrudepublic static FemModel3d createTetExtrusion(FemModel3d model, int n, double d, PolygonalMesh surface)
public static FemModel3d createGrid(FemModel3d model, FemFactory.FemElementType type, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createGrid(FemModel3d model, FemFactory.FemElemType type, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
public static FemModel3d createTube(FemModel3d model, FemFactory.FemElementType type, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createPartialTube(FemModel3d model, FemFactory.FemElementType type, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
public static FemModel3d createTube(FemModel3d model, FemFactory.FemElemType type, double l, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createTorus(FemModel3d model, FemFactory.FemElementType type, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createTorus(FemModel3d model, FemFactory.FemElemType type, double R, double rin, double rout, int nt, int nl, int nr)
public static FemModel3d createExtrusion(FemModel3d model, FemFactory.FemElementType type, int n, double d, PolygonalMesh surface)
public static FemModel3d createExtrusion(FemModel3d model, FemFactory.FemElemType type, int n, double d, PolygonalMesh surface)
public static FemModel3d createFromMesh(FemModel3d model, PolygonalMesh surface, double quality)
model
), or a newly created FemModel3d
(if model
is null
).
The tessellation is done using tetgen, which is called through a JNI
interface. The tessellation quality is controlled using the
quality
variable, described below.
model
- model to which the tetrahedra should be added, or null
if the
model is to be created from scratch.surface
- triangular surface mesh used to define the tessellation.quality
- If 0, then only the
mesh nodes will be used to form the tessellation. However, this may result
in highly degenerate tetrahedra. Otherwise, if >
0, tetgen will add additional nodes to ensure that the minimum edge-radius
ratio does not exceed quality
. A good default value for
quality
is 2. If set too small (such as less then 1), then
tetgen may not terminate.public static FemModel3d createFromMeshAndPoints(FemModel3d model, PolygonalMesh surface, double quality, Point3d[] pnts)
public static FemModel3d refineFem(FemModel3d out, FemModel3d in, double quality, Point3d[] pnts)
public static FemModel3d refineFem(FemModel3d out, FemModel3d in, double quality)
public static void addFem(FemModel3d fem0, FemModel3d fem1)
fem1
to fem0
. Nodes in fem1 are merged with
nodes in fem0 that are within TOL distance of each other, where TOL is
1e-8 times the maximum radius of fem0 and fem1. For precise control of
node merging, use addFem(FemModel3d,FemModel3d,double)
.fem0
- FEM model to which components should be addedfem1
- FEM model providing componentspublic static void addFem(FemModel3d fem0, FemModel3d fem1, double nodeMergeDist)
fem1
to fem0
.fem0
- FEM model to which components should be addedfem1
- FEM model providing componentsnodeMergeDist
- If >= 0, causes nearby nodes of fem1
and fem0
to
be merged: any node of fem1
that is within
nodeMergeDist
of a node in fem0
is replaced by
the nearest node in fem0
.public static FemModel3d subdivideFem(FemModel3d femr, FemModel3d fem0)
femr
- model in which refined FEM is to be constructed, or null
if
the model is to be created from scratch.fem0
- existing FEM model to be refined.public static FemModel3d subdivideFem(FemModel3d femr, FemModel3d fem0, boolean addMarkers)
public static void createFromElementList(FemModel3d out, java.util.Collection<FemElement3d> elemList)
out
- model to fillelemList
- elements to build model from