pygetdp.Function

class pygetdp.Function[source]

Defining global and piecewise expressions

Parameters:
descriptionstr (optional)

Comment to describe the object

Attributes:
code

Methods

Abs(expression)

Absolute value of expression.

Acos(expression)

Arc cosine (inverse cosine) of expression in [0,Pi], expression in [-1,1] (real valued only).

Asin(expression)

Arc sine (inverse sine) of expression in [-Pi/2,Pi/2], expression in [-1,1] (real valued only).

AtIndex(expression, expression_cst_list)

Returns the i-th entry of expression_cst_list.

Atan(expression)

Arc tangent (inverse tangent) of expression in [-Pi/2,Pi/2] (real valued only).

Atan2(expression)

Arc tangent (inverse tangent) of the first expression divided by the second, in [-Pi,Pi] (real valued only).

Cart2Cyl(vector)

Gets the tensor for transformation of vector from cartesian to cylindric coordinates.

Cart2Pol(expr)

Converts the cartesian form (reale, imaginary) of a complex-valued expression into polar form (amplitude, phase [radians]).

Cart2Sph(vector)

Gets the tensor for transformation of vector from cartesian to spherical coordinates.

Ceil(expression)

Rounds upwards to the nearest integer that is not less than expression (real valued only).

CompElementNum()

Returns 0 if the current element and the current source element are identical.

CompX(vector)

Gets the X component of a vector.

CompXX(tensor)

Gets the XX component of a tensor.

CompXY(tensor)

Gets the XY component of a tensor.

CompXZ(tensor)

Gets the XZ component of a tensor.

CompY(vector)

Gets the Y component of a vector.

CompYX(tensor)

Gets the YX component of a tensor.

CompYY(tensor)

Gets the YY component of a tensor.

CompYZ(tensor)

Gets the YZ component of a tensor.

CompZ(vector)

Gets the Z component of a vector.

CompZX(tensor)

Gets the ZX component of a tensor.

CompZY(tensor)

Gets the ZY component of a tensor.

CompZZ(tensor)

Gets the ZZ component of a tensor.

Complex(*args)

Creates a (multi-harmonic) complex expression from an number of real-valued expressions.

ComplexScalarField(expression, ...[, ...])

Idem, but consider only complex-valued scalar fields.

ComplexTensorField(expression, ...[, ...])

Idem, but consider only complex-valued tensor fields.

ComplexVectorField(expression, ...[, ...])

Idem, but consider only complex-valued vector fields.

Conj(z)

Computes the conjugate of a complex-valued expression.

Cos(expression)

Cosine of expression.

Cos_wt_p(omega, phase)

The first parameter represents the angular frequency and the second represents the phase.

Cosh(expression)

Hyperbolic cosine of expression.

Cross(expression1, expression2)

Cross product of the two arguments; expression must be a vector.

Det(expression)

Determinant of the tensor expression.

ElementNum()

Returns the tag (number) of the current element.

ElementVol()

Computes the element’s volume.

Exp(expression)

Exponential function: e^expression.

Fabs(expression)

Absolute value of expression (real valued only).

Field(expression[, expression_cst_list])

Evaluate the last one of the fields (“views”) loaded with GmshRead (see Types for Resolution), at the point expression.

Floor(expression)

Rounds downwards to the nearest integer that is not greater than expression (real valued only).

Fmod(expression1, expression2)

Remainder of the division of the first expression by the second, with the sign of the first (real valued only).

GetCpuTime()

Returns current CPU time, in seconds (total amount of time spent executing in user mode since GetDP was started).

GetMemory()

Returns the current memory usage, in megabytes (maximum resident set size).

GetNumElements(expression_cst_list)

Counts the elements of physical numbers in expression_cst_list or of the actual region if expression_cst_list is empty.

GetNumberRunTime(char_expression[, expression])

Gets the value of the char-expression ONELAB variable at run-time.

GetVariable(expression, variable_id)

Gets the value of the runtime variable $variable-id.

GetVolume()

Computes the volume of the actual physical group.

GetWallClockTime()

Returns the current wall clock time, in seconds (total wall clock time since GetDP was started).

GradHelmholtz(dim, k0)

Gradient of Helmholtz relative to the destination point ($X, $Y, $Z).

GradLaplace(dim)

Gradient of Laplace relative to the destination point ($X, $Y, $Z).

Helmholtz(dim, k0)

exp(j*k0*r)/(4*Pi*r), where k0 is given by the second parameter.

Hypot(expression1, expression2)

Square root of the sum of the squares of its arguments.

Im(z)

Takes the imaginary part of a complex-valued expression.

InterpolationAkima(expression, ...)

Akima interpolation of points.

InterpolationBilinear(expression1, ...)

Bilinear interpolation of a table based on two variables.

InterpolationLinear(expression, ...)

Linear interpolation of points.

Interval(*args)

Not documented yet.

Inv(expression)

Inverse of the tensor expression.

Jn(expression)

Returns the Bessel function of the first kind of order given by the first expression for the value of the second expression (real valued only).

