Eidolon
Classes | Functions | Variables
eidolon.MathDef Namespace Reference

Classes

class  ElemTypeDef
 
class  ElemTypeMap
 

Functions

def findFaces (xis, numVertices, isSimplex)
 
def findEdges (xis, numVertices, isSimplex)
 
def lagrangeBasisI (i, K, xi, alpha, beta)
 
def lagrangeBasisIStr (i, K, d, alpha, beta)
 
def lagrangeBasisFuncs (K, alpha, beta)
 
def lagrangeBasis (K, dim, alpha, beta)
 
def lagrangeAlpha (beta, xicoords)
 
def lagrangeBeta (order, isSimplex, dim)
 
def xiCoords (order, beta)
 
def nodalLagrangeType (geom, desc, order)
 
def jacobiPoly (n, a, b, x)
 
def modalPoly (n, N, x)
 
def modalPolyLineType (geom, desc, order)
 
def jacobiEvaluate (x, order, a, b)
 
def get1DSpectralCoords (order)
 
def getSpectralTensorCoords (dim, order)
 
def spectralBasis1D (xi, powers, coeffs)
 
def evaluateSpectralBasis (xi0, xi1, xi2, powers, coeffs, order, dim)
 
def spectralBasisType (geom, desc, order)
 
def bezierLineType (geom, desc, order)
 
def cubicHermiteCoeffs1D (t, u=0, v=0)
 
def cubicHermiteCoeffs2D (t, u, v=0)
 
def cubicHermiteCoeffs3D (t, u, v)
 
def cubicHermiteType (geom, desc, order)
 
def catmullRomCoeffs1D (t, u=0, v=0)
 
def catmullRomCoeffs2D (t, u, v=0)
 
def catmullRomCoeffs3D (t, u, v)
 
def catmullRomType (geom, desc, order)
 
def piecewiseCatmullRomType (geom, desc, order)
 

Variables

 GeomType
 

Function Documentation

◆ bezierLineType()

def eidolon.MathDef.bezierLineType (   geom,
  desc,
  order 
)
Generates a bezier line type implemented with De Casteljau's algorithm. A line must have 1+order control points,
order 1 is a linear line. The line passes through only the first and last control points.
Here is the call graph for this function:

◆ catmullRomCoeffs1D()

def eidolon.MathDef.catmullRomCoeffs1D (   t,
  u = 0,
  v = 0 
)
Defines 4 coefficients for interpolating over the unit interval `t', where the result values are for the function 
values at t=-1, t=0, t=1, and t=2. This is used when the derivatives at t=0 and t=1 are not known and adjacent
values at t=-1 and t=2 are used instead. This basis function is a Catmull Rom spline with tension value tau of 0.5.
The result is equivalent to (t*t-t*0.5-t*t*t*0.5, t*t*t*1.5-2.5*t*t+1, 2*t*t+t*0.5-t*t*t*1.5, t*t*t*0.5-0.5*t*t).

◆ catmullRomCoeffs2D()

def eidolon.MathDef.catmullRomCoeffs2D (   t,
  u,
  v = 0 
)
Defines the 16 coefficients for interpolating over the unit quadrilateral (t,u). Given two Catmull Rom splines 
at,bt,ct,dt=catmullRomCoeffs1D(t) and au,bu,cu,du=catmullRomCoeffs1D(u), this is equivalent to 
    Matrix([au,bu,cu,du])*Matrix([at,bt,ct,dt]).T
which if flattened is equivalent to 
    at*au,bt*au,ct*au,dt*au, at*bu,bt*bu,ct*bu,dt*bu, at*cu,bt*cu,ct*cu,dt*cu, at*du,bt*du,ct*du,dt*du
    
The implementation is derived from Sympy using the routine cse(Matrix([au,bu,cu,du])*Matrix([at,bt,ct,dt]).T))
to eliminate common subexpressions from the above matrix.

◆ catmullRomCoeffs3D()

def eidolon.MathDef.catmullRomCoeffs3D (   t,
  u,
  v 
)
Defines the 64 coefficients for interpolating over the unit cube (t,u,v). The code of this function is equivalent
to this code:
    c2d=catmullRomCoeffs2D(t,u)
    av,bv,cv,dv=catmullRomCoeffs1D(v)
    return tuple(c*av for c in c2d)+tuple(c*bv for c in c2d)+tuple(c*cv for c in c2d)+tuple(c*dv for c in c2d)
    
The implementation is derived from Sympy using the cse routine to eliminate common expressions.

◆ catmullRomType()

def eidolon.MathDef.catmullRomType (   geom,
  desc,
  order 
)
Returns a Catmull Rom ElemTypeDef object for line, quad, or hex geometries. The `order' argument is ignored.
Here is the caller graph for this function:

