public class FemFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FemFactory.FemElementType |
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 void |
bilipschitzMapCylinderSphere(Point3d input,
Point3d output)
Maps a cylinder with unit radius and z in [-1,1] to a unit sphere using
the bilipschitz method described in
A bi-Lipschitz continuous, volume preserving map from the unit ball onto
a cube, Griepentrog, Hoppner, Kaiser, Rehberg, 2008
|
static void |
bilipschitzMapSphereCylinder(Point3d input,
Point3d output)
Maps a unit sphere to a cylinder with unit radius and z in [-1,1] using
the bilipschitz method described in
A bi-Lipschitz continuous, volume preserving map from the unit ball onto
a cube, Griepentrog, Hoppner, Kaiser, Rehberg, 2008
|
static void |
conformalMapEllipseRectangle(double a,
double b,
double L1,
double L2,
Point3d input,
Point3d output)
Conformally maps an ellipse to a rectangular grid using the method of
Daniela Rosca, Uniform and refinable grids on elliptic domains and on
some surfaces of revolution, Applied Mathematics and Computation,Volume
217, Issue 19, 2011, Pages 7812-7817
|
static void |
conformalMapRectangleEllipse(double a,
double b,
double L1,
double L2,
Point3d input,
Point3d output)
Conformally maps a rectangular grid to an ellipse using the method of
Daniela Rosca, Uniform and refinable grids on elliptic domains and on
some surfaces of revolution, Applied Mathematics and Computation,Volume
217, Issue 19, 2011, Pages 7812-7817
|
static FemModel3d |
createConformalHexCylinder(FemModel3d fem,
double l,
double r,
int nl,
int nr)
Creates a hex cylinder by first generating a hex grid, then mapping it to
a cylinder using a conformal map
|
static FemModel3d |
createConformalHexEllipsoid(FemModel3d model,
double rz,
double rsx,
double rsy,
int nr)
Creates a hex ellipsoidal model by first
creating a hex sphere using
createConformalHexSphere(artisynth.core.femmodels.FemModel3d, double, int)
and then scaling it. |
static FemModel3d |
createConformalHexSphere(FemModel3d fem,
double r,
int nr)
Creates a hex sphere by first generating a regular grid, then mapping it
to the sphere using a volume-preserving bi-lipschitz projection
|
static FemModel3d |
createCylinder(FemModel3d model,
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 model,
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,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model by extruding a surface mesh along the
normal direction of its faces.
|
static FemModel3d |
createExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
FemModel3d shellFem)
Creates a shell-type FEM model by extruding the shell elements of an
existing surface mesh along the direction of the associated vertex
normals.
|
static FemModel3d |
createExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-type FEM model by extruding a surface mesh along the
normal direction of its faces.
|
static FemModel3d |
createFlattenedHexSphere(FemModel3d fem,
double r,
double rf,
int nt) |
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)
Creates a regular grid, composed of elements of the type specified by
type , centered on the origin, with specified widths and grid
resolutions along each axis. |
static FemModel3d |
createHexCylinder(FemModel3d fem,
double h,
double r,
int nh,
int nt)
Creates a hex cylinder centered on the origin with its central axis
aligned with z.
|
static FemModel3d |
createHexEllipsoid(FemModel3d model,
double rx,
double ry,
double rz,
int nt)
Creates a hex ellipsoidal model by first
creating a hex sphere using
createHexSphere(artisynth.core.femmodels.FemModel3d, double, int)
and then scaling it. |
static FemModel3d |
createHexExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of hex elements by extruding a
surface mesh along the normal direction of its faces.
|
static FemModel3d |
createHexGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of hex elements.
|
static FemModel3d |
createHexSphere(FemModel3d fem,
double r,
int nt)
Creates a hex sphere by partitioning the sphere into seven regions: an
inner block, surrounded by six symmetrical sections.
|
static FemModel3d |
createHexTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a hollow torus made of hex elements.
|
static FemModel3d |
createHexTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a tube made of hex elements.
|
static FemModel3d |
createHexWedgeCylinder(FemModel3d model,
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 |
createHexWedgeExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface,
FemModel3d surfaceFem)
Creates a shell-based FEM model by extruding a surface mesh along the
normal direction of its faces.
|
static FemModel3d |
createIcosahedralSphere(FemModel3d model,
double r,
int ndivisions,
double quality)
Creates a tet-based spherical model based on a icosahedron.
|
static FemModel3d |
createPartialCylinder(FemModel3d model,
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 |
createPartialHexTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr,
double theta)
Creates a hollow partial torus made of hex elements.
|
static FemModel3d |
createPartialHexTube(FemModel3d model,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta)
Creates a partial tube made of hex elements.
|
static FemModel3d |
createPartialHexWedgeCylinder(FemModel3d model,
double l,
double r,
double theta,
int nl,
int nr,
int ntheta) |
static FemModel3d |
createPartialTetTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr,
double theta)
Creates a partial torus made of tet elements.
|
static FemModel3d |
createPartialTetTube(FemModel3d model,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta)
Creates a partial tube made of tet elements.
|
static FemModel3d |
createPartialTube(FemModel3d model,
FemFactory.FemElementType type,
double l,
double rin,
double rout,
double theta,
int nl,
int nr,
int ntheta)
Creates a partial tube made of either tet or hex elements, as specified
by
type . |
static FemModel3d |
createPolarSphere(FemModel3d model,
double r,
int nlat,
int nlong,
int nr)
Creates a fem model with tet, pyramid and hex elements by breaking
the domain into spherical (3D polar) coordinates.
|
static FemModel3d |
createPyramidGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of pyramid elements.
|
static FemModel3d |
createQuadhexExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of quadratic hex elements by
extruding a surface mesh along the normal direction of its faces.
|
static FemModel3d |
createQuadhexGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of quadratic hex elements.
|
static FemModel3d |
createQuadhexTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a hollow torus made of quadratic hex elements.
|
static FemModel3d |
createQuadhexTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a tube made of quadratic hex elements.
|
static FemModel3d |
createQuadpyramidGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of quadratic pyramid elements.
|
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 |
createQuadtetCylinder(FemModel3d model,
double h,
double r,
int nh,
int nr)
Creates a cylinder of quadratic tets, all with approximately uniform size
|
static FemModel3d |
createQuadtetCylinder(FemModel3d fem,
double l,
double r,
int nt,
int nl,
int nr)
Creates a quadratic tetrahedral cylinder by tetrahedralizing a hex-wedge
cylinder
|
static FemModel3d |
createQuadtetExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of quadratic tet elements by
extruding a surface mesh along the normal direction of its faces.
|
static FemModel3d |
createQuadtetGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of quadratic tet elements.
|
static FemModel3d |
createQuadtetSphere(FemModel3d model,
double r,
int nr)
Creates a sphere out of approximately uniform quadratic tets.
|
static FemModel3d |
createQuadtetTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a hollow torus made of quadratic tet elements.
|
static FemModel3d |
createQuadtetTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a tube made of quadratic tet elements.
|
static FemModel3d |
createQuadwedgeExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of quadratic wedge elements by
extruding a surface mesh along the normal direction of its faces.
|
static FemModel3d |
createQuadwedgeGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of quadratic wedge elements.
|
static FemModel3d |
createRoundedDisc(FemModel3d fem,
double h,
double r,
int nh,
int nt)
Creates a hex-dominant disc with rounded edges, based on a hex cylinder,
with additional hexes and wedges added to round off the surrounding edge.
|
static FemModel3d |
createRoundedHexWedgeDisc(FemModel3d fem,
double h,
double r,
int nt,
int nh,
int nr)
Creates a disc with rounded edges using hex and wedge elements, based on
a hex cylinder, with additional hexes and wedges added round off the
surrounding edge.
|
static FemModel3d |
createShellGrid(FemModel3d model,
FemFactory.FemElementType type,
double widthX,
double widthY,
int numX,
int numY,
double thickness,
boolean membrane)
Creates a regular grid of shell elements of the type specified by
type , centered on the origin, with specified widths and grid
resolutions along each axis. |
static FemModel3d |
createShellModel(FemModel3d model,
PolygonalMesh mesh,
double thickness,
boolean membrane)
Creates a shell model from an input mesh.
|
static FemModel3d |
createShellQuadGrid(FemModel3d model,
double widthX,
double widthY,
int numX,
int numY,
double thickness,
boolean membrane)
Creates a regular grid composed of shell quad elements.
|
static FemModel3d |
createShellTriGrid(FemModel3d model,
double widthX,
double widthY,
int numX,
int numY,
double thickness,
boolean membrane)
Creates a regular grid composed of shell triangle elements.
|
static FemModel3d |
createSphere(FemModel3d model,
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 |
createTetCylinder(FemModel3d model,
double h,
double r,
int nh,
int nr)
Creates a cylinder of tets, all with approximately uniform size
|
static FemModel3d |
createTetCylinder(FemModel3d fem,
double l,
double r,
int nt,
int nl,
int nr)
Creates a tetrahedral cylinder by tetrahedralizing a hex-wedge cylinder
|
static FemModel3d |
createTetEllipsoid(FemModel3d model,
double rz,
double rsx,
double rsy,
int nr)
Creates a ellipsoidal model using a tet elements by first
creating a tet sphere and then scaling it.
|
static FemModel3d |
createTetEllipsoid(FemModel3d model,
double rl,
double rs1,
double rs2,
int nt,
int nl,
int ns)
Creates an ellipsoidal model using tet elements.
|
static FemModel3d |
createTetExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of tet elements by
extruding a surface mesh along the normal direction of its faces.
|
static FemModel3d |
createTetGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of tet elements.
|
static FemModel3d |
createTetSphere(FemModel3d model,
double r,
int nr)
Creates a sphere out of approximately uniform tets.
|
static FemModel3d |
createTetTorus(FemModel3d model,
double R,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a torus made of tet elements.
|
static FemModel3d |
createTetTube(FemModel3d model,
double l,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a tube made of tet elements.
|
static FemModel3d |
createTorus(FemModel3d model,
FemFactory.FemElementType type,
double R,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a hollow torus made of either tet, hex, quadTet, or quadHex
elements, as specified by
type . |
static FemModel3d |
createTube(FemModel3d model,
FemFactory.FemElementType type,
double l,
double rin,
double rout,
int nt,
int nl,
int nr)
Creates a tube made of either tet, hex, quadTet, or quadHex elements, as
specified by
type . |
static FemModel3d |
createWedgeCylinder(FemModel3d model,
double h,
double r,
int nh,
int nr)
Creates a cylinder made entirely of wedges, all approximately uniform in
size
|
static FemModel3d |
createWedgeExtrusion(FemModel3d model,
int n,
double d,
double zOffset,
PolygonalMesh surface)
Creates a shell-based FEM model made of wedge elements by extruding a
surface mesh along the normal direction of its faces.
|
static FemModel3d |
createWedgeGrid(FemModel3d model,
double widthX,
double widthY,
double widthZ,
int numX,
int numY,
int numZ)
Creates a regular grid composed of wedge elements.
|
static void |
mapCubeToSphere(Point3d cube,
Point3d sphere)
Maps a 2x2x2 cube to a unit sphere
|
static void |
mapSphereToCube(Point3d sphere,
Point3d cube)
Maps a unit sphere to a 2x2x2 cube
|
static FemModel3d |
mergeCollapsedNodes(FemModel3d model,
FemModel3d orig,
double epsilon) |
static FemModel3d |
refineFem(FemModel3d model,
FemModel3d input,
double quality)
Creates a refined version of a an existing tetrahedral FEM model using
tetgen.
|
static FemModel3d |
refineFem(FemModel3d model,
FemModel3d input,
double quality,
Point3d[] pnts)
Creates a refined version of a an existing tetrahedral FEM model using
tetgen and a list of supplemental node locations.
|
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)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Tet
.public static FemModel3d createPyramidGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Pyramid
.public static FemModel3d createHexGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Hex
.public static FemModel3d createWedgeGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Wedge
.public static FemModel3d createQuadtetGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadTet
.public static FemModel3d createQuadhexGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadHex
.public static FemModel3d createQuadwedgeGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadWedge
.public static FemModel3d createQuadpyramidGrid(FemModel3d model, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
createGrid(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadPyramid
.public static FemModel3d createGrid(FemModel3d model, FemFactory.FemElementType type, double widthX, double widthY, double widthZ, int numX, int numY, int numZ)
type
, centered on the origin, with specified widths and grid
resolutions along each axis.model
- model to which the elements be added, or
null
if the model is to be created from scratch.type
- desired element typewidthX
- x axis model widthwidthY
- y axis model widthwidthZ
- z axis model widthnumX
- element resolution along the x axisnumY
- element resolution along the y axisnumZ
- element resolution along the z axisjava.lang.IllegalArgumentException
- if the specified element type
is not supportedpublic static FemModel3d createShellTriGrid(FemModel3d model, double widthX, double widthY, int numX, int numY, double thickness, boolean membrane)
createShellGrid(FemModel3d,FemElementType,double,double,int,int,double,
boolean)
with the element type set to FemFactory.FemElementType.ShellTri
.public static FemModel3d createShellModel(FemModel3d model, PolygonalMesh mesh, double thickness, boolean membrane)
public static FemModel3d createShellQuadGrid(FemModel3d model, double widthX, double widthY, int numX, int numY, double thickness, boolean membrane)
createShellGrid(FemModel3d,FemElementType,double,double,int,int,double,
boolean)
with the element type set to FemFactory.FemElementType.ShellQuad
.public static FemModel3d createShellGrid(FemModel3d model, FemFactory.FemElementType type, double widthX, double widthY, int numX, int numY, double thickness, boolean membrane)
type
, centered on the origin, with specified widths and grid
resolutions along each axis.model
- model to which the elements be added, or
null
if the model is to be created from scratch.type
- desired element typewidthX
- x axis model widthwidthY
- y axis model widthnumX
- element resolution along the x axisnumY
- element resolution along the y axisthickness
- element rest thicknessmembrane
- if true
, defined the elements to
to be membrane elementsjava.lang.IllegalArgumentException
- if the specified element type
is not supported or is not an shell elementpublic static FemModel3d mergeCollapsedNodes(FemModel3d model, FemModel3d orig, double epsilon)
public static FemModel3d createIcosahedralSphere(FemModel3d model, double r, int ndivisions, double quality)
model
- 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.model
if
model
is not null
).public static FemModel3d createPolarSphere(FemModel3d model, double r, int nlat, int nlong, int nr)
model
- model to populate, null to create oner
- radius of spherenlat
- number of latitude divisions (not including 0)nlong
- number of longitude divisionsnr
- number of radial divisions (not including 0)public static FemModel3d createSphere(FemModel3d model, double r, int nt, int nl, int ns)
createEllipsoid(artisynth.core.femmodels.FemModel3d, double, double, double, int, int, int)
.model
- 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)model
if
model
is not null
).public static FemModel3d createTetSphere(FemModel3d model, double r, int nr)
model
- model to populate, created if nullr
- radius of spherenr
- number of layerspublic static FemModel3d createQuadtetSphere(FemModel3d model, double r, int nr)
model
- model to populate, created if nullr
- radius of spherenr
- number of layerspublic static FemModel3d createConformalHexSphere(FemModel3d fem, double r, int nr)
fem
- model to populater
- radiusnr
- number of elements radially along each axis from the sphere
centerpublic static FemModel3d createHexSphere(FemModel3d fem, double r, int nt)
fem
- model to which the elements should be added, or
null
if the model is to be created from scratchr
- sphere radiusnt
- number of elements around the circumference. Will be rounded up
to an even multiple of 4.public static FemModel3d createFlattenedHexSphere(FemModel3d fem, double r, double rf, int nt)
public static FemModel3d createEllipsoid(FemModel3d model, double rl, double rs1, double rs2, int nt, int nl, int ns)
rl
should be the longest
radius, and corresponds to the polar axis.model
- 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)model
if
model
is not null
).public static FemModel3d createTetEllipsoid(FemModel3d model, double rl, double rs1, double rs2, int nt, int nl, int ns)
rl
should be the longest radius, and
corresponds to the polar axis.model
- 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 equator (will
be rounded up to an even number)nl
- 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)model
if
model
is not null
).public static FemModel3d createConformalHexEllipsoid(FemModel3d model, double rz, double rsx, double rsy, int nr)
createConformalHexSphere(artisynth.core.femmodels.FemModel3d, double, int)
and then scaling it.model
- empty FEM model to which elements are added; if
null
then a new model is allocatedrz
- longest radius (also the polar radius)rsx
- first radius perpendicular to the polar axisrsy
- second radius perpendicular to the polar axisnr
- number of nodes in each radial line extending out from
the polar axis (including end nodes)model
if
model
is not null
).public static FemModel3d createHexEllipsoid(FemModel3d model, double rx, double ry, double rz, int nt)
createHexSphere(artisynth.core.femmodels.FemModel3d, double, int)
and then scaling it.model
- empty FEM model to which elements are added; if
null
then a new model is allocatedrx
- radius along xry
- radius along yrz
- radius along znt
- number of elements around the circumference. Will be rounded up
to an even multiple of 4.public static FemModel3d createTetEllipsoid(FemModel3d model, double rz, double rsx, double rsy, int nr)
model
- empty FEM model to which elements are added; if
null
then a new model is allocatedrz
- longest radius (also the polar radius)rsx
- first radius perpendicular to the polar axisrsy
- second radius perpendicular to the polar axisnr
- number of nodes in each radial line extending out from
the polar axis (including end nodes)model
if
model
is not null
).public static FemModel3d createCylinder(FemModel3d model, double l, double r, int nt, int nl, int nr)
model
- model to which the elements should be added, or
null
if the model is to be created from scratch.l
- length along the z axisr
- radius in the x-y planent
- element resolution around the center axisnl
- element resolution along the lengthnr
- element resolution along the radiuspublic static FemModel3d createRoundedHexWedgeDisc(FemModel3d fem, double h, double r, int nt, int nh, int nr)
r
of the flat portion of the disc, and a height h
. The rounding radius at the edhe h/2
, so that the total radius
about z is r + h/2
.
One disadvantage of this meshing method is that the element density
increases towards the center of the disc, culminating in a small inner
disc composed of wedges. The method createRoundedDisc(artisynth.core.femmodels.FemModel3d, double, double, int, int)
improves
on this by replacing the central disc of wedges with a regular hex grid.
fem
- model to which the elements should be added, or
null
if the model is to be created from scratch.h
- height along the z axisr
- radius of the flat part of the discnh
- number of elements along the z-axis, as seen through an
interior cross section. Will be rounded up to an even number. The number
of rounding elements used to wrap around the edge in a radial direction
will also be based on this value.nt
- number of elements around the circumference. Will be rounded up
to be at least 3.nr
- number of elements along the flat radius. Will
be rounded up to at least 1.public static FemModel3d createRoundedDisc(FemModel3d fem, double h, double r, int nh, int nt)
r
of the
flat portion of the disc, and a height h
. The rounding radius at
the edge is h/2
, so that the total radius about z is r +
h/2
.
The mesh created by this method is best behaved when h <=
r
. As h
increases beyond r
, the regular hex grid in the
center will become quite small and dense, and so alternative mesh
formulations may be preferable in such circumstances.
fem
- model to which the elements should be added, or
null
if the model is to be created from scratch.h
- height along the z axisr
- radius of the flat part of the discnh
- number of elements along the z-axis, as seen through an
interior cross section. Will be rounded up to an even number. The number
of rounding elements used to wrap around the edge in a radial direction
will also be based on this value.nt
- number of elements around the circumference. Will be rounded up
to an even multiple of 4.public static FemModel3d createHexWedgeCylinder(FemModel3d model, double l, double r, int nt, int nl, int nr)
createCylinder(FemModel3d,double,double,int,int,int)
.public static FemModel3d createTetCylinder(FemModel3d fem, double l, double r, int nt, int nl, int nr)
fem
- model to populatel
- length of cylinder (z-axis)r
- radius of cylindernt
- number of elements around the arc (will be rounded up
to an even number)nl
- number of elements along the lengthnr
- number of elements radiallypublic static FemModel3d createQuadtetCylinder(FemModel3d fem, double l, double r, int nt, int nl, int nr)
fem
- model to populatel
- length of cylinder (z-axis)r
- radius of cylindernt
- number of elements around the arcnl
- number of elements along the lengthnr
- number of elements radiallypublic static FemModel3d createWedgeCylinder(FemModel3d model, double h, double r, int nh, int nr)
model
- model to populate, created if nullh
- height of cylinder (z-axis)r
- radius of cylindernh
- element resolution in znr
- radial element resolutionpublic static FemModel3d createTetCylinder(FemModel3d model, double h, double r, int nh, int nr)
model
- model to populate (if null, one is created)h
- height of cylinderr
- radius of cylindernh
- element resolution along heightnr
- radial element resolutionpublic static FemModel3d createQuadtetCylinder(FemModel3d model, double h, double r, int nh, int nr)
model
- model to populate (if null, one is created)h
- height of cylinderr
- radius of cylindernh
- element resolution along heightnr
- radial element resolutionpublic static void conformalMapEllipseRectangle(double a, double b, double L1, double L2, Point3d input, Point3d output)
Daniela Rosca, Uniform and refinable grids on elliptic domains and on some surfaces of revolution, Applied Mathematics and Computation,Volume 217, Issue 19, 2011, Pages 7812-7817
a
- ellipsoid radius along xb
- ellipsoid radius along yL1
- rectangle half-width along xL2
- rectangle half-width along yinput
- input point (x,y)output
- output point (x,y) modified, z left unchangedpublic static void conformalMapRectangleEllipse(double a, double b, double L1, double L2, Point3d input, Point3d output)
Daniela Rosca, Uniform and refinable grids on elliptic domains and on some surfaces of revolution, Applied Mathematics and Computation,Volume 217, Issue 19, 2011, Pages 7812-7817
a
- ellipsoid radius along xb
- ellipsoid radius along yL1
- rectangle half-width along xL2
- rectangle half-width along yinput
- input point using (x,y)output
- output point, only x,y are modifiedpublic static void bilipschitzMapSphereCylinder(Point3d input, Point3d output)
A bi-Lipschitz continuous, volume preserving map from the unit ball onto a cube, Griepentrog, Hoppner, Kaiser, Rehberg, 2008
input
- sphere input pointoutput
- cylinder input pointpublic static void bilipschitzMapCylinderSphere(Point3d input, Point3d output)
A bi-Lipschitz continuous, volume preserving map from the unit ball onto a cube, Griepentrog, Hoppner, Kaiser, Rehberg, 2008
input
- cylinder input pointoutput
- sphere output pointpublic static void mapCubeToSphere(Point3d cube, Point3d sphere)
cube
- input point in cube coordinatessphere
- output point in sphere coordinatespublic static void mapSphereToCube(Point3d sphere, Point3d cube)
sphere
- input point in sphere coordinatescube
- output point in cube coordinatespublic static FemModel3d createConformalHexCylinder(FemModel3d fem, double l, double r, int nl, int nr)
fem
- modell
- length of cylinder (z-axis)r
- radius of cylindernl
- number of elements along the lengthnr
- number of elements outward from the radius along the x,y-axespublic static FemModel3d createHexCylinder(FemModel3d fem, double h, double r, int nh, int nt)
fem
- model to which the elements should be added, or
null
if the model is to be created from scratchh
- height the along z axisr
- cylinder radiusnh
- number of elements along the heightnt
- number of elements around the circumference. Will be rounded up
to an even multiple of 4.public static FemModel3d createPartialCylinder(FemModel3d model, double l, double r, double theta, int nl, int nr, int ntheta)
model
- model to which the elements should be added, or
null
if the model is to be created from scratch.l
- length along the z axisr
- radius in the x-y planetheta
- size of the slice, in radiansnl
- element resolution along the lengthnr
- element resolution along the radiusntheta
- element resolution around the slicepublic static FemModel3d createPartialHexWedgeCylinder(FemModel3d model, double l, double r, double theta, int nl, int nr, int ntheta)
public static FemModel3d createHexTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
createTube(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Hex
.public static FemModel3d createTetTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
createTube(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Tet
.public static FemModel3d createPartialHexTube(FemModel3d model, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
createPartialTube(FemModel3d,FemElementType,double,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Hex
.public static FemModel3d createPartialTetTube(FemModel3d model, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
createPartialTube(FemModel3d,FemElementType,double,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Tet
.public static FemModel3d createHexTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr)
createTorus(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.Hex
.public static FemModel3d createPartialHexTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr, double theta)
model
- model to which the elements should be added, or
null
if the model is to be created from scratch.R
- major radiusrin
- inner part of the minor radiusrout
- outer part of the minor radiusnt
- element resolution around the minor radiusnl
- element resolution around the major radiusnr
- element resolution (plus 1) along the inner thicknesstheta
- angular circumference around the major radius. Specifying
2*Math.PI
will result in a full torus.public static FemModel3d createPartialTetTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr, double theta)
theta
as
2*Math.PI
will create a full torus.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.R
- major radiusrin
- inner part of the minor radiusrout
- outer part of the minor radiusnt
- element resolution around the minor radius (will be rounded
up to an even number)nl
- element resolution around the major radius (for a full
torus, will be rounded up to an even number)nr
- element resolution (plus 1) along the inner thicknesstheta
- angular circumference around the major radius. Specifying
2*Math.PI
will result in a full torus.public static FemModel3d createTetTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr)
model
- model to which the elements should be added, or
null
if the model is to be created from scratch.R
- major radiusrin
- inner part of the minor radiusrout
- outer part of the minor radiusnt
- element resolution around the minor radiusnl
- element resolution around the major radiusnr
- element resolution (plus 1) along the inner thicknesspublic static FemModel3d createQuadraticModel(FemModel3d quadMod, FemModel3d linMod)
linMod
- A FemModel3d previously inialized with only linear elements.public static FemModel3d createQuadtetTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
createTube(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadTet
.public static FemModel3d createQuadtetTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr)
createTorus(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadTet
.public static FemModel3d createQuadtetExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.QuadTet
.public static FemModel3d createQuadhexTube(FemModel3d model, double l, double rin, double rout, int nt, int nl, int nr)
createTube(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadHex
.public static FemModel3d createQuadhexTorus(FemModel3d model, double R, double rin, double rout, int nt, int nl, int nr)
createTorus(FemModel3d,FemElementType,double,double,double,int,int,int)
with the element type set to FemFactory.FemElementType.QuadHex
.public static FemModel3d createQuadhexExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.QuadHex
.public static FemModel3d createQuadwedgeExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.Wedge
.public static FemModel3d createHexExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.Hex
.public static FemModel3d createWedgeExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.Wedge
.public static FemModel3d createHexWedgeExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface, FemModel3d surfaceFem)
n
.model
- model to which the elements should be added, or
null
if the model is to be created from scratch. Note that
model
must be different from surfaceFem
n
- number of layersd
- layer thicknesszOffset
- offset from the surfacesurface
- surface mesh to extrudesurfaceFem
- FEM associated with the surface mesh, or
null
if there is no associated FEM.model
if
that argument is not null
.public static FemModel3d createExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
n
.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.n
- number of layersd
- layer thicknesszOffset
- offset from the surfacesurface
- surface mesh to extrudemodel
if that
argument is not null
java.lang.IllegalArgumentException
- if the specified element type is not
supported, or if the surface faces are not triangles or quads.public static FemModel3d createExtrusion(FemModel3d model, int n, double d, double zOffset, FemModel3d shellFem)
n
.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.n
- number of layersd
- layer thicknesszOffset
- offset from the surfaceshellFem
- FEM model suppling the shell elementsmodel
if that
argument is not null
java.lang.IllegalArgumentException
- if the specified element type is not
supported, or if the surface faces are not triangles or quads.public static FemModel3d createTetExtrusion(FemModel3d model, int n, double d, double zOffset, PolygonalMesh surface)
createExtrusion(FemModel3d,FemElementType,int,double,double,PolygonalMesh)
with the element type set to FemFactory.FemElementType.Tet
.public static FemModel3d createTube(FemModel3d model, FemFactory.FemElementType type, double l, double rin, double rout, int nt, int nl, int nr)
type
. Note that the element resolution
nt
around the central axis will be rounded up to
an even number for tet or quadTet models.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.type
- desired element typel
- length along the z axisrin
- inner radiusrout
- outer radiusnt
- element resolution around the central axis (will be
rounded up to an even number for tet or quadTet models)nl
- element resolution along the lengthnr
- element resolution along the thicknessjava.lang.IllegalArgumentException
- if the specified element type
is not supportedpublic static FemModel3d createPartialTube(FemModel3d model, FemFactory.FemElementType type, double l, double rin, double rout, double theta, int nl, int nr, int ntheta)
type
.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.type
- desired element typel
- length along the z axisrin
- inner radiusrout
- outer radiustheta
- size of the partial tube slice, in radiansnl
- element resolution along the lengthnr
- element resolution along the thicknessntheta
- element resolution along the slicejava.lang.IllegalArgumentException
- if the specified element type
is not supportedpublic static FemModel3d createTorus(FemModel3d model, FemFactory.FemElementType type, double R, double rin, double rout, int nt, int nl, int nr)
type
. The result is essentially
a tube, with inner and outer radii given by rin
and rout
, bent around the major radius R and connected.
For tet or quadTet models, the element resolutions nt
and nl
will be rounded up to an even number.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.type
- desired element typeR
- major radiusrin
- inner part of the minor radiusrout
- outer part of the minor radiusnt
- element resolution around the major radius (will be rounded
up to an even number for tet or quadTet models)nl
- element resolution around the minor radius (will be rounded
up to an even number for tet or quadTet models)nr
- element resolution along the inner thicknessjava.lang.IllegalArgumentException
- if the specified element type
is not supportedpublic static FemModel3d createExtrusion(FemModel3d model, FemFactory.FemElementType type, int n, double d, double zOffset, PolygonalMesh surface)
type
. The shell
can have multiple layers; the number of layers is n
.model
- model to which the elements should be added, or
null
if the model is to be created from scratch.type
- desired element typen
- number of layersd
- layer thicknesszOffset
- offset from the surfacesurface
- surface mesh to extrudemodel
if
that argument is not null
java.lang.IllegalArgumentException
- if the specified element type is not
supported, or if the surface faces are incompatible with the element
type.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 model, FemModel3d input, double quality, Point3d[] pnts)
model
- model in which the refined model be built, or
null
if the model is to be created from scratch.input
- original FEM model which is to be refinedquality
- quality factor used by tetgen to refine the modelpnts
- locations of the supplemental nodepublic static FemModel3d refineFem(FemModel3d model, FemModel3d input, double quality)
model
- model in which the refined model be built, or
null
if the model is to be created from scratch.input
- original FEM model which is to be refinedquality
- quality factor used by tetgen to refine the modelpublic 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