Laplace(dim)

r/2, 1/(2*Pi)*ln(1/r), 1/(4*Pi*r).

Log(expression)

Natural logarithm: ln(expression), expression>0.

Log10(expression)

Base 10 logarithm: log10(expression), expression>0.

Max(expression1, expression2)

Maximum of the two (scalar) expressions (real valued only).

Min(expression1, expression2)

Minimum of the two (scalar) expressions (real valued only).

Norm(expression)

Absolute value if expression is a scalar; euclidian norm if expression is a vector.

Normal()

Computes the normal to the element.

NormalSource()

Computes the normal to the source element (only valid in a quantity of Integral type).

Order(quantity)

Returns the interpolation order of the quantity.

Period(expression, expression_cst)

Fmod[expression,expression-cst] + (expression<0 ? expression-cst : 0); the result is always in [0,expression-cst[.

Printf(expression)

Prints the value of expression when evaluated.

QuadraturePointIndex()

Returns the index of the current quadrature point.

Rand(expression)

Returns a pseudo-random number in [0, expression].

Re(z)

Takes the real part of a complex-valued expression.

Rotate(object_to_rotate, rot_x, rot_y, rot_z)

Rotation of a vector or tensor given by the first expression by the angles in radians given by the last three expression values around the x-, y- and z-axis.

ScalarField(expression, expression_cst_list)

Idem, but consider only real-valued scalar fields.

SetNumberRunTime(expression, char_expression)

Sets the char-expression ONELAB variable at run-time to expression.

SetVariable(expression, variable_id)

Sets the value of the runtime variable $variable-id to the value of the first expression, and returns this value.

Sign(expression)

-1 for expression less than zero and 1 otherwise (real valued only).

Sin(expression)

Sine of expression.

Sin_wt_p(omega, phase)

The first parameter represents the angular frequency and the second represents the phase.

Sinh(expression)

Hyperbolic sine of expression.

Sqrt(expression)

Square root, expression>=0.

SquDyadicProduct(vector)

Dyadic product of the vector given by expression with itself.

SquNorm(expression)

Square norm: Norm[expression]^2.

SurfaceArea(expression_cst_list)

Computes the area of the physical surfaces in expression_cst_list or of the actual surface if expression_cst_list is empty.

TTrace(tensor)

Trace; expression must be a tensor.

Tan(expression)

Tangent of expression.

Tangent()

Computes the tangent to the element (only valid for line elements).

TangentSource()

Computes the tangent to the source element (only valid in a quantity of Integral type and only for line elements).

Tanh(expression)

Hyperbolic tangent of the real valued expression.

TanhC2(expression)

Hyperbolic tangent of a complex valued expression.

Tensor(scalar0, scalar1, scalar2, scalar3, ...)

Creates a second-rank tensor of order 3 from 9 scalars, by row:

TensorDiag(scalar0, scalar1, scalar2)

Creates a diagonal second-rank tensor of order 3 from 3 scalars

TensorField(expression, expression_cst_list)

Idem, but consider only real-valued tensor fields.

TensorSym(scalar0, scalar1, scalar2, ...)

Creates a symmetrical second-rank tensor of order 3 from 6 scalars.

TensorV(vector0, vector1, vector2)

Creates a second-rank tensor of order 3 from 3 row vectors:

Transpose(expression)

Transposition; expression must be a tensor.

Unit(expression)

Normalization: expression/Norm[expression].

UnitVectorX()

Creates a unit vector in x-direction.

UnitVectorY()

Creates a unit vector in y-direction.

UnitVectorZ()

Creates a unit vector in z-direction.

ValueFromIndex(expression_cst_list)

Treats expression_cst_list as a map of (entity, value) pairs.

ValueFromTable(expression, char_expression)

Accesses the map char-expression created by a NodeTable or ElementTable PostOperation.

Vector(scalar0, scalar1, scalar2)

Creates a vector from 3 scalars.

VectorField(expression, expression_cst_list)

Idem, but consider only real-valued vector fields.

VectorFromIndex(expression_cst_list)

Same ValueFromIndex, but with 3 scalar values per entity.

X()

Gets the X coordinate.

XYZ()

Gets X, Y and Z in a vector.

Y()

Gets the Y coordinate.

Yn(expression)

Returns the Bessel function of the second kind of order given by the first expression for the value of the second expression (real valued only).

Z()

Gets the Z coordinate.

add_params(params)

Add constant parameters.

dInterpolationAkima(expression, ...)

Derivative of Akima interpolation of points.

dInterpolationBilinear(expression1, ...)

Derivative of bilinear interpolation of a table based on two variables.

dInterpolationLinear(expression, ...)

Derivative of linear interpolation of points.

dJn(expression)

Returns the derivative of the Bessel function of the first kind of order given by the first expression for the value of the second expression (real valued only).

dYn(expression)

Returns the derivative of the Bessel function of the second kind of order given by the first expression for the value of the second expression (real valued only).

add

add_comment

add_raw_code

constant

define

Examples using pygetdp.Function

Function

Function