◆ cubicHermiteCoeffs1D()

def eidolon.MathDef.cubicHermiteCoeffs1D (   t,
  u = 0,
  v = 0 
)
Defines 4 coefficients for interpolating over the unit interval `t', where the result values are for the function 
values at t=0 and t=1, and the derivatives of those values at t=0 and t=1. Thus if two values p1 and p2 have 
derivatives m1 and m2, (a,b,c,d)=cubicHermiteCoeffs1D(t) implies the value at t is (a*p1 + b*p2 + c*m1 + d*m2).
Here is the caller graph for this function:

◆ cubicHermiteCoeffs2D()

def eidolon.MathDef.cubicHermiteCoeffs2D (   t,
  u,
  v = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cubicHermiteCoeffs3D()

def eidolon.MathDef.cubicHermiteCoeffs3D (   t,
  u,
  v 
)
Here is the call graph for this function:

◆ cubicHermiteType()

def eidolon.MathDef.cubicHermiteType (   geom,
  desc,
  order 
)

◆ evaluateSpectralBasis()

def eidolon.MathDef.evaluateSpectralBasis (   xi0,
  xi1,
  xi2,
  powers,
  coeffs,
  order,
  dim 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEdges()

def eidolon.MathDef.findEdges (   xis,
  numVertices,
  isSimplex 
)
Here is the call graph for this function:

◆ findFaces()

def eidolon.MathDef.findFaces (   xis,
  numVertices,
  isSimplex 
)
Find the faces of an axis-aligned element (tet or hex) with unit xi coordinates. This adheres to CHeart node
ordering. The first indices for each face will be the vertices, the last is the index for a node opposite the face.
A more general face-finding operation would look for those nodes defining vertices and then the nodes between them
to find faces, but life is easier with axis-aligned elements. Other geometry types other than tet or hex would
require modification to this function. The first return value is a list of face index lists, the second is a list
of xi values which when subtracted from a xi coordinate on the face will produce an internal xi coordinate.
Here is the caller graph for this function:

◆ get1DSpectralCoords()

def eidolon.MathDef.get1DSpectralCoords (   order)
Calculate the xi positions for the 1D spectral basis.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSpectralTensorCoords()

def eidolon.MathDef.getSpectralTensorCoords (   dim,
  order 
)
Here is the call graph for this function:

◆ jacobiEvaluate()

def eidolon.MathDef.jacobiEvaluate (   x,
  order,
  a,
  b 
)
Here is the caller graph for this function:

◆ jacobiPoly()

def eidolon.MathDef.jacobiPoly (   n,
  a,
  b,
  x 
)
Calculates the Jacobi polynomial for node `n' and xi value `x', with parameters `a' and `b'.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lagrangeAlpha()

def eidolon.MathDef.lagrangeAlpha (   beta,
  xicoords 
)
Calculate an alpha matrix for a nodal lagrange basis function by applying the Vandermonde matrix method to a beta
matrix and node xi coords. This adheres to CHeart node ordering.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lagrangeBasis()

def eidolon.MathDef.lagrangeBasis (   K,
  dim,
  alpha,
  beta 
)
Create a lagrange basis function which accepts xi values and calculates coefficients for each node.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lagrangeBasisFuncs()

def eidolon.MathDef.lagrangeBasisFuncs (   K,
  alpha,
  beta 
)
Create a sequence of lagrange basis functions, each of which accepts xi values and calculates the coefficient for
its respective node.
Here is the call graph for this function:

◆ lagrangeBasisI()

def eidolon.MathDef.lagrangeBasisI (   i,
  K,
  xi,
  alpha,
  beta 
)
Evaluate the i'th lagrange basis function using the input xi values and matrix definitions.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lagrangeBasisIStr()

def eidolon.MathDef.lagrangeBasisIStr (   i,
  K,
  d,
  alpha,
  beta 
)
Construct a string representing the i'th lagrange basis function with free variables xi0,xi1,xi2 storing the
input xi values.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lagrangeBeta()

def eidolon.MathDef.lagrangeBeta (   order,
  isSimplex,
  dim 
)
Calculate the beta matrix for a nodal lagrange basis function defining hex or tet elements.
This adheres to CHeart node ordering.
Here is the caller graph for this function:

◆ modalPoly()

def eidolon.MathDef.modalPoly (   n,
  N,
  x 
)
Calculates the modal polynomial for node `n' out of `N' total nodes at xi value `x'.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modalPolyLineType()

def eidolon.MathDef.modalPolyLineType (   geom,
  desc,
  order 
)
Generates the ElemTypeDef object which defines the modal poly line element type.
Here is the call graph for this function:

◆ nodalLagrangeType()

def eidolon.MathDef.nodalLagrangeType (   geom,
  desc,
  order 
)
Generate the ElemTypeDef object which defines a nodal lagrange element type for the given type geometry,
description, and order. This relies on CHeart node ordering where xi coordinates are sorted based on component
values, where X is least significant and Z most, but with the vertices coming first before medial nodes.
Here is the call graph for this function:

◆ piecewiseCatmullRomType()

def eidolon.MathDef.piecewiseCatmullRomType (   geom,
  desc,
  order 
)
Defines the basis function for a piecewise Catmull Rom object. A piecewise object is composed of multiple sub-element
which are treated as one large object with a continuous xi space. The basis function will, for a given xi coordinate,
determine which element this xi coordinate falls into, what the local xi coordinate in that element is, and choose
the indices of the control points for that element. The produced basis function requires arguments in addition to
the xi coordinates:
    - ul: number of nodes in x dimension
    - vl: number of nodes in y dimension (default 1)
    - wl: number of nodes in z dimension (default 1)
    - circular: a list of boolean values, 1 per dimension, stating if that dimension represents a continuous, circular
    xi space. Setting this to True for certain dimensions can be used to define loops in 1D, cylinders or spheres in 
    2D or 3D. This needs to be coordinated with the limits value to define overlapping control points.
    - limits: a list of integer pairs, 1 per dimension, stating how many nodes at the end of the dimension are control
    point nodes only and do not define geometry, default value for dimensions is (1,1) meaning the edge nodes are for
    control only. Values of (0,0) mean the geometry of the object is defined by all nodes in that dimension, and 
    values of (-1,-1) imply that control points at one dimension edge are used as derivatives at the opposite edge
    (ie. a circular xi space in that dimension) which make sense mostly with "circular" being true for that dimension.
Here is the call graph for this function:

◆ spectralBasis1D()

def eidolon.MathDef.spectralBasis1D (   xi,
  powers,
  coeffs 
)
Here is the caller graph for this function:

◆ spectralBasisType()

def eidolon.MathDef.spectralBasisType (   geom,
  desc,
  order 
)
Here is the call graph for this function:

◆ xiCoords()

def eidolon.MathDef.xiCoords (   order,
  beta 
)
Calculate xi coords for nodes from a beta matrix.
Here is the caller graph for this function:

Variable Documentation

◆ GeomType

GeomType
Initial value:
1 = enum(
2  ('Point','Point',0,False),
3  ('Line','Line',1,False),
4  ('Tri','Triangle',2,True),
5  ('Quad','Quadrilateral',2,False),
6  ('Tet','Tetrahedron',3,True),
7  ('Hex','Hexahedron',3,False),
8  ('Cyl','Cylinder',3,False),
9  ('Hemi','Hemisphere',3,False),
10  doc='This defines the element geometry types available, eg. point, line, tet, etc. Values are (Name,Dimension,isSimplex).'
11 )